// $HD_Form->model[] = new FloatField(_("CREDIT"), "credit"); // $HD_Form->model[] = new FloatField(_("CLIMIT"), "climit",_("Credit limit of agent")); // $HD_Form->model[] = new SqlRefField(_("TARIFFG"), "tariffgroup","cc_tariffgroup", "id", "tariffgroupname"); // // $HD_Form->model[] = new RefField(_("CURRENCY").gettext("CUR"), "currency", "5%"); // // $actived_list = array(); // $actived_list[] = array('t',gettext("Active")); // $actived_list[] = array('f',gettext("Inactive")); // // $HD_Form->model[] = new RefField(_("ACTIVATED"), "active", $actived_list,_("Allow the agent to operate"),"4%"); // end($HD_Form->model)->fieldacr = gettext("ACT"); if ($HD_Form->getAction() != 'tooltip') { $HD_Form->model[] = new DelBtnField(); } $SEL_Form = new SelectionForm(); $SEL_Form->init(); $SEL_Form->enable($HD_Form->getAction() == 'list'); // todo: search in use $SEL_Form->model[] = new TextSearchField(_("Card number"), 'username'); $SEL_Form->model[] = dontAdd(new SqlRefField(_("Group"), "grp", "cc_card_group", "id", "name")); $SEL_Form->model[] = dontAdd(new RefField(_("Status"), 'status', $cs_list)); $SEL_Form->model[] = new TextSearchField(_("Last Name"), 'lastname'); $PAGE_ELEMS[] =& $SEL_Form; $PAGE_ELEMS[] =& $HD_Form; $PAGE_ELEMS[] = new AddNewButton($HD_Form); $SEL_Form->appendClauses($HD_Form); if ($HD_Form->getAction() == 'tooltip') { require "PP_bare_page.inc.php"; } else { require "PP_page.inc.php"; }
end($SEL_Form->model)->fieldexpr = 'starttime'; $SEL_Form->model[] = new SqlRefFieldN(_("Agent"), 'agentid', 'cc_agent', 'id', 'name'); end($SEL_Form->model)->does_add = false; $SEL_Form->search_exprs['date_from'] = '>='; $SEL_Form->search_exprs['date_to'] = '<='; $PAGE_ELEMS[] =& $SEL_Form; // HelpElem::DoHelp(gettext("*-*"),'vcard.png'); $sform = new FormHandler('cc_call, cc_card, cc_card_group', _("Calls"), _("Call")); $sform->checkRights(ACX_INVOICING); $sform->init(null, false); $sform->views['sums'] = new SumMultiView(); $sform->setAction('sums'); if ($FG_DEBUG) { $sform->views['dump-form'] = new DbgDumpView(); } $SEL_Form->appendClauses($sform); $sform->model[] = new FreeClauseField('cc_call.cardid = cc_card.id'); $sform->model[] = new FreeClauseField('cc_card.grp = cc_card_group.id'); $sform->model[] = new FreeClauseField('cc_call.invoice_id IS NULL'); $sform->model[] = new DateField(_("Start"), 'starttime'); $sform->model[] = new DateField(_("End"), 'endtime'); end($sform->model)->fieldexpr = 'starttime'; $sform->model[] = new IntField(_("Calls"), 'uniqueid'); $sform->model[] = new SecondsField(_("Duration"), "sessiontime"); end($sform->model)->fieldacr = _("Dur"); //$Sum_Form->model[] = new FloatField(_("Credit"), "pos_charge"); $sform->model[] = new MoneyField(_("Bill"), "sessionbill"); $sform->model[] = new MoneyField(_("Cost"), "buycost"); $sform->model[] = new TextField(_("Group"), 'grp_name'); end($sform->model)->fieldexpr = 'cc_card_group.name'; $sform->model[] = new SqlRefFieldN(_("Agent"), 'agentid', 'cc_agent', 'id', 'name');