Author: david
Date: Thu Dec 10 17:52:34 2009
New Revision: 4148

Log:
Add autocomplete field for ISDF relation authorized form of name.

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 16:59:24 2009        (r4147)
+++ trunk/apps/qubit/modules/function/actions/editAction.class.php      Thu Dec 
10 17:52:34 2009        (r4148)
@@ -186,6 +186,14 @@
 
         break;
 
+      case 'relation[authorizedFormOfName]':
+        $choices = array();
+
+        $this->form->setValidator($name, new sfValidatorString);
+        $this->form->setWidget($name, new sfWidgetFormSelect(array('choices' 
=> $choices)));
+
+        break;
+
       case 'relation[category]':
         $this->form->setValidator($name, new sfValidatorString);
 
@@ -225,7 +233,6 @@
 
         break;
 
-      case 'relation[authorizedFormOfName]':
       case 'relation[dateStart]':
       case 'relation[dateEnd]':
       case 'relation[dateDisplay]':
@@ -459,7 +466,9 @@
       }
 
       // Get name
-      if (null === $subject = 
QubitFunction::getById($relationData['authorizedFormOfName']))
+      $params = 
$this->context->routing->parse(Qubit::pathInfo($relationData['authorizedFormOfName']));
+      $subjectId = (isset($params['id'])) ? $params['id'] : null;
+      if (null === $subject = QubitFunction::getById($subjectId))
       {
         continue; // If no related subject, skip update
       }
@@ -476,9 +485,6 @@
       $relation->startDate = 
QubitDate::standardize($relationData['dateStart']);
       $relation->endDate = QubitDate::standardize($relationData['dateEnd']);
 
-      // TODO object term relation
-      // $relations->categoryId = $relationsData['categoryId'];
-
       // TODO notes
       //$relations->dateDisplay = $relationsData['dateDisplay'];
       //$relations->description = $relationsData['description'];

Modified: trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php     Thu Dec 
10 16:59:24 2009        (r4147)
+++ trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php     Thu Dec 
10 17:52:34 2009        (r4148)
@@ -134,7 +134,8 @@
       </tr>
       <tr>
         <td colspan="4">
-          <?php echo $form['relation[authorizedFormOfName]']->render() ?>
+          <?php echo 
$form['relation[authorizedFormOfName]']->render(array('class' => 
'form-autocomplete')) ?>
+          <input class="list" type="hidden" value="<?php echo 
url_for(array('module' => 'function', 'action' => 'list')) ?>"/>
         </td>
       </tr>
       <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