Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r609 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/CoPeople View/CoPetitions View/CoTermsAndConditions View/Elements

Subject: COmanage Developers List

List archive

[comanage-dev] r609 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/CoPeople View/CoPetitions View/CoTermsAndConditions View/Elements


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r609 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/CoPeople View/CoPetitions View/CoTermsAndConditions View/Elements
  • Date: Mon, 23 Sep 2013 22:36:48 -0400

Author: benno
Date: 2013-09-23 22:36:48 -0400 (Mon, 23 Sep 2013)
New Revision: 609

Added:
registry/trunk/app/Controller/CoTermsAndConditionsController.php
registry/trunk/app/View/CoTermsAndConditions/
registry/trunk/app/View/CoTermsAndConditions/add.ctp
registry/trunk/app/View/CoTermsAndConditions/edit.ctp
registry/trunk/app/View/CoTermsAndConditions/fields.inc
registry/trunk/app/View/CoTermsAndConditions/index.ctp
registry/trunk/app/View/CoTermsAndConditions/review.ctp
registry/trunk/app/View/CoTermsAndConditions/view.ctp
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Config/bootstrap.php
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CoPeopleController.php
registry/trunk/app/Controller/CoPetitionsController.php
registry/trunk/app/Lib/enum.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/Model/Co.php
registry/trunk/app/Model/CoPerson.php
registry/trunk/app/Model/CoPetition.php
registry/trunk/app/Model/Cou.php
registry/trunk/app/View/CoPeople/fields.inc
registry/trunk/app/View/CoPetitions/petition-attributes.inc
registry/trunk/app/View/Elements/dropMenu.ctp
Log:
Implement Terms and Conditions (CO-677)

Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2013-09-19 06:01:08 UTC (rev
608)
+++ registry/trunk/app/Config/Schema/schema.xml 2013-09-24 02:36:48 UTC (rev
609)
@@ -934,4 +934,51 @@
<field name="created" type="T" />
<field name="modified" type="T" />
</table>
+
+ <table name="co_terms_and_conditions">
+ <field name="id" type="I">
+ <key />
+ <autoincrement />
+ </field>
+ <field name="co_id" type="I">
+ <constraint>REFERENCES cm_cos(id)</constraint>
+ </field>
+ <field name="description" type="C" size="256" />
+ <field name="url" type="C" size="256" />
+ <field name="cou_id" type="I">
+ <constraint>REFERENCES cm_co_groups(id)</constraint>
+ </field>
+ <field name="status" type="C" size="2" />
+ <field name="created" type="T" />
+ <field name="modified" type="T" />
+
+ <index name="co_terms_and_conditions_i1">
+ <col>co_id</col>
+ </index>
+ </table>
+
+ <table name="co_t_and_c_agreements">
+ <field name="id" type="I">
+ <key />
+ <autoincrement />
+ </field>
+ <field name="co_terms_and_conditions_id" type="I">
+ <constraint>REFERENCES cm_co_terms_and_conditions(id)</constraint>
+ </field>
+ <field name="co_person_id" type="I">
+ <constraint>REFERENCES cm_co_people(id)</constraint>
+ </field>
+ <field name="agreement_time" type="T" />
+ <field name="identifier" type="C" size="256" />
+ <field name="created" type="T" />
+ <field name="modified" type="T" />
+
+ <index name="co_t_and_c_agreements_i1">
+ <col>co_terms_and_conditions_id</col>
+ </index>
+
+ <index name="co_t_and_c_agreements_i2">
+ <col>co_person_id</col>
+ </index>
+ </table>
</schema>

Modified: registry/trunk/app/Config/bootstrap.php
===================================================================
--- registry/trunk/app/Config/bootstrap.php 2013-09-19 06:01:08 UTC (rev
608)
+++ registry/trunk/app/Config/bootstrap.php 2013-09-24 02:36:48 UTC (rev
609)
@@ -57,6 +57,9 @@
Inflector::rules('singular', array('irregular' => array('cous' => 'cou')));
Inflector::rules('plural', array('irregular' => array('cou' => 'cous')));

