comanage-dev - [comanage-dev] r318 - in registry/trunk/app: Controller View/CoPeople
Subject: COmanage Developers List
List archive
- From:
- To:
- Subject: [comanage-dev] r318 - in registry/trunk/app: Controller View/CoPeople
- Date: Thu, 19 Jul 2012 22:37:37 -0400
Author: benno
Date: 2012-07-19 22:37:37 -0400 (Thu, 19 Jul 2012)
New Revision: 318
Modified:
registry/trunk/app/Controller/CoPeopleController.php
registry/trunk/app/View/CoPeople/fields.inc
Log:
Render Autogenerate Identifiers button only when appropriate (CO-389)
Modified: registry/trunk/app/Controller/CoPeopleController.php
===================================================================
--- registry/trunk/app/Controller/CoPeopleController.php 2012-07-20
02:35:39 UTC (rev 317)
+++ registry/trunk/app/Controller/CoPeopleController.php 2012-07-20
02:37:37 UTC (rev 318)
@@ -29,7 +29,7 @@
public $helpers = array('Time');
- // When using additional controllers, we must also specify our own
+ // When using additional models, we must also specify our own
public $uses = array('CoPerson', 'CmpEnrollmentConfiguration');
public $paginate = array(
@@ -86,11 +86,19 @@
// Determine if there are any Enrollment Flows for this CO and if so
pass
// them to the view. Currently, we don't check for COU-specific flows.
+ $args = array();
$args['conditions']['CoEnrollmentFlow.co_id'] =
$this->cur_co['Co']['id'];
- // $args['contain'][] = 'CoEnrollmentFlow';
+ $args['contain'][] = false;
- $this->loadModel('CoEnrollmentFlow');
- $this->set('co_enrollment_flows', $this->CoEnrollmentFlow->find('all',
$args));
+ $this->set('co_enrollment_flows',
$this->Co->CoEnrollmentFlow->find('all', $args));
+
+ // Determine if there are any identifier assignments for this CO.
+
+ $args = array();
+ $args['conditions']['CoIdentifierAssignment.co_id'] =
$this->cur_co['Co']['id'];
+ $args['contain'][] = false;
+
+ $this->set('co_identifier_assignments',
$this->Co->CoIdentifierAssignment->find('all', $args));
}
parent::beforeRender();
}
Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2012-07-20 02:35:39 UTC (rev
317)
+++ registry/trunk/app/View/CoPeople/fields.inc 2012-07-20 02:37:37 UTC (rev
318)
@@ -250,15 +250,17 @@
array('controller' =>
'identifiers', 'action' => 'add', 'copersonid' =>
$co_people[0]['CoPerson']['id'], 'co' => $cur_co['Co']['id']),
array('class' => 'addbutton')) .
"\n";
- print '<a
- class="autobutton"
- title="' . _txt('op.id.auto') . '"
- onclick="javascript:js_confirm_autogenerate(\''
. $this->Html->url(array('controller' => 'identifiers',
-
'action' => 'assign',
-
'copersonid' => $co_people[0]['CoPerson']['id'],
-
'co' => $cur_co['Co']['id'])) . '\')";>'
- . _txt('op.id.auto')
- . "</a>\n";
+ if(!empty($co_identifier_assignments)) {
+ print '<a
+ class="autobutton"
+ title="' . _txt('op.id.auto') . '"
+
onclick="javascript:js_confirm_autogenerate(\'' .
$this->Html->url(array('controller' => 'identifiers',
+
'action' => 'assign',
+
'copersonid' => $co_people[0]['CoPerson']['id'],
+
'co' => $cur_co['Co']['id'])) . '\')";>'
+ . _txt('op.id.auto')
+ . "</a>\n";
+ }
}
else
{
- [comanage-dev] r318 - in registry/trunk/app: Controller View/CoPeople, svnlog, 07/19/2012
Archive powered by MHonArc 2.6.16.