Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r573 - in registry/trunk/app: Controller Model View/CoEnrollmentAttributes

Subject: COmanage Developers List

List archive

[comanage-dev] r573 - in registry/trunk/app: Controller Model View/CoEnrollmentAttributes


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r573 - in registry/trunk/app: Controller Model View/CoEnrollmentAttributes
  • Date: Thu, 8 Aug 2013 08:31:17 -0400

Author: benno
Date: 2013-08-08 08:31:17 -0400 (Thu, 08 Aug 2013)
New Revision: 573

Modified:
registry/trunk/app/Controller/CoEnrollmentAttributesController.php
registry/trunk/app/Model/CoEnrollmentAttribute.php
registry/trunk/app/View/CoEnrollmentAttributes/fields.inc
Log:
Add support for Sponsor in enrollment flows (CO-309)

Modified: registry/trunk/app/Controller/CoEnrollmentAttributesController.php
===================================================================
--- registry/trunk/app/Controller/CoEnrollmentAttributesController.php
2013-08-03 22:16:47 UTC (rev 572)
+++ registry/trunk/app/Controller/CoEnrollmentAttributesController.php
2013-08-08 12:31:17 UTC (rev 573)
@@ -128,6 +128,10 @@
// Assemble the list of available affiliations

$this->set('vv_affiliations', $cm_texts[ $cm_lang ]['en.affil']);
+
+ // Assemble the list of available Sponsors
+
+ $this->set('vv_sponsors',
$this->CoEnrollmentAttribute->CoEnrollmentFlow->Co->CoPerson->sponsorList($coid));
}
}


Modified: registry/trunk/app/Model/CoEnrollmentAttribute.php
===================================================================
--- registry/trunk/app/Model/CoEnrollmentAttribute.php 2013-08-03 22:16:47
UTC (rev 572)
+++ registry/trunk/app/Model/CoEnrollmentAttribute.php 2013-08-08 12:31:17
UTC (rev 573)
@@ -102,6 +102,7 @@

$ret['r:cou_id'] = _txt('fd.cou') . " (" . _txt('ct.co_person_roles.1')
. ")";
$ret['r:affiliation'] = _txt('fd.affiliation') . " (" .
_txt('ct.co_person_roles.1') . ")";
+ $ret['r:sponsor_co_person_id'] = _txt('fd.sponsor') . " (" .
_txt('ct.co_person_roles.1') . ")";
$ret['r:title'] = _txt('fd.title') . " (" . _txt('ct.co_person_roles.1')
. ")";
$ret['r:o'] = _txt('fd.o') . " (" . _txt('ct.co_person_roles.1') . ")";
$ret['r:ou'] = _txt('fd.ou') . " (" . _txt('ct.co_person_roles.1') . ")";
@@ -338,6 +339,15 @@
// As of Cake 2.1, inList doesn't work for integers unless you
set strict to false
//
https://cakephp.lighthouseapp.com/projects/42648/tickets/2770-inlist-doesnt-work-more-in-21
$attr['validate']['rule'][2] = false;
+ } elseif($attrName == 'sponsor_co_person_id') {
+ // Like COU ID, we need to set up a select
+
+ $attr['select'] =
$this->CoEnrollmentFlow->CoPetition->Co->CoPerson->sponsorList($efAttr['CoEnrollmentFlow']['co_id']);
+ $attr['validate']['rule'][0] = 'inList';
+ $attr['validate']['rule'][1] = array_keys($attr['select']);
+ // As of Cake 2.1, inList doesn't work for integers unless you
set strict to false
+ //
https://cakephp.lighthouseapp.com/projects/42648/tickets/2770-inlist-doesnt-work-more-in-21
+ $attr['validate']['rule'][2] = false;
} else {
// Default behavior for all other attributes


Modified: registry/trunk/app/View/CoEnrollmentAttributes/fields.inc
===================================================================
--- registry/trunk/app/View/CoEnrollmentAttributes/fields.inc 2013-08-03
22:16:47 UTC (rev 572)
+++ registry/trunk/app/View/CoEnrollmentAttributes/fields.inc 2013-08-08
12:31:17 UTC (rev 573)
@@ -79,6 +79,7 @@
$("#attr_def_val_affil_div").hide();
$("#attr_def_val_cou_div").hide();
$("#attr_def_val_date_div").hide();
+ $("#attr_def_val_sponsor_div").hide();

var curval =
document.getElementById('CoEnrollmentAttributeDefault0Value').value;

@@ -98,6 +99,10 @@
// Set current value before showing
document.getElementById('def_cou_val').value = curval;
$("#attr_def_val_cou_div").show("fade");
+ } else if(curattrcode == "r" && curattrname == "sponsor_co_person_id")
{
+ // Set current value before showing
+ document.getElementById('def_sponsor_val').value = curval;
+ $("#attr_def_val_sponsor_div").show("fade");
} else if((curattrcode == "r"
&& (curattrname == "valid_from" || curattrname ==
"valid_through"))
||
@@ -346,6 +351,18 @@
<br />
<?php endif; ?>
</div>
+ <div id="attr_def_val_sponsor_div">
+ <?php if($e): ?>
+ <select name="def_sponsor_val"
+ id="def_sponsor_val"
+ onchange="set_attr_def_value('def_sponsor_val')">
+ <option value=""></option>
+ <?php foreach(array_keys($vv_sponsors) as $k): ?>
+ <option value="<?php print Sanitize::html($k); ?>"><?php
print Sanitize::html($vv_sponsors[$k]); ?></option>
+ <?php endforeach; ?>
+ </select>
+ <?php endif; ?>
+ </div>
</td>
</tr>
<tr class="line1">



  • [comanage-dev] r573 - in registry/trunk/app: Controller Model View/CoEnrollmentAttributes, svnlog, 08/08/2013

Archive powered by MHonArc 2.6.16.

Top of Page