Author: david
Date: Thu Dec 10 15:50:12 2009
New Revision: 4142

Log:
Remove relation type field, re-arrange related function table.

Modified:
   trunk/apps/qubit/modules/function/actions/editAction.class.php
   trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php

Modified: trunk/apps/qubit/modules/function/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/function/actions/editAction.class.php      Thu Dec 
10 15:38:49 2009        (r4141)
+++ trunk/apps/qubit/modules/function/actions/editAction.class.php      Thu Dec 
10 15:50:12 2009        (r4142)
@@ -53,7 +53,6 @@
     'sources',
     'maintenanceNotes',
     'relation[authorizedFormOfName]',
-    'relation[type]',
     'relation[category]',
     'relation[description]',
     'relation[dateStart]',
@@ -202,21 +201,6 @@
 
         break;
 
-      case 'relation[type]':
-        $this->form->setValidator($name, new sfValidatorString);
-
-        $choices = array();
-        $choices[null] = null;
-
-        foreach (QubitTaxonomy::getTermsById(QubitTaxonomy::FUNCTION_ID) as 
$term)
-        {
-          $choices[$this->context->routing->generate(null, array('module' => 
'term', 'action' => 'show', 'id' => $term->id))] = $term;
-        }
-
-        $this->form->setWidget($name, new sfWidgetFormSelect(array('choices' 
=> $choices)));
-
-        break;
-
       case 'authorizedFormOfName':
       case 'classification':
       case 'dates':
@@ -431,8 +415,7 @@
       if ($this->form->isValid())
       {
         $this->processForm();
-
-        //$this->redirect(array('module' => 'function', 'action' => 'show', 
'id' => $this->func->id));
+        $this->redirect(array('module' => 'function', 'action' => 'show', 'id' 
=> $this->func->id));
       }
     }
 
@@ -485,8 +468,8 @@
         $relation->subject = $subject;
       }
 
-      // Set type_id
-      $params = 
$this->context->routing->parse(Qubit::pathInfo($relationData['type']));
+      // Set category (typeId)
+      $params = 
$this->context->routing->parse(Qubit::pathInfo($relationData['category']));
       $typeId = (isset($params['id'])) ? $params['id'] : null;
       $relation->typeId = $typeId;
 

Modified: trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php     Thu Dec 
10 15:38:49 2009        (r4141)
+++ trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php     Thu Dec 
10 15:50:12 2009        (r4142)
@@ -68,9 +68,9 @@
     <caption><?php echo __('Related corporate bodies, archival materials and 
other resources'); ?></caption>
     <tr>
       <th style="width: 25%"><?php echo __('name'); ?></th>
-      <th style="width: 15%"><?php echo __('type'); ?></th>
-      <th style="width: 20%"><?php echo __('dates'); ?></th>
+      <th style="width: 15%"><?php echo __('category'); ?></th>
       <th style="width: 30%"><?php echo __('description'); ?></th>
+      <th style="width: 20%"><?php echo __('dates'); ?></th>
       <th style="width: 10%; text-align: center"><?php echo 
image_tag('delete', array('align' => 'top', 'class' => 'deleteIcon')) ?></th>
     </tr>
       <?php if (0 < count($relatedFunctions)): ?>
@@ -82,6 +82,7 @@
           <td><?php echo 
$relatedFunction->getObject()->getAuthorizedFormOfName() ?></td>
           <?php endif; ?>
           <td><?php echo $relatedFunction->getType() ?></td>
+          <td><?php echo 
$relatedFunction->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID) 
?></td>
           <td>
           <?php if (0 < strlen($dateDisplay = 
$relatedFunction->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)) || 
0 < count($dateArray = $relatedFunction->getDates())): ?>
             <?php if (0 < strlen($dateDisplay)): ?>
@@ -93,7 +94,6 @@
             <?php endif; ?>
           <?php endif; ?>
           </td>
-          <td><?php echo 
$relatedFunction->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID) 
?></td>
           <td style="text-align: center;">
             <input type="checkbox" name="deleteRelations[<?php echo 
$relatedFunction->getId() ?>]" value="delete" class="multiDelete" />
           </td>
@@ -138,18 +138,12 @@
         </td>
       </tr>
       <tr>
-        <th colspan="2" style="width: 50%">
-          <?php echo $form['relation[type]']->label('type')->renderLabel() ?>
-        </th>
-        <th colspan="2" style="width: 50%">
+        <th colspan="4">
           <?php echo 
$form['relation[category]']->label('category')->renderLabel() ?>
         </th>
       </tr>
       <tr>
-        <td colspan="2">
-          <?php echo $form['relation[type]']->label('type')->render() ?>
-        </td>
-        <td colspan="2">
+        <td colspan="4">
           <?php echo $form['relation[category]']->render() ?>
         </td>
       </tr>

--

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.com/group/qubit-commits?hl=en.


Reply via email to