[hermes] [patch] Merge entry and edit screens, UI improvements

Jason M. Felice jfelice at cronosys.com
Wed Nov 5 07:39:11 PST 2003


Attached is a patch which merges the entry and edit screens and makes
nag-style UI improvements to hermes.  If you have a lot of clients, the
old edit screen can take a long time to load (as it includes the html
for the client drop down for every line item).

The patch does not contain two binary files which have to be manually
copied from nag, i.e.:

cp nag/graphics/edit.gif nag/graphics/delete.gif hermes/graphics/


Modified files:

	hermes/templates/menu/menu.inc
	hermes/time.php
	hermes/lib/Driver/sql.php
	hermes/lib/TimeForm.php

Added files:

	hermes/templates/time/table-footer.inc
	hermes/templates/time/table-header.inc
	hermes/templates/time/table-item.inc

Deleted files:

	hermes/edit.php

-- 
 Jason M. Felice
 Cronosys, LLC <http://www.cronosys.com/>
 216.221.4600 x302
-------------- next part --------------
epm diff edit.php
--- edit.php	2003-11-05 09:59:26.000000000 -0500
+++ edit.php	1969-12-31 19:00:00.000000000 -0500
@@ -1,71 +0,0 @@
-<?php  
-/**
- * $Horde: hermes/edit.php,v 1.10 2003/07/11 20:23:50 chuck Exp $
- *
- * Copyright 2002-2003 Chuck Hagenbuch <chuck at horde.org>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
- */
-
-define('HERMES_BASE', dirname(__FILE__));
-require_once HERMES_BASE . '/lib/base.php';
-require_once HERMES_BASE . '/lib/TimeForm.php';
-
-$r = &Horde_Form_Renderer::factory('rows');
-$vars = &Horde_Form::getDefaultVars();
-$form = &Horde_Form::singleton('TimeEditForm', $vars, Hermes::getCurrentTimestamp());
-$formname = $vars->getVar('formname');
-
-if ($formname) {
-    $form->validate($vars);
-    if ($form->isValid()) {
-        $form->getInfo($vars, $info);
-        $result = $hermes->updateTime($info);
-        if (is_a($result, 'PEAR_Error')) {
-            $notification->push(sprintf(_("There was an error updating your timesheet: %s"), $result->getMessage()), 'horde.error');
-        } else {
-            $notification->push(_("Your timesheet was successfully updated."), 'horde.success');
-            $vars = &new Horde_Form_Vars();
-        }
-    }
-}
-
-$timestamp = Hermes::getCurrentTimestamp();
-$startofweek = Hermes::getStartOfWeekStamp($timestamp);
-$endofweek = Hermes::getEndOfWeekStamp($timestamp);
-
-$title = sprintf(_("Edit Time for %s to %s"), strftime('%x', $startofweek), strftime('%x', $endofweek));
-require HERMES_TEMPLATES . '/common-header.inc';
-
-$myhours = $hermes->getHours(array('employee' => Auth::getAuth(),
-                                   'start' => $startofweek,
-                                   'end' => $endofweek,
-                                   'submitted' => 0));
-if (!is_a($myhours, 'PEAR_Error') && count($myhours) > 0) {
-    foreach ($myhours as $idx => $vals) {
-        foreach ($vals as $key => $val) {
-            $_myhours[$key][$idx] = $val;
-        }
-    }
-    $myvars = &new Horde_Form_Vars($_myhours);
-    $myvars->setVar('timestamp', $timestamp);
-    $r->_rows = count($myhours);
-
-    Hermes::menu();
-    $form->open($r, $myvars, 'edit.php', 'post');
-    $r->beginActive($title);
-    $r->render($form, $myvars, true);
-    $r->submit(_("Update My Hours"));
-    $r->end();
-    $form->close($r);
-} else {
-    if (is_a($myhours, 'PEAR_Error')) {
-        $notification->push(sprintf(_("There was an error retrieving your time: %s"), $myhours->getMessage()), 'horde.error');
-    } else {
-        $notification->push(_("You have no unsubmitted time entered for this week."), 'horde.message');
-    }
-    Hermes::menu();
-}
-
-require HERMES_TEMPLATES . '/common-footer.inc';
epm diff templates/menu/menu.inc
--- templates/menu/menu.inc	2003-11-05 09:59:26.000000000 -0500
+++ templates/menu/menu.inc	2003-11-05 09:59:37.000000000 -0500
@@ -15,16 +15,13 @@
 
 /* Hermes menu items */
 $time = Horde::applicationUrl('time.php');
