本文整理汇总了PHP中paloSantoGrid::setWidth方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::setWidth方法的具体用法?PHP paloSantoGrid::setWidth怎么用?PHP paloSantoGrid::setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::setWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
//.........这里部分代码省略.........
示例4: reportANI
function reportANI($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$smarty->assign("SHOW_DIV_ERROR", "0");
//FIXED: can show div error message with javascript
$smarty->assign("mb_message", "hide");
//FIXED: can show div error message with javascript
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$ani_prefix = getParameter("ani_prefix");
$pANI = new paloSantoANI($pDB, $domain);
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['ani_prefix'] = $ani_prefix;
$total = $pANI->getNumANI($domain, $ani_prefix);
$arrOrgz = array();
if ($credentials['userlevel'] == "superadmin") {
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
}
if ($total === false) {
$error = $pANI->errMsg;
$total = 0;
}
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$oGrid->setTitle(_tr('ANI List'));
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url);
$arrColum = array();
if ($credentials['userlevel'] == "superadmin") {
$arrColum[] = _tr("Organization");
}
$arrColum[] = _tr("Trunk Name");
$arrColum[] = _tr("Prefix ANI");
$oGrid->setColumns($arrColum);
$arrANI = array();
$arrData = array();
if ($total != 0) {
$arrANI = $pANI->getANI($domain, $ani_prefix, $limit, $offset);
}
if ($arrANI === false) {
$error = _tr("Error to obtain ANI") . $pANI->errMsg;
$arrANI = array();
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
$smarty->assign("SHOW_DIV_ERROR", "1");
}
foreach ($arrANI as $row) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$row["organization_domain"]];
}
$arrTmp[] = $row["name"];
$arrTmp[] = "<input type='text' style='width:60px; text-align:center;' id='text#{$row['organization_domain']}#{$row['trunkid']}' value='{$row['ani_prefix']}' /> \n <input type='button' id='button#{$row['organization_domain']}#{$row['trunkid']}' value='" . _tr("Save") . "' />";
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) == 0) {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", _tr("It's necesary you create at least one organization so you can use this module"));
$smarty->assign("SHOW_DIV_ERROR", "1");
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["ani_prefix"] = $ani_prefix;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("ANI Prefix") . " = " . $ani_prefix, $_POST, array("ani_prefix" => ""));
$arrFormElements = createFieldFilter($arrOrgz);
$oFilterForm = new paloForm($smarty, $arrFormElements);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
return $oGrid->fetchGrid(array(), $arrData);
}
示例5: reportOrgPermission
function reportOrgPermission($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrCredentiasls)
{
$pACL = new paloACL($pDB);
$pORGZ = new paloSantoOrganization($pDB);
$arrGroups = array();
$arrOrgz = array();
$filter_resource = getParameter("filter_resource");
$idOrgFil = getParameter("idOrganization");
$orgTmp = $pORGZ->getOrganization(array());
if ($orgTmp === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr($pORGZ->errMsg));
} elseif (count($orgTmp) == 0) {
$smarty->assign("mb_title", _tr("MESSAGE"));
$msg = _tr("You haven't created any organization");
$smarty->assign("mb_message", $msg);
} else {
//si el usuario a selecionado una organizacion comprobamos que esta exista
//caso contrario procedemos a sellecionar la primera disponible
$flag = false;
foreach ($orgTmp as $value) {
$arrOrgz[$value["id"]] = $value["name"];
if ($value["id"] == $idOrgFil) {
$flag = true;
}
}
if (!$flag) {
$idOrgFil = $orgTmp[0]['id'];
}
}
$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') {
//.........这里部分代码省略.........
示例6: reportQueue
function reportQueue($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'];
}
$queue_name = getParameter("queue_name");
$pQueue = new paloQueuePBX($pDB, $domain);
$queue_number = getParameter("queue_number");
if (isset($queue_number) && $queue_number != '') {
$expression = $pQueue->getRegexPatternFromAsteriskPattern($queue_number);
if ($expression === false) {
$queue_number = '';
}
}
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['queue_number'] = $queue_number;
//queue_number
$url['queue_name'] = $queue_name;
//queue_name
$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;
//.........这里部分代码省略.........
示例7: reportExten
function reportExten($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$pExten = new paloSantoExtensions($pDB);
$pORGZ = new paloSantoOrganization($pDB);
$error = '';
$domain = getParameter("organization");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$extension = getParameter("extension");
if (isset($extension) && $extension != '') {
$pPBX = new paloAsteriskDB($pDB);
$expression = $pPBX->getRegexPatternFromAsteriskPattern($extension);
if ($expression === false) {
$extension = '';
}
}
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['extension'] = $extension;
$total = $pExten->getNumExtensions($domain, $extension);
$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 = $pExten->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('Extensions 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") {
$arrColum[] = _tr("Organization");
}
$arrColum[] = _tr("Extension");
$arrColum[] = _tr("Caller ID");
$arrColum[] = _tr("Technology");
$arrColum[] = _tr("Device");
$arrColum[] = _tr("Context");
$arrColum[] = _tr("User");
$arrColum[] = _tr("Voicemail");
$arrColum[] = _tr("Recording In") . " / " . _tr("Recording Out");
$oGrid->setColumns($arrColum);
$arrExtens = array();
$arrData = array();
if ($total != 0) {
$arrExtens = $pExten->getExtensions($domain, $extension, $limit, $offset);
}
if ($arrExtens === false) {
$error = _tr("Error to obtain extensions") . $pExten->errMsg;
$arrExtens = array();
} else {
foreach ($arrExtens as $exten) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$exten["organization_domain"]];
}
$arrTmp[] = " <a href='?menu=extensions&action=view&id_exten=" . $exten['id'] . "&organization={$exten['organization_domain']}'>" . $exten["exten"] . "</a>";
$arrTmp[] = $exten['clid_name'] . " <{$exten['clid_number']}>";
$arrTmp[] = strtoupper($exten['tech']);
$arrTmp[] = $exten['device'];
$arrTmp[] = $exten['context'];
$query = "Select username from acl_user where extension=? and id_group in (select g.id from acl_group g join organization o on g.id_organization=o.id where o.domain=?)";
$result = $pDB->getFirstRowQuery($query, false, array($exten["exten"], $exten["organization_domain"]));
if ($result != false) {
$arrTmp[] = $result[0];
} else {
$arrTmp[] = _tr("Nobody");
}
if (isset($exten["voicemail"])) {
if ($exten["voicemail"] != "novm") {
$arrTmp[] = "yes";
} else {
$arrTmp[] = "no";
}
} else {
$arrTmp[] = "no";
}
$arrTmp[] = _tr($exten["record_in"]) . " / " . _tr($exten["record_out"]);
$arrData[] = $arrTmp;
}
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
//.........这里部分代码省略.........
示例8: showCallers
function showCallers($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$success = false;
$id_conf = getParameter("id_conf");
$domain = getParameter('organization');
if ($credentials['userlevel'] != 'superadmin') {
$domain = $credentials['domain'];
}
$pConf = new paloConference($pDB, $domain);
$conference = $pConf->getConferenceById($id_conf);
if ($conference == false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", $pConf->errMsg);
return reportConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
} else {
$date = time();
if ($date >= strtotime($conference["startTime"]) && $date <= strtotime($conference["endtime"]) || $conference["startTime"] == "1900-01-01 12:00:00") {
$room = $conference["confno"];
$total = $conference["members"];
} else {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("Conference out of Time"));
return reportConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
}
}
$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('Conference') . ": {$conference['name']} ({$conference['ext_conf']})");
//$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 = "?menu={$module_name}&action=current_conf&id_conf={$id_conf}");
//permission
$invite_part = in_array("admin_conference_participant", $arrPermission);
$arrColum = array();
$arrColum[] = _tr("Orden Join");
$arrColum[] = _tr("CallerId");
$arrColum[] = _tr("Time in Conference");
$arrColum[] = _tr("Mode");
if ($invite_part) {
$arrColum[] = "<input type='button' name='mute_caller' value=" . _tr("Mute") . " class='button' onclick='javascript:muteCaller()'/>";
$msgKill = _tr("Are you sure you wish to Kick all caller (s)?");
$arrColum[] = "<input type='button' name='kick_caller' value=" . _tr("Kick") . " class='button' onclick=\"javascript:kickCaller('{$msgKill}');\"/>";
}
$oGrid->setColumns($arrColum);
$arrData = array();
$arrMemb = array();
if ($total != 0) {
$arrMemb = $pConf->ObtainCallers($room);
}
$session = getSession();
if ($arrMemb === false) {
$error = _tr("Error getting conference data.") . $pConf->errMsg;
} else {
$membPagg = array_slice($arrMemb, $offset, $limit);
foreach ($membPagg as $memb) {
$arrTmp = array();
$arrTmp[0] = $memb['userId'];
$arrTmp[1] = trim($memb['callerId']);
$arrTmp[2] = $memb['duration'];
$arrTmp[3] = empty($memb['mode']) ? "user" : "admin";
if ($invite_part) {
$status = strstr($memb['status'], "Muted");
//falso si no encuentra la palabra en el arreglo
$checked = empty($status) ? "" : "checked";
$arrTmp[4] = "<input type='checkbox' name=mute_{$memb['userId']} class='conf_mute' {$checked}>";
$arrTmp[5] = "<input type='checkbox' name=kick_{$memb['userId']} class='conf_kick'>";
}
$arrData[] = $arrTmp;
//se usa para comprobar si ha habido cambios en el estado de las conferencias
$session['conference']["current_conf"][$memb['userId']] = $memb['callerId'];
}
}
//se escribe en session el estado actual de las conferencias
if (!isset($session['conference']["current_conf"])) {
$session['conference']["current_conf"] = array();
}
putSession($session);
//filters
$extens = $pConf->getAllDevice($domain);
$arrExten = array("" => "--unselected--");
if ($extens != false) {
$astMang = AsteriskManagerConnect($errorM);
$result = $pConf->getCodeByDomain($domain);
foreach ($extens as $value) {
$cidname = "";
if ($astMang != false && $result != false) {
$cidname = $astMang->database_get("EXTUSER/" . $result["code"] . "/" . $value["exten"], "cidname");
}
$arrExten[$value["dial"]] = isset($cidname) ? $cidname . " <{$value["exten"]}>" : $value["exten"] . " ({$value["dial"]})";
}
}
//.........这里部分代码省略.........
示例9: reportIVR
function reportIVR($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$name = getParameter("name");
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != 'superadmin') {
$domain = $credentials['domain'];
}
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['name'] = $name;
if ($credentials['userlevel'] == "superadmin") {
if (isset($domain) && $domain != "all") {
$pIVR = new paloIvrPBX($pDB, $domain);
} else {
$pIVR = new paloIvrPBX($pDB, "");
}
$total = $pIVR->getTotalIvr($domain, $name);
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
} else {
$arrOrgz = array();
$pIVR = new paloIvrPBX($pDB, $domain);
$total = $pIVR->getTotalIvr($domain, $name);
}
if ($total === false) {
$error = $pIVR->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('Ivrs List'));
$oGrid->setUrl($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
if ($credentials['userlevel'] == "superadmin") {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Ivr Name");
$arrColumns[] = _tr("Timeout");
$arrColumns[] = _tr("Enable Call Extensions");
$arrColumns[] = _tr("# Loops");
$oGrid->setColumns($arrColumns);
$arrData = array();
$arrIVR = array();
if ($total != 0) {
$arrIVR = $pIVR->getIvrs($domain, $name, $limit, $offset);
}
if ($arrIVR === false) {
$error = _tr("Error getting ivr data.") . $pIVR->errMsg;
} else {
foreach ($arrIVR as $ivr) {
$arrTmp = array();
if ($credentials['userlevel'] == "superadmin") {
$arrTmp[] = $arrOrgz[$ivr['organization_domain']];
}
$arrTmp[] = " <a href='?menu={$module_name}&action=view&id_ivr=" . $ivr['id'] . "&organization={$ivr["organization_domain"]}'>" . htmlentities($ivr["name"], ENT_QUOTES, "UTF-8") . "</a>";
$arrTmp[] = $ivr["timeout"];
$arrTmp[] = $ivr["directdial"];
$arrTmp[] = $ivr["loops"];
$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 IVR"), array_slice($arrOrgz, 1), $selected = null, "create_ivr", $onchange_select = null);
} else {
$oGrid->addNew("create_ivr", _tr("Create New IVR"));
}
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => _tr("all")), true);
}
$_POST["name"] = $name;
//ivr 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));
} 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"));
//.........这里部分代码省略.........
示例10: reportUser
function reportUser($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$pACL = new paloACL($pDB);
$pORGZ = new paloSantoOrganization($pDB);
$idOrgFil = getParameter("idOrganization");
$username = getParameter("username");
$total = 0;
if ($credentials['userlevel'] == "superadmin") {
if (!empty($idOrgFil)) {
$total = $pACL->getNumUsers($idOrgFil, $username);
} else {
$idOrgFil = 0;
//opcion default se muestran todos los usuarios
$total = $pACL->getNumUsers(null, $username);
}
} else {
$idOrgFil = $credentials['id_organization'];
$total = $pACL->getNumUsers($idOrgFil, $username);
}
if ($total === false) {
$total = 0;
$smarty->assign("mb_title", _tr("Error"));
$smarty->assign("mb_message", _tr("Couldn't be retrieved user data"));
}
//url
$url['menu'] = $module_name;
$url['idOrganization'] = $idOrgFil;
$url['username'] = $module_name;
$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('User List'));
$oGrid->setIcon("../web/_common/images/user.png");
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$arrColumns = array();
if ($credentials["userlevel"] == "superadmin") {
$arrColumns[] = _tr("Organization");
//delete
}
$arrColumns[] = _tr("Username");
$arrColumns[] = _tr("Name");
$arrColumns[] = _tr("Group");
$arrColumns[] = _tr("Extension") . " / " . _tr("Fax Extension");
$arrColumns[] = _tr("Used Space") . " / " . _tr("Email Quota");
if (in_array('reconstruct_mailbox', $arrPermission)) {
$arrColumns[] = "";
}
//reconstruct mailbox
$oGrid->setColumns($arrColumns);
$arrData = array();
if ($credentials['userlevel'] == "superadmin") {
if ($idOrgFil != 0) {
$arrUsers = $pACL->getUsersPaging($limit, $offset, $idOrgFil, $username);
} else {
$arrUsers = $pACL->getUsersPaging($limit, $offset, null, $username);
}
} else {
$arrUsers = $pACL->getUsersPaging($limit, $offset, $idOrgFil, $username);
}
if ($arrUsers === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr($pACL->errMsg));
}
//si es un usuario solo se ve a si mismo
//si es un administrador ve a todo los usuarios de
foreach ($arrUsers as $user) {
$arrTmp = array();
if ($credentials["userlevel"] == "superadmin") {
$arrOgz = $pORGZ->getOrganizationById($user[4]);
$arrTmp[] = htmlentities($arrOgz["name"], ENT_COMPAT, 'UTF-8');
//organization
}
$arrTmp[] = " <a href='?menu=userlist&action=view&id={$user['0']}'>" . $user[1] . "</a>";
//username
$arrTmp[] = htmlentities($user[2], ENT_COMPAT, 'UTF-8');
//name
$gpTmp = $pACL->getGroupNameByid($user[7]);
$arrTmp[] = $gpTmp == "superadmin" ? _tr("NONE") : $gpTmp;
if (!isset($user[5]) || $user[5] == "") {
$ext = _tr("Not assigned");
} else {
$ext = $user[5];
}
if (!isset($user[6]) || $user[6] == "") {
$faxExt = _tr("Not assigned");
} else {
$faxExt = $user[6];
}
$arrTmp[] = $ext . " / " . $faxExt;
if ($user[4] != 1) {
//user that belong organization 1 do not have email account
$arrTmp[] = obtener_quota_usuario($user[1], $module_name);
//email quota
//.........这里部分代码省略.........
示例11: reportDIDorganization
function reportDIDorganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials)
{
$pORGZ = new paloSantoOrganization($pDB);
$pDID = new paloDidPBX($pDB);
$domain = getParameter('domain');
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
if (!preg_match("/^(([[:alnum:]-]+)\\.)+([[:alnum:]])+\$/", $domain)) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("Invalid domain format"));
return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
}
$total = $pDID->getTotalDID($domain);
if ($total === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("An error has ocurred to retrieve DID data"));
return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
}
$limit = 20;
$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['domain'] = $domain;
$oGrid->setTitle(_tr('DID Organization List'));
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
if ($credentials['userlevel'] == "superadmin") {
$arrColumns[] = '';
$arrColumns[] = _tr("Organization Domain");
}
$arrColumns[] = _tr("DID");
$arrColumns[] = _tr("Type");
$arrColumns[] = _tr("Country");
$arrColumns[] = _tr("City");
$arrColumns[] = _tr("Country Code / Area Code");
$oGrid->setColumns($arrColumns);
$arrData = array();
$arrDID = $pDID->getDIDs($domain, null, null, null, $limit, $offset);
if ($arrDID === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("An error has ocurred to retrieve DID data"));
return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
} else {
//si es un usuario solo se ve su didsion
//si es un administrador ve todas las didsiones
foreach ($arrDID as $did) {
$arrTmp = array();
if ($credentials["userlevel"] == "superadmin") {
$arrTmp[] = "<input type='checkbox' name='dids[]' value='{$did['id']}' />";
$arrTmp[] = $did["organization_domain"];
}
$arrTmp[] = $did['did'];
$arrTmp[] = $did["type"];
$arrTmp[] = $did["country"];
$arrTmp[] = $did["city"];
$arrTmp[] = $did["country_code"] . " / " . $did["area_code"];
$arrData[] = $arrTmp;
}
}
if ($credentials['userlevel'] == "superadmin") {
$oGrid->addNew("assignDIDs", _tr("Add DID"));
$oGrid->deleteList(_tr('Are you sure you wish REMOVE this DID from organization'), 'removeDID', "Remove DID");
}
$content = $oGrid->fetchGrid(array(), $arrData);
return $content;
}
示例12: reportTrunks
function reportTrunks($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$pTrunk = new paloSantoTrunk($pDB);
$pORGZ = new paloSantoOrganization($pDB);
$error = "";
$domain = getParameter("organization");
$technology = getParameter("technology");
$status = getParameter("status");
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['technology'] = $technology;
$url['status'] = $status;
$total = $pTrunk->getNumTrunks($domain, $technology, $status);
if ($total === false) {
$error = $pTrunk->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('Trunks List'));
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url);
$arrColum[] = _tr("Name");
$arrColum[] = _tr("Technology");
$arrColum[] = _tr("Channel / Peer|[User]");
$arrColum[] = _tr("Max. Channels");
$arrColum[] = _tr("Current # of calls by period");
$arrColum[] = _tr("Status");
$oGrid->setColumns($arrColum);
$edit = in_array('edit', $arrPermission);
$arrData = array();
if ($total != 0) {
$arrTrunks = $pTrunk->getTrunks($domain, $technology, $status, $limit, $offset);
if ($arrTrunks === false) {
$error = _tr("Error to obtain trunks") . $pTrunk->errMsg;
$arrTrunks = array();
}
foreach ($arrTrunks as $trunk) {
$arrTmp[0] = " <a href='?menu=trunks&action=view&id_trunk=" . $trunk['trunkid'] . "&tech_trunk=" . $trunk["tech"] . "'>" . $trunk['name'] . "</a>";
$arrTmp[1] = strtoupper($trunk['tech']);
$arrTmp[2] = $trunk['channelid'];
$arrTmp[3] = $trunk['maxchans'];
$state = "";
if ($trunk['sec_call_time'] == "yes") {
$arrTmp[4] = createDivToolTip($trunk['trunkid'], $pTrunk, $state);
} else {
$arrTmp[4] = _tr("Feature don't Set");
}
if ($trunk['disabled'] == "on" || $state == "YES") {
$disabled = "on";
} else {
$disabled = "off";
}
if ($edit) {
$arrTmp[5] = createSelect($trunk['trunkid'], $disabled);
} else {
$arrTmp[5] = $disabled == 'on' ? _tr('Disabled') : _tr('Enabled');
}
$arrData[] = $arrTmp;
}
}
if (in_array('create', $arrPermission)) {
$arrTech = array("sip" => _tr("SIP"), "dahdi" => _tr("DAHDI"), "iax2" => _tr("IAX2"), "custom" => _tr("CUSTOM"));
$oGrid->addComboAction($name_select = "tech_trunk", _tr("Create New Trunk"), $arrTech, $selected = null, $task = "create_trunk", $onchange_select = null);
}
$arrOrgz = array("" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization Allow") . " = " . $arrOrgz[$domain], $_POST, array("organization" => ""), true);
//organization allow
$techFilter = array('' => _tr('All'), "sip" => _tr("SIP"), "dahdi" => _tr("DAHDI"), "iax2" => _tr("IAX2"), "custom" => _tr("CUSTOM"));
$_POST["technology"] = $technology;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Type") . " = " . $techFilter[$technology], $_POST, array("technology" => ""), true);
//technology
$arrStatus = array('' => '', 'off' => _tr('Enabled'), 'on' => _tr('Disabled'));
$_POST["status"] = $status;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Status") . " = " . $arrStatus[$status], $_POST, array("status" => ""), true);
//status
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='search'>");
$arrFormElements = createFieldFilter($arrOrgz, $techFilter, $arrStatus);
$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);
$contenidoModulo .= "<input type='hidden' name='grid_limit' id='grid_limit' value='{$limit}'>";
$contenidoModulo .= "<input type='hidden' name='grid_offset' id='grid_offset' value='{$offset}'>";
//.........这里部分代码省略.........
示例13: reportRecording
function reportRecording($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;
$pRecording = new paloSantoRecordings($pDB);
$total = $pRecording->getNumRecording($domain, $name);
if ($total === false) {
$error = $pRecording->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;
//permission
$create = in_array("create", $arrPermission);
$edit = in_array("edit", $arrPermission);
$delete = in_array("delete", $arrPermission);
if ($delete) {
$check = " <input type='checkbox' name='checkall' class='checkall' id='checkall' onclick='jqCheckAll(this.id);' />";
} else {
$check = "";
}
$oGrid->setTitle(_tr('Recordings 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);
$arrColumns[] = $check;
if ($credentials['userlevel'] == 'superadmin') {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Name");
//$arrColumns[]=_tr("Source");
$arrColumns[] = _tr("");
$oGrid->setColumns($arrColumns);
$arrRecordings = array();
$arrData = array();
if ($total != 0) {
$arrRecordings = $pRecording->getRecordings($domain, $name, $limit, $offset);
}
if ($arrRecordings === false) {
$error = _tr("Error to obtain Recordings") . $pRecording->errMsg;
$arrRecordings = array();
}
$i = 0;
foreach ($arrRecordings as $recording) {
$arrTmp = array();
$ext = explode(".", $recording["name"]);
if ($delete) {
$arrTmp[] = " <input type ='checkbox' class='delete' name='record_delete[]' value='" . $recording['uniqueid'] . "' />";
}
if ($credentials['userlevel'] == 'superadmin') {
$arrTmp[] = $recording["organization_domain"] == '' ? '' : $arrOrgz[$recording["organization_domain"]];
}
//$arrTmp[] = $recording["source"];
$idfile = $recording['uniqueid'];
if ($ext[1] == "gsm") {
$div_display = '';
} else {
$div_display = "<div class='single' id='{$i}' style='display:inline;'><span data-src='index.php?menu={$module_name}&action=download&id={$idfile}&rawmode=yes'><img style='cursor:pointer;' width='13px' src='web/apps/recordings/images/sound.png'/> </span></div>";
}
$download = "<a href='index.php?menu={$module_name}&action=download&id={$idfile}&rawmode=yes'>" . $recording['name'] . "</a>";
$arrTmp[] = $div_display . $download;
$arrTmp[] = "<audio></audio>";
$i++;
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($create) {
$oGrid->addNew("add_recording", _tr("Add Recording"));
}
if ($delete) {
$oGrid->deleteList(_tr("Are you sure you want to delete?"), "remove", _tr("Delete Selected"), false);
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
//.........这里部分代码省略.........
示例14: 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;
}
示例15: reportGroupPermission
//.........这里部分代码省略.........
//los premisos que tiene el grupo
$arrPermisos = $pACL->loadGroupPermissions($idGroup, $listResource);
if ($arrPermisos === false) {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("An error has ocurred to retrieved Group Permissions"));
$error = true;
}
}
$max_actions = 0;
$isAdministrator = $pACL->getGroupNameByid($idGroup) == _tr("administrator") ? true : false;
if ($totalGroupPermission > 0 && !$error) {
foreach ($arrResourceActions as $resource => $actions) {
$arrTmp = array();
$arrTmp[] = _tr($listResDes[$resource]);
$disabled = "";
if ($isAdministrator && ($resource == 'grouplist' || $resource == 'userlist' || $resource == 'group_permission')) {
$disabled = "disabled='disabled'";
}
//dentro del modulo organizacion ahi acciones que unicamente las puede realizar el superadmin
//por lo tando no deben aparecer listadas
if ($resource == "organization") {
$actions = array_diff($actions, array('change_org_status', 'create_org', 'delete_org', 'edit_DID'));
} elseif ($resource == "dashboard") {
$actions = array('access');
} elseif ($resource == 'cdrreport') {
$actions = array('access', 'export');
}
if (count($actions) > $max_actions) {
$max_actions = count($actions);
}
$desactivar = false;
if (isset($arrPermisos[$resource])) {
//grupo no tiene nigun permiso
if (!in_array('access', $arrPermisos[$resource])) {
$desactivar = true;
}
} else {
$desactivar = true;
$arrPermisos[$resource] = array();
}
foreach ($actions as $action) {
$class = 'other_act';
if ($action == 'access') {
$class = 'access_act';
} elseif ($desactivar) {
$disabled = "disabled='disabled'";
}
$checked0 = '';
//chequeamos si la accion se encuentra en la lista de acciones permitidas en el recurso
if (in_array($action, $arrPermisos[$resource])) {
$checked0 = "checked";
}
$arrTmp[] = "<input type='checkbox' class='{$class}' {$disabled} name='groupPermission[" . $resource . "][{$action}]' {$checked0}> {$action}";
}
$arrData[] = $arrTmp;
}
}
$oGrid->setTitle(_tr("Group Permission"));
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$arrColumn[] = _tr("Resource");
for ($i = 1; $i <= $max_actions; $i++) {
$act = _tr("Action");
$arrColumn[] = "{$act}" . " {$i}";
}
$oGrid->setColumns($arrColumn);
//begin section filter
$arrFormFilter = createFieldFilter($arrGroups);
$oFilterForm = new paloForm($smarty, $arrFormFilter);
$smarty->assign("SHOW", _tr("Show"));
$smarty->assign("limit_apply", htmlspecialchars($limit, ENT_COMPAT, 'UTF-8'));
$smarty->assign("offset_apply", htmlspecialchars($offset, ENT_COMPAT, 'UTF-8'));
$smarty->assign("resource_apply", htmlentities($filter_resource));
$_POST["filter_group"] = htmlspecialchars($filter_group, ENT_COMPAT, 'UTF-8');
$_POST["filter_resource"] = htmlspecialchars($filter_resource, ENT_COMPAT, 'UTF-8');
$_POST["idOrganization"] = $idOrgFil;
if (count($arrOrgz) > 0) {
global $arrPermission;
if (in_array('edit_permission', $arrPermission)) {
$oGrid->addSubmitAction("apply", _tr("Save"));
}
if ($credentials['userlevel'] == "superadmin") {
$oGrid->addComboAction("idOrganization", _tr("Organization"), $arrOrgz, $idOrgFil, "report");
}
$nameGroup = isset($arrGroups[$filter_group]) ? $arrGroups[$filter_group] : "";
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Group") . " = {$nameGroup}", $_POST, array("filter_group" => $groupTmp[0][0]), true);
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Resource") . " = {$filter_resource}", $_POST, array("filter_resource" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
} else {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", _tr("You haven't created any organization"));
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
//end grid parameters
return $contenidoModulo;
}