__construct() public method

public __construct ( $vars, $title = '', $name = null )
Ejemplo n.º 1
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, 'editjobtypestep2form');
     $jobtype = $vars->get('jobtype');
     try {
         $info = $GLOBALS['injector']->getInstance('Hermes_Driver')->getJobTypeByID($jobtype);
     } catch (Exception $e) {
     }
     if (!$info) {
         $stype = 'invalid';
         $type_params = array(_("This is not a valid job type."));
     } else {
         $stype = 'text';
         $type_params = array();
     }
     $this->addHidden('', 'jobtype', 'int', true, true);
     $sname =& $this->addVariable(_("Job Type"), 'name', $stype, true, false, null, $type_params);
     if (!empty($info['name'])) {
         $sname->setDefault($info['name']);
     }
     $enab =& $this->addVariable(_("Enabled?"), 'enabled', 'boolean', false);
     $enab->setDefault($info['enabled']);
     $enab =& $this->addVariable(_("Billable?"), 'billable', 'boolean', false);
     $enab->setDefault($info['billable']);
     $enab =& $this->addVariable(_("Hourly Rate"), 'rate', 'number', false);
     $enab->setDefault($info['rate']);
 }
Ejemplo n.º 2
0
 public function __construct($vars)
 {
     parent::__construct($vars, _("Add Users"));
     $this->addHidden('', 'queue', 'int', true, true);
     global $conf, $whups_driver;
     $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create();
     if ($auth->hasCapability('list')) {
         $queue = $vars->get('queue');
         $current = $whups_driver->getQueueUsers($queue);
         try {
             $list = $auth->listUsers();
             sort($list);
             $users = array();
             foreach ($list as $user) {
                 if (!in_array($user, $current)) {
                     $users[$user] = $GLOBALS['registry']->convertUsername($user, false);
                 }
             }
             $this->addVariable(_("User"), 'user', 'multienum', true, false, null, array($users));
         } catch (Horde_Auth_Exception $e) {
             $this->addVariable(_("User"), 'user', 'invalid', true, false, null, array(sprintf(_("There was an error listing users: %s"), $e->getMessage())));
         }
     } else {
         $this->addVariable(_("User"), 'user', 'text', true);
     }
 }
Ejemplo n.º 3
0
 public function __construct($query, $vars)
 {
     parent::__construct($vars, _("Query Parameters"), 'Whups_Form_Query_Parameter');
     foreach ($query->parameters as $name) {
         $this->addVariable($name, $name, 'text', true);
     }
 }
Ejemplo n.º 4
0
 public function __construct(&$vars, $title = '')
 {
     global $conf;
     parent::__construct($vars, $title);
     $this->addHidden('', 'id', 'int', true, true);
     if (!$GLOBALS['registry']->getAuth()) {
         $this->addVariable(_("Your Email Address"), 'user_email', 'email', true);
         if (!empty($conf['guests']['captcha'])) {
             $this->addVariable(_("Spam protection"), 'captcha', 'figlet', true, null, null, array(Whups::getCAPTCHA(!$this->isSubmitted()), $conf['guests']['figlet_font']));
         }
     }
     $this->addVariable(_("Comment"), 'newcomment', 'longtext', false);
     $this->addVariable(_("Attachment"), 'newattachment', 'file', false);
     $this->addVariable(_("Watch this ticket"), 'add_watch', 'boolean', false);
     /* Group restrictions. */
     if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin')) || $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
         $groups = $GLOBALS['injector']->getInstance('Horde_Group');
         $mygroups = $groups->listGroups($GLOBALS['registry']->getAuth());
         if ($mygroups) {
             foreach (array_keys($mygroups) as $gid) {
                 $grouplist[$gid] = $groups->getName($gid, true);
             }
             asort($grouplist);
             $grouplist = array_merge(array(0 => _("This comment is visible to everyone")), $grouplist);
             $this->addVariable(_("Make this comment visible only to members of a group?"), 'group', 'enum', true, false, null, array($grouplist));
         }
     }
 }