-$edit = Horde::applicationUrl('edit.php');
 $submit = Horde::applicationUrl('submit.php');
 if (isset($timestamp)) {
     $time = Util::addParameter($time, 'timestamp=' . $timestamp);
-    $edit = Util::addParameter($edit, 'timestamp=' . $timestamp);
     $submit = Util::addParameter($submit, 'timestamp=' . $timestamp);
 }
 
 Menu::printItem($time, _("Enter Time"), 'hermes.gif');
-Menu::printItem($edit, _("Edit Time"), 'hermes.gif');
 Menu::printItem($submit, _("Submit Time"), 'hermes.gif');
 if (isset($timestamp) && $browser->hasFeature('dom')) {
     Menu::printItem(Horde::selfUrl(), _("Current Week"), 'today.gif', null, null, null, '__noselection');
epm diff time.php
--- time.php	2003-11-05 09:59:26.000000000 -0500
+++ time.php	2003-11-05 09:59:37.000000000 -0500
@@ -12,21 +12,38 @@
 require_once HERMES_BASE . '/lib/base.php';
 require_once HERMES_BASE . '/lib/TimeForm.php';
 
-$r = &Horde_Form_Renderer::factory('rows');
 $vars = &Horde_Form::getDefaultVars();
-$form = &Horde_Form::singleton('TimeEntryForm', $vars, Hermes::getCurrentTimestamp());
-$formname = $vars->getVar('formname');
 
+$delete = $vars->getVar('delete');
+if (!empty($delete)) {
+    $result = $hermes->updateTime(array(array('id' => $delete, 'delete' => true)));
+    if (is_a($result, 'PEAR_Error')) {
+        Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+        $notification->push(sprintf(_("There was an error deleting the time: %s"), $result->getMessage()), 'horde.error');
+    } else {
+        $notification->push(_("The time entry was successfully deleted."), 'horde.success');
+        $vars->unsetVar('delete');
+    }
+}
+
+$formname = $vars->getVar('formname');
 if ($formname) {
+    $form = &Horde_Form::singleton('TimeEntryForm', $vars, Hermes::getCurrentTimestamp());
     $form->validate($vars);
     if ($form->isValid()) {
         $form->getInfo($vars, $info);
-        $result = $hermes->enterTime(Auth::getAuth(), $info);
+        if ($vars->isVarSet('id')) {
+            $msg = _("Your time was successfully updated.");
+            $result = $hermes->updateTime(array($info));
+        } else {
+            $msg = _("Your time was successfully entered.");
+            $result = $hermes->enterTime(Auth::getAuth(), $info);
+        }
         if (is_a($result, 'PEAR_Error')) {
             Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
             $notification->push(sprintf(_("There was an error storing your timesheet: %s"), $result->getMessage()), 'horde.error');
         } else {
-            $notification->push(_("Your time was successfully entered."), 'horde.success');
+            $notification->push($msg, 'horde.success');
             $vars = &new Horde_Form_Vars();
         }
     }
@@ -55,46 +72,49 @@
 $myhours = $hermes->getHours(array('employee' => Auth::getAuth(),
                                    'start' => $startofweek,
                                    'end' => $endofweek));
-if (!is_a($myhours, 'PEAR_Error') && count($myhours) > 0) {
-    $total_hours = 0.0;
-    $total_billable_hours = 0.0;
-    foreach ($myhours as $vals) {
-        $total_hours += (double)$vals['hours'];
-        if ($vals['billable']) {
-            $total_billable_hours += (double)$vals['hours'];
+if ($vars->isVarSet('id')) {
+    // We are updating a specific entry, load the current value
+    $id = $vars->getVar('id');
+    foreach ($myhours as $item) {
+        if (isset($item['id']) && $item['id'] == $id) {
+            foreach ($item as $key => $value) {
+                $vars->setVar($key, $value);
+            }
         }
     }
-    $billable_pct = round($total_billable_hours / $total_hours * 100.0);
-    $myhours[] = array(
-        'description' => sprintf('Total Billable Hours (%.0f%%)', $billable_pct),
-        'hours' => sprintf('%.02f', $total_billable_hours)
-        );
-    $myhours[] = array(
-        'description' => sprintf('Total Non-Billable Hours (%.0f%%)', 100.0 - $billable_pct),
-        'hours' => sprintf('%.02f', $total_hours - $total_billable_hours)
-        );
-    $myhours[] = array(
-        'description' => 'Total Hours',
-        'hours' => sprintf('%.02f', $total_hours)
-        );
-    foreach ($myhours as $idx => $vals) {
-        foreach ($vals as $key => $val) {
-            $_myhours[$key][$idx] = $val;
+} else {
+    // We are displaying all time.
+    if (!is_a($myhours, 'PEAR_Error') && count($myhours) > 0) {
+        $total_hours = 0.0;
+        $total_billable_hours = 0.0;
+        foreach ($myhours as $vals) {
+            $total_hours += (double)$vals['hours'];
+            if ($vals['billable']) {
+                $total_billable_hours += (double)$vals['hours'];
+            }
+        }
+        $billable_pct = round($total_billable_hours / $total_hours * 100.0);
+
+        require HERMES_TEMPLATES . '/time/table-header.inc';
+        foreach ($myhours as $item) {
+            if (isset($item['id'])) {
+                $item_link = Util::addParameter(Horde::applicationUrl('time.php'),
+                    'timestamp', $timestamp);
+                $delete_link = Util::addParameter($item_link, 'delete', $item['id']);
+                $item_link = Util::addParameter($item_link, 'id', $item['id']);
+            } else {
+                $delete_link = null;
+                $item_link = null;
+            }
+            require HERMES_TEMPLATES . '/time/table-item.inc';
         }
+        require HERMES_TEMPLATES . '/time/table-footer.inc';
     }
-    $readform = &Horde_Form::singleton('TimeDisplayForm', $vars, $timestamp);
-    $readform->clearValidation();
-    $myvars = &new Horde_Form_Vars($_myhours);
-    $oldrows = $r->_rows;
-    $r->_rows = count($myhours);
-    $r->beginInactive(sprintf(_("My Hours for %s to %s"), strftime('%x', $startofweek), strftime('%x', $endofweek)));
-    $r->render($readform, $myvars, false);
-    $r->end();
-    $r->_rows = $oldrows;
 }
 
 if (!$print_view) {
     $r = &new Horde_Form_Renderer();
+    $form = &Horde_Form::singleton('TimeEntryForm', $vars, Hermes::getCurrentTimestamp());
     $form->renderActive($r, $vars, 'time.php', 'post');
 }
 
epm diff templates/time/table-footer.inc
--- templates/time/table-footer.inc	1969-12-31 19:00:00.000000000 -0500
+++ templates/time/table-footer.inc	2003-11-05 09:59:37.000000000 -0500
@@ -0,0 +1,27 @@
+<tr>
+    <td class="item0">&nbsp;</td>
+    <td class="item0" colspan="3"><b>Total Billable Hours (<?php
+        echo sprintf('%.0f%%', $billable_pct);
+    ?>)</b></td>
+    <td class="item0" align="right"><b><?php
+        echo number_format($total_billable_hours,2);
+    ?></b>&nbsp; </td>
+    <td class="item0" colspan="3">&nbsp;</td>
+</tr><tr>
+    <td class="item0">&nbsp;</td>
+    <td class="item0" colspan="3"><b>Total Non-billable Hours (<?php
+        echo sprintf('%.0f%%', 100.0 - $billable_pct);
+    ?>)</b></td>
+    <td class="item0" align="right"><b><?php
+        echo number_format($total_hours - $total_billable_hours,2);
+    ?></b>&nbsp; </td>
+    <td class="item0" colspan="3">&nbsp;</td>
+</tr><tr>
+    <td class="item0">&nbsp;</td>
+    <td class="item0" colspan="3"><b>Total Hours</b></td>
+    <td class="item0" align="right"><b><?php
+        echo number_format($total_hours,2);
+    ?></b>&nbsp; </td>
+    <td class="item0" colspan="3">&nbsp;</td>
+</tr>
+</table><br />
epm diff templates/time/table-header.inc
--- templates/time/table-header.inc	1969-12-31 19:00:00.000000000 -0500
+++ templates/time/table-header.inc	2003-11-05 09:59:37.000000000 -0500
@@ -0,0 +1,16 @@
+<table width="100%" cellspacing="0">
+    <tr>
+        <td align="left" class="header" colspan="8"><?php
+          echo sprintf(_("My Hours for %s to %s"), strftime('%x', $startofweek), strftime('%x', $endofweek));
+        ?></td>
+    </tr><tr>
+        <td class="header">&nbsp;</td>
+        <td class="header">Date</td>
+        <td class="header">Client</td>
+        <td class="header">Job Type</td>
+        <td class="header">Hours</td>
+        <td class="header">Billable?</td>
+        <td class="header">Description</td>
+        <td class="header">Additional Notes</td>
+    </tr>
+
epm diff templates/time/table-item.inc
--- templates/time/table-item.inc	1969-12-31 19:00:00.000000000 -0500
+++ templates/time/table-item.inc	2003-11-05 09:59:37.000000000 -0500
@@ -0,0 +1,51 @@
+<?php
+    if (!isset($item_class)) {
+        $item_class = 'item0';
+    } elseif ($item_class == 'item0') {
+        $item_class = 'item1';
+    } else {
+        $item_class = 'item0';
+    }
+?><tr> 
+    <td class="<?php echo $item_class; ?>"><?php
+        if (isset($item['id'])) {
+            echo Horde::link($item_link, _("Edit Entry"), 'widget'),
+                Horde::img('edit.gif', _("Edit Entry")), "</a>",
+                Horde::link($delete_link, _("Delete Entry"), 'widget'),
+                Horde::img('delete.gif', _("Delete Entry")), "</a>";
+        }
+    ?></td><td class="<?php echo $item_class; ?>"><?php
+        if (isset($item['date'])) {
+            echo strftime("%a (%x)", $item['date']);
+        }
+    ?></td><td class="<?php echo $item_class; ?>"><?php
+        $clients = Hermes::listClients();
+        if (isset($item['client']) && isset($clients[$item['client']])) {
+            echo htmlspecialchars($clients[$item['client']]);
+        }
+    ?></td><td class="<?php echo $item_class; ?>"><?php 
+        if (isset($item['_type_name'])) {
+            echo htmlspecialchars($item['_type_name']);
+        }
+    ?></td><td class="<?php echo $item_class; ?>" align="right"><?php
+        if (isset($item['hours'])) {
+            echo number_format($item['hours'],2);
+        }
+    ?>&nbsp; </td><td class="<?php echo $item_class; ?>"><?php
+        if (isset($item['billable'])) {
+            if ((int) $item['billable']) {
+                echo "Yes";
+            } else {
+                echo "No";
+            }
+        }
+    ?></td><td class="<?php echo $item_class; ?>"><?php
+        if (isset($item['description'])) {
+            echo htmlspecialchars($item['description']);
+        }
+    ?></td><td class="<?php echo $item_class; ?>"><?php
+        if (isset($item['note'])) {
+            echo htmlspecialchars($item['note']);
+        }
+    ?></td>
+</tr>
epm diff lib/Driver/sql.php
--- lib/Driver/sql.php	2003-11-05 09:59:26.000000000 -0500
+++ lib/Driver/sql.php	2003-11-05 09:59:37.000000000 -0500
@@ -66,34 +66,29 @@
      *
      * @return mixed  True on success, PEAR_Error on failure.
      */
-    function enterTime($employee, $entries)
+    function enterTime($employee, $info)
     {
         /* Make sure we have a valid database connection. */
         $this->_connect();
 
-        foreach ($entries as $info) {
-            if (count($info) == 1) {
-                continue;
-            }
-            $timeslice_id = $this->_db->nextId('hermes_timeslices');
-            $sql = sprintf('INSERT INTO hermes_timeslices (timeslice_id, clientjob_id, employee_id, jobtype_id,' .
-                           ' timeslice_hours, timeslice_isbillable, timeslice_date, timeslice_description, timeslice_note)' .
-                           ' VALUES (%d, %s, %s, %s, %s, %s, %d, %s, %s)',
-                           (int)$timeslice_id,
-                           $this->_db->quote($info['client']),
-                           $this->_db->quote($employee),
-                           $this->_db->quote($info['type']),
-                           $this->_db->quote($info['hours']),
-                           isset($info['billable']) ? (int)$info['billable'] : 0,
-                           (int)$info['date'],
-                           $this->_db->quote($info['description']),
-                           $this->_db->quote($info['note']));
+        $timeslice_id = $this->_db->nextId('hermes_timeslices');
+        $sql = sprintf('INSERT INTO hermes_timeslices (timeslice_id, clientjob_id, employee_id, jobtype_id,' .
+                       ' timeslice_hours, timeslice_isbillable, timeslice_date, timeslice_description, timeslice_note)' .
+                       ' VALUES (%d, %s, %s, %s, %s, %s, %d, %s, %s)',
+                       (int)$timeslice_id,
+                       $this->_db->quote($info['client']),
+                       $this->_db->quote($employee),
+                       $this->_db->quote($info['type']),
+                       $this->_db->quote($info['hours']),
+                       isset($info['billable']) ? (int)$info['billable'] : 0,
+                       (int)$info['date'],
+                       $this->_db->quote($info['description']),
+                       $this->_db->quote($info['note']));
 
-            Horde::logMessage($sql, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-            $result = $this->_db->query($sql);
-            if (DB::isError($result)) {
-                return $result;
-            }
+        Horde::logMessage($sql, __FILE__, __LINE__, PEAR_LOG_DEBUG);
+        $result = $this->_db->query($sql);
+        if (DB::isError($result)) {
+            return $result;
         }
 
         return true;
epm diff lib/TimeForm.php
--- lib/TimeForm.php	2003-11-05 09:59:26.000000000 -0500
+++ lib/TimeForm.php	2003-11-05 09:59:37.000000000 -0500
@@ -87,11 +87,15 @@
 
     function TimeEntryForm(&$vars, $dowstamp = null)
     {
-        parent::TimeForm($vars, $dowstamp, 'Enter Time');
-
         global $hermes, $conf;
 
-        $this->setButtons(_("Enter my time"));
+        if ($vars->isVarSet('id')) {
+            parent::TimeForm($vars, $dowstamp, _("Update Time"));
+            $this->setButtons(_("Update my time"));
+        } else {
+            parent::TimeForm($vars, $dowstamp, _("Enter Time"));
+            $this->setButtons(_("Enter my time"));
+        }
 
         list($clienttype, $clientparams) = $this->getClientType();
         if ($clienttype == 'enum') {
@@ -115,127 +119,28 @@
         $date_values = $this->getDOWValues();
         list($typetype, $typeparams) = $this->getJobTypeType();
 
-        $this->addHidden('', 'timestamp', 'int', true);
-        $this->addVariable(_("Date"), 'date[]', 'enum', true, false, null, array($date_values));
-
-        $cli = &$this->addVariable(_("Client"), 'client[]', $clienttype, true, false, null, $clientparams);
-        if (isset($action)) {
-            $cli->setAction($action);
-        }
-
-        $this->addVariable(_("Job Type"), 'type[]', $typetype, true, false, null, $typeparams);
-        $this->addVariable(_("Hours"), 'hours[]', 'number', true);
-
-        if ($conf['time']['choose_ifbillable']) {
-            $yesno = array(1 => _("Yes"), 0 => _("No"));
-            $this->addVariable(_("Billable?"), 'billable[]', 'enum', true, false, null, array($yesno));
-        }
-
-        $this->addVariable(_("Description"), 'description[]', 'longtext', true, false, null, array(1, 20));
-        $this->addVariable(_("Additional Notes"), 'note[]', 'longtext', false, false, null, array(1, 20));
-    }
-
-}
-
-/**
- * TimeDisplayForm Class.
- *
- * $Horde: hermes/lib/TimeForm.php,v 1.20 2003/09/28 08:20:37 mdjukic Exp $
- *
- * Copyright 2002-2003 Chuck Hagenbuch <chuck at horde.org>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
- *
- * @author Chuck Hagenbuch <chuck at horde.org>
- * @version $Revision: 1.20 $
- * @package hermes
- */
-class TimeDisplayForm extends TimeForm {
-
-    function TimeDisplayForm(&$vars, $dowstamp = null)
-    {
-        parent::TimeForm($vars, $dowstamp, 'timedisplayform');
-
-        global $conf;
-
-        list($clienttype, $clientparams) = $this->getClientType();
-        $date_values = $this->getDOWValues();
-        list($typetype, $typeparams) = $this->getJobTypeType();
-
-        $this->addHidden('', 'timestamp', 'int', true);
-        $this->addVariable(_("Date"), 'date[]', 'enum', true, false, null, array($date_values));
-        $this->addVariable(_("Client"), 'client[]', $clienttype, true, false, null, $clientparams);
-        $this->addVariable(_("Job Type"), 'type[]', $typetype, true, false, null, $typeparams);
-        $this->addVariable(_("Hours"), 'hours[]', 'number', true);
-
-        if ($conf['time']['choose_ifbillable']) {
-            $yesno = array(1 => _("Yes"), 0 => _("No"));
-            $this->addVariable(_("Billable?"), 'billable[]', 'enum', true, false, null, array($yesno));
-        }
-
-        $this->addVariable(_("Description"), 'description[]', 'longtext', true, false, null, array(1, 20));
-        $this->addVariable(_("Additional Notes"), 'note[]', 'longtext', true, false, null, array(1, 20));
-    }
-
-}
-
-/**
- * TimeEditForm Class.
- *
- * @author Chuck Hagenbuch <chuck at horde.org>
- * @version $Revision: 1.20 $
- * @package hermes
- */
-class TimeEditForm extends TimeForm {
-
-    function TimeEditForm(&$vars, $dowstamp = null)
-    {
-        parent::TimeForm($vars, $dowstamp, 'timeeditform');
-
-        global $hermes, $conf;
-
-        list($clienttype, $clientparams) = $this->getClientType();
-        if ($clienttype == 'enum') {
-            require_once HORDE_BASE . '/lib/Form/Action.php';
-            $map = array();
-            $clients = Hermes::listClients();
-            foreach ($clients as $id => $name) {
-                $info = $hermes->getClientSettings($id);
-                if (!is_a($info, 'PEAR_Error')) {
-                    $map[$id] = $info['enterdescription'] ? '' : _("See Attached Timesheet");
-                } else {
-                    $map[$id] = '';
-                }
-            }
-            $action = &Horde_Form_Action::factory('conditional_setvalue',
-                                                  array('map' => $map,
-                                                        'target' => 'description'));
+        if ($vars->isVarSet('id')) {
+            $this->addHidden('', 'id', 'int', true);
         }
 
-        $date_values = $this->getDOWValues();
-        list($typetype, $typeparams) = $this->getJobTypeType();
-
         $this->addHidden('', 'timestamp', 'int', true);
-        $this->addHidden('', 'id[]', 'int', true);
-        $this->addVariable(_("Delete?"), 'delete[]', 'boolean', false, false);
-        $this->addVariable(_("Date"), 'date[]', 'enum', true, false, null, array($date_values));
+        $this->addVariable(_("Date"), 'date', 'enum', true, false, null, array($date_values));
 
-        $cli = &$this->addVariable(_("Client"), 'client[]', $clienttype, true, false, null, $clientparams);
+        $cli = &$this->addVariable(_("Client"), 'client', $clienttype, true, false, null, $clientparams);
         if (isset($action)) {
             $cli->setAction($action);
         }
 
-        $this->addVariable(_("Job Type"), 'type[]', $typetype, true, false, null, $typeparams);
-        $this->addVariable(_("Hours"), 'hours[]', 'number', true);
+        $this->addVariable(_("Job Type"), 'type', $typetype, true, false, null, $typeparams);
+        $this->addVariable(_("Hours"), 'hours', 'number', true);
 
         if ($conf['time']['choose_ifbillable']) {
             $yesno = array(1 => _("Yes"), 0 => _("No"));
-            $this->addVariable(_("Billable?"), 'billable[]', 'enum', true, false, null, array($yesno));
+            $this->addVariable(_("Billable?"), 'billable', 'enum', true, false, null, array($yesno));
         }
 
-        $this->addVariable(_("Description"), 'description[]', 'longtext', true, false, null, array(1, 20));
-        $this->addVariable(_("Additional Notes"), 'note[]', 'longtext', false, false, null, array(1, 20));
+        $this->addVariable(_("Description"), 'description', 'longtext', true, false, null, array(1, 20));
+        $this->addVariable(_("Additional Notes"), 'note', 'longtext', false, false, null, array(1, 20));
     }
 
 }


More information about the hermes mailing list