Author: jablko
Date: Tue Sep 15 12:56:23 2009
New Revision: 3318

Log:
Make actor and repository actions consistent, like revision 2742, fixes issue 
917

Modified:
   trunk/apps/qubit/modules/actor/templates/editIsaarSuccess.php
   trunk/apps/qubit/modules/actor/templates/showIsaarSuccess.php
   trunk/apps/qubit/modules/repository/templates/editIsdiahSuccess.php
   trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php

Modified: trunk/apps/qubit/modules/actor/templates/editIsaarSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/actor/templates/editIsaarSuccess.php       Tue Sep 
15 12:48:57 2009        (r3317)
+++ trunk/apps/qubit/modules/actor/templates/editIsaarSuccess.php       Tue Sep 
15 12:56:23 2009        (r3318)
@@ -436,38 +436,14 @@
 
   </fieldset>
 
-  <?php if ($sf_context->getActionName() == 'create'): ?>
-  <!--set initial form focus -->
-  <?php echo javascript_tag(<<<EOF
-  $('[name=authorized_form_of_name]').focus();
-EOF
-  ) ?>
-  <?php endif; ?>
-
-
-<!-- include empty div at bottom of form to bump the fixed button-block and 
allow user to scroll past it -->
-<div id="button-block-bump"></div>
-
-<div id="button-block">
-  <div class="menu-action">
-    <?php if ($actor->getId()): ?>
-      &nbsp;<?php echo link_to(__('delete'), array('module' => 'actor', 
'action' => 'delete', 'id' => $actor->getId()), array('post' => true, 'confirm' 
=> __('are you sure?'))) ?>
-      &nbsp;<?php echo link_to(__('cancel'), array('module' => 'actor', 
'action' => 'show', 'id' => $actor->getId())) ?>
-    <?php else: ?>
-      &nbsp;<?php echo link_to(__('cancel'), array('module' => 'actor', 
'action' => 'list')) ?>
-    <?php endif; ?>
-    <?php if ($actor->getId()): ?>
-      <?php echo submit_tag(__('save')) ?>
+  <ul class="actions">
+    <?php if (isset($sf_request->id)): ?>
+      <li><?php echo link_to(__('Cancel'), array('module' => 'actor', 'action' 
=> 'show', 'id' => $actor->id)) ?></li>
+      <li><?php echo submit_tag(__('Save')) ?></li>
     <?php else: ?>
-      <?php echo submit_tag(__('create')) ?>
+      <li><?php echo link_to(__('Cancel'), array('module' => 'actor', 'action' 
=> 'list')) ?></li>
+      <li><?php echo submit_tag(__('Create')) ?></li>
     <?php endif; ?>
-  </div>
-</form>
-
-<div class="menu-extra">
-  <?php echo link_to(__('add new'), array('module' => 'actor', 'action' => 
'create')) ?>
-  <?php echo link_to(__('list all'), array('module' => 'actor', 'action' => 
'list')) ?>
-</div>
-
-</div>
+  </ul>
 
+</form>

Modified: trunk/apps/qubit/modules/actor/templates/showIsaarSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/actor/templates/showIsaarSuccess.php       Tue Sep 
15 12:48:57 2009        (r3317)
+++ trunk/apps/qubit/modules/actor/templates/showIsaarSuccess.php       Tue Sep 
15 12:56:23 2009        (r3318)
@@ -212,13 +212,12 @@
 </tbody>
 </table>
 
