Restructure to have the index action present an overview
authorMichael Tänzer <neo@nhng.de>
Mon, 28 Jun 2010 14:13:14 +0000 (16:13 +0200)
committerMichael Tänzer <neo@nhng.de>
Mon, 28 Jun 2010 14:13:14 +0000 (16:13 +0200)
The index action should display an overview over the available actions

Signed-off-by: Michael Tänzer <neo@nhng.de>
manager/application/controllers/AddPointsController.php
manager/application/views/scripts/add-points/assuranceform.phtml [new file with mode: 0644]
manager/application/views/scripts/add-points/index.phtml [deleted file]

index 0371718..95b524b 100644 (file)
@@ -21,21 +21,17 @@ class AddPointsController extends Zend_Controller_Action
     
     public function indexAction()
     {
     
     public function indexAction()
     {
-        $this->view->assurance_form = $this->getAssuranceForm();
-        $this->render('index');
+        // Just render the view
+        return;
     }
     
     public function assuranceAction()
     {
         // Validate form
     }
     
     public function assuranceAction()
     {
         // Validate form
-        if (!$this->getRequest()->isPost()) {
-            return $this->_forward('index');
-        }
-        
         $form = $this->getAssuranceForm();
         $form = $this->getAssuranceForm();
-        if (!$form->isValid($_POST)) {
+        if (!$this->getRequest()->isPost() || !$form->isValid($_POST)) {
             $this->view->assurance_form = $form;
             $this->view->assurance_form = $form;
-            return $this->render('index');
+            return $this->render('assuranceform');
         }
         
         // Form is valid -> get values for processing
         }
         
         // Form is valid -> get values for processing
diff --git a/manager/application/views/scripts/add-points/assuranceform.phtml b/manager/application/views/scripts/add-points/assuranceform.phtml
new file mode 100644 (file)
index 0000000..b627b78
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+/**
+ * @author Michael Tänzer
+ */
+?>
+
+<h1><?php print I18n::_('Add Assurance Points to your Account') ?></h1>
+
+<h2><?php print I18n::_('Get Points by Automated Assurance') ?></h2>
+<p><?php print I18n::_('Assign the points by doing an automated assurance '.
+    'which looks just like a normal assurance done by a real person.') ?></p>
+<p><?php print I18n::_('If you enter more than 35 points they will be split '.
+    'into multiple assurances. You can do zero point assurances.') ?></p>
+<?php print $this->assurance_form ?>
diff --git a/manager/application/views/scripts/add-points/index.phtml b/manager/application/views/scripts/add-points/index.phtml
deleted file mode 100644 (file)
index b627b78..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-/**
- * @author Michael Tänzer
- */
-?>
-
-<h1><?php print I18n::_('Add Assurance Points to your Account') ?></h1>
-
-<h2><?php print I18n::_('Get Points by Automated Assurance') ?></h2>
-<p><?php print I18n::_('Assign the points by doing an automated assurance '.
-    'which looks just like a normal assurance done by a real person.') ?></p>
-<p><?php print I18n::_('If you enter more than 35 points they will be split '.
-    'into multiple assurances. You can do zero point assurances.') ?></p>
-<?php print $this->assurance_form ?>