1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13:
14: class Whups_Form_Queue_StepOne extends Horde_Form
15: {
16: public function __construct(&$vars, $title = '')
17: {
18: parent::__construct($vars, $title);
19:
20: $this->addHidden('', 'id', 'int', true, true);
21:
22:
23: $this->addVariable(
24: _("New Queue"), 'queue', 'enum', true, false, null,
25: array(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(),
26: 'queue', Horde_Perms::EDIT)));
27: $this->addVariable(_("Comment"), 'newcomment', 'longtext', false);
28:
29:
30: if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin', 'permlevel' => Horde_Perms::EDIT)) ||
31: $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
32: $groups = $GLOBALS['injector']->getInstance('Horde_Group');
33: $mygroups = $groups->listGroups($GLOBALS['registry']->getAuth());
34: if ($mygroups) {
35: foreach (array_keys($mygroups) as $gid) {
36: $grouplist[$gid] = $groups->getName($gid, true);
37: }
38: asort($grouplist);
39: $grouplist = array_merge(array(0 => _("Any Group")),
40: $grouplist);
41: $this->addVariable(_("Viewable only by members of"), 'group',
42: 'enum', true, false, null,
43: array($grouplist));
44: }
45: }
46: }
47:
48: }