/** * Populate this slice from a time entry form. * Assumes the values are POSTed. */ public function readForm() { // Required $this->_properties['date'] = Hermes::parseDate(Horde_Util::getPost('start_date')); $this->_properties['hours'] = Horde_Util::getPost('hours'); $this->_properties['description'] = Horde_Util::getPost('description'); $this->_properties['id'] = Horde_Util::getPost('id', 0); $this->_properties['billable'] = Horde_Util::getPost('billable') ? 1 : 0; // Optional $client = Horde_Util::getPost('client'); $this->_properties['client'] = empty($client) ? '' : $client; $this->_properties['type'] = Horde_Util::getPost('type'); $this->_properties['costobject'] = Horde_Util::getPost('costobject'); $this->_properties['note'] = Horde_Util::getPost('notes'); // Admin only if ($GLOBALS['registry']->isAdmin(array('permission' => 'hermes:timeadmin')) || $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) { $this->_properties['employee'] = Horde_Util::getPost('employee'); if (empty($this->_properties['employee'])) { $this->_properties['employee'] = $GLOBALS['registry']->getAuth(); } } else { $this->_properties['employee'] = $GLOBALS['registry']->getAuth(); } }