Author: david
Date: Fri Oct  7 13:10:51 2011
New Revision: 9966

Log:
Wire up form

Modified:
   trunk/apps/qubit/modules/informationobject/actions/reportsAction.class.php
   trunk/apps/qubit/modules/informationobject/templates/reportsSuccess.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/reportsAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/reportsAction.class.php  
Fri Oct  7 12:49:27 2011        (r9965)
+++ trunk/apps/qubit/modules/informationobject/actions/reportsAction.class.php  
Fri Oct  7 13:10:51 2011        (r9966)
@@ -38,7 +38,7 @@
         );
 
         $this->form->setDefault($name, $this->context->routing->generate(null, 
array($this->resource, 'module' => 'informationobject', 'action' => 'print')));
-        $this->form->setValidator('descriptionStatus', new 
sfValidatorChoice(array('choices' => array_keys($choices))));
+        $this->form->setValidator($name, new sfValidatorChoice(array('choices' 
=> array_keys($choices))));
         $this->form->setWidget($name, new sfWidgetFormChoice(array(
           'expanded' => true,
           'choices' => $choices)));
@@ -47,17 +47,6 @@
     }
   }
 
-  protected function processForm()
-  {
-    foreach ($this->form as $field)
-    {
-      if (isset($this->request[$field->getName()]))
-      {
-        $this->processField($field);
-      }
-    }
-  }
-
   public function execute($request)
   {
     $this->resource = $this->getRoute()->resource;
@@ -73,5 +62,14 @@
     {
       $this->addField($name);
     }
+
+    if ($request->isMethod('post'))
+    {
+      $this->form->bind($request->getPostParameters());
+      if ($this->form->isValid())
+      {
+        $this->redirect($this->form->getValue('report'));
+      }
+    }
   }
 }

Modified: 
trunk/apps/qubit/modules/informationobject/templates/reportsSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/reportsSuccess.php     
Fri Oct  7 12:49:27 2011        (r9965)
+++ trunk/apps/qubit/modules/informationobject/templates/reportsSuccess.php     
Fri Oct  7 13:10:51 2011        (r9966)
@@ -1,8 +1,10 @@
 <h1><?php echo __('Reports') ?></h1>
 
-<h1 class="label">
-  <?php echo $resource->__toString() ?>
-</h1>
+<h1 class="label"><?php echo $resource->__toString() ?></h1>
+
+<?php echo $form->renderGlobalErrors() ?>
+
+<?php echo $form->renderFormTag(url_for(array($resource, 'module' => 
'informationobject', 'action' => 'reports'))) ?>
 
 <div class="section">
 
@@ -16,9 +18,11 @@
 
   <div class="content">
     <ul class="clearfix links">
-      <li><?php echo link_to(__('Continue'), array($resource, 'module' => 
'informationobject', 'action' => 'reports')) ?></li>
+      <li><input class="form-submit" type="submit" value="<?php echo 
__('Continue') ?>"/></li>
       <li><?php echo link_to(__('Cancel'), array($resource, 'module' => 
'informationobject', 'action' => 'index')) ?></li>
     </ul>
   </div>
 
 </div>
+
+</form>

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