本文整理汇总了PHP中paloSantoGrid::fetchGrid方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::fetchGrid方法的具体用法?PHP paloSantoGrid::fetchGrid怎么用?PHP paloSantoGrid::fetchGrid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::fetchGrid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例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: report_adress_book
//.........这里部分代码省略.........
case '2':
$typeContact = 'Khách hàng công ty';
break;
case '3':
$typeContact = "Khách hàng đại lý";
break;
default:
break;
}
$phone_list = '';
if (isset($adress_book['number']) && count($adress_book['number']) > 0) {
foreach ($adress_book['number'] as $phone) {
$phone_list .= is_null($phone) || trim($phone) == '' ? '' : $phone . '\\n';
}
}
//SDT column
$email_list = '';
if (count($adress_book['email']) > 0) {
foreach ($adress_book['email'] as $email) {
$email_list .= is_null($email) || trim($email) == '' ? '' : $email . '\\n';
}
}
$arrTmp[] = $adress_book['customer_code'];
//Ten column
$arrTmp[] = $adress_book['firstname'];
//Ten column
$arrTmp[] = $adress_book['lastname'];
//Ten column
$arrTmp[] = $phone_list;
$arrTmp[] = $email_list;
$arrTmp[] = $adress_book['booker'];
$arrTmp[] = $adress_book['sale'];
$arrTmp[] = $adress_book['accountant'];
$arrTmp[] = $typeContact;
$arrTmp[] = $adress_book['membership'];
$arrTmp[] = $adress_book['payment'];
$arrData[] = $arrTmp;
}
} else {
foreach ($arrResult as $key => $adress_book) {
switch ($adress_book['type']) {
case '0':
$typeContact = '<img border=0 src="/modules/' . $module_name . '/images/nor-customer.png" title="Khách hàng lẽ"/>KLE';
break;
case '1':
$typeContact = '<img border=0 src="/modules/' . $module_name . '/images/fre-customer.png" title="Khách hàng lẽ thường xuyên"/>KLE-TX';
break;
case '2':
$typeContact = '<img border=0 src="/modules/' . $module_name . '/images/company.png" title="Khách hàng công ty"/>CTY';
break;
case '3':
$typeContact = '<img border=0 src="/modules/' . $module_name . '/images/agency.png" title="Khách hàng đại lý"/>DLY';
break;
default:
break;
}
$phone_list = '';
if (isset($adress_book['number']) && count($adress_book['number']) > 0) {
foreach ($adress_book['number'] as $phone) {
$phone1 = explode('-', $phone);
$call = trim($phone1[0]);
$phone_list .= is_null($call) || trim($call) == '' ? '' : "<a href='?menu={$module_name}&action=call2phone&id=" . $call . "'><img border=0 src='/modules/{$module_name}/images/call.png' title='Gọi số " . $call . "'/></a> " . $phone . '<br/>';
//SDT column
}
}
$email_list = '';
if (count($adress_book['email']) > 0) {
foreach ($adress_book['email'] as $email) {
$phone1 = explode('-', $email);
$addr = trim($phone1[0]);
$email_list .= is_null($addr) || trim($addr) == '' ? '' : '<a title="Gửi mail đến hộp mail này" href="mailto:' . $addr . '?Subject=[CallCenter]:" target="_top">' . $email . '</a><br/>';
}
}
$arrTmp[0] = "<input type='checkbox' name='contact_{$adress_book['id']}' />";
$arrTmp[1] = $adress_book['customer_code'];
//Ten column
$arrTmp[2] = $adress_book['firstname'];
//Ten column
$arrTmp[3] = $adress_book['lastname'];
//Ten column
$arrTmp[4] = $phone_list;
$arrTmp[5] = $email_list;
$arrTmp[6] = $adress_book['booker'];
$arrTmp[7] = $adress_book['sale'];
$arrTmp[8] = $adress_book['accountant'];
$arrTmp[9] = $typeContact;
$arrTmp[10] = $adress_book['membership'];
$arrTmp[11] = $adress_book['payment'];
$arrTmp[12] = "<a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img src='modules/{$module_name}/images/extra.png' title='Xem'></a> \n <a href='?menu={$module_name}&action=edit&id=" . $adress_book['id'] . "'><img src='modules/{$module_name}/images/edit.png' title='Sửa'></a> ";
$arrData[] = $arrTmp;
}
}
}
$oGrid->deleteList("Bạn có muốn xóa khách hàng này không?", "delete", "Xóa");
$arrGrid = array("title" => "Thông tin khách hàng", "url" => array('menu' => $module_name, 'filter' => $pattern), "icon" => "modules/{$module_name}/images/address_book.png", "width" => "99%", "start" => $inicio, "end" => $end, "total" => $total, "columns" => $arr_cols);
$oGrid->addNew("new", "Thêm khách hàng");
$oGrid->showFilter(trim($htmlFilter));
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
return $contenidoModulo;
}
示例5: listRepositories
function listRepositories($smarty, $module_name, $local_templates_dir, $arrConf)
{
global $arrLang;
$oRepositories = new PaloSantoRepositories();
$arrReposActivos = array();
$typeRepository = getParameter("typeRepository");
if (isset($_POST['submit_aceptar'])) {
foreach ($_POST as $key => $value) {
if (substr($key, 0, 5) == 'repo-') {
$arrReposActivos[] = substr($key, 5);
}
}
$oRepositories->setRepositorios($arrConf['ruta_repos'], $arrReposActivos, $typeRepository, $arrConf["main_repos"]);
}
$option["main"] = "";
$option["others"] = "";
$option["all"] = "";
$arrRepositorios = $oRepositories->getRepositorios($arrConf['ruta_repos'], $typeRepository, $arrConf["main_repos"]);
$limit = 40;
$total = count($arrRepositorios);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$arrData = array();
$version = $oRepositories->obtenerVersionDistro();
$arch = $oRepositories->obtenerArquitectura();
// print($arch);
if (is_array($arrRepositorios)) {
for ($i = $offset; $i < $end; $i++) {
$activo = "";
if ($arrRepositorios[$i]['activo']) {
$activo = "checked='checked'";
}
$arrData[] = array("<input {$activo} name='repo-" . $arrRepositorios[$i]['id'] . "' type='checkbox' id='repo-{$i}' />", $valor = str_replace(array("\$releasever", "\$basearch"), array($version, $arch), $arrRepositorios[$i]['name']));
}
}
if (isset($typeRepository)) {
$oGrid->setURL("?menu={$module_name}&typeRepository={$typeRepository}");
$_POST["typeRepository"] = $typeRepository;
} else {
$oGrid->setURL("?menu={$module_name}");
$_POST["typeRepository"] = "main";
}
$arrGrid = array("title" => $arrLang["Repositories"], "icon" => "modules/repositories/images/system_updates_repositories.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => $arrLang["Active"], "property1" => ""), 1 => array("name" => $arrLang["Name"], "property1" => "")));
$oGrid->customAction('submit_aceptar', _tr('Save/Update'));
$oGrid->addButtonAction("default", _tr('Default'), null, "defaultValues({$total},'{$version}','{$arch}')");
$FilterForm = new paloForm($smarty, createFilter());
$arrOpt = array("main" => _tr('Main'), "others" => _tr('Others'), "all" => _tr('All'));
if (isset($arrOpt[$typeRepository])) {
$valorfiltro = $arrOpt[$typeRepository];
} else {
$valorfiltro = _tr('Main');
}
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Repo") . " = " . $valorfiltro, $_POST, array("typeRepository" => "main"), true);
$htmlFilter = $FilterForm->fetchForm("{$local_templates_dir}/new.tpl", "", $_POST);
$oGrid->showFilter($htmlFilter);
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
return $contenidoModulo;
}
示例6: report_adress_book
//.........这里部分代码省略.........
$field = "name";
}
$pattern = "%{$_POST['pattern']}%";
$namePattern = $_POST['pattern'];
$nameField = $arrComboElements[$field];
}
$arrFilter = array("select_directory_type" => $directory_type, "field" => $field, "pattern" => $namePattern);
$startDate = $endDate = date("Y-m-d H:i:s");
$oGrid = new paloSantoGrid($smarty);
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Phone Directory") . " = {$directory_type} ", $arrFilter, array("select_directory_type" => "internal"), true);
$oGrid->addFilterControl(_tr("Filter applied ") . $field . " = {$namePattern}", $arrFilter, array("field" => "name", "pattern" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter_adress_book.tpl", "", $arrFilter);
if ($directory_type == 'external') {
$total = $padress_book->getAddressBook(NULL, NULL, $field, $pattern, TRUE, $id_user);
} else {
$total = $padress_book->getDeviceFreePBX($dsnAsterisk, NULL, NULL, $field, $pattern, TRUE);
}
$total_datos = $total[0]["total"];
//Paginacion
$limit = 20;
$total = $total_datos;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$inicio = $total == 0 ? 0 : $offset + 1;
$end = $offset + $limit <= $total ? $offset + $limit : $total;
//Fin Paginacion
if ($directory_type == 'external') {
$arrResult = $padress_book->getAddressBook($limit, $offset, $field, $pattern, FALSE, $id_user);
} else {
$arrResult = $padress_book->getDeviceFreePBX($dsnAsterisk, $limit, $offset, $field, $pattern);
}
$arrData = null;
//echo print_r($arrResult,true);
if (is_array($arrResult) && $total > 0) {
$arrMails = array();
$typeContact = "";
if ($directory_type == 'internal') {
$arrMails = $padress_book->getMailsFromVoicemail();
}
foreach ($arrResult as $key => $adress_book) {
if ($directory_type == 'external') {
$exten = explode(".", $adress_book["picture"]);
if (isset($exten[count($exten) - 1])) {
$exten = $exten[count($exten) - 1];
}
$picture = "/var/www/address_book_images/{$adress_book['id']}_Thumbnail.{$exten}";
if (file_exists($picture)) {
$arrTmp[1] = "<a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img alt='image' border='0' src='index.php?menu={$module_name}&action=getImage&idPhoto={$adress_book['id']}&thumbnail=yes&rawmode=yes'/></a>";
} else {
$defaultPicture = "modules/{$module_name}/images/Icon-user_Thumbnail.png";
$arrTmp[1] = "<a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img border='0' alt='image' src='{$defaultPicture}'/></a>";
}
}
$arrTmp[0] = $directory_type == 'external' ? "<input type='checkbox' name='contact_{$adress_book['id']}' />" : '';
if ($directory_type == 'external') {
$email = $adress_book['email'];
if ($adress_book['status'] == 'isPublic') {
if ($id_user == $adress_book['iduser']) {
$typeContact = "<div><div style='float: left;'><a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img alt='public' style='padding: 5px;' title='" . $arrLang['Public Contact'] . "' border='0' src='modules/{$module_name}/images/public_edit.png' /></a></div><div style='padding: 16px 0px 0px 5px; text-align:center;'><span style='visibility: hidden;'>" . $arrLang['Public editable'] . "</span></div></div>";
$arrTmp[0] = "<input type='checkbox' name='contact_{$adress_book['id']}' />";
} else {
$typeContact = "<div><div style='float: left;'><a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img alt='public' style='padding: 5px;' title='" . $arrLang['Public Contact'] . "' border='0' src='modules/{$module_name}/images/public.png' /></a></div><div style='padding: 16px 0px 0px 5px; text-align:center;'><span style='visibility: hidden;'>" . $arrLang['Public not editable'] . "</span></div></div>";
$arrTmp[0] = "";
}
} else {
$typeContact = "<div><div style='float: left;'><a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'><img alt='private' style='padding: 5px;' title='" . $arrLang['Private Contact'] . "' border='0' src='modules/{$module_name}/images/contact.png' /></a></div><div style='padding: 16px 0px 0px 5px; text-align:center;'><span style='visibility: hidden;'>" . $arrLang['Private'] . "</span></div></div>";
}
} else {
if (isset($arrMails[$adress_book['id']])) {
$email = $arrMails[$adress_book['id']];
$typeContact = "<div><div style='float: left;'><img alt='public' title='" . $arrLang['Public Contact'] . "' src='modules/{$module_name}/images/public.png' /></div><div style='padding: 16px 0px 0px 5px; text-align:center;'><span style='visibility: hidden;'>" . $arrLang['Public not editable'] . "</span></div></div>";
} else {
$email = '';
$typeContact = "<div><div style='float: left;'><img alt='public' title='" . $arrLang['Public Contact'] . "' src='modules/{$module_name}/images/public.png' /></div><div style='padding: 16px 0px 0px 5px; text-align:center;'><span style='visibility: hidden;'>" . $arrLang['Public not editable'] . "</span></div></div>";
}
}
$arrTmp[2] = $directory_type == 'external' ? "<a href='?menu={$module_name}&action=show&id=" . $adress_book['id'] . "'>" . htmlspecialchars($adress_book['last_name'], ENT_QUOTES, "UTF-8") . " " . htmlspecialchars($adress_book['name'], ENT_QUOTES, "UTF-8") . "</a>" : $adress_book['description'];
$arrTmp[3] = $directory_type == 'external' ? $adress_book['telefono'] : $adress_book['id'];
$arrTmp[4] = $email;
$arrTmp[5] = "<a href='?menu={$module_name}&action=call2phone&id=" . $adress_book['id'] . "&type=" . $directory_type . "'><img border=0 src='/modules/{$module_name}/images/call.png' /></a>";
$arrTmp[6] = "<a href='?menu={$module_name}&action=transfer_call&id=" . $adress_book['id'] . "&type=" . $directory_type . "'>{$arrLang["Transfer"]}</a>";
$arrTmp[7] = $typeContact;
$arrData[] = $arrTmp;
}
}
if ($directory_type == 'external') {
$name = "";
$picture = $arrLang["picture"];
$oGrid->deleteList(_tr("Are you sure you wish to delete the contact."), "delete", _tr("Delete"));
} else {
$name = "";
$picture = "";
}
$arrGrid = array("title" => $arrLang["Address Book"], "url" => array('menu' => $module_name, 'filter' => $pattern, 'select_directory_type' => $directory_type), "icon" => "modules/{$module_name}/images/address_book.png", "width" => "99%", "start" => $inicio, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => $name, "property1" => ""), 1 => array("name" => $picture, "property1" => ""), 2 => array("name" => $arrLang["Name"], "property1" => ""), 3 => array("name" => $arrLang["Phone Number"], "property1" => ""), 4 => array("name" => $arrLang["Email"], "property1" => ""), 5 => array("name" => $arrLang["Call"], "property1" => ""), 6 => array("name" => $arrLang["Transfer"], "property1" => ""), 7 => array("name" => $arrLang["Type Contact"], "property1" => "")));
$oGrid->addNew("new", _tr("New Contact"));
$oGrid->showFilter(trim($htmlFilter));
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
return $contenidoModulo;
}
示例7: _moduleContent
//.........这里部分代码省略.........
$oGrid->showFilter($htmlFilter);
$bExportando = $bElastixNuevo ? $oGrid->isExportAction() : isset($_GET['exportcsv']) && $_GET['exportcsv'] == 'yes' || isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' || isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes';
// Ejecutar la consulta con las variables ya validadas
$arrData = array();
$total = 0;
if (is_array($paramLista)) {
$total = $oCallsDetail->contarDetalleLlamadas($paramLista);
if (is_null($total)) {
$smarty->assign("mb_title", _tr("Error when connecting to database"));
$smarty->assign("mb_message", $oCallsDetail->errMsg);
$total = 0;
} else {
// Habilitar la exportación de todo el contenido consultado
if ($bExportando) {
$limit = $total;
}
// Calcular el offset de la petición de registros
if ($bElastixNuevo) {
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
} else {
// Si se quiere avanzar a la sgte. pagina
if (isset($_GET['nav']) && $_GET['nav'] == "end") {
// Mejorar el sgte. bloque.
if ($total % $limit == 0) {
$offset = $total - $limit;
} else {
$offset = $total - $total % $limit;
}
}
// Si se quiere avanzar a la sgte. pagina
if (isset($_GET['nav']) && $_GET['nav'] == "next") {
$offset = $_GET['start'] + $limit - 1;
}
// Si se quiere retroceder
if (isset($_GET['nav']) && $_GET['nav'] == "previous") {
$offset = $_GET['start'] - $limit - 1;
}
}
// Ejecutar la consulta de los datos en el offset indicado
$recordset = $oCallsDetail->leerDetalleLlamadas($paramLista, $limit, $offset);
// add STT
for ($i = 0; $i < count($recordset); $i++) {
$recordset[$i]['stt'] = $i + 1;
}
if (!is_array($recordset)) {
$smarty->assign("mb_title", _tr("Error when connecting to database"));
$smarty->assign("mb_message", $oCallsDetail->errMsg);
$total = 0;
} else {
function _calls_detail_map_recordset($cdr)
{
$mapaEstados = array('abandonada' => 'Bỏ nhỡ', 'Abandoned' => 'Bỏ nhỡ', 'terminada' => 'Đã nghe', 'Success' => 'Đã nghe', 'fin-monitoreo' => _tr('End Monitor'), 'Failure' => _tr('Failure'), 'NoAnswer' => _tr('NoAnswer'), 'OnQueue' => _tr('OnQueue'), 'Placing' => _tr('Placing'), 'Ringing' => _tr('Ringing'), 'ShortCall' => _tr('ShortCall'), 'activa' => 'Đang gọi');
return array($cdr['stt'], $cdr[0], htmlentities($cdr[1], ENT_COMPAT, "UTF-8"), substr($cdr[2], 0, 10), substr($cdr[2], 11, 8), substr($cdr[3], 0, 10), substr($cdr[3], 11, 8), is_null($cdr[4]) ? '-' : formatoSegundos($cdr[4]), is_null($cdr[5]) ? '-' : formatoSegundos($cdr[5]), $cdr[6], $cdr[8], $cdr[9], isset($mapaEstados[$cdr[10]]) ? $mapaEstados[$cdr[10]] : _tr($cdr[10]), is_null($cdr[12]) || trim($cdr[12] == '') ? '' : '<a href="javascript:void(0)" onclick="view_note(\'' . $cdr[11] . '\')">Xem</a>');
}
$arrData = array_map('_calls_detail_map_recordset', $recordset);
}
}
}
$arrColumnas = array('STT', 'Số Agent', 'Nhân viên', _tr("Start Date"), _tr("Start Time"), _tr("End Date"), _tr("End Time"), "Thời lượng", _tr("Thời gian chờ"), _tr("Queue"), _tr("Số điện thoại"), _tr("Chuyển máy"), _tr("Status"), 'Nội dung');
if ($bElastixNuevo) {
$oGrid->setURL(construirURL($urlVars, array("nav", "start")));
$oGrid->setData($arrData);
$oGrid->setColumns($arrColumnas);
$oGrid->setTitle('Chi tiết cuộc gọi Call Center');
$oGrid->pagingShow(true);
$oGrid->setNameFile_Export(_tr("Calls Detail"));
return $oGrid->fetchGrid();
} else {
global $arrLang;
$url = construirURL($urlVars, array("nav", "start"));
function _map_name($s)
{
return array('name' => $s);
}
$arrGrid = array("title" => _tr("Calls Detail"), "url" => $url, "icon" => "images/user.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $offset + $limit <= $total ? $offset + $limit : $total, "total" => $total, "columns" => array_map('_map_name', $arrColumnas));
if (isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes' && method_exists($oGrid, 'fetchGridPDF')) {
return $oGrid->fetchGridPDF($arrGrid, $arrData);
}
if (isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' && method_exists($oGrid, 'fetchGridXLS')) {
return $oGrid->fetchGridXLS($arrGrid, $arrData);
}
if ($bExportando) {
header("Cache-Control: private");
header("Pragma: cache");
// Se requiere para HTTPS bajo IE6
header('Content-disposition: inline; filename="calls_detail.csv"');
header("Content-Type: text/csv; charset=UTF-8");
}
if ($bExportando) {
return $oGrid->fetchGridCSV($arrGrid, $arrData);
}
$sContenido = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
if (strpos($sContenido, '<form') === FALSE) {
$sContenido = "<form method=\"POST\" style=\"margin-bottom:0;\" action=\"{$url}\">{$sContenido}</form>";
}
return $sContenido;
}
}
示例8: report_backup_restore
function report_backup_restore($smarty, $module_name, $local_templates_dir, $dir_backup, &$pDB)
{
$total_archivos = array_reverse(array_map('basename', glob("{$dir_backup}/*.tar")));
// Paginacion
$limit = 10;
$total = count($total_archivos);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$nombre_archivos = array_slice($total_archivos, $offset, $limit);
//Fin Paginacion
// obtencion de parametros desde la base
$pFTPBackup = new paloSantoFTPBackup($pDB);
$_DATA = $pFTPBackup->getStatusAutomaticBackupById(1);
if (!(is_array($_DATA) & count($_DATA) > 0)) {
$_DATA['status'] = "DISABLED";
}
$arrData = null;
if (is_array($nombre_archivos) && $total > 0) {
foreach ($nombre_archivos as $key => $nombre_archivo) {
$arrTmp[0] = "<input type='checkbox' name='chk[" . $nombre_archivo . "]' id='chk[" . $nombre_archivo . "]'/>";
$arrTmp[1] = "<a href='?menu={$module_name}&action=download_file&file_name={$nombre_archivo}&rawmode=yes'>{$nombre_archivo}</a>";
$fecha = "";
// se parsea el archivo para obtener la fecha
if (preg_match("/\\w*-\\d{4}\\d{2}\\d{2}\\d{2}\\d{2}\\d{2}-\\w{2}\\.\\w*/", $nombre_archivo)) {
//elastixbackup-20110720122759-p7.tar
$arrMatchFile = preg_split("/-/", $nombre_archivo);
$data = $arrMatchFile[1];
$fecha = substr($data, -8, 2) . "/" . substr($data, -10, 2) . "/" . substr($data, 0, 4) . " " . substr($data, -6, 2) . ":" . substr($data, -4, 2) . ":" . substr($data, -2, 2);
$id = $arrMatchFile[1] . "-" . $arrMatchFile[2];
}
$arrTmp[2] = $fecha;
$arrTmp[3] = "<input type='submit' name='submit_restore[" . $nombre_archivo . "]' value='" . _tr('Restore') . "' class='button' />";
$arrData[] = $arrTmp;
}
}
$arrGrid = array("title" => _tr('Backup List'), "url" => array('menu' => $module_name), "icon" => "/modules/{$module_name}/images/system_backup_restore.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => ""), 1 => array("name" => _tr('Name Backup')), 2 => array("name" => _tr('Date')), 3 => array("name" => _tr('Action'))));
$time = $_DATA['status'];
$smarty->assign("FILE_UPLOAD", _tr('File Upload'));
$smarty->assign("AUTOMATIC", _tr('AUTOMATIC'));
$smarty->assign("UPLOAD", _tr('Upload'));
$smarty->assign("FTP_BACKUP", _tr('FTP Backup'));
$oGrid->addNew("backup", _tr("Backup"));
$oGrid->deleteList(_tr("Are you sure you wish to delete backup (s)?"), 'delete_backup', _tr("Delete"));
$oGrid->customAction("view_form_FTP", _tr("FTP Backup"));
$backupIntervals = array('DISABLED' => _tr('DISABLED'), 'DAILY' => _tr('DAILY'), 'MONTHLY' => _tr('MONTHLY'), 'WEEKLY' => _tr('WEEKLY'));
$oGrid->addComboAction("time", _tr("AUTOMATIC"), $backupIntervals, $time, 'automatic');
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData);
return $contenidoModulo;
}
示例9: reportReportCall
//.........这里部分代码省略.........
$value = isset($value_tmp) ? $value_tmp : "";
$order_by = isset($order_by_tmp) ? $order_by_tmp : 1;
$order_type = isset($order_type_tmp) ? $order_type_tmp : "asc";
$date_from = isset($date_ini_tmp) ? $date_ini_tmp : date("d M Y");
$date_to = isset($date_end_tmp) ? $date_end_tmp : date("d M Y");
$date_ini = translateDate($date_from) . " 00:00:00";
$date_end = translateDate($date_to) . " 23:59:59";
//**********************************
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$limit = 40;
$total = $pReportCall->ObtainNumberDevices($type, $value);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->calculatePagination($action, $start);
$offset = $oGrid->getOffsetValue();
$end = $oGrid->getEnd();
$urlFields = array('menu' => $module_name, 'option_fil' => $type, 'value_fil' => $value, 'date_from' => $date_from, 'date_to' => $date_to);
$url = construirUrl($urlFields, array('nav', 'start'));
$urlFields['order_by'] = $order_by;
$urlFields['order_type'] = $order_type;
$smarty->assign("order_by", $order_by);
$smarty->assign("order_type", $order_type);
$arrData = null;
$arrResult = $pReportCall->ObtainReportCall($limit, $offset, $date_ini, $date_end, $type, $value, $order_by, $order_type);
$order_type = $order_type == "desc" ? "asc" : "desc";
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $val) {
$ext = $val['extension'];
$arrTmp[0] = $ext;
$arrTmp[1] = $val['user_name'];
$arrTmp[2] = $val['num_incoming_call'];
$arrTmp[3] = $val['num_outgoing_call'];
$arrTmp[4] = "<label style='color: green;' title='{$val['duration_incoming_call']} {$arrLang['seconds']}'>" . $pReportCall->Sec2HHMMSS($val['duration_incoming_call']) . "</label>";
$arrTmp[5] = "<label style='color: green;' title='{$val['duration_outgoing_call']} {$arrLang['seconds']}'>" . $pReportCall->Sec2HHMMSS($val['duration_outgoing_call']) . "</label>";
$arrTmp[6] = "<a href='javascript: popup_ventana(\"?menu={$module_name}&action=graph&rawmode=yes&ext={$ext}&dini={$date_ini}&dfin={$date_end}\");'>" . "" . $arrLang['Call Details'] . "</a>";
$arrData[] = $arrTmp;
}
}
$img = "<img src='images/flecha_{$order_type}.png' border='0' align='absmiddle'>";
$leyend_1 = "<a class='link_summary_off' href='{$url}&order_by=1&order_type=asc'>{$arrLang["Extension"]}</a>";
$leyend_2 = "<a class='link_summary_off' href='{$url}&order_by=2&order_type=asc'>{$arrLang["User name"]}</a>";
$leyend_3 = "<a class='link_summary_off' href='{$url}&order_by=3&order_type=asc'>{$arrLang["Num. Incoming Calls"]}</a>";
$leyend_4 = "<a class='link_summary_off' href='{$url}&order_by=4&order_type=asc'>{$arrLang["Num. Outgoing Calls"]}</a>";
$leyend_5 = "<a class='link_summary_off' href='{$url}&order_by=5&order_type=asc'>{$arrLang["Sec. Incoming Calls"]}</a>";
$leyend_6 = "<a class='link_summary_off' href='{$url}&order_by=6&order_type=asc'>{$arrLang["Sec. Outgoing Calls"]}</a>";
if ($order_by == 1) {
$leyend_1 = "<a class='link_summary_on' href='{$url}&order_by=1&order_type={$order_type}'>{$arrLang["Extension"]} {$img}</a>";
} else {
if ($order_by == 2) {
$leyend_2 = "<a class='link_summary_on' href='{$url}&order_by=2&order_type={$order_type}'>{$arrLang["User name"]} {$img}</a>";
} else {
if ($order_by == 3) {
$leyend_3 = "<a class='link_summary_on' href='{$url}&order_by=3&order_type={$order_type}'>{$arrLang["Num. Incoming Calls"]} {$img}</a>";
} else {
if ($order_by == 4) {
$leyend_4 = "<a class='link_summary_on' href='{$url}&order_by=4&order_type={$order_type}'>{$arrLang["Num. Outgoing Calls"]} {$img}</a>";
} else {
if ($order_by == 5) {
$leyend_5 = "<a class='link_summary_on' href='{$url}&order_by=5&order_type={$order_type}'>{$arrLang["Sec. Incoming Calls"]} {$img}</a>";
} else {
if ($order_by == 6) {
$leyend_6 = "<a class='link_summary_on' href='{$url}&order_by=6&order_type={$order_type}'>{$arrLang["Sec. Outgoing Calls"]} {$img}</a>";
}
}
}
}
}
}
$arrGrid = array("title" => $arrLang["Summary by Extension"], "icon" => "images/list.png", "width" => "100%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "url" => $urlFields, "columns" => array(0 => array("name" => $leyend_1, "property1" => ""), 1 => array("name" => $leyend_2, "property1" => ""), 2 => array("name" => $leyend_3, "property1" => ""), 3 => array("name" => $leyend_4, "property1" => ""), 4 => array("name" => $leyend_5, "property1" => ""), 5 => array("name" => $leyend_6, "property1" => ""), 6 => array("name" => $arrLang["Details"], "property1" => "")));
//begin section filter
$arrFormFilterReportCall = createFieldForm($arrLang);
$oFilterForm = new paloForm($smarty, $arrFormFilterReportCall);
$_POST['option_fil'] = $type;
$_POST['value_fil'] = $value;
$_POST['date_from'] = $date_from;
$_POST['date_to'] = $date_to;
$smarty->assign("SHOW", $arrLang["Show"]);
if ($_POST["date_from"] === "") {
$_POST["date_from"] = " ";
}
if ($_POST['date_to'] === "") {
$_POST['date_to'] = " ";
}
$oGrid->addFilterControl(_tr("Filter applied: ") . _tr("Start Date") . " = " . $date_from . ", " . _tr("End Date") . " = " . $date_to, $_POST, array("date_from" => date("d M Y"), "date_to" => date("d M Y")), true);
$valueType = "";
if (!is_null($type)) {
if ($type == "Ext") {
$valueType = _tr("Extension");
} else {
$valueType = _tr("User");
}
}
$oGrid->addFilterControl(_tr("Filter applied: ") . $valueType . " = " . $value, $_POST, array("option_fil" => "Ext", "value_fil" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
return $contenidoModulo;
}
示例10: 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;
}
示例11: 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;
//.........这里部分代码省略.........
示例12: 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;
}
示例13: 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;
}
}
示例14: reportListadodeCallTypes
function reportListadodeCallTypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pListadodeCallTypes = new paloSantoListadodeCallTypes($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Listado de Call Types"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Listado de Call Types"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña"), _tr("Call Type"), _tr("Clase de Call Type"), _tr("Peso"), _tr("Status"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pListadodeCallTypes->getNumListadodeCallTypes($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 = $pListadodeCallTypes->getListadodeCallTypes($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['campania'];
$arrTmp[1] = $value['call_type'];
$arrTmp[2] = $value['clase'];
$arrTmp[3] = $value['peso'];
$arrTmp[4] = $value['status'] == "A" ? "Activo" : "Inactivo";
$arrTmp[5] = "<a href=index.php?menu={$module_name}&id={$value['id']}&id_campania={$value['id_campania']}&action=change_status&status=";
if ($value['status'] == "A") {
$arrTmp[5] .= "I";
$accion = "Desactivar";
} else {
$arrTmp[5] .= "A";
$accion = "Activar";
}
$arrTmp[5] .= ">{$accion}</a>";
$arrTmp[5] .= " <a href=index.php?menu=hispana_call_types&id={$value['id']}&id_campania={$value['id_campania']}&action=view_edit>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: 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();
}