+Inflector::rules('singular', array('uninflected' =>
array('co_terms_and_conditions', 'CoTermsAndConditions')));
+Inflector::rules('plural', array('uninflected' =>
array('co_terms_and_conditions', 'CoTermsAndConditions')));
+
/**
* Plugins need to be loaded manually, you can either load them one by one
or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the
documentation on CakePlugin to use more

Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2013-09-19 06:01:08
UTC (rev 608)
+++ registry/trunk/app/Controller/AppController.php 2013-09-24 02:36:48
UTC (rev 609)
@@ -1102,6 +1102,9 @@
// Manage CO provisioning targets?
$p['menu']['coprovtargets'] = $roles['admin'];

+ // Manage CO terms and conditions?
+ $p['menu']['cotandc'] = $roles['admin'];
+
// Admin COmanage?
$p['menu']['admin'] = $roles['cmadmin'];


Modified: registry/trunk/app/Controller/CoPeopleController.php
===================================================================
--- registry/trunk/app/Controller/CoPeopleController.php 2013-09-19
06:01:08 UTC (rev 608)
+++ registry/trunk/app/Controller/CoPeopleController.php 2013-09-24
02:36:48 UTC (rev 609)
@@ -99,6 +99,14 @@
$args['contain'][] = false;

$this->set('co_identifier_assignments',
$this->Co->CoIdentifierAssignment->find('all', $args));
+
+ // Determine if there are any terms and conditions for this CO.
+
+ $args = array();
+ $args['conditions']['CoTermsAndConditions.co_id'] =
$this->cur_co['Co']['id'];
+ $args['contain'][] = false;
+
+ $this->set('vv_co_tandc_count',
$this->Co->CoTermsAndConditions->find('count', $args));
}

parent::beforeRender();

Modified: registry/trunk/app/Controller/CoPetitionsController.php
===================================================================
--- registry/trunk/app/Controller/CoPetitionsController.php 2013-09-19
06:01:08 UTC (rev 608)
+++ registry/trunk/app/Controller/CoPetitionsController.php 2013-09-24
02:36:48 UTC (rev 609)
@@ -255,6 +255,27 @@
}

$this->set('co_enrollment_attributes', $enrollmentAttributes);
+
+ // Pull any relevant Terms and Conditions that must be agreed to. We
only do this
+ // if authentication is required (otherwise we can't really assert
who agreed),
+ // and only for CO-wide T&C (ie: those without a COU ID specified).
There's not
+ // necessarily a reason why we couldn't prompt for COU specific T&C,
if the petition
+ // adjusted dynamically to the COU being enrolled in, but we don't
have a use case
+ // for it at the moment.
+
+ $authn = $this->CoPetition->CoEnrollmentFlow->field('require_authn',
+
array('CoEnrollmentFlow.id' => $enrollmentFlowID));
+
+ if($authn) {
+ $tArgs = array();
+ $tArgs['conditions']['CoTermsAndConditions.co_id'] =
$this->cur_co['Co']['id'];
+ $tArgs['conditions']['CoTermsAndConditions.cou_id'] = null;
+ $tArgs['conditions']['CoTermsAndConditions.status'] =
SuspendableStatusEnum::Active;
+ $tArgs['contain'] = false;
+
+ $this->set('vv_terms_and_conditions',
+
$this->CoPetition->Co->CoTermsAndConditions->find('all', $tArgs));
+ }
}

if(($this->action == 'edit' || $this->action == 'view')

Modified: registry/trunk/app/Lib/enum.php
===================================================================
--- registry/trunk/app/Lib/enum.php 2013-09-19 06:01:08 UTC (rev 608)
+++ registry/trunk/app/Lib/enum.php 2013-09-24 02:36:48 UTC (rev 609)
@@ -42,6 +42,8 @@
const CoPersonRoleEditedPetition = 'ECRP';
const CoPersonOrgIdLinked = 'LOCP';
const CoPersonOrgIdUnlinked = 'UOCP';
+ const CoTAndCAgreement = 'TCAG';
+ const CoTAndCAgreementBehalf = 'TCAB';
const EmailAddressVerified = 'EMLV';
const IdentifierAutoAssigned = 'AIDA';
const InvitationConfirmed = 'INVC';

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-09-19 06:01:08 UTC (rev 608)
+++ registry/trunk/app/Lib/lang.php 2013-09-24 02:36:48 UTC (rev 609)
@@ -86,6 +86,8 @@
'ct.co_petitions.pl' => 'CO Petitions',
'ct.co_provisioning_targets.1' => 'Provisioning Target',
'ct.co_provisioning_targets.pl' => 'Provisioning Targets',
+ 'ct.co_terms_and_conditions.1' => 'Terms and Conditions',
+ 'ct.co_terms_and_conditions.pl' => 'Terms and Conditions',
'ct.cos.1' => 'CO',
'ct.cos.pl' => 'COs',
'ct.cous.1' => 'COU',
@@ -615,6 +617,13 @@
'fd.sponsor' => 'Sponsor',
'fd.sponsor.desc' =>'(for continued membership)',
'fd.status' => 'Status',
+ 'fd.tc.agree.desc' => 'You must agree to the following Terms and
Conditions before continuing',
+ 'fd.tc.agree.no' => 'Not Agreed',
+ 'fd.tc.agree.yes' => 'Agreed',
+ 'fd.tc.cou.desc' => 'If set, this T&C only applies to members of the
specified COU',
+ 'fd.tc.for' => 'Terms and Conditions for %1$s (%2$s)',
+ 'fd.tc.none' => 'There are no applicable Terms and Conditions',
+ 'fd.tc.url.desc' => 'The URL to the Terms and Conditions, which will be
displayed in a popup',
// This must be named fd.model.validation-field
'fd.telephone_number.number' => 'Phone',
'fd.timestamp' => 'Timestamp',
@@ -624,6 +633,7 @@
'fd.type' => 'Type',
'fd.type.warn' => 'After an extended attribute is created, its type may
not be changed',
'fd.untitled' => 'Untitled',
+ 'fd.url' => 'URL',
'fd.valid_from' => 'Valid From',
'fd.valid_from.desc' => '(leave blank for immediate validity)',
'fd.valid_through' => 'Valid Through',
@@ -640,6 +650,7 @@
'me.people' => 'People',
'me.platform' => 'Platform',
'me.population' => 'My Population',
+ 'me.tandc' => 'Terms and Conditions',

// Operations
'op.accept' => 'Accept',
@@ -696,6 +707,9 @@
'op.save' => 'Save',
'op.select' => 'Select',
'op.select-a' => 'Select a %1$s',
+ 'op.tc.agree' => 'Agree to Terms and Conditions',
+ 'op.tc.agree.i' => 'I Agree',
+ 'op.tc.review' => 'Review Terms and Conditions',
'op.unlink' => 'Unlink',
'op.unlink.confirm' => 'Are you sure you wish to unlink this identity?',
'op.view' => 'View',
@@ -727,6 +741,9 @@
'rs.pt.id.login' => 'Identifier "%1$s" flagged for login',
'rs.pt.login' => 'Petition Created. You have been logged out, and an
activation URL has been sent to your email address. Please click the link in
that email to continue.',
'rs.pt.relogin' => 'Petition Confirmed. You have been logged out, and
will need to login again for your new identity to take effect.',
+ 'rs.tc.agree' => 'Terms and Conditions "%1$s" agreed to',
+ 'rs.tc.agree.behalf' => 'Terms and Conditions "%1$s" agreed to on behalf
of',
+ 'rs.tc.agree.ok' => 'Agreement to Terms and Conditions recorded',
'rs.saved' => 'Saved',
'rs.updated' => '"%1$s" Updated',


Modified: registry/trunk/app/Model/Co.php
===================================================================
--- registry/trunk/app/Model/Co.php 2013-09-19 06:01:08 UTC (rev 608)
+++ registry/trunk/app/Model/Co.php 2013-09-24 02:36:48 UTC (rev 609)
@@ -47,6 +47,7 @@
"CoPetition" => array('dependent' => true),
// A CO can have zero or more provisioning targets
"CoProvisioningTarget" => array('dependent' => true),
+ "CoTermsAndConditions" => array('dependent' => true),
// A CO has zero or more COUs
"Cou" => array('dependent' => true),
// A CO has zero or more OrgIdentities, depending on if they are pooled.

Modified: registry/trunk/app/Model/CoPerson.php
===================================================================
--- registry/trunk/app/Model/CoPerson.php 2013-09-19 06:01:08 UTC (rev
608)
+++ registry/trunk/app/Model/CoPerson.php 2013-09-24 02:36:48 UTC (rev
609)
@@ -40,7 +40,7 @@
// A person can have one invite (per CO)
"CoInvite" => array('dependent' => true),
// A person can have one (preferred) name per CO
- // This could change if Name became an MVPA
+ // This could change if Name became an MVPA
"Name" => array('dependent' => true)
);

@@ -75,6 +75,8 @@
"CoPetitionHistoryRecord" => array(
'foreignKey' => 'actor_co_person_id'
),
+ "CoProvisioningExport" => array('dependent' => true),
+ "CoTandCAgreement" => array('dependent' => true),
// A person can have one or more email address
"EmailAddress" => array('dependent' => true),
// We allow dependent=true for co_person_id but not for
actor_co_person_id (see CO-404).
@@ -84,7 +86,6 @@
),
// A person can have many identifiers within a CO
"Identifier" => array('dependent' => true),
- "CoProvisioningExport" => array('dependent' => true)
);

// Default display field for cake generated views

Modified: registry/trunk/app/Model/CoPetition.php
===================================================================
--- registry/trunk/app/Model/CoPetition.php 2013-09-19 06:01:08 UTC (rev
608)
+++ registry/trunk/app/Model/CoPetition.php 2013-09-24 02:36:48 UTC (rev
609)
@@ -737,7 +737,7 @@
}
}

- // Finally, CO Person Role data
+ // Next, CO Person Role data

if(isset($coRoleData['EnrolleeCoPersonRole'])) {
foreach(array_keys($coRoleData['EnrolleeCoPersonRole']) as $a) {
@@ -824,7 +824,7 @@
throw new RuntimeException(_txt('er.db.save'));
}

- // Add a co_petition_history_record.
+ // Add a co_petition_history_record

try {
$this->CoPetitionHistoryRecord->record($coPetitionID,
@@ -836,6 +836,26 @@
throw new RuntimeException(_txt('er.db.save'));
}

+ // Record agreements to Terms and Conditions, if any
+
+ if(!empty($requestData['CoTermsAndConditions'])) {
+ foreach(array_keys($requestData['CoTermsAndConditions']) as
$coTAndCId) {
+ try {
+ // Currently, T&C is only available via a petition when authn is
required.
+ // The array value should be the authenticated identifier as set
by the view.
+
+
$this->Co->CoTermsAndConditions->CoTAndCAgreement->record($coTAndCId,
+
$coPersonID,
+
$coPersonID,
+
$requestData['CoTermsAndConditions'][$coTAndCId]);
+ }
+ catch(Exception $e) {
+ $dbc->rollback();
+ throw new RuntimeException(_txt('er.db.save'));
+ }
+ }
+ }
+
// Send email invite if configured

if($verifyEmail) {

Modified: registry/trunk/app/Model/Cou.php
===================================================================
--- registry/trunk/app/Model/Cou.php 2013-09-19 06:01:08 UTC (rev 608)
+++ registry/trunk/app/Model/Cou.php 2013-09-24 02:36:48 UTC (rev 609)
@@ -47,6 +47,7 @@
),
"CoPersonRole",
"CoPetition",
+ "CoTermsAndConditions",
"CoEnrollmentFlowAuthzCou" => array(
'className' => 'CoEnrollmentFlow',
'foreignKey' => 'authz_cou_id'

Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2013-09-19 06:01:08 UTC (rev
608)
+++ registry/trunk/app/View/CoPeople/fields.inc 2013-09-24 02:36:48 UTC (rev
609)
@@ -79,7 +79,7 @@
'icon' => 'script',
'title' => _txt('op.id.auto'),
'url' => 'javascript:js_confirm_autogenerate();' // Does not
work when added in options
- );
+ );
}

// Provisioning status
@@ -95,6 +95,20 @@
)
);
}
+
+ // Terms and Conditions
+ if(!empty($vv_co_tandc_count) && $vv_co_tandc_count > 0) {
+ $sidebarButtons[] = array(
+ 'icon' => 'tag',
+ 'title' => _txt('op.tc.review'),
+ 'url' => array(
+ 'controller' => 'co_terms_and_conditions',
+ 'action' => 'review',
+ 'copersonid' => $co_people[0]['CoPerson']['id'],
+ 'co' => $cur_co['Co']['id']
+ )
+ );
+ }
}

// Populate the cross reference

Modified: registry/trunk/app/View/CoPetitions/petition-attributes.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-09-19
06:01:08 UTC (rev 608)
+++ registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-09-24
02:36:48 UTC (rev 609)
@@ -26,6 +26,9 @@
// We do a series of <?php tags because we can't mix and match embedded
tag styles.

$l = 1;
+
+ // Are there T&C to agree to?
+ $tandc = !empty($vv_terms_and_conditions);
?>

<style>
@@ -60,6 +63,89 @@
}
</style>

+<script type="text/javascript">
+ var tandcids = Array(
+ <?php
+ // Use PHP to dynamically generate a list of T&C IDs into a Javascript
array
+ if(!empty($vv_terms_and_conditions)) {
+ $i = 0;
+ foreach($vv_terms_and_conditions as $t) {
+ if($i > 0) { print ","; } else { $i++; }
+ print '"' . $t['CoTermsAndConditions']['id'] . '"';
+ }
+ }
+ ?>
+ );
+
+ function open_tandc(title, tandcUrl, id) {
+ // Set title
+ $("div#dialog-review").dialog("option", "title", title);
+
+ // Load T&C into iframe
+ $("#tandc_content").attr("src", tandcUrl);
+
+ // Set up buttons
+ $("div#dialog-review").dialog("option",
+ "buttons",
+ {
+ "<?php print _txt('op.ok'); ?>":
function() {
+ $(this).dialog("close");
+ }
+ });
+
+ // Open dialog
+ $("#dialog-review").dialog("open");
+
+ // Enable the checkbox
+ document.getElementById('CoTermsAndConditions'+id).disabled = false;
+ }
+
+ function maybe_enable_submit() {
+ // If all checkboxes are enabled, enable submit
+
+ var allagreed = 1;
+
+ for(var i = 0;i < tandcids.length;i++) {
+
if(!document.getElementById('CoTermsAndConditions'+tandcids[i]).checked) {
+ allagreed = 0;
+ }
+ }
+
+ if(allagreed) {
+ $(":submit").removeAttr('disabled');
+ }
+ }
+
+<?php if($tandc): ?>
+ function js_local_onload()
+ {
+ // Local (to this view) initializations
+
+ // Disable checkboxes until individual T&C are reviewed
+ for(var i = 0;i < tandcids.length;i++) {
+ document.getElementById('CoTermsAndConditions'+tandcids[i]).disabled =
true;
+ }
+
+ // Disable submit button until all T&C are agreed to
+ $(":submit").attr('disabled', true);
+ }
+<?php endif; ?>
+
+ $(function() {
+ $("#dialog-review").dialog({
+ autoOpen: false,
+ height: 725,
+ width: 750,
+ modal: true,
+ buttons: {
+ "<?php print _txt('op.ok'); ?>": function() {
+ $(this).dialog("close");
+ }
+ }
+ })
+ });
+</script>
+
<div>
<div id="results">
</div>
@@ -259,6 +345,51 @@
<?php
endforeach; // foreach ($coea_model as $m => $coe_attributes):
?>
+
+ <?php if(!empty($vv_terms_and_conditions)): ?>
+ <?php $line = 0; ?>
+ <div class="ui-widget modelbox">
+ <div class="boxtitle">
+ <b><?php print _txt('op.tc.agree'); ?></b><br />
+ <font class="desc"><?php print _txt('fd.tc.agree.desc'); ?></font>
+ </div>
+ <table id="<?php print $this->action; ?>_co_petition_tandc"
class="ui-widget">
+ <tbody>
+ <?php foreach($vv_terms_and_conditions as $t): ?>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <td>
+ <?php
+ print _txt('op.tc.agree.i');
+
+ $args = array();
+ $args['value'] = $this->Session->read('Auth.User.username');
+ $args['onClick'] = "maybe_enable_submit()";
+
+ $fieldName = "CoTermsAndConditions." .
$t['CoTermsAndConditions']['id'];
+
+ print $this->Form->checkbox($fieldName, $args);
+ ?>
+ </td>
+ <td>
+ <b><?php print $t['CoTermsAndConditions']['description'];
?></b>
+ </td>
+ <td>
+ <button class="checkbutton"
+ type="button"
+ onClick="open_tandc('<?php print
addslashes($t['CoTermsAndConditions']['description']); ?>',
+ '<?php print
addslashes($t['CoTermsAndConditions']['url']); ?>',
+ '<?php print
addslashes($t['CoTermsAndConditions']['id']); ?>')">
+ <?php print _txt('op.tc.review'); ?>
+ </button>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </td>
+ </tr>
+ </tbody>
+ </table> </div>
+ <?php endif; ?>
+
<table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
<tbody>
<tr>
@@ -268,7 +399,7 @@
<td>
<?php
if($e) {
- echo $this->Form->submit($submit_label);
+ print $this->Form->submit($submit_label);
print $this->Form->button(_txt('op.reset'),
array('type'=>'reset'));
}
@@ -302,3 +433,8 @@
</table>
</div>
<?php endif; // action == add ?>
+
+<div id="dialog-review" title="<?php print
_txt('ct.co_terms_and_conditions.1'); ?>">
+ <iframe id="tandc_content" height="600" width="700">
+ </iframe>
+</div>
\ No newline at end of file


Property changes on: registry/trunk/app/View/CoTermsAndConditions/add.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/CoTermsAndConditions/edit.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/CoTermsAndConditions/view.ctp
___________________________________________________________________
Added: svn:special
+ *

Modified: registry/trunk/app/View/Elements/dropMenu.ctp
===================================================================
--- registry/trunk/app/View/Elements/dropMenu.ctp 2013-09-19 06:01:08
UTC (rev 608)
+++ registry/trunk/app/View/Elements/dropMenu.ctp 2013-09-24 02:36:48
UTC (rev 609)
@@ -232,7 +232,19 @@
print
$this->Html->link(_txt('ct.co_provisioning_targets.pl'), $args);
print "</li>";
}
-
+
+ if(isset($permissions['menu']['cotandc']) &&
$permissions['menu']['cotandc']) {
+ print "<li>";
+ $args = array();
+ $args['plugin'] = null;
+ $args['controller'] = 'co_terms_and_conditions';
+ $args['action'] = 'index';
+ $args['co'] = $menuCoId;
+
+ print
$this->Html->link(_txt('ct.co_terms_and_conditions.pl'), $args);
+ print "</li>";
+ }
+
if(isset($permissions['menu']['conavigationlinks'])) {
print "<li>";
$args = array();
@@ -326,11 +338,11 @@
<?php
if($this->Session->check('Auth.User.cos'))
$mycos = $this->Session->read('Auth.User.cos');
-
+
// Profiles
if(isset($permissions['menu']['coprofile']) &&
$permissions['menu']['coprofile']) {
$coCount = count($mycos);
-
+
// Identity Submenu
print '<li>
<a href="#">'._txt('me.identity').'</a>
@@ -349,14 +361,32 @@
}
print '</ul>
</li>';
- ?>
-
- <?php // Demographics submenu
+
+ // T&C Submenu
+ print '<li>
+ <a href="#">'._txt('me.tandc').'</a>
+ <span class="sf-sub-indicator"> »</span>
+ <ul>';
+ foreach ($mycos as $co) {
+ print "<li>";
+ $args = array(
+ 'controller' => 'co_terms_and_conditions',
+ 'action' => 'review',
+ 'copersonid' => $co['co_person_id'],
+ 'co' => $co['co_id']
+ );
+ print $this->Html->link(_txt('me.for',
array($co['co_name'])), $args);
+ print "</li>";
+ }
+ print '</ul>
+ </li>';
+
+ // Demographics submenu
print '<li>
<a href="#">'._txt('ct.co_nsf_demographics.pl').'</a>
<span class="sf-sub-indicator"> »</span>
<ul>';
-
+
foreach ($menuContent['CoNsfDemographic'] as $d) {
print "<li>";
$args = array(
@@ -364,31 +394,30 @@
'controller' => 'co_nsf_demographics',
'co' => $d['co_id']
);
-
- // If the record already exists, the id is needed for edit
- if(isset($d['id']))
- $args[] = $d['id'];
-
- // Adjust the link to the NSF Demographics Controller
according to
- // whether or not data has been set already.
- $args['action'] = $d['action'];
-
- // If the record does not exist, the person id is needed for
add
- if(isset($d['co_person_id']))
- $args['copersonid'] = $d['co_person_id'];
-
- print $this->Html->link(_txt('me.for',
array($d['co_name'])),
- $args
- );
+
+ // If the record already exists, the id is needed for edit
+ if(isset($d['id']))
+ $args[] = $d['id'];
+
+ // Adjust the link to the NSF Demographics Controller
according to
+ // whether or not data has been set already.
+ $args['action'] = $d['action'];
+
+ // If the record does not exist, the person id is needed for
add
+ if(isset($d['co_person_id']))
+ $args['copersonid'] = $d['co_person_id'];
+
+ print $this->Html->link(_txt('me.for', array($d['co_name'])),
+ $args
+ );
print "</li>";
}
-
+
print ' </ul>
- </li>';
+ </li>';
}
- ?>
-
- <?php // Plugin submenus
+
+ // Plugin submenus
// This rendering is a bit different from how
render_plugin_menus() does it...
foreach(array_keys($plugins) as $plugin) {
if(isset($plugins[$plugin]['coperson'])) {



  • [comanage-dev] r609 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/CoPeople View/CoPetitions View/CoTermsAndConditions View/Elements, svnlog, 09/23/2013

Archive powered by MHonArc 2.6.16.

Top of Page