Ejemplo n.º 5
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Add Priority"));
     $this->addHidden('', 'type', 'int', true, true);
     $this->addVariable(_("Priority Name"), 'name', 'text', true);
     $this->addVariable(_("Priority Description"), 'description', 'text', true);
 }
Ejemplo n.º 6
0
 public function __construct(&$vars, $title = '')
 {
     global $whups_driver;
     parent::__construct($vars, $title);
     $this->addHidden('', 'id', 'int', true, true);
     $this->addHidden('', 'group', 'int', false, true);
     $this->addHidden('', 'queue', 'int', true, true);
     $this->addHidden('', 'newcomment', 'longtext', false, true);
     /* Give the user an opportunity to check that type, version,
      * etc. are still valid. */
     $queue = $vars->get('queue');
     $info = $whups_driver->getQueue($queue);
     if (!empty($info['versioned'])) {
         $versions = $whups_driver->getVersions($vars->get('queue'));
         if (count($versions) == 0) {
             $vtype = 'invalid';
             $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."));
         } else {
             $vtype = 'enum';
             $v_params = array($versions);
         }
         $this->addVariable(_("Queue Version"), 'version', $vtype, true, false, null, $v_params);
     }
     $this->addVariable(_("Type"), 'type', 'enum', true, false, null, array($whups_driver->getTypes($queue)));
 }
Ejemplo n.º 7
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Add Type"));
     $this->appendButtons(_("Add Type"));
     $this->addVariable(_("Type Name"), 'name', 'text', true);
     $this->addVariable(_("Type Description"), 'description', 'text', true);
 }
Ejemplo n.º 8
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Add Form Reply"));
     $this->addHidden('', 'type', 'int', true, true);
     $this->addVariable(_("Form Reply Name"), 'reply_name', 'text', true);
     $this->addVariable(_("Form Reply Text"), 'reply_text', 'longtext', true);
 }
Ejemplo n.º 9
0
 public function __construct(&$vars, $title = '')
 {
     parent::__construct($vars, $title);
     $GLOBALS['page_output']->addScriptFile('form_helpers.js', 'horde');
     $this->addHidden('', 'smart_id', 'text', false);
     $this->addHidden('', 'actionID', 'text', false);
     $vars->set('actionID', 'search_tasks');
     $this->addVariable(_("Search Text:"), 'search_pattern', 'text', false);
     $v = $this->addVariable(_("Search In:"), 'search_in', 'set', false, false, false, array('values' => array('search_name' => _("Name"), 'search_desc' => _("Description"))));
     $v->setDefault(array('search_name', 'search_desc'));
     $this->addVariable(_("Tagged with:"), 'search_tags', 'Nag:NagTags', false);
     $v = $this->addVariable(_("Search:"), 'search_completed', 'radio', false, false, false, array('values' => array(Nag::VIEW_ALL => _("All"), Nag::VIEW_COMPLETE => _("Completed"), Nag::VIEW_INCOMPLETE => _("Incomplete"))));
     $v->setDefault(Nag::VIEW_ALL);
     $this->addVariable(_("Due date:"), 'due_date', 'Nag:NagSearchDue', false);
     // If editing a SmartList, allow deletion.
     if ($vars->get('smart_id')) {
         $this->addVariable(_("SmartList Name:"), 'smartlist_name', 'text', false);
         $this->setButtons(_("Save"), _("Reset"));
         $this->appendButtons(array(array('value' => _("Delete Smart List"), 'name' => 'deletebutton', 'class' => 'horde-delete')));
     } else {
         $this->addVariable(_("Save this search as a Smart List?"), 'save_smartlist', 'boolean', false);
         $sl_name = $this->addVariable(_("Smart List Name:"), 'smartlist_name', 'text', false);
         $save_action = new Horde_Form_Action_ConditionalEnable(array('target' => 'save_smartlist', 'enabled' => true, 'values' => 'on'));
         $sl_name->setAction($save_action);
         $this->setButtons(_("Search"), _("Reset"));
     }
 }
