Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r513 - in registry/trunk/app: Controller Lib Model View/CoGroupMembers View/CoGroups

Subject: COmanage Developers List

List archive

[comanage-dev] r513 - in registry/trunk/app: Controller Lib Model View/CoGroupMembers View/CoGroups


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r513 - in registry/trunk/app: Controller Lib Model View/CoGroupMembers View/CoGroups
  • Date: Sun, 5 May 2013 22:22:38 -0400
  • Authentication-results: sfpop-ironport04.merit.edu; dkim=neutral (message not signed) header.i=none

Author: benno
Date: 2013-05-05 22:22:38 -0400 (Sun, 05 May 2013)
New Revision: 513

Modified:
registry/trunk/app/Controller/CoGroupMembersController.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/Model/CoGroupMember.php
registry/trunk/app/View/CoGroupMembers/select.ctp
registry/trunk/app/View/CoGroups/fields.inc
Log:
Improve group member selector (CO-600)

Modified: registry/trunk/app/Controller/CoGroupMembersController.php
===================================================================
--- registry/trunk/app/Controller/CoGroupMembersController.php 2013-05-03
23:18:56 UTC (rev 512)
+++ registry/trunk/app/Controller/CoGroupMembersController.php 2013-05-06
02:22:38 UTC (rev 513)
@@ -294,7 +294,8 @@

// Store the group ID in the controller object since performRedirect may
need it

- if($this->action == 'add' &&
isset($this->request->data['CoGroupMember']['co_group_id']))
+ if(($this->action == 'add' || $this->action == 'updateGroup')
+ && isset($this->request->data['CoGroupMember']['co_group_id']))
$this->gid = $this->request->data['CoGroupMember']['co_group_id'];
elseif(($this->action == 'delete' || $this->action == 'edit' ||
$this->action == 'view')
&& isset($this->request->params['pass'][0]))
@@ -337,11 +338,14 @@
// This is for REST
$p['index'] = ($this->restful && ($roles['cmadmin'] ||
$roles['coadmin']));

+ // Select from a list of potential members to add?
+ $p['select'] = ($roles['cmadmin'] || $managed);
+
// Update accepts a CO Person's worth of potential group memberships and
performs the appropriate updates
$p['update'] = ($roles['cmadmin'] || $roles['comember']);

// Select from a list of potential members to add?
- $p['select'] = ($roles['cmadmin'] || $managed);
+ $p['updateGroup'] = ($roles['cmadmin'] || $managed);

// View members of a group?
$p['view'] = ($roles['cmadmin'] || $managed || $member);
@@ -401,48 +405,50 @@
*/

function select() {
- // Set page title
- $this->set('title_for_layout', _txt('op.select-a',
array(_txt('ct.co_group_members.1'))));
-
- // Find all available CO people.
-
- $this->paginate['conditions'] = array(
- 'co_id' => $this->cur_co['Co']['id']
- );
- $allCoPeople = $this->paginate('CoPerson');
-
- // Find all current group members and create an array
- // of the corresponding CO person Ids.
- $groupId = $this->request->params['named']['cogroup'];
- $allGroupMembers = $this->CoGroupMember->find('all',
- array(
- 'conditions' =>
-
array('CoGroupMember.co_group_id' => $groupId),
- 'recursive' => -1)
- );
- $allGroupMembersCoPersonId = array();
- foreach($allGroupMembers as $member){
- $allGroupMembersCoPersonId[] =
$member['CoGroupMember']['co_person_id'];
- }
-
- // Filter out CO people that are already members.
- foreach($allCoPeople as $key => &$coPerson) {
- if (in_array($coPerson['CoPerson']['id'], $allGroupMembersCoPersonId))
{
- unset($allCoPeople[$key]);
+ // Find all available CO people
+
+ $args = array();
+ $args['joins'][0]['table'] = 'co_groups';
+ $args['joins'][0]['alias'] = 'CoGroup';
+ $args['joins'][0]['type'] = 'INNER';
+ $args['joins'][0]['conditions'][0] = 'CoPerson.co_id=CoGroup.co_id';
+ $args['conditions']['CoGroup.id'] =
$this->request->params['named']['cogroup'];
+ $args['order'][] = 'Name.family';
+ $args['contain'][] = 'Name';
+
+ $this->set('co_people', $this->CoGroupMember->CoPerson->find('all',
$args));
+
+ // Find current group members/owners, and rehash to make it easier for
the
+ // view to process
+
+ $args = array();
+ $args['conditions']['CoGroupMember.co_group_id'] =
$this->request->params['named']['cogroup'];
+ $args['recursive'] = -1;
+
+ $coGroupMembers = $this->CoGroupMember->find('all', $args);
+ $coGroupRoles = array();
+
+ foreach($coGroupMembers as $m) {
+ if(isset($m['CoGroupMember']['member']) &&
$m['CoGroupMember']['member']) {
+ // Make it easy to find the corresponding co_group_member:id
+ $coGroupRoles['members'][ $m['CoGroupMember']['co_person_id'] ] =
$m['CoGroupMember']['id'];
}
+
+ if(isset($m['CoGroupMember']['owner']) &&
$m['CoGroupMember']['owner']) {
+ // Make it easy to find the corresponding co_group_member:id
+ $coGroupRoles['owners'][ $m['CoGroupMember']['co_person_id'] ] =
$m['CoGroupMember']['id'];
+ }
}
-
- $this->set('co_people', $allCoPeople);

- // Also find the Group so that its details like name
- // can be rendered.
- $coGroup = $this->CoGroupMember->CoGroup->find('first',
- array('conditions' =>
- array('CoGroup.id' =>
$groupId)
- )
- );
-
- $this->set('co_group', $coGroup);
+ $this->set('co_group_roles', $coGroupRoles);
+
+ // Also find the Group so that its details like name can be rendered
+
+ $args = array();
+ $args['conditions']['CoGroup.id'] =
$this->request->params['named']['cogroup'];
+ $args['contain'] = false;
+
+ $this->set('co_group', $this->CoGroupMember->CoGroup->find('first',
$args));
}

/**
@@ -474,4 +480,34 @@
'co' => $this->cur_co['Co']['id']));
}
}
+
+ /**
+ * Process an update to a CO Group's Memberships.
+ * - precondition: $this->request->params holds cogroup
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.8
+ */
+
+ public function updateGroup() {
+ if(!$this->restful) {
+ try {
+
$this->CoGroupMember->updateGroupMemberships($this->request->data['CoGroupMember']['co_group_id'],
+
$this->request->data['CoGroupMember']['rows'],
+
$this->Session->read('Auth.User.co_person_id'));
+
+ $this->Session->setFlash(_txt('rs.saved'), '', array(), 'success');
+ }
+ catch(Exception $e) {
+ $this->Session->setFlash($e->getMessage(), '', array(), 'error');
+ }
+
+ // Issue redirect
+
+ $this->redirect(array('controller' => 'co_groups',
+ 'action' => 'edit',
+
$this->request->data['CoGroupMember']['co_group_id'],
+ 'co' => $this->cur_co['Co']['id']));
+ }
+ }
}

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-05-03 23:18:56 UTC (rev 512)
+++ registry/trunk/app/Lib/lang.php 2013-05-06 02:22:38 UTC (rev 513)
@@ -451,6 +451,7 @@
'fd.group.mem' => 'Member',
'fd.group.memin' => 'membership in "%1$s"',
'fd.group.own' => 'Owner',
+ 'fd.group.own.only' => 'Owner (only)',
'fd.groups' => 'Groups',
'fd.history.pt' => 'Petition History',
// Identifier Assignment
@@ -563,7 +564,7 @@
'op.enroll' => 'Enroll',
'op.find.inv' => 'Find a Person to Invite to %1$s',
'op.gr.memadd' => 'Manage %1$s Group Memberships',
- 'op.grm.add' => 'Add Person to %1$s Group %2$s',
+ 'op.grm.edit' => 'Edit Members of %1$s Group %2$s',
'op.grm.manage' => 'Manage My Group Memberships',
'op.history' => 'View History',
'op.id.auto' => 'Autogenerate Identifiers',
@@ -574,6 +575,7 @@
'op.inv.reply' => 'Reply to Invitation',
'op.inv.resend' => 'Resend Invite',
'op.inv.send' => 'Send Invite',
+ 'op.manage' => 'Manage',
'op.menu' => 'Menu',
'op.login' => 'Login',
'op.logout' => 'Logout',

Modified: registry/trunk/app/Model/CoGroupMember.php
===================================================================
--- registry/trunk/app/Model/CoGroupMember.php 2013-05-03 23:18:56 UTC (rev
512)
+++ registry/trunk/app/Model/CoGroupMember.php 2013-05-06 02:22:38 UTC (rev
513)
@@ -90,6 +90,39 @@
}

