Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r546 - registry/trunk/app/View/CoPetitions

Subject: COmanage Developers List

List archive

[comanage-dev] r546 - registry/trunk/app/View/CoPetitions


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r546 - registry/trunk/app/View/CoPetitions
  • Date: Wed, 19 Jun 2013 17:34:50 -0400
  • Authentication-results: sfpop-ironport04.merit.edu; dkim=neutral (message not signed) header.i=none

Author: marie
Date: 2013-06-19 17:34:50 -0400 (Wed, 19 Jun 2013)
New Revision: 546

Modified:
registry/trunk/app/View/CoPetitions/fields.inc
registry/trunk/app/View/CoPetitions/petition-attributes.inc
Log:
co605 - converting copetition layout to tabs

Modified: registry/trunk/app/View/CoPetitions/fields.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/fields.inc 2013-06-19 09:38:27
UTC (rev 545)
+++ registry/trunk/app/View/CoPetitions/fields.inc 2013-06-19 21:34:50
UTC (rev 546)
@@ -41,12 +41,27 @@
});

$(function() {
- $( "#accordion" ).accordion({
+/* $( "#accordion" ).accordion({
heightStyle: "fill"
- });
+ });*/
+ // Ennumeration for tabs
+ var tabid = new Object();
+ tabid["petition"] = 0;
+ tabid["attributes"] = 1;
+ tabid["history"] = 2;
+
+ // Turn on Tabs
+ var $tabs = $( "#tabs" ).tabs();
+
+ // If returning to this page via redirect, open last used tab
+ <?php if(isset($this->request->params['named']['tab'])): ?>
+ var selectedtab = "<?php
print($this->request->params['named']['tab']); ?>";
+
+ $tabs.tabs('option', 'active', tabid[selectedtab] );
+ <?php endif; ?>
});
+</script>

-</script>
<?php
// Determine if fields are editable
$e = false;
@@ -72,90 +87,118 @@
// refactored at some point.
?>
<div style="min-height: 350px;">
- <div id="accordion">
+ <div id="tabs">
+ <ul>
+ <?php if($this->action != 'add'): ?>
+ <li>
+ <a href="#tabs-petition">
+ <?php print _txt('ct.co_petitions.1'); ?>
+ </a>
+ </li>
+ <?php endif; ?>

- <?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')
- );
- }
+ <?php if($this->action != "invite"): ?>
+ <li>
+ <a href="#tabs-attributes">
+ <?php print _txt('fd.attrs.pet'); ?>
+ </a>
+ </li>
+ <?php endif; ?>
+
+ <?php if($this->action != 'add'): ?>
+ <li>
+ <a href="#tabs-history">
+ <?php print _txt('fd.history.pt'); ?>
+ </a>
+ </li>
+ <?php endif; ?>
+
+
+ </ul>
+ <div id="tabs-petition">
+ <?php if($this->action != 'add'): ?>
+ <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($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')
- );
+ 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>
- </div>
+ ?>
+ </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>
+ </div>

- <?php endif; // action == add ?>
+ <?php endif; // action == add ?>
+ </div>
+ <div id="tabs-attributes">

<?php
include('petition-attributes.inc');

Modified: registry/trunk/app/View/CoPetitions/petition-attributes.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-06-19
09:38:27 UTC (rev 545)
+++ registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-06-19
21:34:50 UTC (rev 546)
@@ -28,7 +28,6 @@
$l = 1;
?>

-<h2 class="ui-state-default"><?php print _txt('fd.attrs.pet'); ?></h2>
<div>
<table id="<?php print $this->action; ?>_co_petition_attrs"
class="ui-widget">
<tbody>
@@ -162,30 +161,29 @@
</tbody>
</table>
</div>
-
-<?php if($this->action != 'add'): ?>
-<h2 class="ui-state-default"><?php print _txt('fd.history.pt'); ?></h2>
-<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 if($this->action != 'add'): ?>
+ <div id="tabs-history">
+ <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 ?>

<!-- begin



  • [comanage-dev] r546 - registry/trunk/app/View/CoPetitions, svnlog, 06/19/2013

Archive powered by MHonArc 2.6.16.

Top of Page