Ejemplo n.º 10
0
 public function __construct($vars, $calendar)
 {
     parent::__construct($vars, sprintf(_("Unsubscribe from %s"), $calendar['name']));
     $this->addHidden('', 'url', 'text', true);
     $this->addVariable(sprintf(_("Really unsubscribe from the calendar \"%s\" (%s)?"), htmlspecialchars($calendar['name']), htmlspecialchars($calendar['url'])), 'desc', 'description', false);
     $this->setButtons(array(array('class' => 'horde-delete', 'value' => _("Unsubscribe")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
Ejemplo n.º 11
0
 public function __construct($vars)
 {
     parent::__construct($vars, _("Delete Query?"), 'Whups_Form_Query_Delete');
     $yesno = array(array(0 => _("No"), 1 => _("Yes")));
     $this->addVariable(_("Really delete this query? This operation is not undoable."), 'yesno', 'enum', true, false, null, $yesno);
     $this->setButtons(array(array('class' => 'horde-delete', 'value' => _("Delete Query"))));
 }
Ejemplo n.º 12
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Insert Branch"));
     $branchtypes = array(Whups_Query::TYPE_AND => _("And"), Whups_Query::TYPE_OR => _("Or"), Whups_Query::TYPE_NOT => _("Not"));
     $this->addHidden(null, 'path', 'text', false, true);
     $this->addVariable(_("Branch Type"), 'type', 'enum', true, false, null, array($branchtypes));
 }
Ejemplo n.º 13
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, 'editclientstep2form');
     $client = $vars->get('client');
     try {
         $info = $GLOBALS['injector']->getInstance('Hermes_Driver')->getClientSettings($client);
     } catch (Hermes_Exception $e) {
     }
     if (!$info) {
         $stype = 'invalid';
         $type_params = array(_("This is not a valid client."));
     } else {
         $stype = 'text';
         $type_params = array();
     }
     $this->addHidden('', 'client', 'text', true, true);
     $name =& $this->addVariable(_("Client"), 'name', $stype, false, true, null, $type_params);
     $name->setDefault($info['name']);
     $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);
     if (!empty($info['enterdescription'])) {
         $enterdescription->setDefault($info['enterdescription']);
     }
     $exportid =& $this->addVariable(_("ID for this client when exporting data, if different from the name displayed above."), 'exportid', 'text', false);
     if (!empty($info['exportid'])) {
         $exportid->setDefault($info['exportid']);
     }
 }
Ejemplo n.º 14
0
 public function __construct(&$vars)
 {
     global $whups_driver, $conf;
     parent::__construct($vars, _("Create Ticket - Step 4"));
     /* Preserve previously uploaded attachments. */
     $this->addHidden('', 'deferred_attachment', 'text', false);
     /* Groups. */
     $mygroups = $GLOBALS['injector']->getInstance('Horde_Group')->listAll($conf['prefs']['assign_all_groups'] ? null : $GLOBALS['registry']->getAuth());
     asort($mygroups);
     $users = $whups_driver->getQueueUsers($vars->get('queue'));
     $f_users = array();
     foreach ($users as $user) {
         $f_users['user:'******'group:' . $id] = $group;
         }
     }
     if (count($f_users)) {
         asort($f_users);
         $owners = $this->addVariable(_("Owners"), 'owners', 'multienum', false, false, null, array($f_users));
     }
     if (count($f_groups)) {
         asort($f_groups);
         $group_owners = $this->addVariable(_("Group Owners"), 'group_owners', 'multienum', false, false, null, array($f_groups));
     }
     if (!count($f_users) && !count($f_groups)) {
         $owner_params = array(_("There are no users to which this ticket can be assigned."));
         $this->addVariable(_("Owners"), 'owners', 'invalid', false, false, null, $owner_params);
     }
 }
