本文整理汇总了PHP中paloSantoGrid::showFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::showFilter方法的具体用法?PHP paloSantoGrid::showFilter怎么用?PHP paloSantoGrid::showFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::showFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listBreaks
function listBreaks(&$smarty, $module_name, &$pDB, $local_templates_dir)
{
$oBreaks = new PaloSantoBreaks($pDB);
// Procesamiento de la activación/desactivación de breaks
$r = TRUE;
if (isset($_POST['activate']) && isset($_POST['id_break'])) {
$r = $oBreaks->activateBreak($_POST['id_break'], 'A');
if (!$r) {
$smarty->assign("mb_title", _tr('Activate Error'));
$smarty->assign("mb_message", _tr('Error when Activating the Break'));
}
} elseif (isset($_POST['deactivate']) && isset($_POST['id_break'])) {
$r = $oBreaks->activateBreak($_POST['id_break'], 'I');
if (!$r) {
$respuesta->addAssign("mb_title", "innerHTML", _tr("Desactivate Error"));
$respuesta->addAssign("mb_message", "innerHTML", _tr("Error when desactivating the Break"));
}
}
// Procesamiento de la visualización de breaks
$arrBreaks = $oBreaks->getBreaks();
// Todos los breaks en todos los estados
if (!is_array($arrBreaks)) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("Failed to fetch breaks") . "<br/>" . $pDB->errMsg);
$arrBreaks = array();
}
$arrCols = array("<input type=\"submit\" class=\"button\" name=\"activate\" value=\"" . _tr('Activate') . "\" /> " . "<input type=\"submit\" class=\"button\" name=\"deactivate\" value=\"" . _tr('Desactivate') . "\" />", _tr("Name Break"), _tr("Description Break"), _tr("Status"), _tr("Options"));
function listBreaks_formatHTML($break, $param)
{
return array("<input class=\"input\" type=\"radio\" name=\"id_break\" value=\"{$break['id']}\"/>", htmlentities($break['name'], ENT_COMPAT, "UTF-8"), htmlentities($break['description'], ENT_COMPAT, "UTF-8") . ' ', $break['status'] == 'A' ? _tr('Active') : _tr('Inactive'), $break['status'] == 'A' ? "<a href=\"?menu={$param['module_name']}&action=edit&id_break={$break['id']}\">[" . _tr('Edit Break') . ']</a>' : ' ');
}
$arrData = array();
if (count($arrBreaks) > 0) {
$arrData = array_map('listBreaks_formatHTML', $arrBreaks, array_fill(0, count($arrBreaks), array('module_name' => $module_name)));
}
// Construcción de la rejilla de vista
function listBreaks_formatCols($x)
{
return array('name' => $x);
}
global $arrLang;
$end = count($arrBreaks);
$start = $end == 0 ? 0 : 1;
$oGrid = new paloSantoGrid($smarty);
$oGrid->showFilter("<a href=\"?menu={$module_name}&action=new\"><b>" . _tr('Create New Break') . ' »</b></a>');
$url = construirURL(array('menu' => $module_name), array('nav', 'start'));
$sContenido = $oGrid->fetchGrid(array("title" => _tr("Breaks List"), "url" => $url, "icon" => "images/list.png", "width" => "99%", "start" => $end == 0 ? 0 : 1, "end" => $end, "total" => $end, "columns" => array_map('listBreaks_formatCols', $arrCols)), $arrData, $arrLang);
if (strpos($sContenido, '<form') === FALSE) {
$sContenido = "<form method=\"POST\" style=\"margin-bottom:0;\" action=\"{$url}\">{$sContenido}</form>";
}
return $sContenido;
}
示例2: reportMemberList
function reportMemberList($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$pEmailList = new paloSantoEmailList($pDB);
$id_list = getParameter("id");
if ($credentials['userlevel'] == 'superadmin') {
$emailList = $pEmailList->getEmailList($id_list);
} else {
$emailList = $pEmailList->getEmailList($id_list, $credentials['domain']);
}
if ($emailList == false) {
$smarty->assign("mb_title", _tr("Error"));
$error = $emailList === false ? _tr("Couldn't be retrieved Email List data") : _tr("Email List does not exist");
$smarty->assign("mb_message", $error);
return reportEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
}
$field_type = getParameter("filter_type");
$field_pattern = getParameter("filter_txt");
$smarty->assign("IDEMAILLIST", $id_list);
$smarty->assign("ACTION", 'view_memberlist');
$smarty->assign("SHOW", _tr("Show"));
$smarty->assign("RETURN", _tr("Return"));
$smarty->assign("LINK", "?menu={$module_name}&action=export&id={$id_list}&rawmode=yes");
$smarty->assign("EXPORT", _tr("Export Members"));
$edit_permission = in_array('edit_list', $arrPermission);
$totalMembers = $pEmailList->getTotalMembers($id_list);
$oGrid = new paloSantoGrid($smarty);
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($totalMembers);
$oGrid->setTitle(_tr("List Members of") . " " . $pEmailList->getListName($id_list));
$oGrid->setIcon("web/apps/{$module_name}/images/email.png");
$oGrid->pagingShow(true);
$offset = $oGrid->calculateOffset();
$url['menu'] = $module_name;
$url['action'] = 'view_memberlist';
$url['id'] = $id_list;
$url['filter_type'] = $field_type;
$url['filter_txt'] = $field_pattern;
$oGrid->setURL($url);
if ($edit_permission) {
$arrColumns[] = '';
}
$arrColumns[] = _tr("Member name");
$arrColumns[] = _tr("Member email");
$oGrid->setColumns($arrColumns);
$arrResult = $pEmailList->getMembers($limit, $offset, $id_list, $field_type, $field_pattern);
$arrData = null;
//print_r($arrResult);
if (is_array($arrResult) && $totalMembers > 0) {
foreach ($arrResult as $list) {
$arrTmp = array();
if ($edit_permission) {
$arrTmp[] = "<input type='checkbox' name='del_emailmembers[{$list["mailmember"]}]'>";
}
$arrTmp[] = $list["namemember"];
$arrTmp[] = $list["mailmember"];
$arrData[] = $arrTmp;
}
}
$arrFormFilterMembers = createFieldFilterViewMembers();
$oFilterForm = new paloForm($smarty, $arrFormFilterMembers);
$arrType = array("name" => _tr("Name"), "email" => _tr("Email"));
if (!is_null($field_type)) {
$nameField = $arrType[$field_type];
} else {
$nameField = "";
}
$oGrid->customAction("return", _tr("Return"));
if ($edit_permission) {
$oGrid->addNew("new_memberlist", _tr("Add Member(s) to List"));
$oGrid->deleteList(_tr("Are you sure you wish to delete the Email List(s)."), "remove_memberlist", _tr("Delete"));
}
$oGrid->customAction("?menu={$module_name}&action=export&id={$id_list}&rawmode=yes", _tr("Export Members"), null, true);
$oGrid->addFilterControl(_tr("Filter applied: ") . $nameField . " = " . $field_pattern, $_POST, array("filter_type" => "name", "filter_txt" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/view_members.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid(array(), $arrData);
return $content;
}
示例3: listPackages
function listPackages($smarty, $module_name, $local_templates_dir, $arrConf)
{
$oPackages = new PaloSantoPackages($arrConf['ruta_yum']);
$submitInstalado = getParameter('submitInstalado');
$nombre_paquete = getParameter('nombre_paquete');
$smarty->assign(array('module_name' => $module_name, 'RepositoriesUpdate' => _tr('Repositories Update'), 'Search' => _tr('Search'), 'UpdatingRepositories' => _tr('Updating Repositories'), 'InstallPackage' => _tr('Installing Package'), 'UpdatePackage' => _tr('Updating Package'), 'accionEnProceso' => _tr('There is an action in process'), 'msgConfirmDelete' => _tr('You will uninstall package along with everything what it depends on it. System can lose important functionalities or become unstable! Are you sure want to Uninstall?'), 'msgConfirmInstall' => _tr('Are you sure want to Install this package?'), 'UninstallPackage' => _tr('Uninstalling Package'), 'msgConfirmUpdate' => _tr('Are you sure want to Update this package?')));
$arrPaquetes = $oPackages->listarPaquetes($submitInstalado == 'all' ? 'all' : 'installed', $nombre_paquete);
if ($oPackages->bActualizar) {
$smarty->assign("mb_title", _tr("Message"));
$smarty->assign("mb_message", _tr("The repositories are not up to date. Click on the") . " <b>\"" . _tr('Repositories Update') . "\"</b> " . _tr("button to list all available packages."));
}
// Pagination
$limit = 20;
$total = count($arrPaquetes);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$arrPaquetes = array_slice($arrPaquetes, $offset, $limit);
$arrData = array();
foreach ($arrPaquetes as $paquete) {
$packageActions = array();
$tmpPaquete = $paquete['name'] . '.' . $paquete['arch'];
if ($paquete['canupdate']) {
$packageActions[] = "<a href='#' onclick=" . "confirmUpdate('{$tmpPaquete}')" . ">[" . _tr('Update') . "]</a>";
}
if (is_null($paquete['version'])) {
$packageActions[] = "<a href='#' onclick=" . "installaPackage('{$tmpPaquete}',0)" . ">[" . _tr('Install') . "]</a>";
} else {
$packageActions[] = "<a href='#' onclick=" . "confirmDelete('{$tmpPaquete}')" . ">[" . _tr('Uninstall') . "]</a>";
}
$rowData = array($paquete['name'], $paquete['arch'], $paquete['summary'], is_null($paquete['version']) ? _tr('(not installed)') : $paquete['version'] . '-' . $paquete['release'], is_null($paquete['latestversion']) ? _tr('(not available)') : $paquete['latestversion'] . '-' . $paquete['latestrelease'], $paquete['repo'], implode(' ', $packageActions));
if ($paquete['canupdate']) {
$rowData[0] = '<b>' . $rowData[0] . '</b>';
$rowData[4] = '<b>' . $rowData[4] . '</b>';
}
$arrData[] = $rowData;
}
$url = array('menu' => $module_name, 'submitInstalado' => $submitInstalado, 'nombre_paquete' => $nombre_paquete);
$arrGrid = array("title" => _tr('Packages'), "icon" => "web/apps/{$module_name}/images/system_updates_packages.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "url" => $url, "columns" => array(array("name" => _tr("Package Name")), array("name" => _tr("Architecture")), array("name" => _tr("Package Info")), array('name' => _tr('Current Version')), array('name' => _tr('Available Version')), array("name" => _tr("Repositor Place")), array("name" => _tr("Status"))));
/*Inicio Parte del Filtro*/
$arrFilter = filterField();
$oFilterForm = new paloForm($smarty, $arrFilter);
if (getParameter('submitInstalado') == 'all') {
$arrFilter["submitInstalado"] = 'all';
$tipoPaquete = _tr('All Package');
} else {
$arrFilter["submitInstalado"] = 'installed';
$tipoPaquete = _tr('Package Installed');
}
$arrFilter["nombre_paquete"] = $nombre_paquete;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Status") . " = {$tipoPaquete}", $arrFilter, array("submitInstalado" => "installed"), true);
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Name") . " = {$nombre_paquete}", $arrFilter, array("nombre_paquete" => ""));
$oGrid->addButtonAction('update_repositorios', _tr('Repositories Update'), null, 'mostrarReloj()');
$oGrid->showFilter($oFilterForm->fetchForm("{$local_templates_dir}/new.tpl", '', $arrFilter));
return $oGrid->fetchGrid($arrGrid, $arrData);
}
示例4: reportTG
function reportTG($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$name = getParameter('name');
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['name'] = $name;
//name
$pTG = new paloSantoTG($pDB, $domain);
$total = $pTG->getNumTG($domain, $name);
$arrOrgz = array();
if ($credentials['userlevel'] == "superadmin") {
$arrOrgz = array("all" => "all");
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
}
if ($total === false) {
$error = $pTG->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('Time Groups 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");
$oGrid->setColumns($arrColum);
$arrTG = array();
$arrData = array();
if ($total != 0) {
$arrTG = $pTG->getTGs($domain, $name, $limit, $offset);
}
if ($arrTG === false) {
$error = _tr("Error to obtain Time Groups") . $pTG->errMsg;
$arrTG = array();
}
$arrData = array();
foreach ($arrTG as $tg) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$tg["organization_domain"]];
}
$arrTmp[] = " <a href='?menu={$module_name}&action=edit&id_tg=" . $tg['id'] . "&organization={$tg['organization_domain']}'>" . $tg['name'] . "</a>";
$arrData[] = $arrTmp;
}
if ($pORGZ->getNumOrganization(array()) >= 1) {
if (in_array('create', $arrPermission)) {
if ($credentials['userlevel'] == 'superadmin') {
$oGrid->addComboAction("organization_add", _tr("ADD Time Group"), array_slice($arrOrgz, 1), $selected = null, "create_tg", $onchange_select = null);
} else {
$oGrid->addNew("create_tg", _tr("ADD Time Group"));
}
}
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("Time Condition Group") . " = " . $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));
} else {
$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"));
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
$mensaje = showMessageReload($module_name, $pDB, $credentials);
$contenidoModulo = $mensaje . $contenidoModulo;
return $contenidoModulo;
}
示例5: report_TicketDelivery
//.........这里部分代码省略.........
$oGrid->setTitle("Yêu cầu giao vé");
$oGrid->setTableName("delivery_grid");
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export("ticket_delivery");
$url = array("menu" => $module_name);
$oGrid->setURL($url);
$arrColumns = array("ID", "Tên Khách Hàng", "Số điện thoại", "Booker", "Địa chỉ", "Tiền trả", "Mã số vé", "Tình trạng", "Nhân viên giao", "Ngày phân công", "Vé đính kèm", "Ngày nhận tiền", "Xử lý", "Chi tiết", " ");
$oGrid->setColumns($arrColumns);
$total = $pTicket_Delivery->getNumTicket_Delivery($filter);
$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 = $pTicket_Delivery->getTicket_Delivery($limit, $offset, $filter);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$ticket = '';
$name = $pACL->getUsers($value['accounting_id']);
$elastix_user = is_null($value['accounting_id']) ? '(Chưa nhận)' : $name[0][1];
// show files
$download = '';
foreach ($value['ticket_attachment'] as $row) {
$url = "/modules/agent_console/ajax-attachments-handler.php?download=" . $row['filepath'] . "&name=" . $row['filename'];
$filename = $row['filename'];
$download .= "*<a href='{$url}' target='_blank' title='{$filename}'>" . shorten($filename) . "</a><br/>";
}
$print = '<a href="javascript:void(0)" onclick="print(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'print.png" title="In phiếu"></a>';
$enable = $value['isActive'] == '1' ? '<a href="javascript:void(0)" onclick="disable(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'disable.png" title="Hủy yêu cầu giao vé"></a> ' : '
<a href="javascript:void(0)" onclick="enable(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'enable.png" title="Tạo lại yêu cầu giao vé"></a>';
$print .= ' ' . $enable;
// function show base on status
if ($value['isActive'] == '0') {
$value['status'] = 'Đã hủy';
}
switch ($value['status']) {
case 'Mới':
$function = '<a href="javascript:void(1)" onclick="assign_form(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'assign.png" title="Phân công"></a>';
break;
case 'Đang giao':
$function = '<a href="javascript:void(1)" onclick="assign_form(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'assign.png" title="Đổi phân công"></a>
<a href="javascript:void(1)" onclick="collect_form(\'' . $value['id'] . '\',\'' . $elastix_user . '\')"><img src="' . $img_dir . 'result.png" title="Kết quả"></a>';
break;
case 'Đã nhận tiền':
$function = '<a href="javascript:void(1)" onclick="uncollect_form(\'' . $value['id'] . '\',\'' . $elastix_user . '\')"><img src="' . $img_dir . 'unpaid.png" title="Hủy nhận tiền"></a>';
break;
case 'Chờ xử lý':
$function = '<a href="javascript:void(1)" onclick="assign_form(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'assign.png" title="Phân công"></a>';
break;
default:
$function = '';
}
// show ticket code
foreach ($value['ticket_code'] as $row) {
$ticket .= $row . '<br>';
}
$arrTmp[0] = $value['id'];
$arrTmp[1] = $value['customer_name'];
$arrTmp[2] = $value['customer_phone'];
$arrTmp[3] = '<span title="Chi nhánh: ' . $value['office'] . '">' . $value['agent_name'] . '</span>';
$arrTmp[4] = '<a href="javascript:void(1)" title="' . $value['deliver_address'] . '"
onclick="view_address(\'' . $value['deliver_address'] . '\')">' . shorten($value['deliver_address']) . '
</a>';
$arrTmp[5] = $value['pay_amount'];
$arrTmp[6] = $ticket;
$arrTmp[7] = showStatus($value['status']);
$arrTmp[8] = $value['delivery_name'];
$arrTmp[9] = is_null($value['delivery_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['delivery_date']));
$arrTmp[10] = $download;
$arrTmp[11] = is_null($value['collection_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['collection_date']));
$arrTmp[12] = $function;
$arrTmp[13] = '<a href="javascript:void(1)" onclick="view_log(\'' . $value['id'] . '\')">
<img src="' . $img_dir . 'extra.png" title="Xem chi tiết"></a>';
$arrTmp[14] = $print;
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
// get delivery man list
$delivery_man_list = $pTicket_Delivery->getDeliveryMan();
$smarty->assign("DELIVERY_MAN_LIST", $delivery_man_list);
$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: 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;
}
示例7: reportOtherDestinations
function reportOtherDestinations($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$other_destination_name = getParameter("other_destination_name");
$pOtherDestinations = new paloSantoOtherDestinations($pDB, $domain);
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['other_destination_name'] = $other_destination_name;
$total = $pOtherDestinations->getNumOtherDestinations($domain, $other_destination_name);
$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 = $pOtherDestinations->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('Other Destinations 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("Other Destination Name");
$arrColum[] = _tr("Dial Destination");
$oGrid->setColumns($arrColum);
$arrOtherDestinations = array();
$arrData = array();
if ($total != 0) {
$arrOtherDestinations = $pOtherDestinations->getOtherDestinations($domain, $other_destination_name, $limit, $offset);
}
if ($arrOtherDestinations === false) {
$error = _tr("Error to obtain Other Destinations") . $pOtherDestinations->errMsg;
$arrOtherDestinations = array();
}
foreach ($arrOtherDestinations as $row) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$row["organization_domain"]];
}
$arrTmp[] = " <a href='?menu={$module_name}&action=view&id=" . $row['id'] . "&organization={$row['organization_domain']}'>" . htmlentities($row["description"], ENT_QUOTES, "UTF-8") . "</a>";
$arrTmp[] = $row["destdial"];
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) >= 1) {
if (in_array('create', $arrPermission)) {
if ($credentials['userlevel'] == 'superadmin') {
$oGrid->addComboAction("organization_add", _tr("ADD Other Destination"), array_slice($arrOrgz, 1), $selected = null, "create_other_destination", $onchange_select = null);
} else {
$oGrid->addNew("create_other_destination", _tr("ADD Other Destination"));
}
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["other_destination_name"] = $other_destination_name;
// name
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Other Destination Name") . " = " . $other_destination_name, $_POST, array("other_destination_name" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$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("It's necesary you create at least one organization so you can use this module"));
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
$mensaje = showMessageReload($module_name, $pDB, $credentials);
$contenidoModulo = $mensaje . $contenidoModulo;
return $contenidoModulo;
}
示例8: reportQueue
//.........这里部分代码省略.........
$total = $pQueue->getTotalQueues($domain, $queue_number, $queue_name);
$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 = $pQueue->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('Queues 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);
if ($credentials['userlevel'] == 'superadmin') {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Queue Number");
$arrColumns[] = _tr("Queue Name");
$arrColumns[] = _tr("Password");
$arrColumns[] = _tr("Record Call");
$arrColumns[] = _tr("Strategy");
$arrColumns[] = _tr("Timeout Queue");
$arrColumns[] = _tr("Timeout Agent");
$oGrid->setColumns($arrColumns);
$arrData = array();
$arrQueues = array();
if ($total != 0) {
$arrQueues = $pQueue->getQueues($domain, $queue_number, $queue_name, $limit, $offset);
}
if ($arrQueues === false) {
$error = _tr("Error getting queue data. ") . $pQueue->errMsg;
} else {
foreach ($arrQueues as $queue) {
$arrTmp = array();
if ($credentials['userlevel'] == 'superadmin') {
$arrTmp[] = $arrOrgz[$queue['organization_domain']];
}
$queunumber = $queue["queue_number"];
$arrTmp[] = " <a href='?menu=queues&action=view&qname=" . $queue['name'] . "&organization={$queue['organization_domain']}'>" . $queunumber . "</a>";
$arrTmp[] = htmlentities($queue["description"], ENT_QUOTES, "UTF-8");
$arrTmp[] = $queue["password_detail"];
$arrTmp[] = isset($queue["monitor_format"]) ? "yes" : "no";
$arrTmp[] = $queue["strategy"];
$arrTmp[] = $queue["timeout_detail"] == "0" ? "unlimited" : $queue["timeout_detail"];
$arrTmp[] = $queue["timeout"];
/*$result=getInfoQueue();
$arrTmp[6]=$result["logged"];
$arrTmp[6]=$result["free"];*/
$arrData[] = $arrTmp;
}
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) >= 1) {
if (in_array('create', $arrPermission)) {
if ($credentials['userlevel'] == 'superadmin') {
$oGrid->addComboAction("organization_add", _tr("Create New Queue"), array_slice($arrOrgz, 1), $selected = null, "create_queue", $onchange_select = null);
} else {
$oGrid->addNew("create_queue", _tr("Create New Queue"));
}
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["queue_number"] = $queue_number;
// patter to filter estension number
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Queue Number") . " = " . $queue_number, $_POST, array("queue_number" => ""));
$_POST["queue_name"] = $queue_name;
// patter to filter estension number
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Queue Name") . " = " . $queue_name, $_POST, array("queue_name" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$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("It's necesary you create at least one organization so you can use this module"));
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
$mensaje = showMessageReload($module_name, $pDB, $credentials);
$contenidoModulo = $mensaje . $contenidoModulo;
return $contenidoModulo;
}
示例9: reportReportedeCalltypes
//.........这里部分代码省略.........
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte Ultima Gestion Recargables"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value, "id_campania" => $id_campania, "adicionales" => $filter_field_adicional, "filtro_adicional" => $filter_value_adicional);
$oGrid->setURL($url);
// Columnas base
$arrColumns = array(_tr("Fecha"), _tr("Hora"), _tr("Campaña"), _tr("Base"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Contactabilidad"), _tr("Calltype"), _tr("Provincia"), _tr("Ciudad"), _tr("Nacimiento"), _tr("Correo Personal"), _tr("Correo Trabajo"), _tr("Estado Civil"), _tr("Formulario"));
// Otras columnas
if ($id_campania != "") {
// Columnas adicionales
$arrColumnasAdicionales = $pReportedeCalltypes->getColumnasAdicionales($id_campania);
$arrColumns = array_merge($arrColumns, $arrColumnasAdicionales);
$smarty->assign("mostrarAdicional", "si");
$smarty->assign("filtro_adicionales", filter_adicionales($arrColumnasAdicionales, null));
// Columnas de gestión
$arrTmp = $pReportedeCalltypes->getFormFields($id_campania);
$i = 0;
foreach ($arrTmp as $formField) {
$arrOrden[] = $formField['id'];
$arrColumnsAdicionales[$i] = $formField['etiqueta'];
$i++;
}
$arrColumns = array_merge($arrColumns, $arrColumnsAdicionales);
}
$oGrid->setColumns($arrColumns);
$total = $pReportedeCalltypes->getNumReportedeCalltypes($filter_field, $filter_value, $id_campania, $filter_field_adicional, $filter_value_adicional);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
// default 20
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pReportedeCalltypes->getReportedeCalltypes($limit, $offset, $filter_field, $filter_value, $id_campania, $filter_field_adicional, $filter_value_adicional);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$fecha = date("Y-m-d", strtotime($value['fecha']));
$hora = date("H:i:s", strtotime($value['fecha']));
$arrTmp[0] = $fecha;
$arrTmp[1] = $hora;
$arrTmp[2] = $value['campania'];
$arrTmp[3] = $value['base'];
$arrTmp[4] = $value['cliente'];
$arrTmp[5] = $value['ci'];
$arrTmp[6] = $value['telefono'];
$arrTmp[7] = $value['agente'];
$arrTmp[8] = $value['contactabilidad'];
$arrTmp[9] = $value['calltype'];
$arrTmp[10] = $value['provincia'];
$arrTmp[11] = $value['ciudad'];
$arrTmp[12] = $value['nacimiento'];
$arrTmp[13] = $value['correo_personal'];
$arrTmp[14] = $value['correo_trabajo'];
$arrTmp[15] = $value['estado_civil'];
// $arrTmp[8] = $value['formulario'];
// Así lo requiere RUBENING
$arrTmp[16] = "<a href=modules/{$module_name}/gestion_info.php?id_gestion={$value['id_gestion']} target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400'); return false;\">Ver gestión</a>" . "<br>" . "<a href=modules/{$module_name}/gestion_edit.php?id_gestion={$value['id_gestion']}&user=" . $_SESSION["elastix_user"] . " target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400,scrollbars=1'); return false;\">Editar</a>";
// Datos adicionales
$arrDatosAdicionales = $pReportedeCalltypes->getDatosAdicionales($value['id_cliente'], $value['id_base']);
$i = 17;
foreach ($arrColumnasAdicionales as $k => $columnaAdicional) {
$arrTmp[$i] = $arrDatosAdicionales[$columnaAdicional];
$i++;
}
unset($arrDatosAdicionales);
$numColumnasFijas = $i;
// Datos de gestión
$arrFormValues = $pReportedeCalltypes->getFormValues($value['id_gestion']);
// array_search retorna el key dado el valor a buscar
foreach ($arrFormValues as $formValue) {
// echo $formValue['valor'] . " " . array_search($formValue['id_form_field'],$arrOrden) . "<br>";
$ubicacionReal = array_search($formValue['id_form_field'], $arrOrden) + $numColumnasFijas;
if (is_array($formValue['valor'])) {
$formValue['valor'] = print_r($formValue['valor'], true);
}
$arrTmp[$ubicacionReal] = $formValue['valor'];
}
$arrData[] = $arrTmp;
unset($arrTmp);
}
}
$oGrid->setData($arrData);
/* Para colocar en $arrTmp
*/
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$smarty->assign("filter_campaign", filter_campaign($pDB, $id_campania));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例10: _moduleContent
//.........这里部分代码省略.........
if (is_null($ext) || $ext == "") {
$smarty->assign("mb_message", "<b>" . $arrLang["no_extension_assigned"] . "</b>");
}
$path = "/var/spool/asterisk/voicemail/default";
$folder = "INBOX";
if ($esAdministrador) {
if ($handle = opendir($path)) {
while (false !== ($dir = readdir($handle))) {
if ($dir != "." && $dir != ".." && ereg($extension, $dir, $regs) && is_dir($path . "/" . $dir)) {
$directorios[] = $dir;
}
}
}
} else {
$directorios[] = $extension;
}
//if($esAdministrador)
$arrData = array();
foreach ($directorios as $directorio) {
$voicemailPath = "{$path}/{$directorio}/{$folder}";
if (file_exists($voicemailPath)) {
if ($handle = opendir($voicemailPath)) {
$bExito = true;
while (false !== ($file = readdir($handle))) {
//no tomar en cuenta . y ..
//buscar los archivos de texto (txt) que son los que contienen los datos de las llamadas
if ($file != "." && $file != ".." && ereg("(.+)\\.[txt|TXT]", $file, $regs)) {
//leer la info del archivo
$pConfig = new paloConfig($voicemailPath, $file, "=", "[[:space:]]*=[[:space:]]*");
$arrVoiceMailDes = array();
$arrVoiceMailDes = $pConfig->leer_configuracion(false);
//verifico que tenga datos
if (is_array($arrVoiceMailDes) && count($arrVoiceMailDes) > 0 && isset($arrVoiceMailDes['origtime']['valor'])) {
//uso las fechas del filtro
//si la fecha de llamada esta dentro del rango, la muestro
$fecha = date("Y-m-d", $arrVoiceMailDes['origtime']['valor']);
$hora = date("H:i:s", $arrVoiceMailDes['origtime']['valor']);
if (strtotime("{$fecha} {$hora}") <= strtotime($date_end) && strtotime("{$fecha} {$hora}") >= strtotime($date_start)) {
$arrTmp[0] = "<input type='checkbox' name='" . utf8_encode("voc-" . $file) . ",{$directorio}' />";
$arrTmp[1] = $fecha;
$arrTmp[2] = $hora;
$arrTmp[3] = $arrVoiceMailDes['callerid']['valor'];
$arrTmp[4] = $arrVoiceMailDes['origmailbox']['valor'];
$arrTmp[5] = $arrVoiceMailDes['duration']['valor'] . ' sec.';
$pathRecordFile = base64_encode($regs[1] . '.wav');
$recordingLink = "<a href='#' onClick=\"javascript:popUp('index.php?menu={$module_name}&action=display_record&ext={$directorio}&name={$pathRecordFile}&rawmode=yes',350,100); return false;\">{$arrLang['Listen']}</a> ";
$recordingLink .= "<a href='?menu={$module_name}&action=download&ext={$directorio}&name={$pathRecordFile}&rawmode=yes'>{$arrLang['Download']}</a>";
$arrTmp[6] = $recordingLink;
$arrData[] = $arrTmp;
}
}
}
}
closedir($handle);
}
} else {
// No vale la ruta
}
}
/*
function sort_voicemails_hora_desc($a, $b) { return ($a[2] == $b[2]) ? 0 : (($a[2] < $b[2]) ? 1 : -1); }
function sort_voicemails_fecha_desc($a, $b) { return ($a[1] == $b[1]) ? 0 : (($a[1] < $b[1]) ? 1 : -1); }
usort($arrData, 'sort_voicemails_hora_desc');
usort($arrData, 'sort_voicemails_fecha_desc');
*/
$fechas = array();
$horas = array();
foreach ($arrData as $llave => $fila) {
$fechas[$llave] = $fila[1];
$horas[$llave] = $fila[2];
}
array_multisort($fechas, SORT_DESC, $horas, SORT_DESC, $arrData);
//Paginacion
$limit = 15;
$total = count($arrData);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
// Construyo el URL base
if (isset($arrFilterExtraVars) && is_array($arrFilterExtraVars) and count($arrFilterExtraVars) > 0) {
$url = array_merge($url, $arrFilterExtraVars);
}
//Fin Paginacion
$arrVoiceData = array_slice($arrData, $offset, $limit);
} else {
$smarty->assign("mb_message", "<b>" . $arrLang["contact_admin"] . "</b>");
}
$arrGrid = array("title" => $arrLang["Voicemail List"], "url" => $url, "icon" => "/modules/{$module_name}/images/pbx_voicemail.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => "", "property1" => ""), 1 => array("name" => $arrLang["Date"], "property1" => ""), 2 => array("name" => $arrLang["Time"], "property1" => ""), 3 => array("name" => $arrLang["CallerID"], "property1" => ""), 4 => array("name" => $arrLang["Extension"], "property1" => ""), 5 => array("name" => $arrLang["Duration"], "property1" => ""), 6 => array("name" => $arrLang["Message"], "property1" => "")));
if ($bandCustom == true) {
$oGrid->customAction("config", _tr("Configuration"));
}
$oGrid->deleteList(_tr("Are you sure you wish to delete voicemails?"), "submit_eliminar", _tr("Delete"));
$oGrid->showFilter($htmlFilter);
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrVoiceData, $arrLang);
if (strpos($contenidoModulo, '<form') === FALSE) {
$contenidoModulo = "<form style='margin-bottom:0;' method='POST' action='?menu={$module_name}'>{$contenidoModulo}</form>";
}
return $contenidoModulo;
}
示例11: listHistogram
//.........这里部分代码省略.........
}
if (isset($_POST['fecha_ini'])) {
$sFechaInicial = date('Y-m-d', strtotime($_POST['fecha_ini']));
}
if (isset($_GET['fecha_fin'])) {
$sFechaFinal = date('Y-m-d', strtotime($_GET['fecha_fin']));
}
if (isset($_POST['fecha_fin'])) {
$sFechaFinal = date('Y-m-d', strtotime($_POST['fecha_fin']));
}
$_POST['fecha_ini'] = date('d M Y', strtotime($sFechaInicial));
$_POST['fecha_fin'] = date('d M Y', strtotime($sFechaFinal));
$smarty->assign('FECHA_INI', $sFechaInicial);
$smarty->assign('FECHA_FIN', $sFechaFinal);
// Recuperar la lista de llamadas
$oCalls = new paloSantoCallsHour($pDB);
$arrCalls = $oCalls->getCalls($sTipoLlamada, $sEstadoLlamada, $sFechaInicial, $sFechaFinal);
// TODO: manejar error al obtener llamadas
if (!is_array($arrCalls)) {
$smarty->assign("mb_title", _tr("Validation Error"));
$smarty->assign("mb_message", $oCalls->errMsg);
$arrCalls = array();
}
// Lista de colas a elegir para gráfico. Sólo se elige de las colas devueltas
// por la lista de datos.
$listaColas = array_keys($arrCalls);
$comboColas = array('' => _tr('All'));
if (count($listaColas) > 0) {
$comboColas += array_combine($listaColas, $listaColas);
}
$sColaElegida = NULL;
if (isset($_GET['queue'])) {
$sColaElegida = $_GET['queue'];
}
if (isset($_POST['queue'])) {
$sColaElegida = $_POST['queue'];
}
if (!in_array($sColaElegida, $listaColas)) {
$sColaElegida = '';
}
$_POST['queue'] = $sColaElegida;
// Para llenar el formulario
$smarty->assign('QUEUE', $_POST['queue']);
$url = construirURL(array('menu' => $module_name, 'tipo' => $sTipoLlamada, 'estado' => $sEstadoLlamada, 'queue' => $sColaElegida, 'fecha_ini' => $sFechaInicial, 'fecha_fin' => $sFechaFinal), array('nav', 'start'));
$smarty->assign('url', $url);
// Construir el arreglo como debe mostrarse en la tabla desglose
$arrData = array();
for ($i = 0; $i < 24; $i++) {
$arrData[$i] = array(sprintf('%02d:00', $i));
}
$arrData[24] = array(_tr('Total Calls'));
$arrCols = array(0 => array('name' => _tr('Hour')));
$arrTodos = array_fill(0, 24, 0);
foreach ($arrCalls as $sQueue => $hist) {
if (empty($sColaElegida) || $sColaElegida == $sQueue) {
$arrCols[] = array('name' => $sQueue);
$iTotalCola = 0;
foreach ($hist as $i => $iNumCalls) {
$arrData[$i][] = $iNumCalls;
$arrTodos[$i] += $iNumCalls;
$iTotalCola += $iNumCalls;
}
$arrData[24][] = $iTotalCola;
}
}
$arrCols[] = array('name' => _tr('All'));
$iTotalCola = 0;
foreach ($arrTodos as $i => $iNumCalls) {
$arrData[$i][] = $iNumCalls;
$iTotalCola += $iNumCalls;
}
$arrData[24][] = $iTotalCola;
$smarty->assign('MODULE_NAME', $module_name);
$smarty->assign('LABEL_FIND', _tr('Find'));
$formFilter = getFormFilter($comboTipos, $comboEstados, $comboColas);
$oForm = new paloForm($smarty, $formFilter);
//Llenamos las cabeceras
$arrGrid = array("title" => _tr("Graphic Calls per hour"), "url" => $url, "icon" => "images/list.png", "width" => "99%", "start" => 0, "end" => 0, "total" => 0, "columns" => $arrCols);
$oGrid = new paloSantoGrid($smarty);
$oGrid->showFilter($oForm->fetchForm("{$local_templates_dir}/filter-graphic-calls.tpl", NULL, $_POST));
$oGrid->enableExport();
if (isset($_GET['exportcsv']) && $_GET['exportcsv'] == 'yes') {
$fechaActual = date("Y-m-d");
header("Cache-Control: private");
header("Pragma: cache");
header('Content-Type: text/csv; charset=UTF-8; header=present');
$title = "\"calls-per-hour-" . $fechaActual . ".csv\"";
header("Content-disposition: attachment; filename={$title}");
return $oGrid->fetchGridCSV($arrGrid, $arrData);
} else {
$bExportando = isset($_GET['exportcsv']) && $_GET['exportcsv'] == 'yes' || isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' || isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes';
$sContenido = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
if (!$bExportando) {
if (strpos($sContenido, '<form') === FALSE) {
$sContenido = "<form method=\"POST\" style=\"margin-bottom:0;\" action=\"{$url}\">{$sContenido}</form>";
}
}
return $sContenido;
}
}
示例12: reportDHCP_Configuration
function reportDHCP_Configuration($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pDHCP_Configuration = new paloSantoDHCP_Configuration($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
$action = getParameter("nav");
$start = getParameter("start");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$nameOpt = array("hostname" => _tr('Host Name'), "ipaddress" => _tr('IP Address'), "macaddress" => _tr('MAC Address'));
if (isset($nameOpt[$filter_field])) {
$valorFiltro = $nameOpt[$filter_field];
} else {
$valorFiltro = "";
}
$oGrid->addFilterControl(_tr("Filter applied ") . " " . $valorFiltro . " = {$filter_value}", $_POST, array("filter_field" => "hostname", "filter_value" => ""));
$totalDHCP_Configuration = $pDHCP_Configuration->contarIpFijas($filter_field, $filter_value);
$oGrid->addNew("new_dhcpconft", _tr("Assign IP Address"));
$oGrid->deleteList("Are you sure you wish to delete the DHCP configuration.", "delete_dhcpConf", _tr("Delete"));
$limit = 20;
$total = $totalDHCP_Configuration;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->calculatePagination($action, $start);
$offset = $oGrid->getOffsetValue();
$end = $oGrid->getEnd();
$arrData = null;
$arrResult = $pDHCP_Configuration->leerIPsFijas($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = "<input type='checkbox' name='DhcpConfID_{$value['id']}' />";
$arrTmp[1] = "<a href='?menu={$module_name}&action=view_dhcpconf&id=" . $value['id'] . "'>" . $value['hostname'] . "</a>";
$arrTmp[2] = $value['ipaddress'];
$arrTmp[3] = $value['macaddress'];
$arrData[] = $arrTmp;
}
}
$buttonDelete = "";
$arrGrid = array("title" => _tr('Assign IP Address to Host'), "icon" => "modules/{$module_name}/images/system_network_assign_ip_address.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "url" => array('menu' => $module_name, 'filter_field' => $filter_field, 'filter_value' => $filter_value), "columns" => array(0 => array("name" => $buttonDelete, "property1" => ""), 1 => array("name" => _tr('Host Name'), "property1" => ""), 2 => array("name" => _tr('IP Address'), "property1" => ""), 3 => array("name" => _tr('MAC Address'), "property1" => "")));
//begin section filter
$arrFormFilterDHCP_Configuration = createFieldFilter();
$oFilterForm = new paloForm($smarty, $arrFormFilterDHCP_Configuration);
$smarty->assign("SHOW", _tr('Show'));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData);
//end grid parameters
return $contenidoModulo;
}
示例13: reportOrgPermission
//.........这里部分代码省略.........
}
}
$filter_resource = htmlentities($filter_resource);
//buscamos en el arreglo del lenguaje la traduccion del recurso en caso de que exista
$lang = get_language();
//lenguage que esta siendo usado
$parameter_to_find = null;
if (isset($filter_resource)) {
if (trim($filter_resource) != "") {
if ($lang != "en") {
global $arrLang;
$filter_value = strtolower(trim($filter_resource));
$parameter_to_find[] = $filter_value;
//parametro de busqueda sin traduccion
foreach ($arrLang as $key => $value) {
$langValue = strtolower(trim($value));
if (preg_match("/^[[:alnum:]| ]*\$/", $filter_value)) {
if (strpos($langValue, $filter_value) !== FALSE) {
$parameter_to_find[] = $key;
}
}
}
} else {
$parameter_to_find[] = $filter_resource;
}
}
}
//obtenemos el numero de recursos disponibles del sistema
$total = 0;
if (count($arrOrgz) > 0) {
$total = $pACL->getNumResources($parameter_to_find, 'yes');
}
if ($total == false && $pACL->errMsg != "") {
$total = 0;
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("An error has ocurred to retrieved resources data"));
}
$limit = 25;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$url["menu"] = $module_name;
$url["filter_resource"] = $filter_resource;
$url["idOrganization"] = $idOrgFil;
$oGrid->setTitle(_tr("Organization Permission"));
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$arrColumn = array(_tr("Resource"), "<input type='checkbox' name='selectAll' id='selectAll' />" . _tr('Permit Access'));
$oGrid->setColumns($arrColumn);
$arrData = array();
if (count($arrOrgz) > 0 && $total > 0) {
//obtengo una lista con todos los recursos a los que una organizacion puede tener acceso
$arrResource = $pACL->getListResources($limit, $offset, $parameter_to_find, 'yes');
//lista de los recursos permitidos a la organizacion seleccionada organizacion
$arrResourceOrg = $pACL->getResourcesByOrg($idOrgFil, $parameter_to_find);
if ($arrResourceOrg === false || $arrResource === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("An error has ocurred to retrieve resource list.") . " " . _tr($pACL->errMsg));
} else {
$temp = array();
foreach ($arrResourceOrg as $value) {
$temp[] = $value["id"];
}
if (is_array($arrResource) && count($arrResource) > 0) {
foreach ($arrResource as $resource) {
$disabled = "";
if ($resource["id"] == 'usermgr' || $resource["id"] == 'grouplist' || $resource["id"] == 'userlist' || $resource["id"] == 'group_permission' || $resource["id"] == 'organization') {
$disabled = "disabled='disabled'";
}
$checked0 = "";
if (in_array($resource["id"], $temp)) {
$checked0 = "checked";
}
$arrTmp[0] = _tr($resource["description"]);
$arrTmp[1] = "<input type='checkbox' {$disabled} name='resource[" . $resource["id"] . "]' id='" . $resource["id"] . "' class='resource' {$checked0}>" . " " . _tr("Permit");
$arrData[] = $arrTmp;
}
}
}
}
$smarty->assign("SHOW", _tr("Show"));
$smarty->assign("resource_apply", $filter_resource);
if (count($arrOrgz) > 0) {
$oGrid->addSubmitAction("apply", _tr("Save"));
$oGrid->addComboAction("idOrganization", _tr("Organization"), $arrOrgz, $idOrgFil, "report");
$arrFormFilter = createFieldFilter();
$oFilterForm = new paloForm($smarty, $arrFormFilter);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Resource") . " = {$filter_resource}", $_POST, array("filter_resource" => ""));
$oGrid->showFilter(trim($htmlFilter));
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
//end grid parameters
return $contenidoModulo;
}
示例14: 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;
}
示例15: 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;
}