当前位置: 首页>>代码示例>>PHP>>正文


PHP FormHandler::checkRights方法代码示例

本文整理汇总了PHP中FormHandler::checkRights方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHandler::checkRights方法的具体用法?PHP FormHandler::checkRights怎么用?PHP FormHandler::checkRights使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormHandler的用法示例。


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

示例1: SelectionForm

require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.RevRef.inc.php";
require_once "a2blib/Form/Class.TextSearchField.inc.php";
require_once "a2blib/Form/Class.ClauseField.inc.php";
require_once "a2blib/Form/Class.SelectionForm.inc.php";
$menu_section = 'menu_ratecard';
HelpElem::DoHelp(gettext("Sell rates are the prices the end customers will pay us."));
$SEL_Form = new SelectionForm();
$SEL_Form->init();
$SEL_Form->model[] = new TextSearchField(_("Destination"), 'destination');
$SEL_Form->model[] = new SqlRefField(_("Plan"), 'idrp', 'cc_retailplan', 'id', 'name', _("Retail plan"));
end($SEL_Form->model)->does_add = false;
$HD_Form = new FormHandler('cc_sellrate', _("Sell rates"), _("Sell rate"));
$HD_Form->checkRights(ACX_RATECARD);
$HD_Form->init();
$HD_Form->views['tooltip'] = new DetailsMcView();
$PAGE_ELEMS[] =& $SEL_Form;
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$SEL_Form->enable($HD_Form->getAction() == 'list');
$clauses = $SEL_Form->buildClauses();
foreach ($clauses as $cla) {
    $HD_Form->model[] = new FreeClauseField($cla);
}
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Destination"), 'destination');
$HD_Form->model[] = new SqlRefField(_("Plan"), 'idrp', 'cc_retailplan', 'id', 'name', _("Retail plan"));
$HD_Form->model[] = new FloatField(_("Rate"), 'rateinitial', _("End rate, per minute"));
$HD_Form->model[] = new IntField(_("Init Block"), 'initblock', _("Set the minimum duration charged to the customer. (i.e. 30 secs)"));
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_sellrate.php

示例2: TextSearchField

$SEL_Form->search_exprs['date_from'] = '>=';
$SEL_Form->search_exprs['date_to'] = '<=';
$SEL_Form->model[] = new TextSearchField(_("Destination"), 'destination');
$SEL_Form->model[] = new TextSearchField(_("Called number"), 'calledstation');
$SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Agent"), 'agid', 'cc_agent', 'id', 'name'));
end($SEL_Form->model)->fieldexpr = '(SELECT agentid FROM cc_card,cc_card_group
		WHERE cc_card.grp = cc_card_group.id AND cc_card.id = cc_call_v.cardid)';
end($SEL_Form->model)->combofield = "name || ' ('|| login || ')'";
/*$SEL_Form->model[] = new SqlRefField(_("Plan"),'idrp','cc_retailplan','id','name', _("Retail plan"));
	end($SEL_Form->model)->does_add = false;*/
$SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Server"), 'srvid', 'cc_a2b_server', 'id', 'host'));
$SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Trunk"), 'trunk', 'cc_trunk', 'id', 'trunkcode', _("Trunk used for the call")));
$PAGE_ELEMS[] =& $SEL_Form;
// HelpElem::DoHelp(gettext("*-*"),'vcard.png');
$HD_Form = new FormHandler('cc_call_v', _("Calls"), _("Call"));
$HD_Form->checkRights(ACX_CALL_REPORT);
$HD_Form->default_order = 'starttime';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$SEL_Form->enable($HD_Form->getAction() == 'list');
$HD_Form->model[] = DontList(new PKeyFieldTxt(_("Session ID"), 'sessionid'));
$HD_Form->model[] = DontList(new PKeyFieldTxt(_("Unique ID"), 'uniqueid'));
$HD_Form->model[] = DontList(new PKeyField(_("Card ID"), 'cardid'));
// nasipaddress  | text                        |
// qval          | double precision            |
$SEL_Form->appendClauses($HD_Form);
$HD_Form->model[] = new DateTimeFieldDH(_("Start Time"), 'starttime');
$HD_Form->model[] = new TextField(_("Mode"), 'cmode');
$HD_Form->model[] = DontList(new DateTimeField(_("Stop Time"), 'stoptime'));
$HD_Form->model[] = new SqlRefFieldN(_("Card"), 'cardid', 'cc_card', 'id', 'username');
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_call.php

