Author: david
Date: 2008-11-28 15:09:21 -0800 (Fri, 28 Nov 2008)
New Revision: 1639

Modified:
   
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php
   
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
   trunk/qubit/apps/qubit/modules/physicalobject/templates/_edit.php
Log:
Convert to checkboxes for deleting related objects on information object edit 
ISAD form (See issue #531).

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php 
    2008-11-28 18:06:26 UTC (rev 1638)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php 
    2008-11-28 23:09:21 UTC (rev 1639)
@@ -65,6 +65,13 @@
     $this->updatePhysicalObjects($this->informationObject);
     //$this->updateRecursiveRelations($informationObject);
 
+    // delete related objects marked for deletion
+    $this->deleteNotes($request);
+    $this->deleteActorEvents($request);
+    $this->deleteProperties($request);
+    $this->deleteObjectTermRelations($request);
+    $this->deleteRelations($request);
+
     if (sfContext::getInstance()->getActionName() == 'update')
     {
       // update the search index and return user to the default edit template
@@ -274,6 +281,25 @@
     }
   }
 
+  /**
+   * Delete related notes marked for deletion.
+   *
+   * @param sfRequest request object
+   */
+  public function deleteNotes($request)
+  {
+    if (is_array($deleteNotes = $request->getParameter('delete_notes')) && 
count($deleteNotes))
+    {
+      foreach ($deleteNotes as $noteId => $doDelete)
+      {
+        if ($doDelete == 'delete' && !is_null($deleteNote = 
QubitNote::getById($noteId)))
+        {
+          $deleteNote->delete();
+        }
+      }
+    }
+  }
+
   public function updateProperties($informationObject)
   {
     // Add multiple languages of access
@@ -342,6 +368,25 @@
   }
 
   /**
+   * Delete related properties marked for deletion.
+   *
+   * @param sfRequest request object
+   */
+  public function deleteProperties($request)
+  {
+    if (is_array($deleteProperties = 
$request->getParameter('delete_properties')) && count($deleteProperties))
+    {
+      foreach ($deleteProperties as $thisId => $doDelete)
+      {
+        if ($doDelete == 'delete' && !is_null($property = 
QubitProperty::getById($thisId)))
+        {
+          $property->delete();
+        }
+      }
+    }
+  }
+
+  /**
    * Update ObjectTermRelations - Subject, name and place access points and
    * Material types.
    *
@@ -416,6 +461,25 @@
   }
 
   /**
+   * Delete object->term relations marked for deletion.
+   *
+   * @param sfRequest request object
+   */
+  public function deleteObjectTermRelations($request)
+  {
+    if (is_array($deleteRelations = 
$request->getParameter('delete_object_term_relations')) && 
count($deleteRelations))
+    {
+      foreach ($deleteRelations as $thisId => $doDelete)
+      {
+        if ($doDelete == 'delete' && !is_null($relation = 
QubitObjectTermRelation::getById($thisId)))
+        {
+          $relation->delete();
+        }
+      }
+    }
+  }
+
+  /**
    * Add new actor events for this info object.
    *
    * @param QubitInformationObject $informationObject
@@ -500,6 +564,25 @@
   }
 
   /**
+   * Delete related actor events marked for deletion.
+   *
+   * @param sfRequest request object
+   */
+  public function deleteActorEvents($request)
+  {
+    if (is_array($deleteActorEvents = 
$request->getParameter('delete_actor_events')) && count($deleteActorEvents))
+    {
+      foreach ($deleteActorEvents as $thisId => $doDelete)
+      {
+        if ($doDelete == 'delete' && !is_null($actorEvent = 
QubitEvent::getById($thisId)))
+        {
+          $actorEvent->delete();
+        }
+      }
+    }
+  }
+
+  /**
    * Add a new digital object to $informationObject, upload a digital asset,
    * and create a representation (thumbnail, icon) of asset.
    *
@@ -666,4 +749,23 @@
     }
 
   } // end method: updatePhysicalObjects
+
+  /**
+   * Delete related physical objects marked for deletion.
+   *
+   * @param sfRequest request object
+   */
+  public function deleteRelations($request)
+  {
+    if (is_array($deleteRelations = 
$request->getParameter('delete_relations')) && count($deleteRelations))
+    {
+      foreach ($deleteRelations as $thisId => $doDelete)
+      {
+        if ($doDelete == 'delete' && !is_null($relation = 
QubitRelation::getById($thisId)))
+        {
+          $relation->delete();
+        }
+      }
+    }
+  }
 }
\ No newline at end of file

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php  
    2008-11-28 18:06:26 UTC (rev 1638)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php  
    2008-11-28 23:09:21 UTC (rev 1639)
@@ -44,16 +44,27 @@
     </div>
 
     <div class="form-item">
-      <label for="new_title_note"><?php echo __('title note'); ?></label>
-
-      <?php if ($titleNotes): ?>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%"><?php echo __('title note(s)'); ?></th>
+          <th style="width: 10%; text-align: right"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
+        <?php if ($titleNotes): ?>
         <?php foreach ($titleNotes as $titleNote): ?>
-          <?php echo $titleNote->getContent(array('cultureFallback' => 
'true')) ?>
-          <?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteNote?noteId='.$titleNote->getId().'&returnTemplate=isad')
 ?><br />
+        <tr>
+          <td style="width: 470">
+            <?php echo $titleNote->getContent(array('cultureFallback' => 
'true')) ?>
+          </td>
+          <td style="text-align: right">
+            <input type="checkbox" name="delete_notes[<?php echo 
$titleNote->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
-      <?php endif; ?>
-
-      <?php echo input_tag('new_title_note') ?>
+        <?php endif; ?>
+        <tr>
+          <td colspan="2"><?php echo input_tag('new_title_note') ?></td>
+        </tr>
+      </table>
     </div>
 
     <table style="border: 0; width: 98%; margin: 0; padding: 0;"><tr><td 
style="width: 150px;">
@@ -88,7 +99,7 @@
           <th style="width: 35%;"><?php echo __('Name') ?></th>
           <th style="width: 25%;"><?php echo __('Role').'/'.__('Event') ?></th>
           <th style="width: 30%;"><?php echo __('Date(s)') ?></th>
-          <th style="width: 10%">&nbsp;</th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
         </tr>
         <?php if(count($actorEvents)): ?>
         <?php foreach ($actorEvents as $actorEvent): ?>
@@ -110,7 +121,7 @@
           <td><?php echo $actorEvent->getDateDisplay(array('cultureFallback' 
=> 'true')) ?></td>
           <td style="text-align: right">
             <!-- <a href="javascript:editActorEventDialog(<?php echo 
$actorEvent->getId()?>)"><?php echo image_tag('pencil', 'align=top') ?></a> -->
-            <?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteEvent?eventId='.$actorEvent->getId().'&returnTemplate=isad')
 ?>
+            <input type="checkbox" name="delete_actor_events[<?php echo 
$actorEvent->getId()?>]" value="delete" class="multiDelete" />
           </td>
         </tr>
         <?php endforeach; ?>
@@ -170,15 +181,21 @@
       <?php foreach ($creators as $creator): ?>
       <div class="form-item">
       <label>
-      <?php $entityTypeId = $creator->getEntityTypeId() ?>
-      <?php if ($entityTypeId == QubitTerm::CORPORATE_BODY_ID): ?>
+        <?php $entityTypeId = $creator->getEntityTypeId() ?>
+        <?php if ($entityTypeId == QubitTerm::CORPORATE_BODY_ID): ?>
         <?php echo __('Administrative').' ' ?>
