Author: sevein
Date: Thu Aug 18 17:42:03 2011
New Revision: 9540

Log:
Handle contact information component post data correctly

Modified:
   
trunk/apps/qubit/modules/contactinformation/actions/relatedContactInformationComponent.class.php
   
trunk/apps/qubit/modules/contactinformation/templates/_relatedContactInformation.php

Modified: 
trunk/apps/qubit/modules/contactinformation/actions/relatedContactInformationComponent.class.php
==============================================================================
--- 
trunk/apps/qubit/modules/contactinformation/actions/relatedContactInformationComponent.class.php
    Thu Aug 18 17:29:44 2011        (r9539)
+++ 
trunk/apps/qubit/modules/contactinformation/actions/relatedContactInformationComponent.class.php
    Thu Aug 18 17:42:03 2011        (r9540)
@@ -81,12 +81,12 @@
     switch ($field->getName())
     {
       default:
-        $this->resource[$field->getName()] = 
$this->form->getValue($field->getName());
+        $this->contactInformation[$field->getName()] = 
$this->form->getValue($field->getName());
     }
   }
 
   public function processForm()
-  {
+  { echo "<pre>"; var_dump($_POST); die();
     // HACK For now, parameter name and action name are the same. Should
     // really be configurable, ideally by interpreting
     // $form->getWidgetSchema()->getNameFormat()?
@@ -118,12 +118,11 @@
       {
         if (isset($item['id']))
         {
-          // $params = 
$this->context->routing->parse(Qubit::pathInfo($item['id']));
-          // $this->relation = $params['_sf_route']->resource;
+          $this->contactInformation = 
QubitContactInformation::getById($item['id']);
         }
         else
         {
-          // $this->resource->relationsRelatedBysubjectId[] = $this->relation 
= new QubitRelation;
+          $this->resource->contactInformations[] = $this->contactInformation = 
new QubitContactInformation;
         }
 
         foreach ($this->form as $field)
@@ -154,7 +153,6 @@
   {
     $this->form = new sfForm;
     $this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
-
     
$this->form->getWidgetSchema()->setNameFormat('relatedContactInformation[%s]');
 
     foreach ($this::$NAMES as $name)

Modified: 
trunk/apps/qubit/modules/contactinformation/templates/_relatedContactInformation.php
==============================================================================
--- 
trunk/apps/qubit/modules/contactinformation/templates/_relatedContactInformation.php
        Thu Aug 18 17:29:44 2011        (r9539)
+++ 
trunk/apps/qubit/modules/contactinformation/templates/_relatedContactInformation.php
        Thu Aug 18 17:42:03 2011        (r9540)
@@ -29,7 +29,7 @@
           <td>
             <?php echo $item->contactPerson ?>
           </td><td style="text-align: center">
-            <input class="multiDelete" name="deleteContactInformations[]" 
type="checkbox" value="<?php echo url_for(array($item, 'module' => 
'contactinformation')) ?>"/>
+            <input class="multiDelete" name="deleteContactInformations[]" 
type="checkbox" value="<?php echo $item->id ?>"/>
           </td>
         </tr>
       <?php endforeach; ?>

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