示例3: AgentSessionInvoice

/** One function that sets up page elems for an agent-session invoice */
function AgentSessionInvoice($sess_row, $rights, $booth_page)
{
    global $PAGE_ELEMS;
    global $FG_DEBUG;
    $dbhandle = A2Billing::DBHandle();
    $HD_Form = new FormHandler('cc_session_invoice', _("Transactions"), _("Transaction"));
    $HD_Form->checkRights($rights);
    $HD_Form->init(null, false);
    $HD_Form->views['list'] = new ListSumView();
    $HD_Form->views['pay'] = $HD_Form->views['true'] = $HD_Form->views['false'] = new IdleView();
    if ($FG_DEBUG) {
        $HD_Form->views['dump-form'] = new DbgDumpView();
    }
    $PAGE_ELEMS[] =& $HD_Form;
    $HD_Form->model[] = new ClauseField('sid', $sess_row['sid']);
    $HD_Form->model[] = new DateTimeField(_("Date"), 'starttime');
    $HD_Form->model[] = new TextField(_("Description"), 'descr');
    end($HD_Form->model)->fieldacr = _("Descr");
    $HD_Form->model[] = new TextField("", 'f2');
    $HD_Form->model[] = new TextField(_("Called Number"), 'cnum');
    end($HD_Form->model)->fieldacr = _("C. Num");
    //end($HD_Form->model)->fieldname ='agent';
    $HD_Form->model[] = new SecondsField(_("Duration"), "duration");
    end($HD_Form->model)->fieldacr = _("Dur");
    $HD_Form->model[] = new MoneyField(_("Credit"), "pos_charge");
    $HD_Form->model[] = new MoneyField(_("Charge"), "neg_charge");
    $HD_Form->views['list']->sum_fns = array('duration' => 'SUM', 'pos_charge' => 'SUM', 'neg_charge' => 'SUM');
    // Per date calls..
    $Sum_Form = new FormHandler('cc_session_calls', _("Per-date calls"));
    $Sum_Form->checkRights($rights);
    $Sum_Form->init(null, false);
    $Sum_Form->views['list'] = new SumMultiView();
    $Sum_Form->views['pay'] = $Sum_Form->views['true'] = $Sum_Form->views['false'] = new IdleView();
    if ($FG_DEBUG) {
        $Sum_Form->views['dump-form'] = new DbgDumpView();
    }
    $PAGE_ELEMS[] =& $Sum_Form;
    $Sum_Form->model[] = new ClauseField('sid', $sess_row['sid']);
    $Sum_Form->model[] = new DateField(_("Date"), 'starttime');
    end($Sum_Form->model)->fieldexpr = 'date_trunc(\'day\', starttime)';
    $Sum_Form->model[] = new IntField(_("Calls"), 'cnum');
    $Sum_Form->model[] = new SecondsField(_("Duration"), "duration");
    //$Sum_Form->model[] = new FloatField(_("Credit"), "pos_charge");
    $Sum_Form->model[] = new MoneyField(_("Charge"), "neg_charge");
    if ($sess_row['has_days'] == 't') {
        $Sum_Form->views['list']->sums[] = array('title' => _("Per day calls"), 'fns' => array('starttime' => true, 'cnum' => 'COUNT', 'duration' => 'SUM', 'neg_charge' => 'SUM'));
    }
    $Sum_Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('cnum' => 'COUNT', 'duration' => 'SUM', 'neg_charge' => 'SUM'));
    if ($sess_row['is_open'] != 't') {
        $PAGE_ELEMS[] = new StringElem(_("Session is closed"));
    } elseif ($sess_row['is_inuse'] == 't') {
        $PAGE_ELEMS[] = new StringElem(_("Card is in use, cannot close session now."));
    } else {
        $pay_form = new SqlActionElem();
        $pay_form->action_do = 'pay';
        $pay_form->action_ask = 'list';
        $pay_form->init();
        $PAGE_ELEMS[] =& $pay_form;
        if ($sess_row['credit'] > 0) {
            $pay_form->ButtonStr = str_params(_("Pay back %1"), array($sess_row['credit_fmt']), 1);
            $pay_form->elem_success = new StringElem(_("Sesion paid back!"));
        } else {
            $pay_form->ButtonStr = str_params(_("Pay %1"), array($sess_row['credit_fmt']), 1);
            $pay_form->elem_success = new StringElem(_("Sesion paid!"));
        }
        $pay_form->follow_params['sum'] = $sess_row['credit'];
        $pay_form->follow_params['sid'] = $sess_row['sid'];
        $pay_form->QueryString = str_dbparams($dbhandle, 'SELECT pay_session(%1, %2, true) AS money;', array($sess_row['sid'], $_GET['sum']));
        $pay_form->elem_fail = new StringElem(_("Session could not be paid!"));
        $pay_form->elem_success->content .= "\n<br><a href=\"{$booth_page}\">" . _("Back to booths") . "</a>";
    }
}
开发者ID:sayemk,项目名称:a2billing,代码行数:73,代码来源:SessionInvoice.inc.php