-      <?php elseif (($entityTypeId == QubitTerm::PERSON_ID) || ($entityTypeId 
== QubitTerm::FAMILY_ID)): ?>
+        <?php elseif (($entityTypeId == QubitTerm::PERSON_ID) || 
($entityTypeId == QubitTerm::FAMILY_ID)): ?>
         <?php echo __('Biographic').' ' ?>
-      <?php endif; ?>
-        <?php echo __('history').': ' ?></td><td><?php echo $creator ?>
+        <?php endif; ?>
+        <?php echo __('history').': ' ?><?php echo $creator ?>
       </label>
-        <table class="inline" style="margin: 0;"><tr><td><?php echo 
nl2br($creator->getHistory(array('cultureFallback' => 'true'))) ?></td><td 
style="width: 20px;"><?php echo link_to(image_tag('pencil', 'align=top'), 
'actor/edit?id='.$creator->getId().'&informationObjectReroute='.$informationObject->getId())
 ?></td></tr>
+        <table class="inline" style="margin: 0;">
+          <tr>
+            <td><?php echo nl2br($creator->getHistory(array('cultureFallback' 
=> 'true'))) ?></td>
+            <td style="width: 20px;">
+              <?php echo link_to(image_tag('pencil', 'align=top'), 
'actor/edit?id='.$creator->getId().'&informationObjectReroute='.$informationObject->getId())
 ?>
+            </td>
+         </tr>
         </table>
        </div>
       <?php endforeach; ?>
@@ -263,27 +280,55 @@
     </div>
 
     <div class="form-item">
-      <label for="language_of_material"><?php echo __('language of material'); 
?></label>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('language of material'); 
?></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($languageCodes): ?>
         <?php foreach ($languageCodes as $languageCode): ?>
-          <div style="margin-top: 5px; margin-bottom: 5px;">
-          <?php echo 
format_language($languageCode->getValue(array('sourceCulture'=>true))) 
?>&nbsp;<?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteProperty?Id='.$languageCode->getId().'&returnTemplate=isad')
 ?><br/>
-          </div>
+        <tr>
+          <td>
+            <?php echo 
format_language($languageCode->getValue(array('sourceCulture'=>true))) ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_properties[<?php echo 
$languageCode->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-      <?php echo select_language_tag('language_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
-     </div>
-
+        <tr>
+          <td colspan="2">
+            <?php echo select_language_tag('language_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
+    </div>
+    
     <div class="form-item">
-      <label for="script_of_material"><?php echo __('script of material'); 
?></label>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('script of material'); ?></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($scriptCodes): ?>
         <?php foreach ($scriptCodes as $scriptCode): ?>
-          <div style="margin-top: 5px; margin-bottom: 5px;">
-          <?php echo 
format_script($scriptCode->getValue(array('sourceCulture'=>true))) 
?>&nbsp;<?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteProperty?Id='.$scriptCode->getId().'&returnTemplate=isad')
 ?><br/>
-          </div>
+        <tr>
+          <td>
+            <?php echo 
format_script($scriptCode->getValue(array('sourceCulture'=>true))) ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_properties[<?php echo 
$scriptCode->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-      <?php echo select_script_tag('script_code', null, array('include_blank' 
=> true, 'class'=>'multiInstance')) ?>
+        <tr>
+          <td colspan="2">
+            <?php echo select_language_tag('script_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
     </div>
 
     <div class="form-item">
@@ -330,16 +375,29 @@
     </div>
 
     <div class="form-item">
-      <label for="new_title_note"><?php echo __('publication note'); ?></label>
-
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('publication note'); ?></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($publicationNotes): ?>
         <?php foreach ($publicationNotes as $publicationNote): ?>
-          <?php echo $publicationNote->getContent(array('cultureFallback' => 
'true')) ?>
-          <?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteNote?noteId='.$publicationNote->getId().'&returnTemplate=isad')
 ?><br />
+        <tr>
+          <td>
+            <?php echo 
nl2br($publicationNote->getContent(array('cultureFallback' => 'true'))) ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_notes[<?php echo 
$publicationNote->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-
-      <?php echo textarea_tag('new_publication_note', '', 'size=30x3') ?>
+        <tr>
+          <td colspan="2">
+            <?php echo textarea_tag('new_publication_note', '', 'size=30x2') ?>
+          </td>
+        </tr>
+      </table>
     </div>
   </fieldset>
 
@@ -349,16 +407,21 @@
       <label for="notes"><?php echo __('notes'); ?></label>
       <table class="inline">
         <tr>
-          <td class="headerCell" style="width: 65%;"><?php echo __('note'); 
?></td>
-          <td class="headerCell" style="width: 30%"><?php echo __('note 
type'); ?></td>
-          <td class="headerCell" style="width: 5%;"></td>
+          <th style="width: 65%;"><?php echo __('note'); ?></th>
+          <th style="width: 30%"><?php echo __('note type'); ?></th>
+          <th style="width: 5%;"><?php echo image_tag('delete', 'align=top') 
?></th>
         </tr>
         <?php if ($notes): ?>
           <?php foreach ($notes as $note): ?>
             <tr>
-            <td><?php echo $note->getContent(array('cultureFallback' => 
'true')) ?><br/><span class="note"><?php echo $note->getUser() ?>, <?php echo 
$note->getUpdatedAt() ?></span></td>
+            <td>
+              <?php echo nl2br($note->getContent(array('cultureFallback' => 
'true'))) ?><br/>
+              <span class="note"><?php echo $note->getUser() ?>, <?php echo 
$note->getUpdatedAt() ?></span>
+            </td>
             <td><?php echo $note->getType() ?></td>
-            <td style="text-align: center;"><?php echo 
link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteNote?noteId='.$note->getId().'&returnTemplate=isad') 
?></td>
+            <td style="text-align: center;">
+              <input type="checkbox" name="delete_notes[<?php echo 
$note->getId() ?>]" value="delete" class="multiDelete" />
+            </td>
             </tr>
           <?php endforeach; ?>
         <?php endif; ?>
@@ -374,38 +437,89 @@
     <legend><?php echo __('access points'); ?></legend>
 
     <?php include_partial('addAccessPointTermDialog') ?>
+    
     <div class="form-item" id="subjectAccessPoints">
-      <label for="subject_id"><?php echo __('subject access points'); ?><span 
id="addSubjectAccessPointLink" style="font-weight:normal"></span></label>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('subject access points'); 
?><span id="addSubjectAccessPointLink" style="font-weight:normal"></span></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($subjectAccessPoints): ?>
         <?php foreach ($subjectAccessPoints as $subject): ?>
-          <?php echo $subject->getTerm() ?>&nbsp;<?php echo 
link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteTermRelation?TermRelationId='.$subject->getId().'&returnTemplate=isad')
 ?><br/>
+        <tr>
+          <td>
+            <?php echo $subject->getTerm() ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_object_term_relations[<?php 
echo $subject->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-      <?php echo object_select_tag($newSubjectAccessPoint, 'getTermId', 
array('name' => 'subject_id', 'id' => 'subject_id', 'include_blank' => true, 
'peer_method' => 'getSubjects', 'class'=>'multiInstance')) ?>
+        <tr>
+          <td colspan="2">
+            <?php echo object_select_tag($newSubjectAccessPoint, 'getTermId', 
array(
+              'name' => 'subject_id', 'id' => 'subject_id', 'include_blank' => 
true, 'peer_method' => 'getSubjects', 'class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
     </div>
-
+    
     <div class="form-item" id="placeAccessPoints">
-      <label for="place_id"><?php echo __('place access points'); ?><span 
id="addPlaceAccessPointLink" style="font-weight:normal"></span></label>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('place access points'); 
?><span id="addPlaceAccessPointLink" style="font-weight:normal"></span></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($placeAccessPoints): ?>
         <?php foreach ($placeAccessPoints as $place): ?>
-          <?php echo $place->getTerm() ?>&nbsp;<?php echo 
link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteTermRelation?TermRelationId='.$place->getId().'&returnTemplate=isad')
 ?><br/>
+        <tr>
+          <td>
+            <?php echo $place->getTerm() ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_object_term_relations[<?php 
echo $place->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-      <?php echo object_select_tag($newPlaceAccessPoint, 'getTermId', 
array('name' => 'place_id', 'id' => 'place_id', 'include_blank' => true, 
'peer_method' => 'getPlaces', 'class'=>'multiInstance')) ?>
+        <tr>
+          <td colspan="2">
+            <?php echo object_select_tag($newPlaceAccessPoint, 'getTermId', 
array(
+              'name' => 'place_id', 'id' => 'place_id', 'include_blank' => 
true, 'peer_method' => 'getPlaces', 'class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
     </div>
-
-    <div class="form-item">
-      <label for="name_id"><?php echo __('name access points'); ?></label>
+    
+    <div class="form-item" id="nameAccessPoints">
+      <table class="inline">
+        <tr>
+          <th style="width: 60%;"><?php echo __('name access points'); ?></th>
+          <th style="width: 30%;"><?php echo __('role'); ?></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($nameAccessPoints): ?>
         <?php foreach ($nameAccessPoints as $name): ?>
-          <?php echo $name->getActor().' ('.$name->getType()->getRole().')' ?>
-          <?php if ($name->getTypeId() == QubitTerm::SUBJECT_ID): ?>
-            <?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteEvent?eventId='.$name->getId().'&returnTemplate=isad') 
?>
-          <?php endif; ?>
-          <br/>
+        <tr>
+          <td><?php echo $name->getActor() ?></td>
+          <td><?php echo $name->getType()->getRole() ?></td>
+          <td style="text-align: right">
+            <?php if ($name->getTypeId() == QubitTerm::SUBJECT_ID): ?>
+              <input type="checkbox" name="delete_actor_events[<?php echo 
$name->getId() ?>]" value="delete" class="multiDelete" />
+            <?php else: ?>
+              &nbsp;
+            <?php endif; ?>
+          </td>
+        </tr>
         <?php endforeach; ?>
-       <?php endif; ?>
-       <?php echo select_tag('name_id', options_for_select($nameSelectList, 
null, array('include_blank' => true)), array('class'=>'multiInstance')) ?>
+      <?php endif; ?>
+        <tr>
+          <td colspan="3">
+            <?php echo select_tag('name_id', 
options_for_select($nameSelectList, null, array('include_blank' => true)), 
array('class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
     </div>
   </fieldset>
 
@@ -450,29 +564,57 @@
       <?php endif; ?>
       <?php echo object_textarea_tag($informationObject, 'getRevisionHistory', 
array('size' => '30x3')) ?>
     </div>
-
+    
     <div class="form-item">
-      <label for="language_code"><?php echo __('languages of archival 
description'); ?></label>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('languages of archival 
description'); ?></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($descriptionLanguageCodes): ?>
         <?php foreach ($descriptionLanguageCodes as $languageCode): ?>
-          <div style="margin-top: 5px; margin-bottom: 5px;">
-          <?php echo 
format_language($languageCode->getValue(array('sourceCulture'=>true))) 
?>&nbsp;<?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteProperty?Id='.$languageCode->getId().'&returnTemplate=isad')
 ?><br/>
-          </div>
+        <tr>
+          <td>
+            <?php echo 
format_language($languageCode->getValue(array('sourceCulture'=>true))) ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_properties[<?php echo 
$languageCode->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-      <?php echo select_language_tag('description_language_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
+        <tr>
+          <td colspan="2">
+            <?php echo select_language_tag('description_language_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
     </div>
-
+    
     <div class="form-item">
-      <label for="script_id"><?php echo __('scripts of archival description'); 
?></label>
+      <table class="inline">
+        <tr>
+          <th style="width: 90%;"><?php echo __('scripts of archival 
description'); ?></th>
+          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', 'align=top') ?></th>
+        </tr>
       <?php if ($descriptionScriptCodes): ?>
         <?php foreach ($descriptionScriptCodes as $scriptCode): ?>
-          <div style="margin-top: 5px; margin-bottom: 5px;">
-          <?php echo 
format_script($scriptCode->getValue(array('sourceCulture'=>true))) 
?>&nbsp;<?php echo link_to(image_tag('delete', 'align=top'), 
'informationobject/deleteProperty?Id='.$scriptCode->getId().'&returnTemplate=isad')
 ?><br/>
-          </div>
+        <tr>
+          <td>
+            <?php echo 
format_script($scriptCode->getValue(array('sourceCulture'=>true))) ?>
+          </td>
+          <td style="text-align: right">  
+            <input type="checkbox" name="delete_properties[<?php echo 
$scriptCode->getId() ?>]" value="delete" class="multiDelete" />
+          </td>
+        </tr>
         <?php endforeach; ?>
       <?php endif; ?>
-      <?php echo select_script_tag('description_script_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
+        <tr>
+          <td colspan="2">
+            <?php echo select_script_tag('description_script_code', null, 
array('include_blank' => true, 'class'=>'multiInstance')) ?>
+          </td>
+        </tr>
+      </table>
     </div>
 
     <div class="form-item">

Modified: trunk/qubit/apps/qubit/modules/physicalobject/templates/_edit.php
===================================================================
--- trunk/qubit/apps/qubit/modules/physicalobject/templates/_edit.php   
2008-11-28 18:06:26 UTC (rev 1638)
+++ trunk/qubit/apps/qubit/modules/physicalobject/templates/_edit.php   
2008-11-28 23:09:21 UTC (rev 1639)
@@ -3,9 +3,8 @@
 <div class="form-item">
 <table class="inline" style="width: 98%;">
   <tr>
-    <td colspan="3" class="headerCell" style="width: 98%">
-      <?php echo __('containers'); ?>
-    </td>
+    <th colspan="2" style="width: 90%;"><?php echo __('containers'); ?></th>
+    <th style="width: 5%;"><?php echo image_tag('delete', 'align=top') ?></th>
   </tr>
 <?php foreach($relations as $relation): ?>
   <?php $physicalObject = 
QubitPhysicalObject::getById($relation->getSubjectId()); ?>
@@ -15,7 +14,6 @@
       <b><?php echo $physicalObject->getName(array('cultureFallback' => 
'true')); ?></b>
       <?php if ($location = 
$physicalObject->getLocation(array('cultureFallback' => 'true'))) echo ' - 
'.$location; ?>     
     </td>
-    <?php if ($physicalObject): ?>
     <td style="width: 20px; border-top: 1px solid #cccccc;">
       <?php echo link_to(image_tag('pencil', 'align=top'), 
         array('module' => 'physicalobject', 'action' => 'edit', 'id' => 
$physicalObject->getId()), 
@@ -23,14 +21,8 @@
       ) ?>
     </td>
     <td style="width: 20px; border-top: 1px solid #cccccc;">
-      <?php echo link_to(image_tag('delete', 'align=top'),
-        array('module' => 'relation', 'action' => 'delete', 'id' => 
$relation->getId()), 
-        array('query_string' => 'next='.url_for(array('module' => 
'informationobject', 'action' => 'edit', 'id' => $informationObject->getId())))
-      ) ?>
+      <input type="checkbox" name="delete_relations[<?php echo 
$relation->getId() ?>]" value="delete" class="multiDelete" />
     </td>
-    <?php else: ?>
-    <td colspan="2">&nbsp;</td>
-    <?php endif; ?>
   </tr>
 <?php endforeach; ?>
 </table>


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