comanage-dev - [comanage-dev] r557 - in registry/trunk/app: Controller View/CoPetitions
Subject: COmanage Developers List
List archive
- From:
- To:
- Subject: [comanage-dev] r557 - in registry/trunk/app: Controller View/CoPetitions
- Date: Tue, 9 Jul 2013 11:34:05 -0400
- Authentication-results: sfpop-ironport04.merit.edu; dkim=neutral (message not signed) header.i=none
Author: benno
Date: 2013-07-09 11:34:04 -0400 (Tue, 09 Jul 2013)
New Revision: 557
Modified:
registry/trunk/app/Controller/CoPetitionsController.php
registry/trunk/app/View/CoPetitions/petition-attributes.inc
Log:
Fix processing of disabled petition attributes (CO-639)
Modified: registry/trunk/app/Controller/CoPetitionsController.php
===================================================================
--- registry/trunk/app/Controller/CoPetitionsController.php 2013-07-08
22:06:09 UTC (rev 556)
+++ registry/trunk/app/Controller/CoPetitionsController.php 2013-07-09
15:34:04 UTC (rev 557)
@@ -112,6 +112,7 @@
}
catch(Exception $e) {
$this->Session->setFlash($e->getMessage(), '', array(), 'error');
+ parent::add();
}
} else {
parent::add();
Modified: registry/trunk/app/View/CoPetitions/petition-attributes.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-07-08
22:06:09 UTC (rev 556)
+++ registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-07-09
15:34:04 UTC (rev 557)
@@ -32,7 +32,18 @@
<table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
<tbody>
<?php foreach ($co_enrollment_attributes as $ea): ?>
- <?php $fieldName = $ea['model'] . '.' . $ea['field']; ?>
+ <?php if(!$ea['hidden'] && isset($ea['default']) &&
!$ea['modifiable']) {
+ // Since disabled values don't submit with the form, convert
them to hidden
+ // fields and change the fieldName for the visible attribute
+
+ $hfieldName = $ea['model'] . '.' . $ea['field'];
+ $fieldName = $hfieldName . "-disabled";
+
+ print $this->Form->hidden($hfieldName, array('default' =>
$ea['default'])) . "\n";
+ } else {
+ $fieldName = $ea['model'] . '.' . $ea['field'];
+ }
+ ?>
<?php if($ea['hidden']): ?>
<?php print $this->Form->hidden($fieldName, array('default' =>
$ea['default'])) . "\n"; ?>
<?php else: ?>
- [comanage-dev] r557 - in registry/trunk/app: Controller View/CoPetitions, svnlog, 07/09/2013
Archive powered by MHonArc 2.6.16.