示例4: FormHandler

<?php

require "lib/defines.php";
require "lib/module.access.php";
require_once DIR_COMMON . "Form.inc.php";
//require_once (DIR_COMMON."Form/Class.SqlActionForm.inc.php");
require_once DIR_COMMON . "Form/Class.TimeField.inc.php";
require_once DIR_COMMON . "Form/Class.ClauseField.inc.php";
$User_Form = new FormHandler("cc_card");
$User_Form->checkRights(ACX_ACCESS);
$User_Form->init(null, false);
$User_Form->views['list'] = new DetailsView();
// $User_Form->views['list']->table_class="user-info";
$User_Form->model[] = new ClauseField("id", $_SESSION['card_id']);
$User_Form->model[] = new TextField(_('First name'), 'firstname');
$User_Form->model[] = new TextField(_('Last name'), 'lastname');
$User_Form->model[] = new MoneyField(_('Credit'), 'credit');
$User_Form->model[] = new DateField(_('Last used'), 'lastuse');
$User_Form->submitString = _("Calculate!");
$User_Form->edit_no_records = _("Database error: your details cannot be found!");
$PAGE_ELEMS[] =& $User_Form;
require "PP_page.inc.php";
if (false) {
    //require (LANGUAGE_DIR.FILENAME_USERINFO);
    $QUERY = "SELECT  username, credit, lastname, firstname, address, city, state, country, zipcode, phone, email, fax, lastuse, activated, status FROM cc_card WHERE username = '" . $_SESSION["pr_login"] . "' AND uipass = '" . $_SESSION["pr_password"] . "'";
    $DBHandle_max = DbConnect();
    $numrow = 0;
    $resmax = $DBHandle_max->Execute($QUERY);
    if ($resmax) {
        $numrow = $resmax->RecordCount();
    } else {
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:userinfo.php

示例5: FreeClauseField

$tmp->Form->model[] = new FreeClauseField("sessionbill IS NOT NULL");
$tmp->Form->model[] = new FreeClauseField("sessiontime > 0");
$tmp->Form->model[] = new DateTimeField(_("Time"), 'starttime');
$tmp->Form->model[] = new TextField(_("Number"), 'calledstation');
$tmp->Form->model[] = new TextField(_("Destination"), 'destination');
$tmp->Form->model[] = new SecondsField(_("Duration"), 'sessiontime');
end($tmp->Form->model)->fieldacr = _("Dur");
//$tmp->Form->model[] = new PKeyFieldTxt(_("ID"),'id');
$tmp->Form->model[] = new MoneyField(_("Bill"), 'sessionbill');
//one non-summed group
$tmp->Form->views['list']->sums[] = array('fns' => array('starttime' => true, 'calledstation' => true, 'destination' => true, 'sessiontime' => true, 'sessionbill' => true), 'order' => 'starttime');
//Per day/destination
$tmp->Form->views['list']->sums[] = array('title' => _("Sum per destination"), 'fns' => array('starttime' => false, 'destination' => true, 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'), 'order' => 'sessiontime', 'sens' => 'DESC');
$tmp->Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('calledstation' => 'COUNT', 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'));
$hform = new FormHandler('cc_card');
$hform->checkRights(ACX_INVOICING);
$hform->init(null, false);
$hform->setAction('details');
$hform->views['details'] = new DetailsView();
$hform->model[] = new FreeClauseField(str_dbparams(A2Billing::DBHandle(), 'id = (SELECT cardid FROM cc_invoices WHERE id = %#1)', array($dform->getpost_dirty('id'))));
//$hform->model[] = new PKeyField(_("ID"),'id');
$hform->model[] = new TextField(_("Local number"), 'useralias');
$hform->model[] = new TextFieldN(_("First name"), 'firstname');
$hform->model[] = new TextFieldN(_("Last name"), 'lastname');
$hform->model[] = new TextAreaField(_("Address"), 'address');
$hform->model[] = new TextFieldN(_("City"), 'city');
$hform->model[] = new TextFieldN(_("State"), 'state');
$hform->model[] = new TextFieldN(_("Country"), 'country');
$hform->model[] = new TextFieldN(_("Zipcode"), 'zipcode');
//$hform->model[] = new TextFieldN(_("Phone"),'phone');
$hform->model[] = new TextFieldN(_("Fax"), 'fax');
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:invoices_card.php

示例6: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
// require_once ("a2blib/Form/Class.TabField.inc.php");
require_once "a2blib/Form/Class.TimeField.inc.php";
// require_once ("a2blib/Class.JQuery.inc.php");
$menu_section = 'menu_queues';
HelpElem::DoHelp(_("Logs are the technical entries, directly from asterisk, of queue events."));
$HD_Form = new FormHandler('ast_queue_log', _("Logs"), _("Log"));
$HD_Form->checkRights(ACX_QUEUES);
$HD_Form->default_order = 'tstamp';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
// $PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new DateTimeFieldDH(_("Date"), "tstamp", _("Event date"));
$HD_Form->model[] = new TextFieldN(_("Call"), 'callid', _("Asterisk call identifier."));
$HD_Form->model[] = new TextFieldN(_("Queue"), 'queuename', _("Queue name."));
$HD_Form->model[] = new TextFieldN(_("Agent"), 'agent', _("Agent which served the call, if any."));
$HD_Form->model[] = new TextFieldN(_("Event"), 'event', _("Asterisk event code."));
$HD_Form->model[] = dontList(new TextFieldN(_("P 1"), 'parm1', _("Event parameter 1.")));
$HD_Form->model[] = dontList(new TextFieldN(_("P 2"), 'parm2', _("Event parameter 2.")));
$HD_Form->model[] = dontList(new TextFieldN(_("P 3"), 'parm3', _("Event parameter 3.")));
// $HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
开发者ID:sayemk,项目名称:a2billing,代码行数:30,代码来源:A2B_entity_queue_log.php

示例7: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RevRef.inc.php";
require_once "a2blib/Form/Class.RevRefForm.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
$menu_section = 'menu_config';
HelpElem::DoHelp(_("Reverse numplans are sets of rules that define the callerid of our customers on an outgoing call."), 'vcard.png');
$HD_Form = new FormHandler('cc_re_numplan', _("Reverse Numplans"), _("Reverse Numplan"));
$HD_Form->checkRights(ACX_NUMPLAN);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'name', _('Name of group'));
$HD_Form->model[] = new DelBtnField();
$tmp = new RevRefForm(_("Pattern"), 'pat', 'id', 'cc_re_numplan_pattern', 'nplan');
$HD_Form->meta_elems[] = $tmp;
$tmp->Form->checkRights(ACX_NUMPLAN);
$tmp->Form->init();
$tmp->Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$tmp->Form->model[] = new SqlRefFieldN(_("Forward numplan"), 'fplan', 'cc_numplan', 'id', 'name', _("If set, this pattern will only apply to calls originating from cards in that numplan."));
end($tmp->Form->model)->fieldacr = _("F Nplan");
$tmp->Form->model[] = new TextField(_("Find"), 'find', _('Prefix of outgoing number to match. This will match the <b>translated</b> string by the forward numplan.'));
$tmp->Form->model[] = new TextField(_("Replace"), 'repl', _('String to replace the match prefix with. It may include special strings like %useralias, %nplan etc. See manual.'));
$tmp->Form->model[] = new TextFieldEH(_("Name"), 'nick', _('Name of pattern'));
//$tmp->Form->model[] = new SqlRefField(_("Out CLID Group"),'oclid','cc_outbound_cgroup','id','name');
//	end($tmp->Form->model)->fieldacr = _("OC GRP");
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_re_numplan.php

示例8: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.RevRefForm.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
$menu_section = 'menu_did';
HelpElem::DoHelp(_("DID phonebooks help associate incoming CLIDs with names"));
$HD_Form = new FormHandler('did_phonebook', _("DID Phonebooks"), _("DID phonebook"));
$HD_Form->checkRights(ACX_DID);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'name');
$HD_Form->model[] = new TextFieldN(_("Code"), 'code', _("A code, for syncing it with foreign ones."));
$HD_Form->model[] = dontList(new SqlRefFieldN(_("CLID Rules"), "rnplan", "cc_re_numplan", "id", "name", _("Use this book in those CLIDs only")));
$HD_Form->model[] = dontList(new SqlRefFieldN(_("Card Group"), "card_group", "cc_card_group", "id", "name", _("Use this book in that card group only")));
$HD_Form->model[] = dontList(new SqlBigRefField(_("Card"), "cardid", "cc_card", "id", "name", _("Use this book only for that card: private one.")));
$HD_Form->model[] = new DelBtnField();
$tmp = new RevRefForm(_("Entries"), 'ints', 'id', 'did_pb_entry', 'pb');
$HD_Form->meta_elems[] = $tmp;
$tmp->Form->checkRights(ACX_DID);
$tmp->Form->init();
$tmp->Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$tmp->Form->model[] = new TextField(_("Name"), 'name');
$tmp->Form->model[] = new TextField(_("Number"), 'dnum', _('Number, in intermediate incoming format.'));
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_did_phonebook.php

示例9: SecondsField

$tmp->Form->model[] = new SecondsField(_("Duration"), 'sessiontime');
end($tmp->Form->model)->fieldacr = _("Dur");
//$tmp->Form->model[] = new PKeyFieldTxt(_("ID"),'id');
$tmp->Form->model[] = new MoneyField(_("Bill"), 'agentbill');
/*	//one non-summed group
	$tmp->Form->views['list']->sums[] =array( 'fns' => array( 'starttime' => true,
			'calledstation' => true,
			'destination' => true,
			'sessiontime' => true, 'agentbill' => true)); */
// sum per day/destination
$tmp->Form->views['list']->sums[] = array('fns' => array('starttime' => true, 'calledstation' => true, 'destination' => true, 'sessiontime' => 'SUM', 'agentbill' => 'SUM'), 'order' => 'starttime');
//Per day/destination
$tmp->Form->views['list']->sums[] = array('title' => _("Sum per destination"), 'fns' => array('starttime' => false, 'destination' => true, 'sessiontime' => 'SUM', 'agentbill' => 'SUM'), 'order' => 'sessiontime', 'sens' => 'DESC');
$tmp->Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('calledstation' => 'COUNT', 'sessiontime' => 'SUM', 'agentbill' => 'SUM'));
$hform = new FormHandler('cc_agent');
$hform->checkRights(ACX_AGENTS);
$hform->init(null, false);
$hform->setAction('details');
$hform->views['details'] = new DetailsView();
$hform->model[] = new FreeClauseField(str_dbparams(A2Billing::DBHandle(), 'id = (SELECT agentid FROM cc_invoices WHERE id = %#1)', array($dform->getpost_dirty('id'))));
//$hform->model[] = new PKeyField(_("ID"),'id');
$hform->model[] = new TextField(_("Name"), "name");
$hform->model[] = new TextField(_("Address"), "location");
//$hform->model[] = new TextField(_("Name"), "name");
$hform->model[] = new SqlRefField(_("Tariff Plan"), "tariffgroup", "cc_tariffgroup", "id", "pubname");
$PAGE_ELEMS[] =& $hform;
$PAGE_ELEMS[] =& $dform;
if (isset($_GET['printable']) && $_GET['printable']) {
    require "PP_print.inc.php";
} else {
    require "PP_page.inc.php";
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:invoices_agent.php

示例10: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
$menu_section = 'menu_servers';
HelpElem::DoHelp(gettext("Trunks are used to terminate the call!<br>" . "The trunk and ratecard is selected by the rating engine on the basis of the dialed digits.<br>" . "The trunk is used to dial out from your asterisk box which can be a zaptel interface or a voip provider."), 'hwbrowser.png');
$HD_Form = new FormHandler('cc_trunk', _("Trunks"), _("Trunk"));
$HD_Form->checkRights(ACX_TRUNK);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$status_list = array();
$status_list[] = array('1', gettext("Active"));
$status_list[] = array('0', gettext("Inactive"));
$trunkfmt_list = array();
$trunkfmt_list[] = array('1', '<Tech>/<IP>/<Number>');
$trunkfmt_list[] = array('2', '<Tech>/<Number>@<IP>');
$trunkfmt_list[] = array('3', '<Tech>/<IP>');
$trunkfmt_list[] = array('4', 'Local Peer: <[Tech]>/<@[IP:numplan]>');
$trunkfmt_list[] = array('5', 'Direct Peer: <[Tech]>/<@[IP:numplan]>');
$trunkfmt_list[] = array('6', 'Remote Peer: <[Tech]>/<@[IP:numplan]>');
$trunkfmt_list[] = array('7', 'Local Peer, cross Numplan');
$trunkfmt_list[] = array('8', 'Remote Peer, cross Numplan');
$trunkfmt_list[] = array('9', 'Group destination');
$trunkfmt_list[] = array('10', 'Email to local peer');
$trunkfmt_list[] = array('11', 'Email to cross numplan peer');
$trunkfmt_list[] = array('12', 'Voicemail to local peer');
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_trunk.php

示例11: FormHandler

require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RevRef.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.RevRefForm.inc.php";
require_once "a2blib/Form/Class.TextSearchField.inc.php";
// require_once ("a2blib/Form/Class.ClauseField.inc.php");
require_once "a2blib/Form/Class.SelectionForm.inc.php";
require_once "a2blib/Form/Class.SumMultiView.inc.php";
require_once "a2blib/Form/Class.ElemGraph.inc.php";
$menu_section = 'menu_netmon';
// Init the class early, so that ACL message appears here.
$sform = new FormHandler('nm.attr_float', _("Values"), _("Value"));
$sform->checkRights(ACX_NETMON);
$sform->init(null, false);
$SEL_Form = new SelectionForm();
$SEL_Form->init();
$SEL_Form->model[] = new DateTimeField(_("Period from"), 'date_from');
//end($SEL_Form->model)->does_add = false;
end($SEL_Form->model)->def_date = '00:00 - 7 days';
end($SEL_Form->model)->fieldexpr = 'tstamp';
$SEL_Form->model[] = new DateTimeField(_("Period to"), 'date_to');
//end($SEL_Form->model)->does_add = false;
end($SEL_Form->model)->def_date = 'now';
end($SEL_Form->model)->fieldexpr = 'tstamp';
$SEL_Form->fallbackClause = array('date_from');
/*$SEL_Form->model[] = new SqlRefFieldN(_("Agent"),'agentid','cc_agent','id','name');
	end($SEL_Form->model)->does_add = false;*/
$SEL_Form->search_exprs['date_from'] = '>=';
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:netmon_stats.php

示例12: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RevRef2.inc.php";
$menu_section = 'menu_servers';
HelpElem::DoHelp(_("Providers are the companies that offer us trunks."));
$HD_Form = new FormHandler('cc_provider', _("Providers"), _("Provider"));
$HD_Form->checkRights(ACX_SERVERS);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'provider_name');
$HD_Form->model[] = new TextAreaField(_("Description"), 'description');
//RevRef2::html_body($action);
$HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
开发者ID:sayemk,项目名称:a2billing,代码行数:20,代码来源:A2B_entity_provider.php

示例13: AgentMoney

function AgentMoney($agentid, &$sel_form, $intl, $rights)
{
    global $PAGE_ELEMS;
    global $FG_DEBUG;
    $dbhandle = A2Billing::DBHandle();
    $HD_Form = new FormHandler('cc_agent_money_v', _("Transactions"), _("Transaction"));
    $HD_Form->checkRights($rights);
    $HD_Form->init(null, false);
    $HD_Form->views['list'] = new SumMultiView();
    $HD_Form->views['pay'] = $HD_Form->views['true'] = $HD_Form->views['false'] = new IdleView();
    if ($FG_DEBUG) {
        $HD_Form->views['dump-form'] = new DbgDumpView();
    }
    $clauses = $sel_form->buildClauses();
    // $PAGE_ELEMS[] = new DbgElem(print_r($clauses,true));
    $PAGE_ELEMS[] =& $HD_Form;
    $HD_Form->model[] = new ClauseField('agentid', $agentid);
    if (isset($clauses['date_from'])) {
        $HD_Form->model[] = new FreeClauseField($clauses['date_from']);
    }
    if (isset($clauses['date_to'])) {
        $HD_Form->model[] = new FreeClauseField($clauses['date_to']);
    }
    $HD_Form->model[] = new DateTimeField(_("Date"), 'date');
    $HD_Form->model[] = new TextField(_("Type"), 'pay_type');
    if ($intl) {
        end($HD_Form->model)->fieldexpr = 'gettexti(pay_type,\'' . getenv('LANG') . '\')';
    } else {
        end($HD_Form->model)->fieldexpr = 'gettexti(pay_type,\'C\')';
    }
    $HD_Form->model[] = new TextField(_("Description"), 'descr');
    if ($intl) {
        end($HD_Form->model)->fieldexpr = 'gettext(descr,\'' . getenv('LANG') . '\')';
    }
    $HD_Form->model[] = new MoneyField(_("In"), 'pos_credit');
    $HD_Form->model[] = new MoneyField(_("Out"), 'neg_credit');
    $HD_Form->model[] = new MoneyField(_("Sum"), 'credit');
    $HD_Form->views['list']->sums[] = array('group' => false, 'fns' => array('date' => true, 'pay_type' => true, 'descr' => true, 'pos_credit' => true, 'neg_credit' => true));
    $HD_Form->views['list']->sums[] = array('fns' => array('descr' => array(_("Totals")), 'pos_credit' => 'SUM', 'neg_credit' => 'SUM'));
    $HD_Form->views['list']->sums[] = array('fns' => array('descr' => array(_("Sum Total")), 'credit' => 'SUM'));
    $Totals = new SqlDetailsActionForm();
    $Totals->checkRights($rights);
    $Totals->init();
    $Totals->setAction('true');
    $PAGE_ELEMS[] =& $Totals;
    $Totals->expectRows = false;
    $Totals->listclass = 'total';
    $Totals->headerString = _("Agent Totals");
    $Totals->successString = null;
    $dc2 = '';
    if (isset($clauses['date_from'])) {
        $dc2 .= ' AND ' . str_replace('date ', 'starttime ', $clauses['date_from']);
    }
    if (isset($clauses['date_to'])) {
        $dc2 .= ' AND ' . str_replace('date ', 'starttime ', $clauses['date_to']);
    }
    $cardsqr = "SELECT SUM(CASE WHEN credit > 0.0 THEN credit ELSE NULL END) AS pos_credit,\n\t\t\tSUM(CASE WHEN credit < 0.0 THEN (0.0 - credit) ELSE NULL END) AS neg_credit,\n\t\t\tSUM(creditlimit) AS climit\n\t\t\tFROM cc_card, cc_card_group\n\t\t\tWHERE cc_card.grp = cc_card_group.id AND cc_card_group.agentid IS NOT NULL\n\t\t\tAND agentid = %1";
    $callsqr = "SELECT SUM(sessionbill) AS calls \n\t\t\tFROM cc_call, cc_card, cc_card_group \n\t\t\tWHERE cc_call.cardid = cc_card.id AND cc_card_group.id = cc_card.grp\n\t\t\t\tAND cc_card_group.agentid = %1 " . $dc2;
    $dleftqr = "cc_calc_daysleft(%1,now(), interval '1 month')";
    $Totals->QueryString = str_dbparams($dbhandle, "SELECT format_currency(tc.pos_credit, %2) AS total_ccredit,\n\t\t format_currency(tc.neg_credit, %2) AS total_cdebit, " . "format_currency(tc.climit, %2) AS total_cclimit,\n\t\tformat_currency(sb.calls,%2) AS total_calls, format_currency((sb.calls * cc_agent.commission), %2) AS total_com,\n\t\tformat_currency((sb.calls * (1.0 - cc_agent.commission)), %2) AS total_wh,\n\t\tformat_currency(cc_agent.credit, %2) AS agent_credit, format_currency(cc_agent.climit, %2) AS climit, dleft.days_left\n\t\t  FROM ({$cardsqr}) AS tc, ({$callsqr}) AS sb, cc_agent, {$dleftqr} AS dleft\n\t\t  WHERE cc_agent.id = %1;", array($agentid, A2Billing::instance()->currency));
    $Totals->noRowsString = _("Totals could not be calculated!");
    $Totals->rmodel[] = new MoneyField(_("Total sum credited to customers"), 'total_ccredit');
    $Totals->rmodel[] = new MoneyField(_("Total sum debited from customers"), 'total_cdebit');
    $Totals->rmodel[] = new MoneyField(_("Total potential debit from customers"), 'total_cclimit');
    $Totals->rmodel[] = new IntField(_("Total calls made by customers"), 'total_calls');
    $Totals->rmodel[] = new MoneyField(_("Wholesale price of calls"), 'total_wh');
    $Totals->rmodel[] = new MoneyField(_("Estimated profit from calls"), 'total_com');
    $Totals->rmodel[] = new MoneyField(_("Outstanding balance"), 'agent_credit');
    $Totals->rmodel[] = new MoneyField(_("Credit Limit"), 'climit');
    $Totals->rmodel[] = new IntField(_("Estimated Days left"), 'days_left');
    // if ($vat>0) echo  " (" .gettext("includes VAT"). "$vat %)";
}
开发者ID:sayemk,项目名称:a2billing,代码行数:72,代码来源:AgentMoney.inc.php

示例14: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.ClauseField.inc.php";
$menu_section = 'menu_invoicing';
HelpElem::DoHelp(gettext("Invoices for regular clients"));
$HD_Form = new FormHandler('cc_invoices', _("Invoices"), _("Invoice"));
$HD_Form->checkRights(ACX_INVOICING);
$HD_Form->default_order = 'id';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
// $PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new FreeClauseField('agentid IS NULL');
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new SqlRefField(_("Card"), "cardid", "cc_card", "id", "username");
$HD_Form->model[] = new TextField(_("Ref"), "orderref");
$HD_Form->model[] = new DateTimeFieldDH(_("Start"), 'cover_startdate');
$HD_Form->model[] = new DateTimeField(_("Finish"), 'cover_enddate');
$HD_Form->model[] = dontList(new DateTimeField(_("Created"), 'created', _("Date this invoice was registered")));
$HD_Form->model[] = dontList(new MoneyField(_("Amount"), 'amount'));
$HD_Form->model[] = dontList(new MoneyField(_("Tax"), 'tax'));
$HD_Form->model[] = new MoneyField(_("Total"), 'total');
$HD_Form->model[] = new IntFieldN(_("Type"), "invoicetype");
//end($HD_Form->model)->refclause = "lang = 'C'";
$HD_Form->model[] = dontList(new TextFieldN(_("Filename"), "filename"));
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_view_invoice.php

示例15: FormHandler

<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RefField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
$menu_section = 'menu_cront';
HelpElem::DoHelp(_("Data from run or pending alarms."));
$HD_Form = new FormHandler('cc_alarm_run', _("Alarm Data"), _("Alarm Data"));
$HD_Form->checkRights(ACX_CRONT_SERVICE);
$HD_Form->default_order = 'id';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new SqlRefField(_("Alarm"), 'alid', 'cc_alarm', 'id', 'name');
$HD_Form->model[] = dontAdd(dontList(new DateTimeField(_("Creation"), "tcreate", _("Creation date"))));
$HD_Form->model[] = dontAdd(new DateTimeField(_("Modify"), "tmodify", _("Last modification date")));
$mstates = array();
$mstates[] = array(0, _("Unknown"));
$mstates[] = array(1, _("Run"));
$mstates[] = array(2, _("Failed to run"));
$mstates[] = array(3, _("Raised Error"));
$mstates[] = array(10, _("Request to run"));
$mstates[] = array(12, _("Auto-ceased"));
$HD_Form->model[] = new RefField(_("Status"), 'status', $mstates);
end($HD_Form->model)->def_value = 10;
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_alarmrun.php


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