1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13:
14: class Hermes_Form_Admin_EditJobTypeStepTwo extends Horde_Form
15: {
16: public function __construct(&$vars)
17: {
18: parent::__construct($vars, 'editjobtypestep2form');
19:
20: $jobtype = $vars->get('jobtype');
21: try {
22: $info = $GLOBALS['injector']
23: ->getInstance('Hermes_Driver')
24: ->getJobTypeByID($jobtype);
25: } catch (Exception $e) {}
26:
27: if (!$info) {
28: $stype = 'invalid';
29: $type_params = array(_("This is not a valid job type."));
30: } else {
31: $stype = 'text';
32: $type_params = array();
33: }
34:
35: $this->addHidden('', 'jobtype', 'int', true, true);
36:
37: $sname = &$this->addVariable(_("Job Type"), 'name', $stype, true, false, null, $type_params);
38: if (!empty($info['name'])) {
39: $sname->setDefault($info['name']);
40: }
41:
42: $enab = &$this->addVariable(_("Enabled?"), 'enabled', 'boolean', false);
43: $enab->setDefault($info['enabled']);
44: $enab = &$this->addVariable(_("Billable?"), 'billable', 'boolean', false);
45: $enab->setDefault($info['billable']);
46: $enab = &$this->addVariable(_("Hourly Rate"), 'rate', 'number', false);
47: $enab->setDefault($info['rate']);
48: }
49:
50: }