当前位置: 首页>>代码示例>>PHP>>正文


PHP paloSantoGrid::setEnd方法代码示例

本文整理汇总了PHP中paloSantoGrid::setEnd方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::setEnd方法的具体用法?PHP paloSantoGrid::setEnd怎么用?PHP paloSantoGrid::setEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paloSantoGrid的用法示例。


在下文中一共展示了paloSantoGrid::setEnd方法的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[] = "&nbsp;<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;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:97,代码来源:index.php

示例2: 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[] = "&nbsp;<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[] = "&nbsp;<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;
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例3: 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']}' />&nbsp;&nbsp;\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);
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:92,代码来源:index.php

示例4: 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') {
//.........这里部分代码省略.........
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:101,代码来源:index.php

示例5: 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[] = "&nbsp;<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;
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例6: reportEmailList

function reportEmailList($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $pORGZ = new paloSantoOrganization($pDB);
    $pEmailList = new paloSantoEmailList($pDB);
    $org_domain = getParameter("domain");
    $name_list = getParameter("name_list");
    $total = 0;
    if ($credentials['userlevel'] == "superadmin") {
        if (!empty($org_domain)) {
            $total = $pEmailList->getNumEmailList($name_list, $org_domain);
        } else {
            $org_domain = 0;
            //opcion default se muestran todas las listas
            $total = $pEmailList->getNumEmailList($name_list);
        }
    } else {
        $org_domain = $credentials['domain'];
        $total = $pEmailList->getNumEmailList($name_list, $org_domain);
    }
    if ($total === false) {
        $total = 0;
        $smarty->assign("mb_title", _tr("Error"));
        $smarty->assign("mb_message", _tr("Couldn't be retrieved Email List data"));
    }
    //url
    $url['menu'] = $module_name;
    $url['domain'] = $org_domain;
    $url['name_list'] = $name_list;
    $limit = 20;
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $end = $offset + $limit <= $total ? $offset + $limit : $total;
    $oGrid->setStart($total == 0 ? 0 : $offset + 1);
    $oGrid->setEnd($end);
    $oGrid->setTitle(_tr("Email List"));
    $oGrid->setIcon("web/apps/{$module_name}/images/email.png");
    $oGrid->setURL($url);
    $oGrid->setWidth("99%");
    $del_permission = in_array('delete_list', $arrPermission);
    $edit_permission = in_array('edit_list', $arrPermission);
    $create_permission = in_array('create_list', $arrPermission);
    if ($del_permission) {
        $arrColumns[] = "";
    }
    //checkbox to delete
    $arrColumns[] = _tr('List Name');
    $arrColumns[] = _tr('Number of Members');
    $arrColumns[] = _tr('Actions');
    $oGrid->setColumns($arrColumns);
    $arrData = null;
    if ($total > 0) {
        $arrResult = $pEmailList->getEmailListPagging($name_list, $org_domain, $limit, $offset);
        if ($arrResult === false) {
            $smarty->assign("mb_title", _tr("Error"));
            $smarty->assign("mb_message", _tr("Couldn't be retrieved Email List data"));
        } else {
            foreach ($arrResult as $list) {
                $arrTmp = array();
                if ($del_permission) {
                    $arrTmp[] = "<input type='checkbox' name='del_list' id='{$list['id']}'>";
                }
                $arrTmp[] = "<a href='?menu={$module_name}&action=view_list&id={$list['id']}'>" . htmlentities($list['listname'], ENT_QUOTES, "UTF-8") . "@" . $list['organization_domain'] . "</a>";
                $arrTmp[] = $pEmailList->getTotalMembers($list['id']);
                $arrTmp[] = "<a href='?menu={$module_name}&action=view_memberlist&id=" . $list['id'] . "'>" . _tr("View members") . "</a>";
                $arrData[] = $arrTmp;
            }
        }
    }
    //Verifico si en el archivo /etc/postfix/main.cf las variables alias_map y virtual_alias_map están apuntando a los archivos correctos, de no ser así se lo corrige
    $checkPostfixFile = $pEmailList->checkPostfixFile();
    if (!$checkPostfixFile) {
        $smarty->assign("mb_title", _tr("Error"));
        $smarty->assign("mb_message", _tr("An error has ocurred to try config postfix file"));
    }
    //begin section filter
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("SEARCH", "<input name='search_org' type='submit' class='button' value='" . _tr('Search') . "'>");
    //se comprueba que el mailman haya sido configurado por primera vez
    $MailmanListCreated = $pEmailList->isMailmanListCreated();
    if (is_null($MailmanListCreated)) {
        $smarty->assign("mb_title", _tr("ERROR"));
        $smarty->assign("mb_message", $pEmailList->getError());
    } elseif (!$MailmanListCreated) {
        //sino ha sido configurado se muestra un mensaje
        if ($credentials['userlevel'] != 'superadmin') {
            //solo el superadmin puede hacer esta accion
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("A new List can not be added because some configurations are missed. Please contact with Elastix Admisnistrator"));
        } else {
            $smarty->assign("mb_title", _tr("Message"));
            $smarty->assign("mb_message", _tr("In order to use this module configure the Mailman Admin Settings. Click here >> ") . "<a href='?menu={$module_name}&action=mailman_settings'>" . _tr('Mailman Settings') . "</a>");
        }
    } else {
        if ($pORGZ->getNumOrganization(array()) > 0) {
            if ($create_permission) {
                $oGrid->addNew("new_emaillist", _tr("New Email list"));
            }
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例7: 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"]})";
        }
    }
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例8: report_AccessAudit


