[patch] Make entry form use standard renderer

"Jason M. Felice" <[email protected]> Tue, 23 Sep 2003 13:47:58 -0400
Newsgroups gmane.comp.horde.hermes
Message-ID <[email protected]>
We have some clients and some categories with long names, so the entry form on
the entry screen is very wide.  Some users miss the description and
additional notes fields because they are off to the right side of the
screen.

This uses the standard renderer so the field layout is vertical instead of
horizontal.  There is also a small fix for conditional_setvalue.php.

-Jason


-- 
hermes mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
hermes-entry-form.diff (text/plain, 2.2 KB)
epm diff lib/Form/Action/conditional_setvalue.php
--- lib/Form/Action/conditional_setvalue.php	2003-09-23 13:26:51.000000000 -0400
+++ lib/Form/Action/conditional_setvalue.php	2003-09-23 13:27:54.000000000 -0400
@@ -31,11 +31,13 @@
 
         if ($arrayVal && is_null($index)) {
             $i = 0;
-            foreach ($sourceVal as $val) {
-                if (!empty($map[$val])) {
-                    $vars->setVar($target, $map[$val], $i);
+	    if (is_array($sourceVal)) {
+                foreach ($sourceVal as $val) {
+                    if (!empty($map[$val])) {
+                        $vars->setVar($target, $map[$val], $i);
+                    }
+                    $i++;
                 }
-                $i++;
             }
         } else {
             if (!empty($map[$sourceVal])) {
epm diff hermes/lib/TimeForm.php
--- hermes/lib/TimeForm.php	2003-09-23 13:37:05.000000000 -0400
+++ hermes/lib/TimeForm.php	2003-09-23 11:37:55.000000000 -0400
@@ -28,11 +28,6 @@
         parent::Horde_Form($vars, $name);
     }
 
-    function &getCustomRenderer()
-    {
-        return Horde_Form_Renderer::singleton('rows');
-    }
-
     function getDOWValues()
     {
         list($year, $month, $day) = explode(':', date('Y:n:j', $this->_weekstart));
@@ -92,10 +87,12 @@
 
     function TimeEntryForm(&$vars, $dowstamp = null)
     {
-        parent::TimeForm($vars, $dowstamp, 'timeentryform');
+        parent::TimeForm($vars, $dowstamp, 'Enter Time');
 
         global $hermes, $conf;
 
+        $this->_submit = _("Enter my time");
+
         list($clienttype, $clientparams) = $this->getClientType();
         if ($clienttype == 'enum') {
             $map = array();
epm diff hermes/time.php
--- hermes/time.php	2003-09-23 13:38:10.000000000 -0400
+++ hermes/time.php	2003-09-23 13:36:21.000000000 -0400
@@ -94,12 +94,8 @@
 }
 
 if (!$print_view) {
-    $form->open($r, $vars, 'time.php', 'post');
-    $r->beginActive($title);
-    $r->render($form, $vars, true);
-    $r->submit(_("Enter my time"));
-    $r->end();
-    $form->close($r);
+    $r = &new Horde_Form_Renderer();
+    $form->renderActive($r, $vars, 'time.php', 'post');
 }
 
 require HERMES_TEMPLATES . '/common-footer.inc';