本文整理汇总了PHP中Operator::getAccountCodes方法的典型用法代码示例。如果您正苦于以下问题:PHP Operator::getAccountCodes方法的具体用法?PHP Operator::getAccountCodes怎么用?PHP Operator::getAccountCodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operator
的用法示例。
在下文中一共展示了Operator::getAccountCodes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perms
/**
*/
public function perms()
{
$perms = array('accountcodes' => array('title' => _("Account Codes")));
$accountcodes = Operator::getAccountCodes();
foreach ($accountcodes as $accountcode) {
$perms['accountcodes:' . $accountcode] = array('title' => $accountcode);
}
return $perms;
}
示例2: _operator_perms
function _operator_perms()
{
static $perms = array();
if (!empty($perms)) {
return $perms;
}
@define('OPERATOR_BASE', __DIR__ . '/..');
require_once OPERATOR_BASE . '/lib/base.php';
$perms['tree']['operator']['accountcodes'] = false;
$perms['title']['operator:accountcodes'] = _("Account Codes");
$accountcodes = Operator::getAccountCodes();
foreach ($accountcodes as $accountcode) {
$perms['tree']['operator']['accountcodes'][$accountcode] = false;
$perms['title']['operator:accountcodes:' . $accountcode] = $accountcode;
}
return $perms;
}
示例3: __construct
public function __construct($title, &$vars)
{
parent::__construct($vars, $title);
// FIXME: Generate a list of clients from Turba?
//$clients =
$now = time();
if (!$vars->exists('startdate')) {
// Default to the beginning of the previous calendar month
$startdate = array('day' => 1, 'month' => date('n', $now), 'year' => date('Y', $now), 'hour' => 0, 'minute' => 0, 'second' => 0);
$vars->set('startdate', $startdate);
}
if (!$vars->exists('enddate')) {
// Default to the end of the previous calendar month
$month = date('n', $now);
$year = date('Y', $now);
$lastday = Horde_Date_Utils::daysInMonth($month, $year);
$enddate = array('day' => $lastday, 'month' => $month, 'year' => $year, 'hour' => 23, 'minute' => 59, 'second' => 59);
$vars->set('enddate', $enddate);
}
try {
$accountcodes = Operator::getAccountCodes(true);
} catch (Exception $e) {
$GLOBALS['notification']->push($e);
$accountcodes = array();
}
// Parameters for Horde_Form_datetime
$start_year = date('Y', $now) - 5;
$end_year = '';
$picker = true;
$format_in = null;
$format_out = '%x';
$show_seconds = true;
$params = array($start_year, $end_year, $picker, $format_in, $format_out, $show_seconds);
$this->addVariable(_("Account Code"), 'accountcode', 'enum', false, false, null, array($accountcodes));
$this->addVariable(_("Destination Context"), 'dcontext', 'text', false, false, _("An empty destination context will match all destination contexts."));
$this->addVariable(_("Start Date & Time"), 'startdate', 'datetime', true, false, null, $params);
$this->addVariable(_("End Date & Time"), 'enddate', 'datetime', true, false, null, $params);
}