Ejemplo n.º 15
0
Archivo: List.php Proyecto: horde/horde
 public function __construct($vars, $title)
 {
     parent::__construct($vars, $title);
     $this->setButtons(_("Save"), true);
     try {
         $sam_driver = $GLOBALS['injector']->getInstance('Sam_Driver');
     } catch (Sam_Exception $e) {
         return;
     }
     foreach ($this->_attributes as $key => $attribute) {
         if (!$sam_driver->hasCapability($key)) {
             continue;
         }
         $var = $this->addVariable($attribute, $key, 'longtext', false, false, null, array('5', '40'));
         $var->setHelp($key);
         if (!$vars->exists($key)) {
             $vars->set($key, $sam_driver->getListOption($key));
         }
     }
     if ($sam_driver->hasCapability('global_defaults') && $GLOBALS['registry']->isAdmin()) {
         $this->addVariable('', '', 'spacer', false);
         $var = $this->addVariable(_("Make Settings Global"), 'global_defaults', 'boolean', false);
         $var->setHelp('global_defaults');
     }
 }
Ejemplo n.º 16
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Edit Attribute"));
     $attribute = $vars->get('attribute');
     $info = $GLOBALS['whups_driver']->getAttributeDesc($attribute);
     $this->addHidden('', 'type', 'int', true, true);
     $this->addHidden('', 'attribute', 'int', true, true);
     $pname =& $this->addVariable(_("Attribute Name"), 'attribute_name', 'text', true);
     $pname->setDefault($info['name']);
     $pdesc =& $this->addVariable(_("Attribute Description"), 'attribute_description', 'text', true);
     $pdesc->setDefault($info['description']);
     $preq =& $this->addVariable(_("Required Attribute?"), 'attribute_required', 'boolean', false);
     $preq->setDefault($info['required']);
     $ptype =& $this->addVariable(_("Attribute Type"), 'attribute_type', 'enum', true, false, null, array(Whups::fieldTypeNames()));
     $ptype->setAction(Horde_Form_Action::factory(array('whups', 'whups_reload'), array('formname' => 'whups_form_admin_editattributesteptwo_reload')));
     $ptype->setDefault($info['type']);
     $type = $vars->get('attribute_type');
     if (empty($type)) {
         $type = $info['type'];
     }
     foreach (Whups::fieldTypeParams($type) as $param => $param_info) {
         $pparam =& $this->addVariable($param_info['label'], 'attribute_params[' . $param . ']', $param_info['type'], false);
         if (isset($info['params'][$param])) {
             $pparam->setDefault($info['params'][$param]);
         }
     }
 }
Ejemplo n.º 17
0
 public function __construct($vars)
 {
     parent::__construct($vars, _("Create Address Book"));
     $this->addVariable(_("Name"), 'name', 'text', true);
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     $this->setButtons(array(_("Create")));
 }
Ejemplo n.º 18
0
 /**
  * Constructor
  *
  * @var params Horde_Variables  TODO
  */
 public function __construct(&$vars)
 {
     parent::__construct($vars, Horde_Core_Translation::t("Sign up for an account"));
     $this->setButtons(Horde_Core_Translation::t("Sign up"));
     $this->addHidden('', 'url', 'text', false);
     /* Use hooks get any extra fields required in signing up. */
     try {
         $extra = $GLOBALS['injector']->getInstance('Horde_Core_Hooks')->callHook('signup_getextra', 'horde');
     } catch (Horde_Exception_HookNotSet $e) {
     }
     if (!empty($extra)) {
         if (!isset($extra['user_name'])) {
             $this->addVariable(Horde_Core_Translation::t("Choose a username"), 'user_name', 'text', true);
         }
         if (!isset($extra['password'])) {
             $this->addVariable(Horde_Core_Translation::t("Choose a password"), 'password', 'passwordconfirm', true, false, Horde_Core_Translation::t("Type your password twice to confirm"));
         }
         foreach ($extra as $field_name => $field) {
             $readonly = isset($field['readonly']) ? $field['readonly'] : null;
             $desc = isset($field['desc']) ? $field['desc'] : null;
             $required = isset($field['required']) ? $field['required'] : false;
             $field_params = isset($field['params']) ? $field['params'] : array();
             $this->addVariable($field['label'], 'extra[' . $field_name . ']', $field['type'], $required, $readonly, $desc, $field_params);
         }
     } else {
         $this->addVariable(Horde_Core_Translation::t("Choose a username"), 'user_name', 'text', true);
         $this->addVariable(Horde_Core_Translation::t("Choose a password"), 'password', 'passwordconfirm', true, false, Horde_Core_Translation::t("Type your password twice to confirm"));
     }
 }
