1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: 16: 17:
18: class Whups_Form_Ticket_CreateStepFour extends Horde_Form
19: {
20: public function __construct(&$vars)
21: {
22: global $whups_driver, $conf;
23:
24: parent::__construct($vars, _("Create Ticket - Step 4"));
25:
26:
27: $this->addHidden('', 'deferred_attachment', 'text', false);
28:
29:
30: $mygroups = $GLOBALS['injector']
31: ->getInstance('Horde_Group')
32: ->listAll($conf['prefs']['assign_all_groups']
33: ? null
34: : $GLOBALS['registry']->getAuth());
35: asort($mygroups);
36:
37: $users = $whups_driver->getQueueUsers($vars->get('queue'));
38: $f_users = array();
39: foreach ($users as $user) {
40: $f_users['user:' . $user] = Whups::formatUser($user);
41: }
42:
43: $f_groups = array();
44: if (count($mygroups)) {
45: foreach ($mygroups as $id => $group) {
46: $f_groups['group:' . $id] = $group;
47: }
48: }
49:
50: if (count($f_users)) {
51: asort($f_users);
52: $owners = &$this->addVariable(_("Owners"), 'owners', 'multienum',
53: false, false, null, array($f_users));
54: }
55:
56: if (count($f_groups)) {
57: asort($f_groups);
58: $group_owners = &$this->addVariable(_("Group Owners"),
59: 'group_owners', 'multienum',
60: false, false, null,
61: array($f_groups));
62: }
63:
64: if (!count($f_users) && !count($f_groups)) {
65: $owner_params = array(
66: _("There are no users to which this ticket can be assigned."));
67: $this->addVariable(_("Owners"), 'owners', 'invalid', false, false,
68: null, $owner_params);
69: }
70: }
71:
72: }