/**
+ * Obtain the member roles for a CO Group.
+ *
+ * @since COmanage Registry v0.8
+ * @param Integer CO Person ID
+ * @return Array An array of two array: CO Person IDs for the group's
members, and CO Person IDs for the group's owners
+ */
+
+ function findCoGroupRoles($coGroupId) {
+ $ret = array(
+ 'member' => array(),
+ 'owner' => array()
+ );
+
+ $args = array();
+ $args['conditions']['CoGroupMember.co_group_id'] = $coGroupId;
+ $args['contain'] = false;
+
+ $memberships = $this->find('all', $args);
+
+ foreach($memberships as $m) {
+ if(isset($m['CoGroupMember']['member']) &&
$m['CoGroupMember']['member']) {
+ $ret['member'][] = $m['CoGroupMember']['co_person_id'];
+ }
+
+ if(isset($m['CoGroupMember']['owner']) &&
$m['CoGroupMember']['owner']) {
+ $ret['owner'][] = $m['CoGroupMember']['co_person_id'];
+ }
+ }
+
+ return $ret;
+ }
+
+ /**
* Obtain the group roles for a CO person.
*
* @since COmanage Registry v0.6
@@ -230,7 +263,7 @@
}
}
} else {
- // If id is not specified, that a role has been specified, make
sure
+ // If id is not specified, but a role has been specified, make sure
// the CO Person is not already in the group, that the group is in
the
// same CO as the CO Person, and add a new row.

@@ -285,4 +318,170 @@

return false;
}
+
+ /**
+ * Update the CO Group Memberships for a CO Group.
+ *
+ * @since COmanage Registry v0.8
+ * @param Integer CO Group ID
+ * @param Array Array of CO Group Member attributes (id, co_person_id,
member, owner)
+ * @param Integer CO Person ID of requester
+ * @return Boolean True on success, false otherwise
+ * @throws LogicException
+ * @todo Perhaps consolidate with updateMemberships (lots of duplicate
code)
+ */
+
+ public function updateGroupMemberships($coGroupId, $memberships,
$requesterCoPersonId) {
+ if($coGroupId && !empty($memberships)) {
+ // First, pull the current group memberships.
+
+ $curRoles = $this->findCoGroupRoles($coGroupId);
+
+ // Pull the related group information
+ $args = array();
+ $args['conditions']['id'] = $coGroupId;
+ $args['contain'] = false;
+
+ $grp = $this->CoGroup->find('first', $args);
+
+ if(empty($grp)) {
+ throw new InvalidArgumentException(_txt('er.gr.nf',
array($coGroupId)));
+ }
+
+ foreach($memberships as $m) {
+ // Determine desired roles for this row
+ $member = isset($m['member']) && $m['member'];
+ $owner = isset($m['owner']) && $m['owner'];
+
+ if(!empty($m['id'])) {
+ // There's already a corresponding CO Group Member record
+ $args = array();
+ $args['conditions']['id'] = $m['id'];
+ $args['contain'] = false;
+
+ $grpMem = $this->find('first', $args);
+
+ if(empty($grpMem)) {
+ throw new InvalidArgumentException(_txt('er.grm.nf',
array($m['id'])));
+ }
+
+ if(!$member && !$owner) {
+ // If a (CO Group Member) id is specified but member and owner
are
+ // both false, delete the row and cut a history record.
+
+ // Set $this->data so ProvisionerBehavior can run on
beforeDelete()
+ $this->data = $grpMem;
+
+ if(!$this->delete($m['id'], false)) {
+ throw new RuntimeException(_txt('er.delete'));
+ }
+
+ // Cut a history record
+
+ try {
+ $this->CoPerson->HistoryRecord->record($m['co_person_id'],
+ null,
+ null,
+ $requesterCoPersonId,
+
ActionEnum::CoGroupMemberDeleted,
+ _txt('rs.grm.deleted',
array($grp['CoGroup']['name'],
+
$coGroupId)));
+ }
+ catch(Exception $e) {
+ throw new RuntimeException($e->getMessage());
+ }
+ } else {
+ // Otherwise, update the row if the member or owner are
different than current.
+
+ $curMember = isset($grpMem['CoGroupMember']['member']) &&
$grpMem['CoGroupMember']['member'];
+ $curOwner = isset($grpMem['CoGroupMember']['owner']) &&
$grpMem['CoGroupMember']['owner'];
+
+ if(($member != $curMember) || ($owner != $curOwner)) {
+ $cogm = array();
+ $cogm['CoGroupMember']['id'] = $m['id'];
+ $cogm['CoGroupMember']['co_group_id'] = $coGroupId;
+ $cogm['CoGroupMember']['co_person_id'] = $m['co_person_id'];
+ $cogm['CoGroupMember']['member'] = $member;
+ $cogm['CoGroupMember']['owner'] = $owner;
+
+ if(!$this->save($cogm)) {
+ throw new RuntimeException($this->validationErrors);
+ }
+
+ // Cut a history record
+
+ try {
+ $this->CoPerson->HistoryRecord->record($m['co_person_id'],
+ null,
+ null,
+ $requesterCoPersonId,
+
ActionEnum::CoGroupMemberEdited,
+ _txt('rs.grm.edited',
array($grp['CoGroup']['name'],
+
$coGroupId,
+
_txt($curMember ? 'fd.yes' : 'fd.no'),
+
_txt($curOwner ? 'fd.yes' : 'fd.no'),
+
_txt($member ? 'fd.yes' : 'fd.no'),
+
_txt($owner ? 'fd.yes' : 'fd.no'))));
+ }
+ catch(Exception $e) {
+ throw new RuntimeException($e->getMessage());
+ }
+ }
+ }
+ } else {
+ // If id is not specified, but a role has been specified, make sure
+ // the CO Person is not already in the group, that the group is in
the
+ // same CO as the CO Person, and add a new row.
+
+ if($member || $owner) {
+ if(!in_array($m['co_person_id'], $curRoles['member'])
+ && !in_array($m['co_person_id'], $curRoles['owner'])) {
+ if($grp['CoGroup']['co_id']
+ != $this->CoPerson->field('co_id', array('id' =>
$m['co_person_id']))) {
+ throw new InvalidArgumentException(_txt('er.co.mismatch',
array("CoGroup", $coGroupId)));
+ }
+
+ // We can finally add a new CoGroupMember
+
+ $cogm = array();
+ $cogm['CoGroupMember']['co_group_id'] = $coGroupId;
+ $cogm['CoGroupMember']['co_person_id'] = $m['co_person_id'];
+ $cogm['CoGroupMember']['member'] = $member;
+ $cogm['CoGroupMember']['owner'] = $owner;
+
+ if(!$this->save($cogm)) {
+ throw new RuntimeException($this->validationErrors);
+ }
+
+ // Cut a history record
+
+ try {
+ $this->CoPerson->HistoryRecord->record($m['co_person_id'],
+ null,
+ null,
+ $requesterCoPersonId,
+
ActionEnum::CoGroupMemberAdded,
+ _txt('rs.grm.added',
array($grp['CoGroup']['name'],
+
$coGroupId,
+
_txt($member ? 'fd.yes' : 'fd.no'),
+
_txt($owner ? 'fd.yes' : 'fd.no'))));
+ }
+ catch(Exception $e) {
+ throw new RuntimeException($e->getMessage());
+ }
+ } else {
+ // We shouldn't get here since $m['id'] should have been set
if the CO person
+ // already had a role in the group
+
+ throw new LogicException(_txt('er.grm.already',
array($m['co_person_id'], $coGroupId)));
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
}

Modified: registry/trunk/app/View/CoGroupMembers/select.ctp
===================================================================
--- registry/trunk/app/View/CoGroupMembers/select.ctp 2013-05-03 23:18:56
UTC (rev 512)
+++ registry/trunk/app/View/CoGroupMembers/select.ctp 2013-05-06 02:22:38
UTC (rev 513)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Group Member Select View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -23,7 +23,7 @@
*/
-->
<?php
- $params = array('title' => _txt('op.grm.add', array($cur_co['Co']['name'],
$co_group['CoGroup']['name'])));
+ $params = array('title' => _txt('op.grm.edit',
array($cur_co['Co']['name'], $co_group['CoGroup']['name'])));
print $this->element("pageTitle", $params);

echo $this->Html->link(_txt('op.cancel'),
@@ -40,18 +40,18 @@
<table id="co_people" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort(_txt('fd.name'), 'Name.family');
?></th>
- <th>Permissions</th>
+ <th><?php print _txt('fd.name'); ?></th>
+ <th><?php print _txt('fd.perms'); ?></th>
</tr>
<?php
- echo $this->Form->create('CoGroupMember',
- array('action' => 'add',
- 'inputDefaults' => array('label' =>
false,
- 'div' =>
false))) . "\n";
+ print $this->Form->create('CoGroupMember',
+ array('action' => 'updateGroup',
+ 'inputDefaults' => array('label' =>
false,
+ 'div' =>
false))) . "\n";
// beforeFilter needs CO ID
- echo $this->Form->hidden('CoGroupMember.co_id', array('default' =>
$cur_co['Co']['id'])) . "\n";
+ print $this->Form->hidden('CoGroupMember.co_id', array('default' =>
$cur_co['Co']['id'])) . "\n";
// Group ID must be global for isAuthorized
- echo $this->Form->hidden('CoGroupMember.co_group_id', array('default'
=> $co_group['CoGroup']['id'])) . "\n";
+ print $this->Form->hidden('CoGroupMember.co_group_id', array('default'
=> $co_group['CoGroup']['id'])) . "\n";
?>
</thead>

@@ -59,13 +59,41 @@
<?php $i = 0; ?>
<?php foreach ($co_people as $p): ?>
<tr class="line<?php print ($i % 2)+1; ?>">
- <td><?php echo Sanitize::html(generateCn($p['Name'])); ?></td>
<td>
<?php
- echo $this->Form->hidden('CoGroupMember.'.$i.'.co_person_id',
+ print $this->Html->link(Sanitize::html(generateCn($p['Name'])),
+ array('controller' => 'co_people',
+ 'action' => 'edit',
+ $p['CoPerson']['id'],
+ 'co' => $cur_co['Co']['id']));
+ ?>
+ </td>
+ <td>
+ <?php
+ $isMember = isset($co_group_roles['members'][$p['CoPerson']['id']])
+ && $co_group_roles['members'][$p['CoPerson']['id']];
+ $isOwner = isset($co_group_roles['owners'][$p['CoPerson']['id']])
+ && $co_group_roles['owners'][$p['CoPerson']['id']];
+ $gmid = null;
+
+ if($isMember) {
+ $gmid = $co_group_roles['members'][$p['CoPerson']['id']];
+ } elseif($isOwner) {
+ $gmid = $co_group_roles['owners'][$p['CoPerson']['id']];
+ }
+
+ if($gmid) {
+ print $this->Form->hidden('CoGroupMember.rows.'.$i.'.id',
+ array('default' => $gmid)) . "\n";
+ }
+ print $this->Form->hidden('CoGroupMember.rows.'.$i.'.co_person_id',
array('default' => $p['CoPerson']['id']))
. "\n";
- echo $this->Form->checkbox('CoGroupMember.'.$i.'.member') .
_txt('fd.group.mem') . "\n";
- echo $this->Form->checkbox('CoGroupMember.'.$i.'.owner') .
_txt('fd.group.own') . "\n";
+ print $this->Form->checkbox('CoGroupMember.rows.'.$i.'.member',
+ array('checked' => $isMember))
+ . _txt('fd.group.mem') . "\n";
+ print $this->Form->checkbox('CoGroupMember.rows.'.$i.'.owner',
+ array('checked' => $isOwner))
+ . _txt('fd.group.own') . "\n";
?>
</td>
</tr>
@@ -75,15 +103,14 @@

<tfoot>
<tr class="ui-widget-header">
- <th colspan="8">
- <?php echo $this->Paginator->numbers(); ?>
+ <th colspan="2">
</th>
</tr>
<tr>
<td>
<?php
- echo $this->Form->submit(_txt('op.add'));
- echo $this->Form->end();
+ print $this->Form->submit(_txt('op.save'));
+ print $this->Form->end();
?>
</td>
</tr>

Modified: registry/trunk/app/View/CoGroups/fields.inc
===================================================================
--- registry/trunk/app/View/CoGroups/fields.inc 2013-05-03 23:18:56 UTC (rev
512)
+++ registry/trunk/app/View/CoGroups/fields.inc 2013-05-06 02:22:38 UTC (rev
513)
@@ -117,59 +117,64 @@
?>
</td>
</tr>
+ <tr>
+ <td>
+ <i><font class="required"><?php echo _txt('fd.req');
?></font></i><br />
+ </td>
+ <td>
+ <?php
+ if($e)
+ echo $this->Form->submit($submit_label);
+ ?>
+ </td>
+ </tr>
<tr class="line1">
<td>
<?php echo _txt('fd.members'); ?>
</td>
<td>
- <?php
-
- if(isset($co_group_members))
- {
- if($e)
- {
- foreach($co_group_members as $c)
- {
- foreach($c['CoPerson']['CoGroupMember'] as $g)
- {
- // We get all the group memberships, but are only
interested in the current group
- if($g['co_group_id'] == $co_groups[0]['CoGroup']['id'])
- {
- if($dok)
- echo '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(_txt('fd.group.memin',
array(Sanitize::html($co_groups[0]['CoGroup']['name'])))) . '\', \'' .
$this->Html->url(array('controller' => 'co_group_members', 'action' =>
'delete', $g['id'], 'copersonid' => $g['co_person_id'], 'co' =>
$cur_co['Co']['id'])) . '\')";>' . _txt('op.delete') . '</a>' . "\n";
- echo
$this->Html->link(generateCn($c['CoPerson']['Name']), array('controller' =>
'co_group_members', 'action' => 'edit', $g['id'], 'co' =>
$cur_co['Co']['id']));
- echo "<br />\n";
- break;
+ <?php
+ if(isset($co_group_members)) {
+ if($e) {
+ foreach($co_group_members as $c) {
+ foreach($c['CoPerson']['CoGroupMember'] as $g) {
+ // We get all the group memberships, but are only interested
in the current group
+ if($g['co_group_id'] == $co_groups[0]['CoGroup']['id']) {
+ if($dok) {
+ print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(_txt('fd.group.memin',
array(Sanitize::html($co_groups[0]['CoGroup']['name'])))) . '\', \'' .
$this->Html->url(array('controller' => 'co_group_members', 'action' =>
'delete', $g['id'], 'copersonid' => $g['co_person_id'], 'co' =>
$cur_co['Co']['id'])) . '\')";>' . _txt('op.delete') . '</a>' . "\n";
}
+ print $this->Html->link(generateCn($c['CoPerson']['Name']),
+ array('controller' =>
'co_group_members',
+ 'action' => 'edit',
+ $g['id'],
+ 'co' =>
$cur_co['Co']['id']));
+
+ if($g['owner']) {
+ if(!$g['member']) {
+ print " " . _txt('fd.group.own.only');
+ } else {
+ print " " . _txt('fd.group.own');
+ }
+ }
+ print "<br />\n";
+ break;
}
}
-
- echo $this->Html->link(_txt('op.add'),
- array('controller' =>
'co_group_members',
- 'action' => 'select',
- 'cogroup' =>
$co_groups[0]['CoGroup']['id'],
- 'co' => $cur_co['Co']['id']),
- array('class' => 'addbutton'));
}
- else
- {
- foreach($co_group_members as $c)
- echo Sanitize::html(generateCn($c['CoPerson']['Name'])) .
"<br />\n";
- }
+
+ echo $this->Html->link(_txt('op.manage'),
+ array('controller' => 'co_group_members',
+ 'action' => 'select',
+ 'cogroup' =>
$co_groups[0]['CoGroup']['id'],
+ 'co' => $cur_co['Co']['id']),
+ array('class' => 'linkbutton'));
+ } else {
+ foreach($co_group_members as $c)
+ echo Sanitize::html(generateCn($c['CoPerson']['Name'])) . "<br
/>\n";
}
- ?>
+ }
+ ?>
</td>
</tr>
- <tr>
- <td>
- <i><font class="required"><?php echo _txt('fd.req');
?></font></i><br />
- </td>
- <td>
- <?php
- if($e)
- echo $this->Form->submit($submit_label);
- ?>
- </td>
- </tr>
</tbody>
</table>



  • [comanage-dev] r513 - in registry/trunk/app: Controller Lib Model View/CoGroupMembers View/CoGroups, svnlog, 05/05/2013

Archive powered by MHonArc 2.6.16.

Top of Page