comanage-dev - [comanage-dev] r497 - in registry/trunk/app/View: CoPetitions Standard
Subject: COmanage Developers List
List archive
- From:
- To:
- Subject: [comanage-dev] r497 - in registry/trunk/app/View: CoPetitions Standard
- Date: Mon, 15 Apr 2013 20:45:53 -0400
- Authentication-results: sfpop-ironport05.merit.edu; dkim=neutral (message not signed) header.i=none
Author: marie
Date: 2013-04-15 20:45:53 -0400 (Mon, 15 Apr 2013)
New Revision: 497
Modified:
registry/trunk/app/View/CoPetitions/fields.inc
registry/trunk/app/View/CoPetitions/petition-attributes.inc
registry/trunk/app/View/Standard/view.ctp
Log:
CO392 convert petition view into accordion style
Modified: registry/trunk/app/View/CoPetitions/fields.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/fields.inc 2013-04-14 15:59:48
UTC (rev 496)
+++ registry/trunk/app/View/CoPetitions/fields.inc 2013-04-16 00:45:53
UTC (rev 497)
@@ -39,6 +39,13 @@
}
});
});
+
+$(function() {
+ $( "#accordion" ).accordion({
+ heightStyle: "fill"
+ });
+});
+
</script>
<?php
// Determine if fields are editable
@@ -58,11 +65,6 @@
array('controller' => 'co_people', 'action' => 'index', 'co' =>
$cur_co['Co']['id']),
array('class' => 'cancelbutton')
);
-
- echo '
- <br />
- <br />
- ';
if(isset($cur_co))
print $this->Form->hidden('co_id', array('default' =>
$cur_co['Co']['id'])) . "\n";
@@ -76,87 +78,96 @@
// lot of logic to embed in a view file, and plausibly this code should be
// refactored at some point.
?>
+<div style="min-height: 350px;">
+ <div id="accordion">
-<?php if($this->action != 'add'): ?>
-<h2 class="ui-state-default"><?php print _txt('ct.co_petitions.1'); ?></h2>
+ <?php if($this->action != 'add'): ?>
+ <h2 class="ui-state-default"><?php print _txt('ct.co_petitions.1');
?></h2>
+ <div>
+ <table id="<?php print $this->action; ?>_co_petition"
class="ui-widget">
+ <tbody>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th><?php print _txt('fd.status'); ?></th>
+ <td>
+ <?php
+ print _txt('en.status', null,
$co_petitions[0]['CoPetition']['status']);
+
+ if($co_petitions[0]['CoPetition']['status'] ==
StatusEnum::PendingApproval) {
+ if($permissions['approve']) {
+ print $this->Html->link(
+ _txt('op.approve'),
+ array('controller' => 'co_petitions',
+ 'action' => 'approve',
+ $co_petitions[0]['CoPetition']['id'],
+ 'co' =>
$co_petitions[0]['CoPetition']['co_id'],
+ 'coef' =>
$co_petitions[0]['CoPetition']['co_enrollment_flow_id']),
+ array('class' => 'checkbutton')
+ );
+ }
+
+ if($permissions['deny']) {
+ print $this->Html->link(
+ _txt('op.deny'),
+ array('controller' => 'co_petitions',
+ 'action' => 'deny',
+ $co_petitions[0]['CoPetition']['id'],
+ 'co' =>
$co_petitions[0]['CoPetition']['co_id'],
+ 'coef' =>
$co_petitions[0]['CoPetition']['co_enrollment_flow_id']),
+ array('class' => 'cancelbutton')
+ );
+ }
+ }
+ ?>
+ </td>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th><?php print _txt('fd.petitioner'); ?></th>
+ <td>
+ <?php
+ if(isset($co_petitions[0]['PetitionerCoPerson']['Name'])) {
generateCn($co_petitions[0]['PetitionerCoPerson']['Name']);
+ }
+ ?>
+ </td>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th><?php print _txt('fd.sponsor'); ?></th>
+ <td>
+ <?php
+ if(isset($co_petitions[0]['SponsorCoPerson']['Name'])) {
generateCn($co_petitions[0]['SponsorCoPerson']['Name']);
+ }
+ ?>
+ </td>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th><?php print _txt('fd.approver'); ?></th>
+ <td>
+ <?php
+ if(isset($co_petitions[0]['ApproverCoPerson']['Name'])) {
generateCn($co_petitions[0]['ApproverCoPerson']['Name']);
+ }
+ ?>
+ </td>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th><?php print _txt('fd.created'); ?></th>
+ <td><?php print
$this->Time->nice($co_petitions[0]['CoPetition']['created']); ?></td>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th><?php print _txt('fd.modified'); ?></th>
+ <td><?php print
$this->Time->nice($co_petitions[0]['CoPetition']['modified']); ?></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
-<table id="<?php print $this->action; ?>_co_petition" class="ui-widget">
- <tbody>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <th><?php print _txt('fd.status'); ?></th>
- <td>
- <?php
- print _txt('en.status', null,
$co_petitions[0]['CoPetition']['status']);
-
- if($co_petitions[0]['CoPetition']['status'] ==
StatusEnum::PendingApproval) {
- if($permissions['approve']) {
- print $this->Html->link(
- _txt('op.approve'),
- array('controller' => 'co_petitions',
- 'action' => 'approve',
- $co_petitions[0]['CoPetition']['id'],
- 'co' => $co_petitions[0]['CoPetition']['co_id'],
- 'coef' =>
$co_petitions[0]['CoPetition']['co_enrollment_flow_id']),
- array('class' => 'checkbutton')
- );
- }
-
- if($permissions['deny']) {
- print $this->Html->link(
- _txt('op.deny'),
- array('controller' => 'co_petitions',
- 'action' => 'deny',
- $co_petitions[0]['CoPetition']['id'],
- 'co' => $co_petitions[0]['CoPetition']['co_id'],
- 'coef' =>
$co_petitions[0]['CoPetition']['co_enrollment_flow_id']),
- array('class' => 'cancelbutton')
- );
- }
- }
- ?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <th><?php print _txt('fd.petitioner'); ?></th>
- <td>
- <?php
- if(isset($co_petitions[0]['PetitionerCoPerson']['Name'])) {
- print generateCn($co_petitions[0]['PetitionerCoPerson']['Name']);
- }
- ?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <th><?php print _txt('fd.sponsor'); ?></th>
- <td>
- <?php
- if(isset($co_petitions[0]['SponsorCoPerson']['Name'])) {
- print generateCn($co_petitions[0]['SponsorCoPerson']['Name']);
- }
- ?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <th><?php print _txt('fd.approver'); ?></th>
- <td>
- <?php
- if(isset($co_petitions[0]['ApproverCoPerson']['Name'])) {
- print generateCn($co_petitions[0]['ApproverCoPerson']['Name']);
- }
- ?>
- </td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <th><?php print _txt('fd.created'); ?></th>
- <td><?php print
$this->Time->nice($co_petitions[0]['CoPetition']['created']); ?></td>
- </tr>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <th><?php print _txt('fd.modified'); ?></th>
- <td><?php print
$this->Time->nice($co_petitions[0]['CoPetition']['modified']); ?></td>
- </tr>
- </tbody>
-</table>
-<?php endif; // action == add ?>
+ <?php endif; // action == add ?>
-<?php
- include('petition-attributes.inc');
+ <?php
+ include('petition-attributes.inc');
+ ?>
+ </div>
+</div>
+
+
Modified: registry/trunk/app/View/CoPetitions/petition-attributes.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-04-14
15:59:48 UTC (rev 496)
+++ registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-04-16
00:45:53 UTC (rev 497)
@@ -27,169 +27,167 @@
$l = 1;
?>
-
-<div>
- <div style="float:left">
<h2 class="ui-state-default"><?php print _txt('fd.attrs.pet'); ?></h2>
-
-<table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
- <tbody>
- <?php foreach ($co_enrollment_attributes as $ea): ?>
- <?php $fieldName = $ea['model'] . '.' . $ea['field']; ?>
- <?php if($ea['hidden']): ?>
- <?php print $this->Form->hidden($fieldName, array('default' =>
$ea['default'])) . "\n"; ?>
- <?php else: ?>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td>
- <?php
- // Emit the label for this field
-
- print "<b>" . $ea['label'] . "</b>";
-
- if($ea['required']) {
- print "<font class=\"required\">*</font>\n";
- }
-
- if(isset($ea['description'])
- && $ea['description'] != "") {
- print "</br>\n<font class=\"desc\">" . $ea['description'] .
"</font>\n";
- }
- ?>
- </td>
- <td>
- <?php
- // Emit the field itself, according to the type of field
-
- // The type of validation rule can influence what we output.
- $ruleType = 'default';
-
- if(isset($ea['validate']['rule'][0]))
- $ruleType = $ea['validate']['rule'][0];
+<div>
+ <table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
+ <tbody>
+ <?php foreach ($co_enrollment_attributes as $ea): ?>
+ <?php $fieldName = $ea['model'] . '.' . $ea['field']; ?>
+ <?php if($ea['hidden']): ?>
+ <?php print $this->Form->hidden($fieldName, array('default' =>
$ea['default'])) . "\n"; ?>
+ <?php else: ?>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <td>
+ <?php
+ // Emit the label for this field
- // XXX need to retrieve current values for edit and view
-
- if($e) {
- switch($ruleType) {
- case 'inList':
- // This is a select
- $attrs = array();
-// $attrs['value'] =
(isset($co_person_roles[0]['CoPersonRole']['affiliation'])
-// ?
$co_person_roles[0]['CoPersonRole']['affiliation']
-// : "M");
- $attrs['empty'] = !$ea['required'];
-
- print $this->Form->select($fieldName,
- $ea['select'],
- $attrs);
-
- if($this->Form->isFieldError($fieldName)) {
- print $this->Form->error($fieldName);
- }
- break;
- case 'validateTimestamp':
- // Handle dates specially to generate the popup calendar
- $c = 'datepicker';
-
- if($ea['field'] == 'valid_from')
- $c = 'datepicker-f';
- elseif($ea['field'] == 'valid_until')
- $c = 'datepicker-c';
-
- print $this->Form->text($fieldName, array('class' => $c));
-
- if($this->Form->isFieldError($fieldName)) {
- print $this->Form->error($fieldName);
- }
- break;
- default:
- // Use default field
-
- $args = array();
- $args['required'] = $ea['required'];
-
- // Use a provided default value, if one specified
- if(isset($ea['default'])) {
- $args['default'] = $ea['default'];
- }
-
- if($permissions['match']
- && ($fieldName == 'EnrolleeCoPerson.Name.given'
- || $fieldName == 'EnrolleeCoPerson.Name.family')) {
- # XXX Temp hack to enable real-time query. This should
- # instead be enabled for fields with an appropriate flag.
- $args['class'] = 'matchable';
- }
-
- print $this->Form->input($fieldName, $args);
- break;
+ print "<b>" . $ea['label'] . "</b>";
+
+ if($ea['required']) {
+ print "<font class=\"required\">*</font>\n";
}
- print "\n";
- } else {
- // Just emit the current value for this attribute, if set
+ if(isset($ea['description'])
+ && $ea['description'] != "") {
+ print "</br>\n<font class=\"desc\">" . $ea['description'] .
"</font>\n";
+ }
+ ?>
+ </td>
+ <td>
+ <?php
+ // Emit the field itself, according to the type of field
- if(isset($co_petition_attribute_values[ $ea['id'] ][
$ea['field'] ])) {
+ // The type of validation rule can influence what we output.
+ $ruleType = 'default';
+
+ if(isset($ea['validate']['rule'][0]))
+ $ruleType = $ea['validate']['rule'][0];
+
+ // XXX need to retrieve current values for edit and view
+
+ if($e) {
switch($ruleType) {
case 'inList':
- print $ea['select'][ $co_petition_attribute_values[
$ea['id'] ][ $ea['field'] ]];
+ // This is a select
+ $attrs = array();
+ // $attrs['value'] =
(isset($co_person_roles[0]['CoPersonRole']['affiliation'])
+ // ?
$co_person_roles[0]['CoPersonRole']['affiliation']
+ // : "M");
+ $attrs['empty'] = !$ea['required'];
+
+ print $this->Form->select($fieldName,
+ $ea['select'],
+ $attrs);
+
+ if($this->Form->isFieldError($fieldName)) {
+ print $this->Form->error($fieldName);
+ }
break;
case 'validateTimestamp':
- print $this->Time->nice($co_petition_attribute_values[
$ea['id'] ][ $ea['field'] ]);
+ // Handle dates specially to generate the popup calendar
+ $c = 'datepicker';
+
+ if($ea['field'] == 'valid_from')
+ $c = 'datepicker-f';
+ elseif($ea['field'] == 'valid_until')
+ $c = 'datepicker-c';
+
+ print $this->Form->text($fieldName, array('class' => $c));
+
+ if($this->Form->isFieldError($fieldName)) {
+ print $this->Form->error($fieldName);
+ }
break;
default:
- print $co_petition_attribute_values[ $ea['id'] ][
$ea['field'] ];
+ // Use default field
+
+ $args = array();
+ $args['required'] = $ea['required'];
+
+ // Use a provided default value, if one specified
+ if(isset($ea['default'])) {
+ $args['default'] = $ea['default'];
+ }
+
+ if($permissions['match']
+ && ($fieldName == 'EnrolleeCoPerson.Name.given'
+ || $fieldName == 'EnrolleeCoPerson.Name.family')) {
+ # XXX Temp hack to enable real-time query. This should
+ # instead be enabled for fields with an appropriate flag.
+ $args['class'] = 'matchable';
+ }
+
+ print $this->Form->input($fieldName, $args);
break;
}
+
+ print "\n";
+ } else {
+ // Just emit the current value for this attribute, if set
+
+ if(isset($co_petition_attribute_values[ $ea['id'] ][
$ea['field'] ])) {
+ switch($ruleType) {
+ case 'inList':
+ print $ea['select'][ $co_petition_attribute_values[
$ea['id'] ][ $ea['field'] ]];
+ break;
+ case 'validateTimestamp':
+ print $this->Time->nice($co_petition_attribute_values[
$ea['id'] ][ $ea['field'] ]);
+ break;
+ default:
+ print $co_petition_attribute_values[ $ea['id'] ][
$ea['field'] ];
+ break;
+ }
+ }
}
- }
- ?>
- </td>
- </tr>
- <?php endif; ?>
- <?php endforeach; ?>
- <tr>
- <td>
- <i><font class="required"><?php echo _txt('fd.req');
?></font></i><br />
- </td>
- <td>
- <?php
- if($e)
- print $this->Form->submit($submit_label);
- ?>
- </td>
- </tr>
- </tbody>
-</table>
+ ?>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ <tr>
+ <td>
+ <i><font class="required"><?php echo _txt('fd.req');
?></font></i><br />
+ </td>
+ <td>
+ <?php
+ if($e)
+ print $this->Form->submit($submit_label);
+ ?>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
<?php if($this->action != 'add'): ?>
<h2 class="ui-state-default"><?php print _txt('fd.history.pt'); ?></h2>
-
-<table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
- <tbody>
- <tr>
- <th class="ui-state-default"><?php print _txt('fd.action'); ?></th>
- <th class="ui-state-default"><?php print _txt('fd.actor'); ?></th>
- <th class="ui-state-default"><?php print _txt('fd.comment'); ?></th>
- <th class="ui-state-default"><?php print _txt('fd.timestamp'); ?></th>
- </tr>
-
- <?php foreach ($co_petitions[0]['CoPetitionHistoryRecord'] as $hr): ?>
- <tr class="line<?php print ($l % 2); $l++; ?>">
- <td><?php print $hr['action']; ?></td>
- <td><?php print generateCn($hr['ActorCoPerson']['Name']); ?></td>
- <td><?php print $hr['comment']; ?></td>
- <td><?php print $this->Time->nice($hr['created']); ?></td>
- </tr>
- <?php endforeach; // CoPetitionHistoryRecord ?>
- </tbody>
-</table>
+<div>
+ <table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
+ <tbody>
+ <tr>
+ <th class="ui-state-default"><?php print _txt('fd.action'); ?></th>
+ <th class="ui-state-default"><?php print _txt('fd.actor'); ?></th>
+ <th class="ui-state-default"><?php print _txt('fd.comment'); ?></th>
+ <th class="ui-state-default"><?php print _txt('fd.timestamp');
?></th>
+ </tr>
+
+ <?php foreach ($co_petitions[0]['CoPetitionHistoryRecord'] as $hr): ?>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <td><?php print $hr['action']; ?></td>
+ <td><?php print generateCn($hr['ActorCoPerson']['Name']); ?></td>
+ <td><?php print $hr['comment']; ?></td>
+ <td><?php print $this->Time->nice($hr['created']); ?></td>
+ </tr>
+ <?php endforeach; // CoPetitionHistoryRecord ?>
+ </tbody>
+ </table>
+</div>
<?php endif; // action == add ?>
- </div>
-</div>
-
+<!-- begin
<div>
<div style="float:right;width:35%" id="results">
</div>
</div>
+//-->
Modified: registry/trunk/app/View/Standard/view.ctp
===================================================================
--- registry/trunk/app/View/Standard/view.ctp 2013-04-14 15:59:48 UTC (rev
496)
+++ registry/trunk/app/View/Standard/view.ctp 2013-04-16 00:45:53 UTC (rev
497)
@@ -33,7 +33,7 @@
$params = array('title' => $title_for_layout);
print $this->element("pageTitle", $params);
- print '<div style="float:left">';
+ print '<div style="float:left;width:100%;">';
if(!empty($this->plugin)) {
include(APP . "Plugin/" . $this->plugin . "/View/" . $model .
"/fields.inc");
} else {
- [comanage-dev] r497 - in registry/trunk/app/View: CoPetitions Standard, svnlog, 04/15/2013
Archive powered by MHonArc 2.6.16.