comanage-dev - [comanage-dev] r349 - in registry/trunk/app: Lib View/CoPeople View/OrgIdentities View/Standard webroot/css
Subject: COmanage Developers List
List archive
[comanage-dev] r349 - in registry/trunk/app: Lib View/CoPeople View/OrgIdentities View/Standard webroot/css
Chronological Thread
- From:
- To:
- Subject: [comanage-dev] r349 - in registry/trunk/app: Lib View/CoPeople View/OrgIdentities View/Standard webroot/css
- Date: Mon, 27 Aug 2012 12:22:53 -0400
Author: marie
Date: 2012-08-27 12:22:53 -0400 (Mon, 27 Aug 2012)
New Revision: 349
Modified:
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/CoPeople/fields.inc
registry/trunk/app/View/OrgIdentities/fields.inc
registry/trunk/app/View/Standard/view.ctp
registry/trunk/app/webroot/css/comanage.css
Log:
co360 - organizes orgID and coperson views into tabs
Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2012-08-27 00:26:22 UTC (rev 348)
+++ registry/trunk/app/Lib/lang.php 2012-08-27 16:22:53 UTC (rev 349)
@@ -408,6 +408,7 @@
'fd.members' => 'Members',
'fd.modified' => 'Modified',
'fd.name' => 'Name',
+ 'fd.name.affil' => 'Name and Affiliation',
'fd.name.d' => 'Display Name',
'fd.name.h.desc' => '(Dr, Hon, etc)',
'fd.name.s.desc' => '(Jr, III, etc)',
Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2012-08-27 00:26:22 UTC (rev
348)
+++ registry/trunk/app/View/CoPeople/fields.inc 2012-08-27 16:22:53 UTC (rev
349)
@@ -164,13 +164,15 @@
</ul>
<div id="tabs-name">
<table>
- <tr>
- <th class="ui-widget-header"><?php print _txt('fd.attribute');
?></th>
- <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
- <?php if($this->action == "compare"): ?>
- <th class="ui-widget-header"><?php print
(!empty($org_identities[0]['OrgIdentity']['o']) ?
Sanitize::html($org_identities[0]['OrgIdentity']['o']) : _txt('fd.o'));
?></th>
- <?php endif; ?>
- </tr>
+ <?php if($this->action == "compare"): ?>
+ <tr>
+ <th class="ui-widget-header"><?php print _txt('fd.attribute');
?></th>
+ <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
+ <?php if($this->action == "compare"): ?>
+ <th class="ui-widget-header"><?php print
(!empty($org_identities[0]['OrgIdentity']['o']) ?
Sanitize::html($org_identities[0]['OrgIdentity']['o']) : _txt('fd.o'));
?></th>
+ <?php endif; ?>
+ </tr>
+ <?php endif; ?>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
<?php
@@ -273,71 +275,74 @@
<div style="float:left">
<table>
<tbody>
- <tr>
- <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
- <?php if($e && !$es): ?>
- <th class="ui-widget-header"><?php print
_txt('fd.actions'); ?></th>
- <?php endif; ?>
- </tr>
- <?php
- $l = 1;
- if($e && !$es)
+ <?php if($this->action == "compare"): ?>
+ <tr>
+ <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
+ <?php if($e && !$es): ?>
+ <th class="ui-widget-header"><?php print
_txt('fd.actions'); ?></th>
+ <?php endif; ?>
+ </tr>
+ <?php endif; ?>
+
+ <?php
+ $l = 1;
+ if($e && !$es)
+ {
+ if(isset($co_people[0]['Identifier']))
{
- if(isset($co_people[0]['Identifier']))
+ foreach($co_people[0]['Identifier'] as $id)
{
- foreach($co_people[0]['Identifier'] as $id)
- {
- print '<tr class="line';
- print ($l % 2);
- print '">';
- $l++;
- print '<td>';
- print $this->Html->link($id['identifier'],
array('controller' => 'identifiers', 'action' => 'edit', $id['id'], 'co' =>
$cur_co['Co']['id']));
- print " (" . $id['type'] . ")";
- print '</td>';
- print '<td>';
- // XXX we already checked for
$permissions['edit'], but not ['delete']... should we?
- print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' . _txt('op.delete') .
'</a>' . "\n";
- print $this->Html->link(_txt('op.edit'),
- array('controller' =>
'identifiers', 'action' => 'edit', $id['id'], 'co' => $cur_co['Co']['id']),
- array('class' => 'editbutton'));
- print '</td>';
- print '</tr>';
- }
+ print '<tr class="line';
+ print ($l % 2);
+ print '">';
+ $l++;
+ print '<td>';
+ print $this->Html->link($id['identifier'],
array('controller' => 'identifiers', 'action' => 'edit', $id['id'], 'co' =>
$cur_co['Co']['id']));
+ print " (" . $id['type'] . ")";
+ print '</td>';
+ print '<td>';
+ // XXX we already checked for
$permissions['edit'], but not ['delete']... should we?
+ print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' . _txt('op.delete') .
'</a>' . "\n";
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' =>
'identifiers', 'action' => 'edit', $id['id'], 'co' => $cur_co['Co']['id']),
+ array('class' => 'editbutton'));
+ print '</td>';
+ print '</tr>';
}
}
- else
+ }
+ else
+ {
+ if(isset($co_people[0]['Identifier']))
{
- if(isset($co_people[0]['Identifier']))
+ foreach($co_people[0]['Identifier'] as $id)
{
- foreach($co_people[0]['Identifier'] as $id)
- {
- print '<tr class="line';
- print ($l % 2);
- print '">';
- $l++;
- print '<td>';
- print Sanitize::html($id['identifier']) . " (" .
$id['type'] . ")<br />\n";
- print '</td>';
- print '</tr>';
- }
+ print '<tr class="line';
+ print ($l % 2);
+ print '">';
+ $l++;
+ print '<td>';
+ print Sanitize::html($id['identifier']) . " (" .
$id['type'] . ")<br />\n";
+ print '</td>';
+ print '</tr>';
}
}
- if($e && !$es)
- {
- print '<tr>';
- print '<td></td>';
- print '<td>';
+ }
+ if($e && !$es)
+ {
+ print '<tr>';
+ print '<td></td>';
+ print '<td>';
- print $this->Html->link(_txt('op.add'),
- array('controller' =>
'identifiers', 'action' => 'add', 'copersonid' =>
$co_people[0]['CoPerson']['id'], 'co' => $cur_co['Co']['id']),
- array('class' =>
'addbutton')) . "\n";
- print '</td>';
- print '</tr>';
- }
- ?>
+ print $this->Html->link(_txt('op.add'),
+ array('controller' =>
'identifiers', 'action' => 'add', 'copersonid' =>
$co_people[0]['CoPerson']['id'], 'co' => $cur_co['Co']['id']),
+ array('class' => 'addbutton'))
. "\n";
+ print '</td>';
+ print '</tr>';
+ }
+ ?>
</tbody>
</table>
</div>
@@ -386,12 +391,14 @@
<div style="float:left">
<table>
<tbody>
- <tr>
- <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
- <?php if($e && !$es): ?>
- <th class="ui-widget-header"><?php print
_txt('fd.actions'); ?></th>
- <?php endif; ?>
- </tr>
+ <?php if($this->action == "compare"): ?>
+ <tr>
+ <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
+ <?php if($e && !$es): ?>
+ <th class="ui-widget-header"><?php print
_txt('fd.actions'); ?></th>
+ <?php endif; ?>
+ </tr>
+ <?php endif; ?>
<?php
$l = 1;
if($e)
@@ -489,12 +496,14 @@
<div id="tabs-group">
<div style="float:left;">
<table>
- <tr>
- <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
- <?php if($e && !$es): ?>
- <th class="ui-widget-header"><?php print _txt('fd.actions');
?></th>
- <?php endif; ?>
- </tr>
+ <?php if($this->action == "compare"): ?>
+ <tr>
+ <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
+ <?php if($e && !$es): ?>
+ <th class="ui-widget-header"><?php print
_txt('fd.actions'); ?></th>
+ <?php endif; ?>
+ </tr>
+ <?php endif; ?>
<?php
if(isset($co_people[0]['CoGroupMember']))
{
Modified: registry/trunk/app/View/OrgIdentities/fields.inc
===================================================================
--- registry/trunk/app/View/OrgIdentities/fields.inc 2012-08-27 00:26:22
UTC (rev 348)
+++ registry/trunk/app/View/OrgIdentities/fields.inc 2012-08-27 16:22:53
UTC (rev 349)
@@ -22,6 +22,14 @@
* @version $Id$
*/
-->
+
+<script>
+// Turn on Tabs
+$(function() {
+ $( "#tabs" ).tabs();
+ });
+</script>
+
<?php
// Globals
@@ -29,36 +37,25 @@
// Determine if fields are editable
$e = false;
-
+
if(($this->action == "add" && $permissions['add'])
|| ($this->action == "edit" && $permissions['edit']))
$e = true;
-
+
// We shouldn't get here if we don't have at least read permission, but
check just in case
-
+
if(!$e && !$permissions['view'])
return(false);
-
+
if($e)
{
- print $this->Html->link(
- _txt('op.cancel'),
- isset($redirect) ? $redirect
- : array(
- 'controller' => 'org_identities',
- 'action' => 'index',
- 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id'])
- ),
- array('class' => 'cancelbutton')
- );
-
// Populate CO ID if approporiate
-
+
if(!$pool_org_identities)
echo $this->Form->hidden('OrgIdentity.co_id',
array('default' => $cur_co['Co']['id'])).
"\n";
}
-
+
if($this->action != "add") {
print $this->Html->link(
_txt('op.history'),
@@ -75,6 +72,7 @@
<br />
<?php
+
// The fields to render are determined by the CMP Enrollment Flow
configuration,
// which is passed to us in $cmp_ef_attributes. The minor gotcha is that
MVPAs
// allow multiple versions their attributes where the enrollment flow
configuration
@@ -82,125 +80,267 @@
// follow the config exactly on an add, but on an edit if the fields
aren't pulled
// from LDAP or SAML we'll allow multiple. This will probably need to get
rewritten
// at some point.
-
+
// Track which models we've emitted hidden fields for
$emitted = array();
-
+
$l = 1;
?>
-<table id="<?php print $this->action; ?>_org_identity" class="ui-widget">
- <tbody>
- <tr class="line1">
- <td>
- <?php
- echo _txt('fd.name.honorific');
-
- if($e)
- echo " " . _txt('fd.name.h.desc');
- ?>
- </td>
- <td>
- <?php
- echo $this->Form->hidden('Name.id');
- echo $this->Form->hidden('Name.type', array('default' => 'O'));
- echo ($e ? $this->Form->input('Name.honorific') :
Sanitize::html($org_identities[0]['Name']['honorific']));
- ?>
- </td>
- </tr>
- <tr class="line2">
- <td>
- <?php echo _txt('fd.name.given'); ?><font class="required">*</font>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('Name.given') :
Sanitize::html($org_identities[0]['Name']['given'])); ?>
- </td>
- </tr>
- <tr class="line1">
- <td>
- <?php echo _txt('fd.name.middle'); ?>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('Name.middle') :
Sanitize::html($org_identities[0]['Name']['middle'])); ?>
- </td>
- <tr class="line2">
- <td>
- <?php echo _txt('fd.name.family'); ?>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('Name.family') :
Sanitize::html($org_identities[0]['Name']['family'])); ?>
- </td>
- </tr>
- <tr class="line1">
- <td>
- <?php
- echo _txt('fd.name.suffix');
-
- if($e)
- echo " " . _txt('fd.name.s.desc');
- ?>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('Name.suffix') :
Sanitize::html($org_identities[0]['Name']['suffix'])); ?>
- </td>
- </tr>
- <tr class="line2">
- <td>
- <?php echo _txt('fd.affiliation'); ?><font class="required">*</font>
- </td>
- <td>
- <?php
- global $cm_lang, $cm_texts;
- $attrs['value'] =
(isset($org_identities[0]['OrgIdentity']['affiliation'])
- ?
$org_identities[0]['OrgIdentity']['affiliation']
- : "M");
- $attrs['empty'] = false;
-
- if($e) {
- print $this->Form->select('affiliation',
- $cm_texts[ $cm_lang ]['en.affil'],
- $attrs);
-
- if($this->Form->isFieldError('status')) {
- print $this->Form->error('status');
- }
- } else {
- if(isset($org_identities[0]['OrgIdentity']['affiliation'])) {
- print $cm_texts[ $cm_lang ]['en.affil'][
$org_identities[0]['OrgIdentity']['affiliation'] ];
- }
- }
- ?>
- </td>
- </tr>
- <tr class="line1">
- <td>
- <?php echo _txt('fd.title'); ?>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('title') :
Sanitize::html($org_identities[0]['OrgIdentity']['title'])); ?>
- </td>
- </tr>
- <tr class="line2">
- <td>
- <?php echo _txt('fd.o'); ?>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('o') :
Sanitize::html($org_identities[0]['OrgIdentity']['o'])); ?>
- </td>
- </tr>
- <tr class="line1">
- <td>
- <?php echo _txt('fd.ou'); ?>
- </td>
- <td>
- <?php echo ($e ? $this->Form->input('ou') :
Sanitize::html($org_identities[0]['OrgIdentity']['ou'])); ?>
- </td>
- </tr>
+<div id="<?php print $this->action; ?>_org_identity" style=" float:left;
height:auto;">
+ <div id="tabs" style="min-height:350px; width:550px">
+ <ul>
+ <li>
+ <a href="#tabs-name">
+ <?php print _txt('fd.name.affil'); ?>
+ </a>
+ </li>
+
+ <?php if($this->action != "add"): ?>
+ <li>
+ <a href="#tabs-id">
+ <?php print _txt('fd.ids'); ?>
+ </a>
+ </li>
+ <li>
+ <a href="#tabs-email">
+ <?php print _txt('fd.email_address.mail'); ?>
+ </a>
+ </li>
+ <li>
+ <a href="#tabs-phone">
+ <?php print _txt('fd.telephone_number.number'); ?>
+ </a>
+ </li>
+ <li>
+ <a href="#tabs-address">
+ <?php print _txt('fd.address'); ?>
+ </a>
+ </li>
+ <?php endif; ?>
+ </ul>
+
+ <div id="tabs-name" class="ui-helper-clearfix">
+ <table id="<?php print $this->action; ?>_org_identity"
class="ui-widget">
+ <tbody>
+ <tr class="line1">
+ <td>
+ <?php
+ echo _txt('fd.name.honorific');
+
+ if($e)
+ echo " " . _txt('fd.name.h.desc');
+ ?>
+ </td>
+ <td>
+ <?php
+ echo $this->Form->hidden('Name.id');
+ echo $this->Form->hidden('Name.type', array('default' =>
'O'));
+ echo ($e ? $this->Form->input('Name.honorific') :
Sanitize::html($org_identities[0]['Name']['honorific']));
+ ?>
+ </td>
+ </tr>
+ <tr class="line2">
+ <td>
+ <?php echo _txt('fd.name.given'); ?><font
class="required">*</font>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('Name.given') :
Sanitize::html($org_identities[0]['Name']['given'])); ?>
+ </td>
+ </tr>
+ <tr class="line1">
+ <td>
+ <?php echo _txt('fd.name.middle'); ?>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('Name.middle') :
Sanitize::html($org_identities[0]['Name']['middle'])); ?>
+ </td>
+ <tr class="line2">
+ <td>
+ <?php echo _txt('fd.name.family'); ?>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('Name.family') :
Sanitize::html($org_identities[0]['Name']['family'])); ?>
+ </td>
+ </tr>
+ <tr class="line1">
+ <td>
+ <?php
+ echo _txt('fd.name.suffix');
+
+ if($e)
+ echo " " . _txt('fd.name.s.desc');
+ ?>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('Name.suffix') :
Sanitize::html($org_identities[0]['Name']['suffix'])); ?>
+ </td>
+ </tr>
+ <tr class="line2">
+ <td>
+ <?php echo _txt('fd.affiliation'); ?><font
class="required">*</font>
+ </td>
+ <td>
+ <?php
+ global $cm_lang, $cm_texts;
+ $attrs['value'] =
(isset($org_identities[0]['OrgIdentity']['affiliation'])
+ ?
$org_identities[0]['OrgIdentity']['affiliation']
+ : "M");
+ $attrs['empty'] = false;
+
+ if($e) {
+ print $this->Form->select('affiliation',
+ $cm_texts[ $cm_lang
]['en.affil'],
+ $attrs);
+
+ if($this->Form->isFieldError('status')) {
+ print $this->Form->error('status');
+ }
+ } else {
+
if(isset($org_identities[0]['OrgIdentity']['affiliation'])) {
+ print $cm_texts[ $cm_lang ]['en.affil'][
$org_identities[0]['OrgIdentity']['affiliation'] ];
+ }
+ }
+ ?>
+ </td>
+ </tr>
+ <tr class="line1">
+ <td>
+ <?php echo _txt('fd.title'); ?>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('title') :
Sanitize::html($org_identities[0]['OrgIdentity']['title'])); ?>
+ </td>
+ </tr>
+ <tr class="line2">
+ <td>
+ <?php echo _txt('fd.o'); ?>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('o') :
Sanitize::html($org_identities[0]['OrgIdentity']['o'])); ?>
+ </td>
+ </tr>
+ <tr class="line1">
+ <td>
+ <?php echo _txt('fd.ou'); ?>
+ </td>
+ <td>
+ <?php echo ($e ? $this->Form->input('ou') :
Sanitize::html($org_identities[0]['OrgIdentity']['ou'])); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <i><font class="required"><?php print _txt('fd.req');
?></font></i><br />
+ </td>
+ <td>
+ <?php
+ if($e)
+ {
+ print '<div style="float:left; margin:0 10px 0 0;">';
+ print $this->Form->submit($submit_label);
+ print '</div>';
+ print $this->Html->link(_txt('op.cancel'),
+ isset($redirect) ? $redirect
+ :
array('controller' => 'org_identities',
+ 'action'
=> 'index',
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])
+ ),
+ array('class' => 'cancelbutton')
+ );
+ }
+ ?>
+ </td>
+ </tr>
+ <?php if(0): ?>
+ <?php foreach ($cmp_ef_attribute_order as $f): ?>
+ <?php
+ // Find this attribute in the CMP enrollment flow configuration
+ $a =
find_ef_attribute($cmp_ef_attributes['CmpEnrollmentAttribute'], $f['attr'],
$f['type']);
+
+ // Skip this one if not found or not permitted
+ if(!$a || $a['required'] == RequiredEnum::NotPermitted)
+ continue;
+
+ // Convert table:column into usable bits
+ if(preg_match('/:/', $f['attr']))
+ {
+ $attr = preg_split('/:/', $f['attr'], 2);
+ $m = Inflector::classify($attr[0]); // names -> Name
+
+ // Associated models must be referenced as Model.0.field for
HABTM,
+ // or Model.field for HasOne
+ if(isset($f['assoc']) && $f['assoc'] != 'hasone')
+ $d = '.0.';
+ else
+ $d = '.';
+
+ $fattr = $m.$d.$attr[1];
+
+ // Create hidden fields for associated models
+
+ if(!isset($emitted[$m]))
+ {
+ print $this->Form->hidden($m.$d.'id');
+ print $this->Form->hidden($m.$d.'type', array('default' =>
$f['type']));
+
+ $emitted[$m] = true;
+ }
+ }
+ else
+ {
+ // Set up matching array
+ $attr[0] = 'org_identities';
+ $attr[1] = $f['attr'];
+ $m = Inflector::classify($attr[0]); // names -> Name
+ $fattr = $attr[1];
+ }
+ ?>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <td>
+ <?php
+ print $f['label'];
+
+ if($a['required'] == RequiredEnum::Required)
+ print '<font class="required">*</font>';
+
+ if($e && isset($f['desc']))
+ print " " . $f['desc'];
+ ?>
+ </td>
+ <td>
+ <?php
+ if(isset($f['select']))
+ {
+ // Render a select element
+ $attrs['value'] = (isset($org_identities[0][$m][
$attr[1] ])
+ ? $org_identities[0][$m][ $attr[1] ]
+ : $f['select']['default']);
+ $attrs['empty'] = false;
+
+ print ($e ? $this->Form->select($fattr,
+ $f['select']['options'],
+ $attrs)
+ : Sanitize::html($org_identities[0][$m][
$attr[1] ]));
+
+ if($this->Form->isFieldError($fattr)) {
+ print $this->Form->error($fattr);
+ }
+ }
+ else
+ {
+ // Use default rendering
+ print ($e ? $this->Form->input($fattr) :
Sanitize::html($org_identities[0][$m][ $attr[1] ]));
+ }
+ ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tbody>
+ </table>
+ </div>
+
<?php if($this->action != "add"): ?>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td>
- <?php print _txt('fd.ids'); ?>
- </td>
- <td>
+ <div id="tabs-id" class="additionalinfo">
<?php
if($e)
{
@@ -208,43 +348,49 @@
{
foreach($org_identities[0]['Identifier'] as $id)
{
- // XXX we already checked for $permissions['edit'], but not
['delete']... should we?
- print '<a class="deletebutton" title="' . _txt('op.delete')
.'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') . '</a>' . "\n";
- print $this->Html->link(_txt('op.edit'),
- array('controller' => 'identifiers',
- 'action' => 'edit',
- $id['id'],
- 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
- array('class' => 'editbutton')) . "\n";
- print $this->Html->link($id['identifier'],
array('controller' => 'identifiers',
+ print '<div>';
+ print '<div>';
+
+ print $this->Html->link($id['identifier'],
array('controller' => 'identifiers',
'action' =>
'edit',
$id['id'],
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
- print " (" . $id['type'] . ")<br />\n";
+ print " (" . $id['type'] . ")\n";
+ print '</div>';
+
+ // XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') . '</a>' . "\n";
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' => 'identifiers',
+ 'action' => 'edit',
+ $id['id'],
+ 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
+ array('class' => 'editbutton')) . "\n";
+ print '</div>';
}
}
-
print $this->Html->link(_txt('op.add'),
- array('controller' => 'identifiers',
- 'action' => 'add',
- 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
- 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id'])),
- array('class' => 'addbutton'));
+ array('controller' => 'identifiers',
+ 'action' => 'add',
+ 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
+ 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
+ array('class' => 'addbutton'));
}
else
{
if(isset($org_identities[0]['Identifier']))
foreach($org_identities[0]['Identifier'] as $id)
- print Sanitize::html($id['identifier']) . " (" . $id['type']
. ")<br />\n";
+ {
+ print '<div>';
+ print Sanitize::html($id['identifier']) . " (" .
$id['type'] . ")<br />\n";
+ print '</div>';
+ }
}
?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td>
- <?php print _txt('fd.email_address.mail'); ?>
- </td>
- <td>
+ <br>
+ </div>
+
+ <div id="tabs-email"class="additionalinfo">
<?php
if($e)
{
@@ -252,43 +398,51 @@
{
foreach($org_identities[0]['EmailAddress'] as $ea)
{
- // XXX we already checked for $permissions['edit'], but not
['delete']... should we?
- print '<a class="deletebutton" title="' . _txt('op.delete')
.'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($ea['mail'])) . '\', \'' .
$this->Html->url(array('controller' => 'email_addresses', 'action' =>
'delete', $ea['id'], 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']))) . '\')";>' . _txt('op.delete') .'</a>' . "\n";
- print $this->Html->link(_txt('op.edit'),
- array('controller' => 'email_addresses',
- 'action' => 'edit',
- $ea['id'],
- 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
- array('class' => 'editbutton')) . "\n";
- print $this->Html->link($ea['mail'], array('controller' =>
'email_addresses',
- 'action' => 'edit',
- $ea['id'],
- 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
- print " (" . _txt('en.contact', null, $ea['type']) . ")<br
/>\n";
+ print '<div>';
+ print '<div>';
+
+ print $this->Html->link($ea['mail'], array('controller'
=> 'email_addresses',
+ 'action' =>
'edit',
+ $ea['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
+ print " (" . _txt('en.contact', null, $ea['type'])
. ")";
+ print '</div>';
+
+ // XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($ea['mail'])) . '\', \'' .
$this->Html->url(array('controller' => 'email_addresses', 'action' =>
'delete', $ea['id'], 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']))) . '\')";>' . _txt('op.delete') .'</a>' . "\n";
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' =>
'email_addresses',
+ 'action' => 'edit',
+ $ea['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' => 'editbutton')) .
"\n";
+ print '</div>';
}
}
-
+
print $this->Html->link(_txt('op.add'),
- array('controller' => 'email_addresses',
- 'action' => 'add',
- 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
- 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id'])),
- array('class' => 'addbutton'));
+ array('controller' =>
'email_addresses',
+ 'action' => 'add',
+ 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' => 'addbutton'));
}
else
{
if(isset($org_identities[0]['EmailAddress']))
foreach($org_identities[0]['EmailAddress'] as $ea)
- print Sanitize::html($ea['mail']) . " (" .
_txt('en.contact', null, $ea['type']) . ")<br />\n";
+ {
+ print '<div>';
+ print Sanitize::html($ea['mail']) . " (" .
_txt('en.contact', null, $ea['type']) . ")<br />\n";
+ print '</div>';
+ }
+
}
?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td>
- <?php print _txt('fd.telephone_number.number'); ?>
- </td>
- <td>
+ <br>
+ </div>
+
+ <div id="tabs-phone" class="additionalinfo">
<?php
if($e)
{
@@ -296,43 +450,50 @@
{
foreach($org_identities[0]['TelephoneNumber'] as $t)
{
- // XXX we already checked for $permissions['edit'], but not
['delete']... should we?
- print '<a class="deletebutton" title="' . _txt('op.delete')
.'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($t['number'])) . '\', \'' .
$this->Html->url(array('controller' => 'telephone_numbers', 'action' =>
'delete', $t['id'], 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']))) . '\')";>' . _txt('op.delete') .'</a>' . "\n";
- print $this->Html->link(_txt('op.edit'),
- array('controller' => 'telephone_numbers',
- 'action' => 'edit',
- $t['id'],
- 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
- array('class' => 'editbutton')) . "\n";
- print $this->Html->link($t['number'], array('controller' =>
'telephone_numbers',
+ print '<div>';
+ print '<div>';
+ print $this->Html->link($t['number'], array('controller'
=> 'telephone_numbers',
'action' => 'edit',
$t['id'],
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
- print " (" . _txt('en.contact', null, $t['type']) . ")<br
/>\n";
+ print " (" . _txt('en.contact', null, $t['type']) .
")<br />\n";
+ print '</div>';
+
+ // XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($t['number'])) . '\', \'' .
$this->Html->url(array('controller' => 'telephone_numbers', 'action' =>
'delete', $t['id'], 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']))) . '\')";>' . _txt('op.delete') .'</a>' . "\n";
+
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' =>
'telephone_numbers',
+ 'action' => 'edit',
+ $t['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' => 'editbutton')) .
"\n";
+ print '</div>';
}
}
-
- print $this->Html->link(_txt('op.add'),
- array('controller' => 'telephone_numbers',
- 'action' => 'add',
- 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
- 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id'])),
- array('class' => 'addbutton'));
+
+ print $this->Html->link(_txt('op.add'),
+ array('controller' =>
'telephone_numbers',
+ 'action' => 'add',
+ 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
+ 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
+ array('class' => 'addbutton'));
}
else
{
if(isset($org_identities[0]['TelephoneNumber']))
foreach($org_identities[0]['TelephoneNumber'] as $t)
- print Sanitize::html($t['number']) . " (" .
_txt('en.contact', null, $t['type']) . ")<br />\n";
+ {
+ print '<div>';
+ print Sanitize::html($t['number']) . " (" .
_txt('en.contact', null, $t['type']) . ")<br />\n";
+ print '</div>';
+ }
}
?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td>
- <?php print _txt('fd.address'); ?>
- </td>
- <td>
+ <br>
+ </div>
+
+ <div id="tabs-address" class="additionalinfo">
<?php
if($e)
{
@@ -340,132 +501,49 @@
{
foreach($org_identities[0]['Address'] as $addr)
{
- // XXX we already checked for $permissions['edit'], but not
['delete']... should we?
- print '<a class="deletebutton" title="' . _txt('op.delete')
.'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($addr['line1'])) . '\', \'' .
$this->Html->url(array('controller' => 'addresses', 'action' => 'delete',
$addr['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') .'</a>' . "\n";
- print $this->Html->link(_txt('op.edit'),
- array('controller' => 'addresses',
- 'action' => 'edit',
- $addr['id'],
- 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
- array('class' => 'editbutton')) . "\n";
- print $this->Html->link($addr['line1'], array('controller'
=> 'addresses',
- 'action' => 'edit',
- $addr['id'],
- 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
- print " (" . _txt('en.contact', null, $addr['type']) . ")<br
/>\n";
+ print '<div>';
+ print '<div>';
+ print $this->Html->link($addr['line1'],
array('controller' => 'addresses',
+ 'action'
=> 'edit',
+
$addr['id'],
+ 'co'
=> ($pool_org_identities ? false : $cur_co['Co']['id'])));
+ print " (" . _txt('en.contact', null,
$addr['type']) . ")<br />\n";
+ print '</div>';
+
+ // XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($addr['line1'])) . '\', \'' .
$this->Html->url(array('controller' => 'addresses', 'action' => 'delete',
$addr['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') .'</a>' . "\n";
+
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' => 'addresses',
+ 'action' => 'edit',
+ $addr['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' => 'editbutton')) .
"\n";
+ print '</div>';
}
}
-
+
print $this->Html->link(_txt('op.add'),
- array('controller' => 'addresses', 'action' =>
'add', 'orgidentityid' => $org_identities[0]['OrgIdentity']['id'], 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
- array('class' => 'addbutton'));
+ array('controller' => 'addresses',
'action' => 'add',
+ 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' => 'addbutton'));
}
else
{
if(isset($org_identities[0]['Address']))
+ {
foreach($org_identities[0]['Address'] as $addr)
- print Sanitize::html($addr['line1']) . " (" .
_txt('en.contact', null, $addr['type']) . ")<br />\n";
- }
- ?>
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td>
- <i><font class="required"><?php print _txt('fd.req');
?></font></i><br />
- </td>
- <td>
- <?php
- if($e)
- print $this->Form->submit($submit_label);
- ?>
- </td>
- </tr>
- </tbody>
-</table>
-<?php if(0): ?>
- <?php foreach ($cmp_ef_attribute_order as $f): ?>
- <?php
- // Find this attribute in the CMP enrollment flow configuration
- $a = find_ef_attribute($cmp_ef_attributes['CmpEnrollmentAttribute'],
$f['attr'], $f['type']);
-
- // Skip this one if not found or not permitted
- if(!$a || $a['required'] == RequiredEnum::NotPermitted)
- continue;
-
- // Convert table:column into usable bits
- if(preg_match('/:/', $f['attr']))
- {
- $attr = preg_split('/:/', $f['attr'], 2);
- $m = Inflector::classify($attr[0]); // names -> Name
-
- // Associated models must be referenced as Model.0.field for HABTM,
- // or Model.field for HasOne
- if(isset($f['assoc']) && $f['assoc'] != 'hasone')
- $d = '.0.';
- else
- $d = '.';
-
- $fattr = $m.$d.$attr[1];
-
- // Create hidden fields for associated models
-
- if(!isset($emitted[$m]))
- {
- print $this->Form->hidden($m.$d.'id');
- print $this->Form->hidden($m.$d.'type', array('default' =>
$f['type']));
-
- $emitted[$m] = true;
- }
- }
- else
- {
- // Set up matching array
- $attr[0] = 'org_identities';
- $attr[1] = $f['attr'];
- $m = Inflector::classify($attr[0]); // names -> Name
- $fattr = $attr[1];
- }
- ?>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td>
- <?php
- print $f['label'];
-
- if($a['required'] == RequiredEnum::Required)
- print '<font class="required">*</font>';
-
- if($e && isset($f['desc']))
- print " " . $f['desc'];
- ?>
- </td>
- <td>
- <?php
- if(isset($f['select']))
- {
- // Render a select element
- $attrs['value'] = (isset($org_identities[0][$m][ $attr[1] ])
- ? $org_identities[0][$m][ $attr[1] ]
- : $f['select']['default']);
- $attrs['empty'] = false;
-
- print ($e ? $this->Form->select($fattr,
- $f['select']['options'],
- $attrs)
- : Sanitize::html($org_identities[0][$m][ $attr[1] ]));
-
- if($this->Form->isFieldError($fattr)) {
- print $this->Form->error($fattr);
+ {
+ print '<div>';
+ print Sanitize::html($addr['line1']) . " (" .
_txt('en.contact', null, $addr['type']) . ")\n";
+ print '</div>';
+ }
}
}
- else
- {
- // Use default rendering
-
- print ($e ? $this->Form->input($fattr) :
Sanitize::html($org_identities[0][$m][ $attr[1] ]));
- }
?>
- </td>
- </tr>
- <?php endforeach; ?>
-<?php endif; ?>
+ <br>
+ </div>
+ <?php endif; //will not show up if adding ?>
+ </div>
+</div>
Modified: registry/trunk/app/View/Standard/view.ctp
===================================================================
--- registry/trunk/app/View/Standard/view.ctp 2012-08-27 00:26:22 UTC (rev
348)
+++ registry/trunk/app/View/Standard/view.ctp 2012-08-27 16:22:53 UTC (rev
349)
@@ -60,8 +60,11 @@
$params = array('title' => $h);
print $this->element("pageTitle", $params);
- include(APP . "View/" . $model . "/fields.inc");
+ print '<div style="float:left">';
+ include(APP . "View/" . $model . "/fields.inc");
+ print '</div>';
+ print '<div style = "float:right">';
// If user has edit permission, offer an edit button
if($permissions['edit'])
@@ -76,3 +79,4 @@
array('class' => 'editbutton'));
}
?>
+</div>
Modified: registry/trunk/app/webroot/css/comanage.css
===================================================================
--- registry/trunk/app/webroot/css/comanage.css 2012-08-27 00:26:22 UTC (rev
348)
+++ registry/trunk/app/webroot/css/comanage.css 2012-08-27 16:22:53 UTC (rev
349)
@@ -212,7 +212,8 @@
float:right;
}
- #OrgIdentityEditForm .addbutton{
+ #OrgIdentityEditForm .addbutton,
+ #view_org_identity .addbutton{
float:right;
}
- [comanage-dev] r349 - in registry/trunk/app: Lib View/CoPeople View/OrgIdentities View/Standard webroot/css, svnlog, 08/27/2012
Archive powered by MHonArc 2.6.16.