1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13:
14: class Hermes_Form_Admin_EditClientStepTwo extends Horde_Form
15: {
16:
17: public function __construct(&$vars)
18: {
19: parent::__construct($vars, 'editclientstep2form');
20:
21: $client = $vars->get('client');
22: try {
23: $info = $GLOBALS['injector']
24: ->getInstance('Hermes_Driver')
25: ->getClientSettings($client);
26: } catch (Hermes_Exception $e) {}
27: if (!$info) {
28: $stype = 'invalid';
29: $type_params = array(_("This is not a valid client."));
30: } else {
31: $stype = 'text';
32: $type_params = array();
33: }
34:
35: $this->addHidden('', 'client', 'text', true, true);
36: $name = &$this->addVariable(_("Client"), 'name', $stype, false, true, null, $type_params);
37: $name->setDefault($info['name']);
38:
39: $enterdescription = &$this->addVariable(sprintf(_("Should users enter descriptions of their timeslices for this client? If not, the description will automatically be \"%s\"."), _("See Attached Timesheet")), 'enterdescription', 'boolean', true);
40: if (!empty($info['enterdescription'])) {
41: $enterdescription->setDefault($info['enterdescription']);
42: }
43:
44: $exportid = &$this->addVariable(_("ID for this client when exporting data, if different from the name displayed above."), 'exportid', 'text', false);
45: if (!empty($info['exportid'])) {
46: $exportid->setDefault($info['exportid']);
47: }
48: }
49:
50: }
51: