• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Whups类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Whups的典型用法代码示例。如果您正苦于以下问题:PHP Whups类的具体用法?PHP Whups怎么用?PHP Whups使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Whups类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _title

 /**
  */
 protected function _title()
 {
     if (($query = $this->_getQuery()) && $query->name) {
         return Horde::link(Whups::urlFor('query', empty($query->slug) ? array('id' => $query->id) : array('slug' => $query->slug))) . htmlspecialchars($query->name) . '</a>';
     }
     return $this->getName();
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:9,代码来源:Query.php


示例2: __construct

 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]);
         }
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:27,代码来源:EditAttributeStepTwo.php


示例3: validate

 public function validate(&$vars)
 {
     if (Whups::hasPermission($this->_queue, 'queue', Horde_Perms::DELETE)) {
         $this->_warn->setDefault('<span class="horde-form-error">' . _("Permission Denied.") . '</span>');
     }
     return parent::validate($vars);
 }
开发者ID:horde,项目名称:horde,代码行数:7,代码来源:Delete.php


示例4: validate

 public function validate(&$vars)
 {
     if (!Whups::hasPermission($this->_queue, 'queue', Horde_Perms::DELETE)) {
         $this->setError('yesno', _("Permission Denied."));
     }
     return parent::validate($vars);
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:7,代码来源:Delete.php


示例5: _table

 /**
  * Generates a table with ticket information.
  *
  * @param array $tickets  A list of tickets.
  * @param string $tableClass  The DOM ID to use for the generated table.
  *
  * @return string  Table HTML code.
  */
 protected function _table($tickets, $tableId = null)
 {
     if (!$tableId) {
         $tableId = get_class($this);
     }
     $columns = isset($this->_params['columns']) ? $this->_params['columns'] : null;
     $sortby = $GLOBALS['prefs']->getValue('sortby');
     $sortdirclass = ' class="' . ($GLOBALS['prefs']->getValue('sortdir') ? 'sortup' : 'sortdown') . '"';
     $html = '<thead><tr><th' . ($sortby == 'id' ? $sortdirclass : '') . '>' . _("Id") . '</th>';
     foreach (Whups::getSearchResultColumns('block', $this->_params['columns']) as $name => $column) {
         if ($column == 'id') {
             continue;
         }
         $html .= '<th' . ($sortby == $column ? $sortdirclass : '') . '>' . $name . '</th>';
     }
     $html .= '</tr></thead><tbody>';
     Whups::sortTickets($tickets);
     foreach ($tickets as $ticket) {
         foreach (Whups::getSearchResultColumns('block', $columns) as $column) {
             $thevalue = Whups::formatColumn($ticket, $column);
             $sortval = '';
             if ($column == 'timestamp' || $column == 'due' || substr($column, 0, 5) == 'date_') {
                 $sortval = strlen($ticket[$column]) ? ' sortval="' . $ticket[$column] . '"' : '';
             }
             $html .= '<td' . $sortval . '>' . (strlen($thevalue) ? $thevalue : '&nbsp;') . '</td>';
         }
         $html .= '</tr>';
     }
     $GLOBALS['page_output']->addScriptFile('tables.js', 'horde');
     return '<table id="' . htmlspecialchars($tableId) . '" class="horde-table sortable" style="width:100%">' . $html . '</tbody></table>';
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:39,代码来源:Tickets.php


示例6: _content

 /**
  */
 protected function _content()
 {
     global $whups_driver;
     $queues = Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::READ);
     $qsummary = $whups_driver->getQueueSummary(array_keys($queues));
     if (!$qsummary) {
         return '<p class="horde-content"><em>' . _("There are no open tickets.") . '</em></p>';
     }
     $summary = $types = array();
     foreach ($qsummary as $queue) {
         $types[$queue['type']] = $queue['type'];
         if (!isset($summary[$queue['id']])) {
             $summary[$queue['id']] = $queue;
         }
         $summary[$queue['id']][$queue['type']] = $queue['open_tickets'];
     }
     $html = '<thead><tr>';
     $sortby = 'queue_name';
     foreach (array_merge(array('queue_name' => _("Queue")), $types) as $column => $name) {
         $html .= '<th' . ($sortby == $column ? ' class="sortdown"' : '') . '>' . $name . '</th>';
     }
     $html .= '</tr></thead><tbody>';
     foreach ($summary as $queue) {
         $html .= '<tr><td>' . Horde::link(Whups::urlFor('queue', $queue, true), $queue['description']) . htmlspecialchars($queue['name']) . '</a></td>';
         foreach ($types as $type) {
             $html .= '<td>' . (isset($queue[$type]) ? $queue[$type] : '&nbsp;') . '</td>';
         }
         $html .= '</tr>';
     }
     $GLOBALS['page_output']->addScriptFile('tables.js', 'horde');
     return '<table id="whups_block_queuesummary" class="horde-table sortable" style="width:100%">' . $html . '</tbody></table>';
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:34,代码来源:Queuesummary.php


示例7: __construct

 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:' . $user] = Whups::formatUser($user);
     }
     $f_groups = array();
     if (count($mygroups)) {
         foreach ($mygroups as $id => $group) {
             $f_groups['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);
     }
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:33,代码来源:CreateStepFour.php


示例8: _getAddressbookSearchParams

 /**
  */
 protected function _getAddressbookSearchParams()
 {
     $params = Whups::getAddressbookSearchParams();
     $ob = new stdClass();
     $ob->fields = $params['fields'];
     $ob->sources = $params['sources'];
     return $ob;
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:10,代码来源:ContactAutoCompleter.php


示例9: _content

 /**
  */
 protected function _content()
 {
     $queue_ids = array_keys(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(), 'queue', Horde_Perms::READ));
     $info = array('owner' => Whups::getOwnerCriteria($GLOBALS['registry']->getAuth()), 'nores' => true, 'queue' => $queue_ids);
     $assigned = $GLOBALS['whups_driver']->getTicketsByProperties($info);
     if (!$assigned) {
         return '<p class="horde-content"><em>' . _("No tickets are assigned to you.") . '</em></p>';
     }
     return $this->_table($assigned);
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:12,代码来源:Mytickets.php


示例10: _content

 /**
  */
 protected function _content()
 {
     global $whups_driver, $prefs;
     $queue_ids = array_keys(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(), 'queue', Horde_Perms::READ));
     $info = array('requester' => $GLOBALS['registry']->getAuth(), 'notowner' => 'user:' . $GLOBALS['registry']->getAuth(), 'nores' => true, 'queue' => $queue_ids);
     $requests = $GLOBALS['whups_driver']->getTicketsByProperties($info);
     if (!$requests) {
         return '<p class="horde-content"><em>' . _("You have no open requests.") . '</em></p>';
     }
     return $this->_table($requests);
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:13,代码来源:Myrequests.php


示例11: validate

 public function validate(&$vars, $canAutoFill = false)
 {
     global $conf;
     if (!parent::validate($vars, $canAutoFill)) {
         if (!$GLOBALS['registry']->getAuth() && !empty($conf['guests']['captcha'])) {
             $vars->remove('captcha');
             $this->removeVariable($varname = 'captcha');
             $this->insertVariableBefore('newcomment', _("Spam protection"), 'captcha', 'figlet', true, null, null, array(Whups::getCAPTCHA(true), $conf['guests']['figlet_font']));
         }
         return false;
     }
     return true;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:13,代码来源:AddComment.php


示例12: _getQueue

 /**
  */
 private function _getQueue()
 {
     if (empty($this->_params['queue'])) {
         return false;
     }
     if (!Whups::permissionsFilter(array($this->_params['queue'] => true), 'queue', Horde_Perms::READ)) {
         return false;
     }
     try {
         return $GLOBALS['whups_driver']->getQueue($this->_params['queue']);
     } catch (Whups_Exception $e) {
         return false;
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:16,代码来源:Queuecontents.php


示例13: __construct

 public function __construct(&$vars)
 {
     global $whups_driver, $registry;
     parent::__construct($vars);
     $queue = $vars->get('queue');
     try {
         $info = $whups_driver->getQueue($queue);
     } catch (Whups_Exception $e) {
         $this->addVariable(_("Invalid Queue"), 'invalid', 'invalid', true, false, null, array(_("Invalid Queue")));
         return;
     }
     $this->setTitle(sprintf(_("Edit %s"), $info['name']));
     $this->addHidden('', 'queue', 'int', true, true);
     $mname = $this->addVariable(_("Queue Name"), 'name', 'text', true, $info['readonly']);
     $mname->setDefault($info['name']);
     $mdesc = $this->addVariable(_("Queue Description"), 'description', 'text', true, $info['readonly']);
     $mdesc->setDefault($info['description']);
     $mslug = $this->addVariable(_("Queue Slug"), 'slug', 'text', false, $info['readonly']);
     $mslug->setDefault($info['slug']);
     $memail = $this->addVariable(_("Queue Email"), 'email', 'email', false, $info['readonly']);
     $memail->setDefault($info['email']);
     $types = $whups_driver->getAllTypes();
     $mtypes = $this->addVariable(_("Ticket Types associated with this Queue"), 'types', 'set', true, false, null, array($types));
     $mtypes->setDefault(array_keys($whups_driver->getTypes($queue)));
     $mdefaults = $this->addVariable(_("Default Ticket Type"), 'default', 'enum', false, false, null, array($types));
     $mdefaults->setDefault($whups_driver->getDefaultType($queue));
     /* Versioned and version link. */
     $mversioned = $this->addVariable(_("Keep a set of versions for this queue?"), 'versioned', 'boolean', false, $info['readonly']);
     $mversioned->setDefault($info['versioned']);
     if ($registry->hasMethod('tickets/listVersions') == $registry->getApp()) {
         $versionlink = array('text' => _("Edit the versions for this queue"), 'url' => Horde::url('admin/?formname=whups_form_admin_editversionstepone')->add('queue', $queue));
         $this->addVariable('', 'link', 'link', false, true, null, array($versionlink));
     }
     /* Usertype and usertype link. */
     $users = $whups_driver->getQueueUsers($queue);
     $f_users = array();
     foreach ($users as $user) {
         $f_users[$user] = Whups::formatUser($user);
     }
     asort($f_users);
     $musers = $this->addVariable(_("Users responsible for this Queue"), 'users', 'set', false, true, null, array($f_users));
     $musers->setDefault($whups_driver->getQueueUsers($queue));
     $userlink = array('text' => _("Edit the users responsible for this queue"), 'url' => Horde::url('admin/?formname=edituserform')->add('queue', $queue));
     $this->addVariable('', 'link', 'link', false, true, null, array($userlink));
     /* Permissions link. */
     if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin', 'permlevel' => Horde_Perms::EDIT))) {
         $permslink = array('text' => _("Edit the permissions on this queue"), 'url' => Horde::url('admin/perms/edit.php', false, array('app' => 'horde'))->add(array('category' => 'whups:queues:' . $queue, 'autocreate' => '1')));
         $this->addVariable('', 'link', 'link', false, true, null, array($permslink));
     }
 }
开发者ID:horde,项目名称:horde,代码行数:50,代码来源:EditQueueStepTwo.php


示例14: __construct

 /**
  * Constructor.
  */
 public function __construct($vars, $title = '')
 {
     global $whups_driver;
     parent::__construct($vars, $title);
     $this->addHidden('', 'tickets', 'text', true, true);
     $this->addHidden('', 'url', 'text', true, true);
     $tickets = array();
     foreach ((array) $vars->get('ticket') as $id) {
         $ticket = $whups_driver->getTicketDetails($id, false);
         if (Whups::hasPermission($ticket['queue'], 'queue', Horde_Perms::DELETE)) {
             $this->_tickets[] = (int) $id;
             $this->addVariable(_("Ticket") . ' ' . $id, 'summary' . $id, 'text', false, true)->setDefault($ticket['summary']);
         }
     }
     $this->addVariable('', 'warn', 'html', false)->setDefault('<span class="horde-form-error">' . _("Really delete these tickets? They will NOT be archived, and will be gone forever.") . '</span>');
     $this->setButtons(array(array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
开发者ID:horde,项目名称:horde,代码行数:20,代码来源:DeleteMultiple.php


示例15: __construct

 public function __construct(&$vars)
 {
     parent::__construct($vars, _("Add Attribute"));
     $this->addHidden('', 'type', 'int', true, true);
     $this->addVariable(_("Attribute Name"), 'attribute_name', 'text', true);
     $this->addVariable(_("Attribute Description"), 'attribute_description', 'text', true);
     $this->addVariable(_("Required Attribute?"), 'attribute_required', 'boolean', false);
     $v =& $this->addVariable(_("Attribute Type"), 'attribute_type', 'enum', true, false, null, array(Whups::fieldTypeNames()));
     $v->setDefault('text');
     $v->setAction(Horde_Form_Action::factory(array('whups', 'whups_reload'), array('formname' => 'whups_form_admin_addattribute_reload')));
     $type = $vars->get('attribute_type');
     if (empty($type)) {
         $type = 'text';
     }
     foreach (Whups::fieldTypeParams($type) as $param => $info) {
         $this->addVariable($info['label'], 'attribute_params[' . $param . ']', $info['type'], false);
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:18,代码来源:AddAttribute.php


示例16: run

 public function run()
 {
     $this->_runtime = time();
     // See if we need to include the reminders config file.
     if (filemtime(WHUPS_BASE . '/config/reminders.php') > $this->_filestamp) {
         $this->_filestamp = $this->_runtime;
         $this->_reminders = Horde::loadConfiguration('reminders.php', 'reminders', 'whups');
     }
     foreach ($this->_reminders as $reminder) {
         $ds = new Horde_Scheduler_Cron_Date($reminder['frequency']);
         if ($ds->scheduledAt($this->_runtime)) {
             if (!empty($reminder['server_name'])) {
                 $GLOBALS['conf']['server']['name'] = $reminder['server_name'];
             }
             $vars = new Horde_Variables($reminder);
             Whups::sendReminders($vars);
         }
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:19,代码来源:Scheduler.php


示例17: __construct

 public function __construct(&$vars)
 {
     global $whups_driver;
     parent::__construct($vars, _("Send Reminders"));
     $queues = Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::EDIT);
     if (count($queues)) {
         $modtype = 'enum';
         $type_params = array($queues);
     } else {
         $modtype = 'invalid';
         $type_params = array(_("There are no queues available."));
     }
     $this->addVariable(_("Send only for this list of ticket ids"), 'id', 'intlist', false);
     $this->addVariable(_("For tickets from these queues"), 'queue', $modtype, false, false, null, $type_params);
     $cats = $whups_driver->getCategories();
     unset($cats['resolved']);
     $categories = $this->addVariable(_("For tickets which are"), 'category', 'multienum', false, false, null, array($cats, 3));
     $categories->setDefault(array('assigned'));
     $this->addVariable(_("Unassigned tickets"), 'unassigned', 'email', false, false, _("If you select any tickets that do not have an owner, who should we send email to?"));
 }
开发者ID:horde,项目名称:horde,代码行数:20,代码来源:SendReminder.php


示例18: __construct

 public function __construct(&$vars)
 {
     global $whups_driver, $registry;
     if ($registry->hasMethod('tickets/listQueues') == $registry->getApp()) {
         parent::__construct($vars, _("Edit or Delete Queues"));
         $this->setButtons(array(_("Edit Queue"), array('class' => 'horde-delete', 'value' => _("Delete Queue"))));
     } else {
         parent::__construct($vars, _("Edit Queues"));
         $this->setButtons(array(_("Edit Queue")));
     }
     $queues = Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::EDIT);
     if ($queues) {
         $modtype = 'enum';
         $type_params = array($queues);
     } else {
         $modtype = 'invalid';
         $type_params = array(_("There are no queues to edit"));
     }
     $this->addVariable(_("Queue Name"), 'queue', $modtype, true, false, null, $type_params);
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:20,代码来源:EditQueueStepOne.php


示例19: __construct

 public function __construct(&$vars, $title = '')
 {
     parent::__construct($vars, $title);
     $this->addHidden('', 'id', 'int', true, true);
     /* Queues. */
     $this->addVariable(_("New Queue"), 'queue', 'enum', true, false, null, array(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(), 'queue', Horde_Perms::EDIT)));
     $this->addVariable(_("Comment"), 'newcomment', 'longtext', false);
     /* Group restrictions. */
     if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin', 'permlevel' => Horde_Perms::EDIT)) || $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 => _("Any Group")), $grouplist);
             $this->addVariable(_("Viewable only by members of"), 'group', 'enum', true, false, null, array($grouplist));
         }
     }
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:21,代码来源:StepOne.php


示例20: __construct

 public function __construct(&$vars)
 {
     global $whups_driver;
     $this->appendButtons(array(array('class' => 'horde-delete', 'value' => _("Remove User"))));
     parent::__construct($vars, _("Responsible Users"));
     $queue = $vars->get('queue');
     $users = $whups_driver->getQueueUsers($queue);
     $f_users = array();
     foreach ($users as $user) {
         $f_users[$user] = Whups::formatUser($user);
     }
     if ($f_users) {
         asort($f_users);
         $usertype = 'enum';
         $type_params = array($f_users);
     } else {
         $usertype = 'invalid';
         $type_params = array(_("There are no users responsible for this queue."));
     }
     $this->addHidden('', 'queue', 'int', true, true);
     $this->addVariable(_("Users responsible for this queue"), 'user', $usertype, true, false, null, $type_params);
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:22,代码来源:EditUser.php



注:本文中的Whups类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WideImage类代码示例发布时间:2022-05-23
下一篇:
PHP WhatsProt类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap