Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit c416249

Browse files
author
Jamie Snape
committed
Revise communityagreement module to remove redundant configuration form
1 parent 545cc85 commit c416249

15 files changed

+20
-74
lines changed

modules/communityagreement/Notification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getCommunityManageTabs($args)
4343
$fc = Zend_Controller_Front::getInstance();
4444
$moduleWebroot = $fc->getBaseUrl().'/communityagreement';
4545

46-
return array('Agreement' => $moduleWebroot.'/config/agreementtab');
46+
return array('Agreement' => $moduleWebroot.'/community/agreementtab');
4747
}
4848

4949
/**
@@ -56,7 +56,7 @@ public function getCommunityViewJSs()
5656
$fc = Zend_Controller_Front::getInstance();
5757
$moduleUriroot = $fc->getBaseUrl().'/modules/communityagreement';
5858

59-
return array($moduleUriroot.'/public/js/config/config.agreementenforce.js');
59+
return array($moduleUriroot.'/public/js/community/community.agreementenforce.js');
6060
}
6161

6262
/**

modules/communityagreement/controllers/ConfigController.php renamed to modules/communityagreement/controllers/CommunityController.php

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,12 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
/**
22-
* Communityagreement_ConfigController
23-
*
24-
* @category Midas modules
25-
* @package communityagreement
26-
*/
27-
class Communityagreement_ConfigController extends Communityagreement_AppController
21+
/** Community controller for the community agreement module. */
22+
class Communityagreement_CommunityController extends Communityagreement_AppController
2823
{
2924
public $_models = array('Community');
3025
public $_moduleModels = array('Agreement');
31-
public $_moduleForms = array('Config');
32-
33-
/**
34-
* @throws Zend_Exception on invalid userSession
35-
*/
36-
public function indexAction()
37-
{
38-
$this->requireAdminPrivileges();
39-
}
26+
public $_moduleForms = array('Community');
4027

4128
/** community agreement tab
4229
*
@@ -70,7 +57,7 @@ public function agreementtabAction()
7057
$agreementDao = $this->Communityagreement_Agreement->createAgreement($communityId, $agreement);
7158
}
7259

73-
$formAgreement = $this->ModuleForm->Config->createCreateAgreementForm($communityId);
60+
$formAgreement = $this->ModuleForm->Community->createCreateAgreementForm($communityId);
7461
if ($this->_request->isPost() && $formAgreement->isValid($this->getRequest()->getPost())
7562
) {
7663
$this->disableView();

modules/communityagreement/controllers/forms/ConfigForm.php renamed to modules/communityagreement/controllers/forms/CommunityForm.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
/**
22-
* Communityagreement_ConfigForm
23-
*
24-
* @category Midas modules
25-
* @package communityagreement
26-
* @copyright Copyright (c) Kitware SAS. See Copyright.txt for details.
27-
*/
28-
class Communityagreement_ConfigForm extends AppForm
21+
/** Community form for the communityagreement module. */
22+
class Communityagreement_CommunityForm extends AppForm
2923
{
3024
/**
3125
* Create create_agreement form
@@ -37,7 +31,7 @@ public function createCreateAgreementForm($community_id)
3731
{
3832
$form = new Zend_Form();
3933
$form->setAction(
40-
$this->webroot.'/communityagreement/config/agreementtab?communityId='.$community_id
34+
$this->webroot.'/communityagreement/community/agreementtab?communityId='.$community_id
4135
)->setMethod('post');
4236
$agreement = new Zend_Form_Element_Textarea('agreement');
4337

File renamed without changes.
File renamed without changes.
File renamed without changes.

modules/communityagreement/public/js/config/config.agreementenforce.js renamed to modules/communityagreement/public/js/community/community.agreementenforce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $(document).ready(function () {
1414

1515
if (hasAgreement == 'true') {
1616
$('form#joinCommunityForm').unbind('submit').submit(function () {
17-
midas.loadDialog('agreement', '/communityagreement/config/agreementdialog?communityId=' + json.community.community_id);
17+
midas.loadDialog('agreement', '/communityagreement/community/agreementdialog?communityId=' + json.community.community_id);
1818
midas.showDialog('Community Agreement', false, {
1919
width: 500
2020
});
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)