Author: david
Date: Thu Sep  3 14:50:59 2009
New Revision: 3164

Log:
Add additional warnings when deleting term (show term page).

Modified:
   trunk/apps/qubit/modules/term/actions/showAction.class.php
   trunk/apps/qubit/modules/term/templates/showSuccess.php

Modified: trunk/apps/qubit/modules/term/actions/showAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/showAction.class.php  Thu Sep  3 
14:50:47 2009        (r3163)
+++ trunk/apps/qubit/modules/term/actions/showAction.class.php  Thu Sep  3 
14:50:59 2009        (r3164)
@@ -35,6 +35,9 @@
     $this->useFors = QubitRelation::getRelationsBySubjectId($this->term->id, 
array('typeId' => QubitTerm::TERM_RELATION_EQUIVALENCE_ID));
     $this->associateRelations = 
QubitRelation::getRelationsBySubjectOrObjectId($this->term->id, array('typeId' 
=> QubitTerm::TERM_RELATION_ASSOCIATIVE_ID));
 
+    // Count related object for delete confirmation
+    $this->relatedObjectCount = $this->term->getRelatedObjectCount();
+    $this->relatedEventCount = $this->term->getRelatedEventCount();
     $this->descendantCount = count($this->term->getDescendants());
 
     //determine if user has edit priviliges

Modified: trunk/apps/qubit/modules/term/templates/showSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/showSuccess.php     Thu Sep  3 
14:50:47 2009        (r3163)
+++ trunk/apps/qubit/modules/term/templates/showSuccess.php     Thu Sep  3 
14:50:59 2009        (r3164)
@@ -145,7 +145,21 @@
 </tbody>
 </table>
 
-<?php $deleteConfirm = format_number_choice('[0]Are you sure?|[1,+Inf]Deleting 
this term will also delete %1% descendants.  Are you sure you want to 
proceed?', array('%1%' => $descendantCount), $descendantCount) ?>
+<?php
+  $deleteConfirm = '';
+  if (0 < $descendantCount) {
+    $deleteConfirm .= __('Deleting this term will also delete %1% 
descendants.\n', array('%1%' => $descendantCount));
+  }
+  if($relatedEventCount > 0)
+  {
+    $deleteConfirm .= __('Deleting this term will delete %1% related 
events.\n', array('%1%' => $relatedEventCount));
+  }
+  if ($relatedObjectCount > 0)
+  {
+    $deleteConfirm .= __('Deleting this term will remove it from %1% 
descriptions.\n', array('%1%' => $relatedObjectCount));
+  }
+  $deleteConfirm .= __('Are you sure?');
+?>
 
 <ul class="actions">
   <?php if (SecurityPriviliges::editCredentials($sf_user, 'term')): ?>

--~--~---------~--~----~------------~-------~--~----~
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