-<?php if (SecurityCheck::HasPermission($sf_user, array('module' => 'actor', 
'action' => 'update'))): ?>
-<div class="menu-action">
-<?php echo link_to(__('edit %1%', array('%1%' => 
sfConfig::get('app_ui_label_actor'))), array('module' => 'actor', 'action' => 
'edit', 'id' => $actor->getId())) ?>
-</div>
-
-<div class="menu-extra">
-  <?php echo link_to(__('add new'), array('module' => 'actor', 'action' => 
'create')) ?>
-  <?php echo link_to(__('list all'), array('module' => 'actor', 'action' => 
'list')) ?>
-</div>
-<?php endif; ?>
+<ul class="actions">
+  <?php if (SecurityPriviliges::editCredentials($sf_user, 'actor')): ?>
+    <li><?php echo link_to(__('Delete'), array('module' => 'actor', 'action' 
=> 'delete', 'id' => $actor->id), array('title' => __('Delete authority 
record'))) ?></li>
+  <?php endif; ?>
+  <?php if (SecurityPriviliges::editCredentials($sf_user, 'actor')): ?>
+    <li><?php echo link_to(__('Edit'), array('module' => 'actor', 'action' => 
'edit', 'id' => $actor->id), array('title' => __('Edit authority record'))) 
?></li>
+  <?php endif; ?>
+  <li><?php echo link_to(__('List'), array('module' => 'actor', 'action' => 
'list')) ?></li>
+</ul>

Modified: trunk/apps/qubit/modules/repository/templates/editIsdiahSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/repository/templates/editIsdiahSuccess.php Tue Sep 
15 12:48:57 2009        (r3317)
+++ trunk/apps/qubit/modules/repository/templates/editIsdiahSuccess.php Tue Sep 
15 12:56:23 2009        (r3318)
@@ -407,38 +407,14 @@
 
   </fieldset>
 
-  <?php if ($sf_context->getActionName() == 'create'): ?>
-  <!--set initial form focus -->
-  <?php echo javascript_tag(<<<EOF
-  $('[name=authorized_form_of_name]').focus();
-EOF
-  ) ?>
-  <?php endif; ?>
-
-
-<!-- include empty div at bottom of form to bump the fixed button-block and 
allow user to scroll past it -->
-<div id="button-block-bump"></div>
-
-<div id="button-block">
-
-  <div class="menu-action">
-    <?php if ($repository->getId()): ?>
-      &nbsp;<?php echo link_to(__('delete'), array('module' => 'repository', 
'action' => 'delete', 'id' => $repository->getId()), array('post' => true, 
'confirm' => __('are you sure?'))) ?>
-      &nbsp;<?php echo link_to(__('cancel'), array('module' => 'repository', 
'action' => 'show', 'id' => $repository->getId())) ?>
+  <ul class="actions">
+    <?php if (isset($sf_request->id)): ?>
+      <li><?php echo link_to(__('Cancel'), array('module' => 'repository', 
'action' => 'show', 'id' => $repository->id)) ?></li>
+      <li><?php echo submit_tag(__('Save')) ?></li>
     <?php else: ?>
-      &nbsp;<?php echo link_to(__('cancel'), array('module' => 'repository', 
'action' => 'list')) ?>
+      <li><?php echo link_to(__('Cancel'), array('module' => 'repository', 
'action' => 'list')) ?></li>
+      <li><?php echo submit_tag(__('Create')) ?></li>
     <?php endif; ?>
-    <?php if ($repository->getId()): ?>
-      <?php echo submit_tag(__('save')) ?>
-    <?php else: ?>
-      <?php echo submit_tag(__('create')) ?>
-    <?php endif; ?>
-  </div>
-</form>
+  </ul>
 
-<div class="menu-extra">
-  <?php echo link_to(__('add new'), array('module' => 'repository', 'action' 
=> 'create')) ?>
-  <?php echo link_to(__('list all'), array('module' => 'repository', 'action' 
=> 'list')) ?>
-</div>
-
-</div>
+</form>

Modified: trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php Tue Sep 
15 12:48:57 2009        (r3317)
+++ trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php Tue Sep 
15 12:56:23 2009        (r3318)
@@ -257,13 +257,12 @@
 </tbody>
 </table>
 
-<?php if ($editCredentials): ?>
-<div class="menu-action">
-<?php echo link_to(__('edit %1%', array('%1%' => 
sfConfig::get('app_ui_label_repository'))), array('module' => 'repository', 
'action' => 'edit', 'id' => $repository->getId())) ?>
-</div>
-
-<div class="menu-extra">
-  <?php echo link_to(__('add new'), array('module' => 'repository', 'action' 
=> 'create')) ?>
-  <?php echo link_to(__('list all'), array('module' => 'repository', 'action' 
=> 'list')) ?>
-</div>
-<?php endif; ?>
+<ul class="actions">
+  <?php if (SecurityPriviliges::editCredentials($sf_user, 'repository')): ?>
+    <li><?php echo link_to(__('Delete'), array('module' => 'repository', 
'action' => 'delete', 'id' => $repository->id), array('title' => __('Delete 
repository'))) ?></li>
+  <?php endif; ?>
+  <?php if (SecurityPriviliges::editCredentials($sf_user, 'repository')): ?>
+    <li><?php echo link_to(__('Edit'), array('module' => 'repository', 
'action' => 'edit', 'id' => $repository->id), array('title' => __('Edit 
repository'))) ?></li>
+  <?php endif; ?>
+  <li><?php echo link_to(__('List'), array('module' => 'repository', 'action' 
=> 'list')) ?></li>
+</ul>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to