Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r613 - in registry/trunk/app: Controller Lib View/CoPetitions

Subject: COmanage Developers List

List archive

[comanage-dev] r613 - in registry/trunk/app: Controller Lib View/CoPetitions


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r613 - in registry/trunk/app: Controller Lib View/CoPetitions
  • Date: Sat, 28 Sep 2013 09:56:57 -0400

Author: benno
Date: 2013-09-28 09:56:57 -0400 (Sat, 28 Sep 2013)
New Revision: 613

Modified:
registry/trunk/app/Controller/CoPetitionsController.php
registry/trunk/app/Controller/StandardController.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/CoPetitions/petition-attributes.inc
Log:
Petition title is now petition name, add button is now submit (CO-706)

Modified: registry/trunk/app/Controller/CoPetitionsController.php
===================================================================
--- registry/trunk/app/Controller/CoPetitionsController.php 2013-09-27
18:15:34 UTC (rev 612)
+++ registry/trunk/app/Controller/CoPetitionsController.php 2013-09-28
13:56:57 UTC (rev 613)
@@ -74,10 +74,16 @@
function add() {
if(!$this->restful) {
$enrollmentFlowID = $this->enrollmentFlowID();
-
+
+ // Set the title to be the name of the enrollment flow
+
+ $this->set('title_for_layout',
+ $this->CoPetition->CoEnrollmentFlow->field('name',
+
array('CoEnrollmentFlow.id' => $enrollmentFlowID)));
+
if($this->request->is('post')) {
// Set the view var. We need this on both success and failure.
-
+
$this->set('co_enrollment_attributes',

$this->CoPetition->CoEnrollmentFlow->CoEnrollmentAttribute->enrollmentFlowAttributes($enrollmentFlowID));

@@ -112,9 +118,6 @@
}
catch(Exception $e) {
$this->Session->setFlash($e->getMessage(), '', array(), 'error');
-
- // Set page title for page refresh
- $this->set('title_for_layout', _txt('op.add.new',
array(_txt('ct.co_petitions.1'))));
}
} else {
parent::add();

Modified: registry/trunk/app/Controller/StandardController.php
===================================================================
--- registry/trunk/app/Controller/StandardController.php 2013-09-27
18:15:34 UTC (rev 612)
+++ registry/trunk/app/Controller/StandardController.php 2013-09-28
13:56:57 UTC (rev 613)
@@ -55,8 +55,10 @@
// Reformat the request
$data = $this->convertRestPost();
} else {
- // Set page title
- $this->set('title_for_layout', _txt('op.add.new', array(_txt('ct.' .
$modelpl . '.1'))));
+ if(!isset($this->viewVars['title_for_layout'])) {
+ // Set page title, if not already set
+ $this->set('title_for_layout', _txt('op.add.new', array(_txt('ct.' .
$modelpl . '.1'))));
+ }

if($this->request->is('get')) {
// Nothing to do yet... return to let the form render
@@ -317,27 +319,29 @@
}

if(!$this->restful) {
- // Set page title -- note we do similar logic in view()
-
- $t = _txt('ct.' . $modelpl . '.1');
-
- if(!empty($curdata['Name'])) {
- $t = generateCn($curdata['Name']);
- } elseif(!empty($curdata[$req][ $model->displayField ])) {
- $t = $curdata[$req][ $model->displayField ];
- }
-
- if($this->requires_person) {
- if(!empty($curdata[$req]['co_person_id'])) {
- $t .= " (" . _txt('ct.co_people.1') . ")";
- } elseif(!empty($curdata[$req]['co_person_role_id'])) {
- $t .= " (" . _txt('ct.co_person_roles.1') . ")";
- } elseif(!empty($curdata[$req]['org_identity_id'])) {
- $t .= " (" . _txt('ct.org_identities.1') . ")";
+ if(!isset($this->viewVars['title_for_layout'])) {
+ // Set page title if not already set -- note we do similar logic in
view()
+
+ $t = _txt('ct.' . $modelpl . '.1');
+
+ if(!empty($curdata['Name'])) {
+ $t = generateCn($curdata['Name']);
+ } elseif(!empty($curdata[$req][ $model->displayField ])) {
+ $t = $curdata[$req][ $model->displayField ];
}
+
+ if($this->requires_person) {
+ if(!empty($curdata[$req]['co_person_id'])) {
+ $t .= " (" . _txt('ct.co_people.1') . ")";
+ } elseif(!empty($curdata[$req]['co_person_role_id'])) {
+ $t .= " (" . _txt('ct.co_person_roles.1') . ")";
+ } elseif(!empty($curdata[$req]['org_identity_id'])) {
+ $t .= " (" . _txt('ct.org_identities.1') . ")";
+ }
+ }
+
+ $this->set('title_for_layout', _txt('op.edit-a', array($t)));
}
-
- $this->set('title_for_layout', _txt('op.edit-a', array($t)));
}

if($this->restful)
@@ -875,28 +879,30 @@
$this->set($modelpl, $this->convertResponse(array(0 => $obj)));
$this->restResultHeader(200, "OK");
} else {
- // Set page title -- note we do similar logic in edit()
-
- $t = _txt('ct.' . $modelpl . '.1');
-
- if(!empty($obj['Name'])) {
- $t = generateCn($obj['Name']);
- } elseif(!empty($obj[$req][ $model->displayField ])) {
- $t = $obj[$req][ $model->displayField ];
- }
+ if(!isset($this->viewVars['title_for_layout'])) {
+ // Set page title if not already set -- note we do similar logic
in edit()

- if($this->requires_person) {
- if(!empty($obj[$req]['co_person_id'])) {
- $t .= " (" . _txt('ct.co_people.1') . ")";
- } elseif(!empty($obj[$req]['co_person_role_id'])) {
- $t .= " (" . _txt('ct.co_person_roles.1') . ")";
- } elseif(!empty($obj[$req]['org_identity_id'])) {
- $t .= " (" . _txt('ct.org_identities.1') . ")";
+ $t = _txt('ct.' . $modelpl . '.1');
+
+ if(!empty($obj['Name'])) {
+ $t = generateCn($obj['Name']);
+ } elseif(!empty($obj[$req][ $model->displayField ])) {
+ $t = $obj[$req][ $model->displayField ];
}
+
+ if($this->requires_person) {
+ if(!empty($obj[$req]['co_person_id'])) {
+ $t .= " (" . _txt('ct.co_people.1') . ")";
+ } elseif(!empty($obj[$req]['co_person_role_id'])) {
+ $t .= " (" . _txt('ct.co_person_roles.1') . ")";
+ } elseif(!empty($obj[$req]['org_identity_id'])) {
+ $t .= " (" . _txt('ct.org_identities.1') . ")";
+ }
+ }
+
+ $this->set('title_for_layout', _txt('op.view-a', array($t)));
}

- $this->set('title_for_layout', _txt('op.view-a', array($t)));
-
$this->set($modelpl, array(0 => $obj));

if($this->requires_person) {

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-09-27 18:15:34 UTC (rev 612)
+++ registry/trunk/app/Lib/lang.php 2013-09-28 13:56:57 UTC (rev 613)
@@ -709,6 +709,7 @@
'op.save' => 'Save',
'op.select' => 'Select',
'op.select-a' => 'Select a %1$s',
+ 'op.submit' => 'Submit',
'op.tc.agree' => 'Agree to Terms and Conditions',
'op.tc.agree.i' => 'I Agree',
'op.tc.review' => 'Review Terms and Conditions',

Modified: registry/trunk/app/View/CoPetitions/petition-attributes.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-09-27
18:15:34 UTC (rev 612)
+++ registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-09-28
13:56:57 UTC (rev 613)
@@ -402,7 +402,7 @@
<td>
<?php
if($e) {
- print $this->Form->submit($submit_label);
+ print $this->Form->submit(_txt('op.submit'));
print $this->Form->button(_txt('op.reset'),
array('type'=>'reset'));
}



  • [comanage-dev] r613 - in registry/trunk/app: Controller Lib View/CoPetitions, svnlog, 09/28/2013

Archive powered by MHonArc 2.6.16.

Top of Page