本文整理汇总了PHP中paloSantoGrid::setColumns方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::setColumns方法的具体用法?PHP paloSantoGrid::setColumns怎么用?PHP paloSantoGrid::setColumns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::setColumns方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listFax
function listFax($smarty, $module_name, $local_templates_dir)
{
$limit = 30;
$oFax = new paloFax();
$total = $oFax->getTotalFax();
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->pagingShow(true);
$oGrid->setURL("?menu=faxlist");
$oGrid->setTitle(_tr("Virtual Fax List"));
$oGrid->setIcon("/modules/{$module_name}/images/fax_virtual_fax_list.png");
$arrColumns = array(_tr("Virtual Fax Name"), _tr("Fax Extension"), _tr("Secret"), _tr("Destination Email"), _tr("Caller ID Name"), _tr("Caller ID Number"), _tr("Status"));
$oGrid->setColumns($arrColumns);
$offset = $oGrid->calculateOffset();
$arrFax = $oFax->getFaxList($offset, $limit);
$arrFaxStatus = $oFax->getFaxStatus();
$arrData = array();
foreach ($arrFax as $fax) {
$arrTmp = array();
$arrTmp[0] = " <a href='?menu=faxnew&action=view&id=" . $fax['id'] . "'>" . $fax['name'] . "</a>";
$arrTmp[1] = $fax['extension'];
$arrTmp[2] = $fax['secret'];
$arrTmp[3] = $fax['email'];
$arrTmp[4] = $fax['clid_name'] . " ";
$arrTmp[5] = $fax['clid_number'] . " ";
$arrTmp[6] = $arrFaxStatus['modems']['ttyIAX' . $fax['dev_id']] . ' on ttyIAX' . $fax['dev_id'];
$arrData[] = $arrTmp;
}
$session = getSession();
$session['faxlist']['faxListStatus'] = $arrData;
putSession($session);
$oGrid->setData($arrData);
return $oGrid->fetchGrid();
}
示例2: getParameter
function reportListadodecampañas($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pListadodecampañas = new paloSantoListadodecampañas($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Listado de campañas"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Listado de campañas"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Nombre"), _tr("Fecha Inicial"), _tr("Fecha Final"), _tr("Form"), _tr("# de Bases"), _tr("# de Agentes"), _tr("Tipo"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pListadodecampañas->getNumListadodecampañas($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pListadodecampañas->getListadodecampañas($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrBasesAgentes = $pListadodecampañas->getBasesAgentes($value['id']);
$arrTmp[0] = $value['nombre'];
$arrTmp[1] = $value['fecha_inicio'];
$arrTmp[2] = $value['fecha_fin'];
$arrTmp[3] = $value['form'];
$arrTmp[4] = $arrBasesAgentes['bases'];
$arrTmp[5] = $arrBasesAgentes['agentes'];
$arrTmp[6] = $value['tipo'];
if ($value['tipo'] == "RECARGABLE") {
$arrTmp[7] = "<a href=index.php?menu=hispana_campania_recargable&action=view_edit&id=" . $value['id'] . ">Editar</a>";
} else {
$arrTmp[7] = "<a href=index.php?menu=hispana_crear_campania&action=view_edit&id=" . $value['id'] . ">Editar</a>";
}
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例3: reportListadodebases
function reportListadodebases($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pListadodebases = new paloSantoListadodebases($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Listado de bases"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Listado de bases"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Base"), _tr("CI"), _tr("Nombre"), _tr("Apellido"), _tr("Provincia"), _tr("Ciudad"), _tr("Nacimiento"), _tr("Correo personal"), _tr("Correo trabajo"), _tr("Estado civil"), _tr("Action"));
$oGrid->setColumns($arrColumns);
$total = $pListadodebases->getNumListadodebases($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
//$limit = 20;
$limit = 200;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pListadodebases->getListadodebases($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['base'];
$arrTmp[1] = $value['ci'];
$arrTmp[2] = $value['nombre'];
$arrTmp[3] = $value['apellido'];
$arrTmp[4] = $value['provincia'];
$arrTmp[5] = $value['ciudad'];
$arrTmp[6] = $value['nacimiento'];
$arrTmp[7] = $value['correo_personal'];
$arrTmp[8] = $value['correo_trabajo'];
$arrTmp[9] = $value['estado_civil'];
$arrTmp[10] = "<a href='?menu=hispana_clientes_datosbasicos&ci=" . $value['ci'] . "'>Editar</a>";
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例4: getParameter
function reportReporteGeneraldeGestión($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pReporteGeneraldeGestión = new paloSantoReporteGeneraldeGestión($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Reporte General de Gestión"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte General de Gestión"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Calltype"), _tr("Fecha"), _tr("Audio"));
$oGrid->setColumns($arrColumns);
$total = $pReporteGeneraldeGestión->getNumReporteGeneraldeGestión($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pReporteGeneraldeGestión->getReporteGeneraldeGestión($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['campania'];
$arrTmp[1] = $value['cliente'];
$arrTmp[2] = $value['cedula'];
$arrTmp[3] = $value['telefono'];
$arrTmp[4] = $value['agente'];
$arrTmp[5] = $value['calltype'];
$arrTmp[6] = $value['fecha'];
if (stripos($value['calltype'], "contactado") >= 0) {
$arrTmp[7] = "<a href=monitoring_translator.php?action=download&id=" . $value['timestamp'] . "&rawmode=yes>Descargar</a>";
}
//$arrTmp[7] = "";
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例5: reportRegestion
function reportRegestion($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pRegestion = new paloSantoRegestion($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Regestión de campañas"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Regestión de campañas"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña padre"), _tr("Clase de calltypes"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pRegestion->getNumRegestion($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pRegestion->getRegestion($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['nombre'];
$arrTmp[1] = "<form method='POST' action=\"index.php?menu={$module_name}\">";
$arrTmp[1] .= "<select name=\"clase_calltype\">\n\t\t\t <option value=\"Contactado\">Contactado</option>\n\t\t\t <option value=\"No contactado\">No contactado</option>\n\t\t\t <option value=\"Agendado\">Agendado</option>\n\t\t\t </select>";
$arrTmp[1] .= "<input type=hidden name=\"action\" value=\"view_edit\">";
$arrTmp[1] .= "<input type=hidden name=\"id\" value={$value['id']}>";
$arrTmp[2] = "<input type=submit value=\"Regestionar\">";
$arrTmp[2] .= "</form>";
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例6: listarFaxes
function listarFaxes(&$smarty, $module_name, $local_templates_dir)
{
$smarty->assign(array('SEARCH' => _tr('Search')));
$oFax = new paloFaxVisor();
// Generación del filtro
$oFilterForm = new paloForm($smarty, getFormElements());
// Parámetros base y validación de parámetros
$url = array('menu' => $module_name);
$paramFiltroBase = $paramFiltro = array('name_company' => '', 'fax_company' => '', 'date_fax' => NULL, 'filter' => 'All');
foreach (array_keys($paramFiltro) as $k) {
if (!is_null(getParameter($k))) {
$paramFiltro[$k] = getParameter($k);
}
}
$oGrid = new paloSantoGrid($smarty);
$arrType = array("All" => _tr('All'), "In" => _tr('in'), "Out" => _tr('out'));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Company Name") . " = " . $paramFiltro['name_company'], $paramFiltro, array("name_company" => ""));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Company Fax") . " = " . $paramFiltro['fax_company'], $paramFiltro, array("fax_company" => ""));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Fax Date") . " = " . $paramFiltro['date_fax'], $paramFiltro, array("date_fax" => NULL));
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Type Fax") . " = " . $arrType[$paramFiltro['filter']], $paramFiltro, array("filter" => "All"), true);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $paramFiltro);
if (!$oFilterForm->validateForm($paramFiltro)) {
$smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
$paramFiltro = $paramFiltroBase;
unset($_POST['faxes_delete']);
// Se aborta el intento de borrar faxes, si había uno.
}
$url = array_merge($url, $paramFiltro);
// Ejecutar el borrado, si se ha validado.
if (isset($_POST['faxes_delete']) && isset($_POST['faxes']) && is_array($_POST['faxes']) && count($_POST['faxes']) > 0) {
$msgError = NULL;
foreach ($_POST['faxes'] as $idFax) {
if (!$oFax->deleteInfoFax($idFax)) {
if ($oFax->errMsg = '') {
$msgError = _tr('Unable to eliminate pdf file from the path.');
} else {
$msgError = _tr('Unable to eliminate pdf file from the database.') . ' - ' . $oFax->errMsg;
}
}
}
if (!is_null($msgError)) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
}
}
$oGrid->setTitle(_tr("Fax Viewer"));
$oGrid->setIcon("modules/{$module_name}/images/kfaxview.png");
$oGrid->pagingShow(true);
// show paging section.
$oGrid->setURL($url);
$arrData = NULL;
$total = $oFax->obtener_cantidad_faxes($paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $paramFiltro['filter']);
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$arrResult = $oFax->obtener_faxes($paramFiltro['name_company'], $paramFiltro['fax_company'], $paramFiltro['date_fax'], $offset, $limit, $paramFiltro['filter']);
$oGrid->setColumns(array("", _tr('Type'), _tr('File'), _tr('Company Name'), _tr('Company Fax'), _tr('Fax Destiny'), _tr('Fax Date'), _tr('Status'), _tr('Options')));
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $fax) {
foreach (array('pdf_file', 'company_name', 'company_fax', 'destiny_name', 'destiny_fax', 'errormsg') as $k) {
$fax[$k] = htmlentities($fax[$k], ENT_COMPAT, 'UTF-8');
}
if (empty($fax['status']) && !empty($fax['errormsg'])) {
$fax['status'] = 'failed';
}
$arrData[] = array('<input type="checkbox" name="faxes[]" value="' . $fax['id'] . '" />', _tr($fax['type']), strtolower($fax['type']) == 'in' || strpos($fax['pdf_file'], '.pdf') !== FALSE ? "<a href='?menu={$module_name}&action=download&id=" . $fax['id'] . "&rawmode=yes'>" . $fax['pdf_file'] . "</a>" : $fax['pdf_file'], $fax['company_name'], $fax['company_fax'], $fax['destiny_name'] . " - " . $fax['destiny_fax'], $fax['date'], _tr($fax['status']) . (empty($fax['errormsg']) ? '' : ': ' . $fax['errormsg']), "<a href='?menu={$module_name}&action=edit&id=" . $fax['id'] . "'>" . _tr('Edit') . "</a>");
}
}
if (!is_array($arrResult)) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
}
$oGrid->setData($arrData);
$oGrid->deleteList(_tr('Are you sure you wish to delete fax (es)?'), "faxes_delete", _tr("Delete"));
$oGrid->showFilter($htmlFilter);
return $oGrid->fetchGrid();
}
示例7: reportANI
function reportANI($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$smarty->assign("SHOW_DIV_ERROR", "0");
//FIXED: can show div error message with javascript
$smarty->assign("mb_message", "hide");
//FIXED: can show div error message with javascript
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$ani_prefix = getParameter("ani_prefix");
$pANI = new paloSantoANI($pDB, $domain);
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['ani_prefix'] = $ani_prefix;
$total = $pANI->getNumANI($domain, $ani_prefix);
$arrOrgz = array();
if ($credentials['userlevel'] == "superadmin") {
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
}
if ($total === false) {
$error = $pANI->errMsg;
$total = 0;
}
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$oGrid->setTitle(_tr('ANI List'));
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url);
$arrColum = array();
if ($credentials['userlevel'] == "superadmin") {
$arrColum[] = _tr("Organization");
}
$arrColum[] = _tr("Trunk Name");
$arrColum[] = _tr("Prefix ANI");
$oGrid->setColumns($arrColum);
$arrANI = array();
$arrData = array();
if ($total != 0) {
$arrANI = $pANI->getANI($domain, $ani_prefix, $limit, $offset);
}
if ($arrANI === false) {
$error = _tr("Error to obtain ANI") . $pANI->errMsg;
$arrANI = array();
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
$smarty->assign("SHOW_DIV_ERROR", "1");
}
foreach ($arrANI as $row) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$row["organization_domain"]];
}
$arrTmp[] = $row["name"];
$arrTmp[] = "<input type='text' style='width:60px; text-align:center;' id='text#{$row['organization_domain']}#{$row['trunkid']}' value='{$row['ani_prefix']}' /> \n <input type='button' id='button#{$row['organization_domain']}#{$row['trunkid']}' value='" . _tr("Save") . "' />";
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) == 0) {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", _tr("It's necesary you create at least one organization so you can use this module"));
$smarty->assign("SHOW_DIV_ERROR", "1");
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["ani_prefix"] = $ani_prefix;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("ANI Prefix") . " = " . $ani_prefix, $_POST, array("ani_prefix" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
return $oGrid->fetchGrid(array(), $arrData);
}
示例8: listPortKnockCurrentAuths
function listPortKnockCurrentAuths(&$smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$eth_in = getParameter('eth_in');
if (is_null($eth_in)) {
Header("Location: ?menu={$module_name}");
return NULL;
}
include_once "libs/paloSantoACL.class.php";
$pACL = new paloACL($arrConf['elastix_dsn']['acl']);
$pk = new paloSantoPortKnockInterfaces($pDB);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr('PortKnock Interface Authorizations'));
$oGrid->setColumns(array('', _tr('IP'), _tr('User'), _tr('Ports'), _tr('Since')));
$oGrid->deleteList(_tr('Are you sure you wish to revoke this authorization?'), 'delete', _tr('Revoke authorization'));
if (isset($_POST['delete']) && isset($_POST['id_user_ip'])) {
$l = explode('-', $_POST['id_user_ip']);
if (count($l) >= 2) {
$bExito = $pk->removeAuthorizationsUserInterface($l[0], $l[1]);
if (!$bExito) {
$smarty->assign("mb_title", _tr("Error"));
$smarty->assign("mb_message", $pk->errMsg);
} else {
Header("Location: ?menu={$module_name}");
return NULL;
}
}
}
$recordset = $pk->listAuthorizationsInterface($eth_in);
$data = array();
if (is_array($recordset)) {
foreach ($recordset as $id_user => $auth_user) {
$userinfo = $pACL->getUsers($id_user);
foreach ($auth_user as $ip_source => $auth_ips) {
$listaProto = array();
$ruleStart = NULL;
foreach ($auth_ips as $id_auth => $info_auth) {
$listaProto[] = $info_auth['name'];
$ruleStart = $info_auth['rule_start'];
}
$data[] = array('<input type="radio" name="id_user_ip" value="' . $id_user . '-' . $ip_source . '" />', $ip_source, $userinfo[0][1], implode(' ', $listaProto), $ruleStart);
}
}
}
$oGrid->pagingShow(false);
$url = array("menu" => $module_name);
$oGrid->setURL($url);
$oGrid->setData($data);
return $oGrid->fetchGrid();
}
示例9: reportMoH
function reportMoH($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$pORGZ = new paloSantoOrganization($pDB);
$name = getParameter("name");
if ($credentials['userlevel'] == "superadmin") {
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
} else {
$arrOrgz = array();
$domain = $credentials['domain'];
}
$url["menu"] = $module_name;
$url["organization"] = $domain;
$url["name"] = $name;
$pMoH = new paloSantoMoH($pDB, $domain);
$total = $pMoH->getNumMoH($domain, $name);
if ($total === false) {
$error = $pMoH->errMsg;
$total = 0;
}
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$oGrid->setTitle(_tr('MoH Class List'));
//$oGrid->setIcon('url de la imagen');
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url);
$arrColum = array();
if ($credentials['userlevel'] == "superadmin") {
$arrColum[] = _tr("Organization");
}
$arrColum[] = _tr("Name");
$arrColum[] = _tr("Type");
$arrColum[] = _tr("Sort");
$arrColum[] = _tr("Directory");
$arrColum[] = _tr("Aplication");
$oGrid->setColumns($arrColum);
$arrMoH = array();
$arrData = array();
if ($total != 0) {
$arrMoH = $pMoH->getMoHs($domain, $name, $limit, $offset);
}
if ($arrMoH === false) {
$error = _tr("Error to obtain MoH Class") . $pMoH->errMsg;
$arrMoH = array();
}
$arrData = array();
foreach ($arrMoH as $moh) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
if (empty($moh["organization_domain"])) {
$arrTmp[] = "";
$arrTmp[] = " <a href='?menu={$module_name}&action=view&id_moh=" . $moh["name"] . "'>" . $moh["description"] . "</a>";
} else {
$arrTmp[] = $arrOrgz[$moh["organization_domain"]];
$arrTmp[] = $moh["description"];
}
} else {
$arrTmp[] = " <a href='?menu={$module_name}&action=view&id_moh=" . $moh["name"] . "'>" . $moh["description"] . "</a>";
}
$arrTmp[] = $moh["mode"];
$arrTmp[] = $moh["sort"];
$arrTmp[] = $moh["directory"];
$arrTmp[] = $moh["application"];
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if (in_array("create", $arrPermission)) {
$oGrid->addNew("create_moh", _tr("Create New Class MoH"));
}
if ($credentials['userlevel'] == "superadmin") {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["name"] = $name;
// name
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Name") . " = " . $name, $_POST, array("name" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
return $contenidoModulo;
//.........这里部分代码省略.........
示例10: reportWeakKeys
function reportWeakKeys($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pWeakKeys = new paloSantoWeakKeys($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$total = $pWeakKeys->getNumWeakKeys($filter_field, $filter_value);
$pDB2 = new paloDB($arrConf['elastix_dsn']['acl']);
$pACL = new paloACL($pDB2);
$oGrid->enableExport();
// enable csv export.
$oGrid->pagingShow(true);
// show paging section.
$oGrid->setTitle(_tr("Weak Secrets"));
$oGrid->setIcon("modules/{$module_name}/images/security_weak_keys.png");
$oGrid->setNameFile_Export(_tr("Weak Secrets"));
if ($oGrid->isExportAction()) {
$limit = $total;
$offset = 0;
$bExportation = true;
} else {
$limit = 30;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$bExportation = false;
}
$url = array('menu' => $module_name, 'filter_field' => $filter_field, 'filter_value' => $filter_value);
$oGrid->setURL($url);
$arrResult = $pWeakKeys->getWeakKeys($limit, $offset, $filter_field, $filter_value);
$arrData = null;
//$arrResult =$pWeakKeys->getWeakKeysChecker();
$arrColumns = array(_tr("Extension"), _tr("Description"), _tr("Status"));
$oGrid->setColumns($arrColumns);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $tech) {
foreach ($tech as $key => $value) {
$arrTmp[0] = $value['id'];
$arrTmp[1] = $value['description'];
$mensaje = getMensaje($value['id'], $value['data']);
if ($mensaje != "OK" && !$bExportation) {
if ($pACL->isUserAdministratorGroup($_SESSION['elastix_user']) || $pACL->getUserExtension($_SESSION['elastix_user']) == $value['id']) {
$mensaje = _tr("Weak Key") . ": {$mensaje} <a href='?menu={$module_name}&action=change&id={$value['id']}'>" . _tr("Change Secret") . "</a>";
}
}
$arrTmp[2] = $mensaje;
$arrData[] = $arrTmp;
}
}
}
$oGrid->setData($arrData);
//begin section filter
$arrFormFilterWeakKeys = createFieldFilter();
$oFilterForm = new paloForm($smarty, $arrFormFilterWeakKeys);
$smarty->assign("SHOW", _tr("Show"));
$_POST["filter_field"] = $filter_field;
$_POST["filter_value"] = $filter_value;
$oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Extension") . " = " . $filter_value, $_POST, array("filter_field" => "extension", "filter_value" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例11: reportGroupPermission
//.........这里部分代码省略.........
//los premisos que tiene el grupo
$arrPermisos = $pACL->loadGroupPermissions($idGroup, $listResource);
if ($arrPermisos === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("An error has ocurred to retrieved Group Permissions"));
$error = true;
}
}
$max_actions = 0;
$isAdministrator = $pACL->getGroupNameByid($idGroup) == _tr("administrator") ? true : false;
if ($totalGroupPermission > 0 && !$error) {
foreach ($arrResourceActions as $resource => $actions) {
$arrTmp = array();
$arrTmp[] = _tr($listResDes[$resource]);
$disabled = "";
if ($isAdministrator && ($resource == 'grouplist' || $resource == 'userlist' || $resource == 'group_permission')) {
$disabled = "disabled='disabled'";
}
//dentro del modulo organizacion ahi acciones que unicamente las puede realizar el superadmin
//por lo tando no deben aparecer listadas
if ($resource == "organization") {
$actions = array_diff($actions, array('change_org_status', 'create_org', 'delete_org', 'edit_DID'));
} elseif ($resource == "dashboard") {
$actions = array('access');
} elseif ($resource == 'cdrreport') {
$actions = array('access', 'export');
}
if (count($actions) > $max_actions) {
$max_actions = count($actions);
}
$desactivar = false;
if (isset($arrPermisos[$resource])) {
//grupo no tiene nigun permiso
if (!in_array('access', $arrPermisos[$resource])) {
$desactivar = true;
}
} else {
$desactivar = true;
$arrPermisos[$resource] = array();
}
foreach ($actions as $action) {
$class = 'other_act';
if ($action == 'access') {
$class = 'access_act';
} elseif ($desactivar) {
$disabled = "disabled='disabled'";
}
$checked0 = '';
//chequeamos si la accion se encuentra en la lista de acciones permitidas en el recurso
if (in_array($action, $arrPermisos[$resource])) {
$checked0 = "checked";
}
$arrTmp[] = "<input type='checkbox' class='{$class}' {$disabled} name='groupPermission[" . $resource . "][{$action}]' {$checked0}> {$action}";
}
$arrData[] = $arrTmp;
}
}
$oGrid->setTitle(_tr("Group Permission"));
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$arrColumn[] = _tr("Resource");
for ($i = 1; $i <= $max_actions; $i++) {
$act = _tr("Action");
$arrColumn[] = "{$act}" . " {$i}";
}
$oGrid->setColumns($arrColumn);
//begin section filter
$arrFormFilter = createFieldFilter($arrGroups);
$oFilterForm = new paloForm($smarty, $arrFormFilter);
$smarty->assign("SHOW", _tr("Show"));
$smarty->assign("limit_apply", htmlspecialchars($limit, ENT_COMPAT, 'UTF-8'));
$smarty->assign("offset_apply", htmlspecialchars($offset, ENT_COMPAT, 'UTF-8'));
$smarty->assign("resource_apply", htmlentities($filter_resource));
$_POST["filter_group"] = htmlspecialchars($filter_group, ENT_COMPAT, 'UTF-8');
$_POST["filter_resource"] = htmlspecialchars($filter_resource, ENT_COMPAT, 'UTF-8');
$_POST["idOrganization"] = $idOrgFil;
if (count($arrOrgz) > 0) {
global $arrPermission;
if (in_array('edit_permission', $arrPermission)) {
$oGrid->addSubmitAction("apply", _tr("Save"));
}
if ($credentials['userlevel'] == "superadmin") {
$oGrid->addComboAction("idOrganization", _tr("Organization"), $arrOrgz, $idOrgFil, "report");
}
$nameGroup = isset($arrGroups[$filter_group]) ? $arrGroups[$filter_group] : "";
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Group") . " = {$nameGroup}", $_POST, array("filter_group" => $groupTmp[0][0]), true);
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Resource") . " = {$filter_resource}", $_POST, array("filter_resource" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
} else {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", _tr("You haven't created any organization"));
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
//end grid parameters
return $contenidoModulo;
}
示例12: reportRules
function reportRules($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pRules = new paloSantoRules($pDB);
$action = getParameter("action");
$id = getParameter("id");
$smarty->assign("ID", $id);
$oFilterForm = new paloForm($smarty, array());
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$first_time = $pRules->isFirstTime();
//$oGrid->setTplFile("$local_templates_dir/_list.tpl");
$totalRules = $pRules->ObtainNumRules();
$error = "";
if ($action == 'edit') {
$arrtmp = $pRules->getRule($id);
$arripsource = explode("/", $arrtmp['ip_source']);
$arripdst = explode("/", $arrtmp['ip_destiny']);
$arrValues['id_traffic'] = $arrtmp['traffic'];
$arrValues['interface_in'] = $arrtmp['eth_in'];
$arrValues['interface_out'] = $arrtmp['eth_out'];
$arrValues['ip_source'] = $arripsource[0];
$arrValues['mask_source'] = $arripsource[1];
$arrValues['port_in'] = $arrtmp['sport'];
$arrValues['ip_destin'] = $arripdst[0];
$arrValues['mask_destin'] = $arripdst[1];
$arrValues['port_out'] = $arrtmp['dport'];
$arrValues['type_icmp'] = $arrtmp['icmp_type'];
$arrValues['id_ip'] = $arrtmp['number_ip'];
$arrValues['id_protocol'] = $arrtmp['protocol'];
$arrValues['target'] = $arrtmp['target'];
$arrValues['orden'] = $arrtmp['rule_order'];
$arrValues['state'] = $arrtmp['state'];
$arrValues['id'] = $id;
$content = newRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrValues, $action);
return $content;
} elseif ($action == 'Activate') {
$pRules->setActivated($id);
} elseif ($action == 'Desactivate') {
$pRules->setDesactivated($id);
}
$limit = 30;
$total = $totalRules;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->setTitle(_tr("FireWall Rules"));
$oGrid->setIcon("/modules/{$module_name}/images/security_firewall_rules.png");
$oGrid->pagingShow(true);
$offset = $oGrid->calculateOffset();
$url = "?menu={$module_name}";
$oGrid->setURL($url);
$arrData = null;
$arrResult = $pRules->ObtainRules($limit, $offset);
$start = getParameter("start");
$accion = getParameter("nav");
if ($accion == "end") {
if ($total % $limit == 0) {
$start = $total - 2 * $limit + 1;
} else {
$start = $total - $total % $limit - $limit + 1;
}
} elseif ($accion == "previous") {
$start = $start - 2 * $limit;
}
if ($first_time) {
$arrColumns = array("", _tr("Order"), _tr("Traffic"), _tr("Target"), _tr("Interface"), _tr("IP Source"), _tr("IP Destiny"), _tr("Protocol"), _tr("Details"));
} else {
$oGrid->deleteList("Are you sure you wish to delete the Rule?", "delete", _tr("Delete"));
$arrColumns = array("", _tr("Order"), _tr("Traffic"), _tr("Target"), _tr("Interface"), _tr("IP Source"), _tr("IP Destiny"), _tr("Protocol"), _tr("Details"), "", "");
}
$oGrid->setColumns($arrColumns);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
if (!$first_time) {
$arrTmp[0] = "<input type='checkbox' name='id_" . $value['id'] . "' />";
$arrTmp[1] = "<div id='div_{$value['id']}' style='width: 22px; font-size: 14pt;color:#E35332;float:left;text-align:right'>{$value['rule_order']} </div>";
}
if (!$first_time) {
//if($offset!=0)
$arrTmp[1] .= "<a href='javascript:void(0);' class='up' id='rulerup_{$value['id']}_{$value['rule_order']}'>" . "<img src='modules/{$module_name}/images/up.gif' border=0 title='" . _tr('Up') . "' /></a>" . "<a href='javascript:void(0);' class='down' id='rulerdown_{$value['id']}_{$value['rule_order']}'>" . "<img src='modules/{$module_name}/images/down.gif' border=0 title='" . _tr('Down') . "' /></a>";
/*else
$arrTmp[1].="<a href='?menu=$module_name&action=$changeOrder&id=$value[id]&order=$value[rule_order]&direction=up;' class='up' id='rulerup_$value[id]_$value[rule_order]'>"."<img src='modules/$module_name/images/up.gif' border=0 title='"._tr('Up')."' /></a>"."<a href='javascript:void(0);' class='down' id='rulerdown_$value[id]_$value[rule_order]'>"."<img src='modules/$module_name/images/down.gif' border=0 title='"._tr('Down')."' /></a>";*/
}
if ($value['traffic'] == "INPUT") {
$image = "modules/{$module_name}/images/fw_input.gif";
$title = _tr("INPUT");
$arrTmp[4] = _tr("IN") . ": {$value['eth_in']}";
} elseif ($value['traffic'] == "OUTPUT") {
$image = "modules/{$module_name}/images/fw_output.gif";
$title = _tr("OUTPUT");
$arrTmp[4] = _tr("OUT") . ": {$value['eth_out']}";
} else {
$image = "modules/{$module_name}/images/fw_forward.gif";
$title = _tr("FORWARD");
$arrTmp[4] = _tr("IN") . ": {$value['eth_in']}<br />" . _tr("OUT") . ": {$value['eth_out']}";
}
$arrTmp[2] = "<a><img src='{$image}' border=0 title='" . _tr($title) . "'</a>";
if ($value['target'] == "ACCEPT") {
$image = "modules/{$module_name}/images/target_accept.gif";
$title = _tr("ACCEPT");
} elseif ($value['target'] == "DROP") {
//.........这里部分代码省略.........
示例13: reportGroup
function reportGroup($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $userLevel1, $userAccount, $idOrganization)
{
$pACL = new paloACL($pDB);
$pORGZ = new paloSantoOrganization($pDB);
$idOrgFil = getParameter("idOrganization");
if ($userLevel1 == "superadmin") {
if (!empty($idOrgFil)) {
$cntGroups = $pACL->getNumGroups($idOrgFil);
} else {
$idOrgFil = 0;
//opcion default se muestran todos los grupos
$cntGroupsMO = $pACL->getNumGroups(1);
//obtenemos en numero de grupos que pertenecen a
//la organizacion 1 y lo restamos del total de grupos
$cntGroups = $pACL->getNumGroups() - $cntGroupsMO;
}
} else {
$idOrgFil = $idOrganization;
$cntGroups = $pACL->getNumGroups($idOrganization);
}
if ($cntGroups === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr($pACL->errMsg));
$total = 0;
} else {
$total = $cntGroups;
}
//url
$url['menu'] = $module_name;
$url['idOrganization'] = $idOrgFil;
$total = $total == NULL ? 0 : $total;
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$oGrid->setURL($url);
$oGrid->setTitle(_tr('Group List'));
$oGrid->setIcon("web/apps/{$module_name}/images/system_groups.png");
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
if ($userLevel1 == "superadmin") {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Group Name");
$arrColumns[] = _tr("Group Description");
$oGrid->setColumns($arrColumns);
if ($idOrgFil != 0) {
$Groups = $pACL->getGroupsPaging($limit, $offset, $idOrgFil);
} else {
$Groups = $pACL->getGroupsPaging($limit, $offset);
}
$arrData = array();
foreach ($Groups as $group) {
if ($group[3] != 1) {
$arrTmp = array();
if ($userLevel1 == "superadmin") {
$orgz = $pORGZ->getOrganizationById($group[3]);
$arrTmp[] = htmlentities($orgz["name"], ENT_COMPAT, 'UTF-8');
//organization
}
$arrTmp[] = " <a href='?menu=grouplist&action=view&id=" . $group[0] . "'>" . $group[1] . "</a>";
//id,group name
$arrTmp[] = _tr($group[2]);
//description
$arrData[] = $arrTmp;
}
}
if ($pORGZ->getNumOrganization(array()) > 0) {
global $arrPermission;
if (in_array('create_group', $arrPermission)) {
$oGrid->addNew("create_group", _tr("Create New Group"));
}
if ($userLevel1 == "superadmin") {
$arrOrgz = array(0 => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
if ($value["id"] != 1) {
$arrOrgz[$value["id"]] = $value["name"];
}
}
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$_POST["idOrganization"] = $idOrgFil;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$idOrgFil], $_POST, array("idOrganization" => 0), true);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
}
} else {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("You need have created at least one organization before you can create a new group"));
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
return $contenidoModulo;
}
示例14: reportMissedCalls
function reportMissedCalls($smarty, $module_name, $local_templates_dir, &$pDB, &$pDBACL, $pACL, $arrConf)
{
ini_set('max_execution_time', 3600);
$pCallingReport = new paloSantoMissedCalls($pDB);
$oFilterForm = new paloForm($smarty, createFieldFilter());
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
$date_start = getParameter("date_start");
$date_end = getParameter("date_end");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Missed Calls"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Missed Calls"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$date_start = isset($date_start) ? $date_start : date("d M Y") . ' 00:00';
$date_end = isset($date_end) ? $date_end : date("d M Y") . ' 23:59';
$_POST['date_start'] = $date_start;
$_POST['date_end'] = $date_end;
$parmFilter = array("date_start" => $date_start, "date_end" => $date_end);
if (!$oFilterForm->validateForm($parmFilter)) {
$smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
$date_start = date("d M Y") . ' 00:00';
$date_end = date("d M Y") . ' 23:59';
}
$url = array_merge($url, array('date_start' => $date_start, 'date_end' => $date_end));
$oGrid->setURL($url);
$arrColumns = array(_tr("Date"), _tr("Source"), _tr("Destination"), _tr("Time since last call"), _tr("Number of attempts"), _tr("Status"));
$oGrid->setColumns($arrColumns);
$arrData = null;
$date_start_format = date('Y-m-d H:i:s', strtotime($date_start . ":00"));
$date_end_format = date('Y-m-d H:i:s', strtotime($date_end . ":59"));
// Para usuarios que no son administradores, se restringe a los CDR de la
// propia extensión
$sExtension = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']) ? '' : $pACL->getUserExtension($_SESSION['elastix_user']);
$total = $pCallingReport->getNumCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
$arrResult = $pCallingReport->getCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
$arrData = $pCallingReport->showDataReport($arrResult, $total);
$size = count($arrData);
$oGrid->setData($arrData);
} else {
$limit = 20;
$oGrid->setLimit($limit);
$arrResult = $pCallingReport->getCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
$arrData = $pCallingReport->showDataReport($arrResult, $total);
if ($pCallingReport->errMsg != '') {
$smarty->assign('mb_message', $pCallingReport->errMsg);
}
//recalculando el total para la paginación
$size = count($arrData);
$oGrid->setTotal($size);
$offset = $oGrid->calculateOffset();
//echo $size." : ".$offset;
$arrResult = $pCallingReport->getDataByPagination($arrData, $limit, $offset);
$oGrid->setData($arrResult);
}
//begin section filter
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例15: viewFormDomain
function viewFormDomain($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrLang)
{
$pEmail = new paloEmail($pDB);
$oGrid = new paloSantoGrid($smarty);
$arrDomains = $pEmail->getDomains();
$end = count($arrDomains);
$arrData = array();
$oGrid->pagingShow(true);
$url = array("menu" => $module_name);
$oGrid->setURL($url);
$oGrid->setTitle(_tr("Domain List"));
$oGrid->setIcon("modules/{$module_name}/images/email_domains.png");
$arrColumns = array(_tr("Domain"), _tr("Number of Accounts"));
$oGrid->setColumns($arrColumns);
$total = 0;
$limit = 20;
$limitInferior = "";
$limitSuperior = "";
$oGrid->setLimit($limit);
$oGrid->addNew("submit_create_domain", _tr('Create Domain'));
if (is_array($arrDomains) && $end > 0) {
$oGrid->setTotal($end);
$offset = $oGrid->calculateOffset();
$cont = 0;
$limitInferior = $offset;
$limitSuperior = $offset + $limit - 1;
foreach ($arrDomains as $domain) {
$arrTmp = array();
if ($cont > $limitSuperior) {
break;
}
if ($cont >= $limitInferior & $cont <= $limitSuperior) {
$arrTmp[0] = " <a href='?menu=email_domains&action=view&id=" . $domain[0] . "'>{$domain['1']}</a>";
//obtener el numero de cuentas que posee ese email
$arrTmp[1] = $pEmail->getNumberOfAccounts($domain[0]);
$arrData[] = $arrTmp;
}
$cont++;
}
} else {
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$oGrid->setData($arrData);
$content = $oGrid->fetchGrid();
return $content;
}