Ejemplo n.º 19
0
 public function __construct(&$vars)
 {
     global $whups_driver;
     parent::__construct($vars, _("Create Ticket - Step 2"));
     $types = $whups_driver->getTypes($vars->get('queue'));
     $info = $whups_driver->getQueue($vars->get('queue'));
     $type = $whups_driver->getDefaultType($vars->get('queue'));
     if (count($types) == 0) {
         $typetype = 'invalid';
         $type_params = array(_("There are no ticket types associated with this queue; until there are, you cannot create any tickets in this queue."));
     } else {
         $typetype = 'enum';
         $type_params = array($types);
         if (empty($type) || !isset($types[$type])) {
             $type_params[] = _("Choose:");
         }
     }
     $types =& $this->addVariable(_("Ticket Type"), 'type', $typetype, true, false, null, $type_params);
     $types->setDefault($type);
     if (!empty($info['versioned'])) {
         $versions = $whups_driver->getVersions($vars->get('queue'));
         if (count($versions) == 0) {
             $vtype = 'invalid';
             $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."));
         } else {
             $vtype = 'enum';
             $v_params = array($versions);
         }
         $this->addVariable(_("Queue Version"), 'version', $vtype, true, false, null, $v_params);
     } else {
         $types->setAction(Horde_Form_Action::factory('submit'));
     }
 }