//.........这里部分代码省略.........
                } else {
                    $offset = $arrResult[count($arrResult) - $iNumLineasPorPagina]['offset'];
                }
                break;
            case 'next':
                $offset = $iOffsetSiguiente;
                break;
            case 'previous':
                $offset = $iOffsetPrevio;
                break;
            case 'bypage':
                $numPage = $limit == 0 ? 0 : ceil($total / $limit);
                $page = getParameter("page");
                if (preg_match("/[0-9]+/", $page) == 0) {
                    // no es un número
                    $page = 1;
                }
                if ($page > $numPage) {
                    // se está solicitando una pagina mayor a las que existen
                    $page = $numPage;
                }
                $start = ($page - 1) * $limit + 1 - $limit;
                //$accion = "next";
                if ($start + $limit <= 1) {
                    break;
                }
                /*$inicioRango = $page * $iEstimadoBytesPagina;
                
                        $arrResult =$pAccessLogs->ObtainAccessLogs(10 * $iEstimadoBytesPagina, $inicioRango, $field_pattern, NULL, $isExport);
                        $offset = $arrResult[0]['offset'];
                
                        $oGrid->setOffsetValue($offset);
                
                        $oGrid->setEnd(((int)($offset / 128) + $iNumLineasPorPagina) <= $oGrid->getTotal() ? (int)($offset / 128) + $iNumLineasPorPagina : $oGrid->getTotal());
                
                        $oGrid->setStart(($oGrid->getTotal()==0) ? 0 : (1 + (int)($offset / 128)));*/
                $inicioBusqueda = $page * $iEstimadoBytesPagina - $iEstimadoBytesPagina;
                $arrResult = $pAccessLogs->ObtainAccessLogs(10 * $iEstimadoBytesPagina, $inicioBusqueda, $field_pattern, NULL, $isExport);
                $offset = $arrResult[0]['offset'];
                $oGrid->setOffsetValue($offset);
                break;
        }
    }
    // Buscar la cadena de texto indicada, y modificar offset si se encuentra
    $smarty->assign("SEARCHNEXT", _tr('Search'));
    if (isset($_POST['searchnext']) && $busqueda != '') {
        $pAccessLogs->astLog->posicionarMensaje($field_pattern, $offset);
        $posBusqueda = $pAccessLogs->astLog->buscarTextoMensaje($busqueda);
        if (!is_null($posBusqueda)) {
            $offset = $posBusqueda[1];
            $smarty->assign('SEARCHNEXT', _tr('Search next'));
            $_POST['ultima_busqueda'] = $busqueda;
            $_POST['ultimo_offset'] = $offset;
            // Si el offset anterior indicado es idéntico al offset recién encontrado
            // y la cadena de búsqueda es también idéntica, se asume que se ha
            // pedido una búsqueda de la siguiente ocurrencia.
            if (!is_null($sUltimaBusqueda) && !is_null($iUltimoOffset) && $offset == $iUltimoOffset && $sUltimaBusqueda == $busqueda) {
                $pAccessLogs->astLog->posicionarMensaje($field_pattern, $offset);
                $pAccessLogs->astLog->siguienteMensaje();
                // Sólo para ignorar primera ocurrencia
                $posBusqueda = $pAccessLogs->astLog->buscarTextoMensaje($busqueda);
                if (!is_null($posBusqueda)) {
                    $offset = $posBusqueda[1];
                    $_POST['ultimo_offset'] = $offset;
                }
            }
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:67,代码来源:index.php

示例9: reportContact

function reportContact($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    global $arrCredentials;
    $coreContact = new coreContact($pDB);
    $jsonObject = new PaloSantoJSON();
    //obtener los parametros del filtro
    $filters['ftype_contacto'] = getParameter('ftype_contacto');
    $filters['filter'] = getParameter('filter');
    $filters['filter_value'] = getParameter('filter_value');
    $validatedfilters = $coreContact->validatedFilters($filters);
    $total = $coreContact->getTotalContactsByFilter($validatedfilters);
    if ($total === false) {
        $total = 0;
        $smarty->assign("MSG_ERROR_FIELD", _tr("Error en database"));
        $jsonObject->set_error($coreContact->sqlContact->getErrorMsg());
        return $jsonObject->createJSON();
    }
    $limit = 7;
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $end = $offset + $limit <= $total ? $offset + $limit : $total;
    $oGrid->setStart($total == 0 ? 0 : $offset + 1);
    $oGrid->setEnd($end);
    $currentPage = $oGrid->calculateCurrentPage();
    $numPage = $oGrid->calculateNumPage();
    $url['menu'] = $module_name;
    $url['ftype_contacto'] = $filters['ftype_contacto'];
    $url['filter'] = $filters['filter'];
    $url['filter_value'] = $filters['filter_value'];
    $oGrid->setTitle(_tr('Contacts List'));
    $oGrid->setURL($url);
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export(_tr("ContactsExport"));
    $arrColumn = array();
    if ($oGrid->isExportAction()) {
        // arreglo de columnas para mostrar en los archivos de exportacion
        $arrColumn[] = 'Name';
        //if($validatedfilters['table']=="internal"){
        if ($validatedfilters['table'] == "internal") {
            $arrColumn[] = 'Ext';
        } else {
            $arrColumn[] = 'Phone';
        }
        $arrColumn[] = 'Email';
        $arrColumn[] = 'Type Contact';
    } else {
        //arreglo de columnas para mostrar en la grilla
        $arrColumn[] = "<span class='glyphicon glyphicon-check'></span>";
        $arrColumn[] = _tr('Picture');
        $arrColumn[] = _tr('Name');
        //if($validatedfilters['table']=="internal"){
        $arrColumn[] = _tr('Ext / Phone');
        $arrColumn[] = _tr('Email');
        $arrColumn[] = _tr('Call');
        $arrColumn[] = _tr('Transfer');
        $arrColumn[] = _tr('Type Contact');
    }
    $oGrid->setColumns($arrColumn);
    $validatedfilters = $coreContact->validatedFilters($filters);
    //enviamos como parametros limit, offset y los filtros validados
    $contacts = $coreContact->getContacts($limit, $offset, $validatedfilters);
    $arrDatosGrid = array();
    if ($contacts === false) {
        $smarty->assign("MSG_ERROR_FIELD", $coreContact->getErrorMsg());
        $jsonObject->set_error($coreContact->getErrorMsg());
        return $jsonObject->createJSON();
    } else {
        if ($oGrid->isExportAction()) {
            // data para exportar en los archivos
            foreach ($contacts as $value) {
                $tmp = array();
                $tmp[] = $value['name'];
                if (empty($value['work_phone'])) {
                    $tmp[] = "N/A";
                } else {
                    $tmp[] = $value['work_phone'];
                }
                if (!empty($value['username'])) {
                    $tmp[] = $value['username'];
                } else {
                    $tmp[] = "N/A";
                }
                if ($validatedfilters['table'] != "internal") {
                    if ($value['status'] == "isPrivate") {
                        $tmp[] = _tr('Private');
                    } else {
                        $tmp[] = _tr('Public');
                    }
                } else {
                    $tmp[] = _tr('Public');
                }
                $arrDatosGrid[] = $tmp;
            }
        } else {
            //data para mostrar en las grillas
            foreach ($contacts as $value) {
                $tmp = array();
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例10: 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[] = "&nbsp;<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"));
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例11: 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[] = "&nbsp;<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
//.........这里部分代码省略.........
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:101,代码来源:index.php

示例12: 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;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:73,代码来源:index.php

示例13: 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] = "&nbsp;<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}'>";
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例14: 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 = "&nbsp;<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[] = "&nbsp;<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'/>&nbsp;&nbsp;</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);
    }
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例15: 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[] = "&nbsp;<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;
}
开发者ID:Neo2SHYAlien,项目名称:elastix-mt-gui,代码行数:99,代码来源:index.php


注:本文中的paloSantoGrid::setEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。