1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: class Whups_Form_Queue_StepTwo extends Horde_Form
12: {
13: public function __construct(&$vars, $title = '')
14: {
15: global $whups_driver;
16:
17: parent::__construct($vars, $title);
18:
19: $this->addHidden('', 'id', 'int', true, true);
20: $this->addHidden('', 'group', 'int', false, true);
21: $this->addHidden('', 'queue', 'int', true, true);
22: $this->addHidden('', 'newcomment', 'longtext', false, true);
23:
24: 25:
26:
27: $queue = $vars->get('queue');
28:
29: $info = $whups_driver->getQueue($queue);
30: if (!empty($info['versioned'])) {
31: $versions = $whups_driver->getVersions($vars->get('queue'));
32: if (count($versions) == 0) {
33: $vtype = 'invalid';
34: $v_params = array(_("This queue requires that you specify a version, but there are no versions associated with it. Until versions are created for this queue, you will not be able to create tickets."));
35: } else {
36: $vtype = 'enum';
37: $v_params = array($versions);
38: }
39: $this->addVariable(_("Queue Version"), 'version', $vtype, true, false, null, $v_params);
40: }
41:
42: $this->addVariable(_("Type"), 'type', 'enum', true, false, null, array($whups_driver->getTypes($queue)));
43: }
44:
45: }