Ejemplo n.º 20
0
 public function __construct($vars, $calendar)
 {
     global $conf, $injector, $registry;
     $this->_calendar = $calendar;
     $owner = $calendar->get('owner') == $registry->getAuth() || is_null($calendar->get('owner')) && $registry->isAdmin();
     parent::__construct($vars, $owner ? sprintf(_("Edit %s"), $calendar->get('name')) : $calendar->get('name'));
     $this->addHidden('', 'c', 'text', true);
     $this->addVariable(_("Name"), 'name', 'text', true);
     if (!$owner) {
         $v = $this->addVariable(_("Owner"), 'owner', 'text', false);
         $owner_name = $injector->getInstance('Horde_Core_Factory_Identity')->create($calendar->get('owner'))->getValue('fullname');
         if (trim($owner_name) == '') {
             $owner_name = $calendar->get('owner');
         }
         $v->setDefault($owner_name ? $owner_name : _("System"));
     }
     $this->addVariable(_("Color"), 'color', 'colorpicker', false);
     if ($registry->isAdmin()) {
         $this->addVariable(_("System Calendar"), 'system', 'boolean', false, false, _("System calendars don't have an owner. Only administrators can change the calendar settings and permissions."));
     }
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     $this->addVariable(_("Tags"), 'tags', 'Kronolith:KronolithTags', false);
     /* Display URL. */
     $url = Horde::url('month.php', true, -1)->add('display_cal', $calendar->getName());
     $this->addVariable(_("Display URL"), '', 'link', false, false, null, array(array('url' => $url, 'text' => $url, 'title' => _("Click or copy this URL to display this calendar"), 'target' => '_blank')));
     /* Subscription URLs. */
     $url = $registry->get('webroot', 'horde');
     if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') {
         $webdavUrl = $url . '/rpc/kronolith/';
         $caldavUrl = $url . '/rpc/calendars/';
         $accountUrl = $url . '/rpc/';
     } else {
         $webdavUrl = $url . '/rpc.php/kronolith/';
         $caldavUrl = $url . '/rpc.php/calendars/';
         $accountUrl = $url . '/rpc.php/';
     }
     try {
         $accountUrl = Horde::url($accountUrl, true, -1) . 'principals/' . $registry->convertUsername($registry->getAuth(), false) . '/';
         $caldavUrl = Horde::url($caldavUrl, true, -1) . $registry->convertUsername($registry->getAuth(), false) . '/' . $injector->getInstance('Horde_Dav_Storage')->getExternalCollectionId($calendar->getName(), 'calendar') . '/';
         $this->addVariable(_("CalDAV Subscription URL"), '', 'link', false, false, null, array(array('url' => $caldavUrl, 'text' => $caldavUrl, 'title' => _("Copy this URL to a CalDAV client to subscribe to this calendar"), 'target' => '_blank')));
         $this->addVariable(_("CalDAV Account URL"), '', 'link', false, false, null, array(array('url' => $accountUrl, 'text' => $accountUrl, 'title' => _("Copy this URL to a CalDAV client to subscribe to all your calendars"), 'target' => '_blank')));
     } catch (Horde_Exception $e) {
     }
     $webdavUrl = Horde::url($webdavUrl, true, -1) . ($calendar->get('owner') ? $registry->convertUsername($calendar->get('owner'), false) : '-system-') . '/' . $calendar->getName() . '.ics';
     $this->addVariable(_("WebDAV/ICS Subscription URL"), '', 'link', false, false, null, array(array('url' => $webdavUrl, 'text' => $webdavUrl, 'title' => _("Copy this URL to a WebDAV or ICS client to subscribe to this calendar"), 'target' => '_blank')));
     /* Feed URL. */
     $url = Kronolith::feedUrl($calendar->getName());
     $this->addVariable(_("Feed URL"), '', 'link', false, false, null, array(array('url' => $url, 'text' => $url, 'title' => _("Copy this URL to a news feed reader to subscribe to this calendar"), 'target' => '_blank')));
     /* Embed code. */
     $v = $this->addVariable(_("Embed code"), '', 'longtext', false, false, _("To embed this calendar in another website, use the code above."), array(4, 60));
     $v->setHelp('embed');
     $v->setDefault(Kronolith::embedCode($calendar->getName()));
     /* Permissions link. */
     if (empty($conf['share']['no_sharing']) && $owner) {
         $url = Horde::url('perms.php')->add('share', $calendar->getName());
         $this->addVariable('', '', 'link', false, false, null, array(array('url' => $url, 'text' => _("Change Permissions"), 'onclick' => Horde::popupJs($url, array('params' => array('urlencode' => true))) . 'return false;', 'class' => 'horde-button', 'target' => '_blank')));
     }
     $this->setButtons(array(_("Save"), array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
Ejemplo n.º 21
0
 public function __construct($vars, $calendar)
 {
     $this->_calendar = $calendar;
     parent::__construct($vars, sprintf(_("Delete %s"), $calendar->get('name')));
     $this->addHidden('', 'c', 'text', true);
     $this->addVariable(sprintf(_("Really delete the calendar \"%s\"? This cannot be undone and all data on this calendar will be permanently removed."), htmlspecialchars($this->_calendar->get('name'))), 'desc', 'description', false);
     $this->setButtons(array(array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
Ejemplo n.º 22
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Add State"));
     $this->addHidden('', 'type', 'int', true, true);
     $this->addVariable(_("State Name"), 'name', 'text', true);
     $this->addVariable(_("State Description"), 'description', 'text', true);
     $this->addVariable(_("State Category"), 'category', 'enum', false, false, null, array($GLOBALS['whups_driver']->getCategories()));
 }
Ejemplo n.º 23
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Select Client"));
     $action =& Horde_Form_Action::factory('submit');
     list($clienttype, $clientparams) = $this->getClientType();
     $cli =& $this->addVariable(_("Client"), 'client_id', $clienttype, true, false, null, $clientparams);
     $cli->setAction($action);
     $this->setButtons(_("Edit Deliverables"));
 }
Ejemplo n.º 24
0
 /**
  * Basic constructor for the SearchForm.
  *
  * @param  Horde_Variables $vars  The default variables to use.
  */
 public function __construct($vars)
 {
     parent::__construct($vars, _("Search The Inventory"));
     $this->appendButtons(_("Search"));
     $this->addHidden('', 'actionId', 'text', true);
     $this->addVariable(_("Search these properties"), 'location', 'multienum', true, false, null, array(array(Sesha::SEARCH_ID => _("Stock ID"), Sesha::SEARCH_NAME => _("Item Name"), Sesha::SEARCH_NOTE => _("Item Note"), Sesha::SEARCH_PROPERTY => _("Property Value"))));
     $this->addVariable(_("For this value"), 'criteria', 'text', true);
     $this->addVariable(_("Only exact matches"), 'exact', 'boolean', true, false);
 }
Ejemplo n.º 25
0
 public function __construct($vars)
 {
     parent::__construct($vars, $vars->get('edit') ? _("Edit Text Criterion") : _("Add Text Criterion"), 'Whups_Form_Query_TextCriterion');
     $this->addHidden('', 'edit', 'boolean', false);
     $this->addVariable(_("Text"), 'text', 'text', true);
     $this->addVariable(_("Match Operator"), 'operator', 'enum', true, false, null, array(Whups_Query::textOperators()));
     $this->addVariable(_("Search Summary"), 'summary', 'boolean', false);
     $this->addVariable(_("Search Comments"), 'comments', 'boolean', false);
 }
Ejemplo n.º 26
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Add Queue"));
     $this->appendButtons(_("Add Queue"));
     $this->addVariable(_("Queue Name"), 'name', 'text', true);
     $this->addVariable(_("Queue Description"), 'description', 'text', true);
     $this->addVariable(_("Queue Slug"), 'slug', 'text', false, false, sprintf(_("Slugs allows direct access to this queue's open tickets by visiting: %s. <br /> Slug names may contain only letters, numbers or the _ (underscore) character."), Horde::url('queue/slugname', true)), array('/^[a-zA-Z1-9_]*$/'));
     $this->addVariable(_("Queue Email"), 'email', 'email', false, false, _("This email address will be used when sending notifications for any queue tickets."));
 }
Ejemplo n.º 27
0
 public function __construct($vars)
 {
     parent::__construct($vars, _("Search"));
     $this->addHidden('', 'actionID', 'text', false);
     $this->addVariable(_("For"), 'search_pattern', 'text', false);
     $v = $this->addVariable(_("In"), 'search_type', 'radio', false, false, null, array(array('desc' => _("Title"), 'body' => _("Body"), 'tags' => _("Tags"))));
     $v->setDefault('desc');
     $this->setButtons(_("Search"));
 }
Ejemplo n.º 28
0
 public function __construct(&$vars, &$object, $params = array())
 {
     $this->koward =& Koward::singleton();
     $this->object =& $object;
     parent::__construct($vars);
     $type = false;
     $this->setButtons(_("Search"));
     $this->_addFields($this->koward->search);
 }
Ejemplo n.º 29
0
 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Save Query"), 'Whups_Form_Query_ChooseNameForSave');
     $this->setButtons(_("Save"));
     $v = $this->addVariable(_("Query Name"), 'name', 'text', true);
     $v->setDefault($GLOBALS['whups_query']->name);
     $v = $this->addVariable(_("Query Slug"), 'slug', 'text', false);
     $v->setDefault($GLOBALS['whups_query']->slug);
 }
Ejemplo n.º 30
0
 function __construct(&$vars)
 {
     $menu = $vars->get('$menu');
     $account = $vars->get('account');
     $title = _("Delete Menu %s - Account: %s");
     $title = sprintf($title, $menu, $GLOBALS['session']->get('shout', 'curaccount_name'));
     parent::__construct($vars, $title);
     $this->setButtons(array(_("Delete"), _("Cancel")));
 }