function _moduleContent(&$smarty, $module_name) { include_once "modules/{$module_name}/configs/default.conf.php"; load_language_module($module_name); global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $sContenidoModulo = ''; $sAccion = getParameter('action'); switch ($sAccion) { case 'new': case 'edit': $sContenidoModulo = modificarArchivo($module_name, $smarty, $local_templates_dir, $arrConf['astetcdir'], $sAccion); break; case 'list': default: $sContenidoModulo = listarArchivos($module_name, $smarty, $local_templates_dir, $arrConf['astetcdir']); break; } return $sContenidoModulo; }
function _moduleContent(&$smarty, $module_name) { include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoReportsBreak.class.php"; global $arrConf; $arrConf = array_merge($arrConf, $arrConfModule); // Obtengo la ruta del template a utilizar para generar el filtro. $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; load_language_module($module_name); // Abrir conexión a la base de datos $pDB = new paloDB($arrConf['dsn_conn_database']); if (!is_object($pDB->conn) || $pDB->errMsg != "") { $smarty->assign("mb_title", _tr("Error")); $smarty->assign("mb_message", _tr("Error when connecting to database") . " " . $pDB->errMsg); return NULL; } // Cadenas estáticas a asignar $smarty->assign(array("btn_consultar" => _tr('query'), "module_name" => $module_name)); //actions $action = getAction(); $content = ""; switch ($action) { default: $content = reportReportsBreak($smarty, $module_name, $local_templates_dir, $pDB); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; require_once "modules/{$module_name}/libs/paloSantoHoldTime.class.php"; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $relative_dir_rich_text = "modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrConfig = $pConfig->leer_configuracion(false); $dsn = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asterisk"; $oDB = new paloDB($dsn); // se conecta a la base $pDB = new paloDB($arrConf["cadena_dsn"]); $htmlFilter = ""; if (!is_object($pDB->conn) || $pDB->errMsg != "") { $smarty->assign("mb_message", _tr("Error when connecting to database") . " " . $pDB->errMsg); } $oGrid = new paloSantoGrid($smarty); $arrGrid = array(); $arrData = array(); //llamamos a funcion que construye la vista $contenidoModulo = listadoHoldTime($pDB, $smarty, $module_name, $local_templates_dir, $oGrid, $arrGrid, $arrData); $oGrid->showFilter($htmlFilter); return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/libs/externalUrl.class.php"; load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_urls'; if (isset($_GET['action'])) { $sAction = $_GET['action']; } switch ($sAction) { case 'new_url': $contenidoModulo = newURL($pDB, $smarty, $module_name, $local_templates_dir); break; case 'edit_url': $contenidoModulo = editURL($pDB, $smarty, $module_name, $local_templates_dir); break; case 'list_urls': default: $contenidoModulo = listURL($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoReportedeTroncalesusadasporHoraeneldia.class.php"; include_once "libs/paloSantoConfig.class.php"; $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); load_language_module($module_name); //global variables global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrConfig = $pConfig->leer_configuracion(false); $dsnAsteriskCdr = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asterisk"; $pDB = new paloDB($arrConf['dsn_conn_database']); $pDB_asterisk = new paloDB($dsnAsteriskCdr); //actions $accion = getAction(); $content = ""; switch ($accion) { default: $content = reportReportedeTroncalesusadasporHoraeneldia($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $pDB_asterisk); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/libs/paloSantoCallsHour.class.php"; #incluir el archivo de idioma de acuerdo al que este seleccionado #si el archivo de idioma no existe incluir el idioma por defecto $lang = get_language(); $script_dir = dirname($_SERVER['SCRIPT_FILENAME']); load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_campaign'; if (isset($_GET['action'])) { $sAction = $_GET['action']; } switch ($sAction) { case 'graph_histogram': $contenidoModulo = graphHistogram($pDB, $smarty, $module_name, $local_templates_dir); break; case 'list_histogram': default: $contenidoModulo = listHistogram($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/libs/PaloSantoBreaks.class.php"; require_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; load_language_module($module_name); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // se conecta a la base $pDB = new paloDB($arrConf["cadena_dsn"]); if (!empty($pDB->errMsg)) { $smarty->assign("mb_message", _tr("Error when connecting to database") . "<br/>" . $pDB->errMsg); } $sAccion = getParameter('action'); $smarty->assign(array('MODULE_NAME' => $module_name, 'ACTION' => $sAccion, "CANCEL" => _tr("Cancel"))); switch ($sAccion) { case 'new': $contenidoModulo = nuevoBreak($smarty, $module_name, $pDB, $local_templates_dir); break; case 'edit': $contenidoModulo = editarBreak($smarty, $module_name, $pDB, $local_templates_dir); break; case 'list': default: $contenidoModulo = listBreaks($smarty, $module_name, $pDB, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/configs/default.config.php"; require_once "modules/{$module_name}/libs/paloSantoColaEntrante.class.php"; global $arrConf; load_language_module($module_name); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($config['templates_dir']) ? $config['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $config['theme']; $relative_dir_rich_text = "modules/{$module_name}/" . $templates_dir . '/' . $config['theme']; $smarty->assign("relative_dir_rich_text", $relative_dir_rich_text); // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_queues'; if (isset($_GET['action'])) { $sAction = $_GET['action']; } switch ($sAction) { case 'new_queue': return crearCola($pDB, $smarty, $module_name, $local_templates_dir); case 'edit_queue': return modificarCola($pDB, $smarty, $module_name, $local_templates_dir); case 'list_queue': default: return listarColas($pDB, $smarty, $module_name, $local_templates_dir); } }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/PaloSantoThemes.class.php"; load_language_module($module_name); //global variables global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // se conecta a la base $pDB = new paloDB($arrConf['elastix_dsn']['settings']); if (!empty($pDB->errMsg)) { $smarty->assign("mb_message", _tr("Error when connecting to database") . "<br/>" . $pDB->errMsg); } // Definición del formulario de nueva campaña $smarty->assign("REQUIRED_FIELD", _tr("Required field")); $smarty->assign("CHANGE", _tr("Save")); $smarty->assign("icon", "modules/{$module_name}/images/system_preferences_themes.png"); $oThemes = new PaloSantoThemes($pDB); $arr_themes = $oThemes->getThemes("{$base_dir}/themes/"); $formCampos = array('themes' => array("LABEL" => _tr("Themes"), "REQUIRED" => "yes", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arr_themes, "VALIDATION_TYPE" => "", "VALIDATION_EXTRA_PARAM" => "")); $oForm = new paloForm($smarty, $formCampos); if (isset($_POST['changeTheme'])) { $contenidoModulo = updateTheme($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm); } else { $contenidoModulo = changeTheme($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm); } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoGroupPermission.class.php"; load_language_module($module_name); //global variables global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = ""; //actions $accion = getAction(); $content = ""; switch ($accion) { case "apply": $content = applyGroupPermission($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; default: $content = reportGroupPermission($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files require_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/PaloSantoPackages.class.php"; load_language_module($module_name); //global variables global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $action = getParameter('action'); switch ($action) { case 'updateRepositories': return actualizarRepositorios($arrConf); case 'install': return installPaquete($arrConf); case 'uninstall': return uninstallPaquete($arrConf); default: return listPackages($smarty, $module_name, $local_templates_dir, $arrConf); } }
function _moduleContent(&$smarty, $module_name) { //include module files require_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/paloSantoDataFormList.class.php"; load_language_module($module_name); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConfig['theme']; // Definición del formulario de nueva formulario $smarty->assign("MODULE_NAME", $module_name); $script = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"libs/js/jscalendar/calendar-win2k-2.css\" />\n <script type=\"text/javascript\" src=\"libs/js/jscalendar/calendar.js\"></script>\n <script type=\"text/javascript\" src=\"libs/js/jscalendar/lang/calendar-en.js\"></script>\n <script type=\"text/javascript\" src=\"libs/js/jscalendar/calendar-setup.js\"></script>"; $smarty->assign("HEADER", $script); //Definicion de campos $formCampos = array('form_nombre' => array("LABEL" => _tr("Form Name"), "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("size" => "40"), "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""), 'form_description' => array("LABEL" => _tr("Form Description"), "REQUIRED" => "no", "INPUT_TYPE" => "TEXTAREA", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "COLS" => "33", "ROWS" => "2")); $smarty->assign("type", _tr('Type')); $smarty->assign("select_type", "type"); $smarty->assign("option_type", array("VALUE" => array("LABEL", "TEXT", "LIST", "DATE", "TEXTAREA"), "NAME" => array(_tr("Type Label"), _tr("Type Text"), _tr("Type List"), _tr("Type Date"), _tr("Type Text Area")), "SELECTED" => "Text")); $smarty->assign("item_list", _tr('List Item')); $oForm = new paloForm($smarty, $formCampos); $pDB = new paloDB($arrConfig['cadena_dsn']); if (!is_object($pDB->conn) || $pDB->errMsg != "") { $smarty->assign("mb_message", _tr("Error when connecting to database") . " " . $pDB->errMsg); } if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "preview") { $contenidoModulo = preview_form($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm); } else { $contenidoModulo = listadoForm($pDB, $smarty, $module_name, $local_templates_dir); } return $contenidoModulo; }
function _moduleContent($smarty, $module_name) { global $arrConf; load_language_module($module_name); $smarty->assign("module_name", $module_name); // Leer lista de applets implementados y validar con directorio $paloApplets = new paloSantoApplets(); $appletlist = $paloApplets->leerAppletsActivados($_SESSION["elastix_user"]); $t = array(); foreach ($appletlist as $applet) { if (is_dir("{$arrConf['elxPath']}/apps/{$module_name}/applets/{$applet['applet']}")) { $t[] = $applet; } } $appletlist = $t; // Verificar si se pide una petición para un applet individual $appletnames = array(); foreach ($appletlist as $applet) { $appletnames[] = $applet['applet']; } if (isset($_REQUEST['applet']) && !in_array($_REQUEST['applet'], $appletnames)) { unset($_REQUEST['applet']); } if (isset($_REQUEST['applet'])) { if (file_exists("{$arrConf['elxPath']}/apps/{$module_name}/applets/{$_REQUEST['applet']}/lang/en.lang")) { load_language_module("{$module_name}/applets/{$_REQUEST['applet']}"); } require_once "{$arrConf['elxPath']}/apps/{$module_name}/applets/{$_REQUEST['applet']}/index.php"; } $h = 'handleHTML_appletGrid'; if (isset($_REQUEST['action'])) { $h = NULL; $regs = NULL; if (preg_match('/^\\w+$/', $_REQUEST['action'])) { if (isset($_REQUEST['applet']) && preg_match('/^\\w+$/', $_REQUEST['applet'])) { $classname = 'Applet_' . ucfirst($_REQUEST['applet']); $methodname = 'handleJSON_' . $_REQUEST['action']; if (class_exists($classname)) { $appletobj = new $classname(); if (method_exists($appletobj, $methodname)) { $h = array($appletobj, $methodname); } } } if (is_null($h) && function_exists('handleJSON_' . $_REQUEST['action'])) { $h = 'handleJSON_' . $_REQUEST['action']; } } if (is_null($h)) { $h = 'handleJSON_unimplemented'; } } return call_user_func($h, $smarty, $module_name, $appletlist); }
function _moduleContent(&$smarty, $module_name) { global $arrConf; global $arrLang; require_once "modules/agent_console/libs/elastix2.lib.php"; require_once "modules/agent_console/libs/paloSantoConsola.class.php"; require_once "modules/agent_console/getinfo.php"; require_once "modules/agent_console/libs/JSON.php"; require_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/queue_waiting2.class.php"; // Directorio de este módulo $sDirScript = dirname($_SERVER['SCRIPT_FILENAME']); // Se fusiona la configuración del módulo con la configuración global $arrConf = array_merge($arrConf, $arrConfModule); /* Se pide el archivo de inglés, que se elige a menos que el sistema indique otro idioma a usar. Así se dispone al menos de la traducción al inglés si el idioma elegido carece de la cadena. */ load_language_module($module_name); // Asignación de variables comunes y directorios de plantillas $sDirPlantillas = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $sDirLocalPlantillas = "{$sDirScript}/modules/{$module_name}/" . $sDirPlantillas . '/' . $arrConf['theme']; $smarty->assign("MODULE_NAME", $module_name); // Incluir todas las bibliotecas y CSS necesarios generarRutaJQueryModulo($smarty, $module_name); $sAction = ''; $sContenido = ''; $sAction = getParameter('action'); $oPaloConsola = new PaloSantoConsola(); switch ($sAction) { case 'checkStatus': $sContenido = agent_monitoring_checkStatus($module_name, $smarty, $sDirLocalPlantillas, $oPaloConsola); break; case 'queueWaitingStatus': $sContenido = queue_waiting_checkStatus($module_name, $smarty, $sDirLocalPlantillas, $oPaloConsola); break; case 'show_call_history': $sContenido = refreshCallHistory(); break; case "viewNote": $sContenido = viewNote(); break; case "viewDelivery": $sContenido = viewDelivery(); break; default: $sContenido = agent_monitoring_HTML($module_name, $smarty, $sDirLocalPlantillas, $oPaloConsola); break; } $oPaloConsola->desconectarTodo(); return $sContenido; }
function _moduleContent(&$smarty, $module_name) { //include elastix framework include_once "libs/paloSantoGrid.class.php"; include_once "libs/paloSantoForm.class.php"; include_once "libs/paloSantoConfig.class.php"; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoRecordings.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); /* $lang=get_language(); $lang_file="modules/$module_name/lang/$lang.lang"; if (file_exists("$base_dir/$lang_file")) include_once "$lang_file"; else include_once "modules/$module_name/lang/en.lang"; */ load_language_module($module_name); //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrConfig = $pConfig->leer_configuracion(false); $dsn_agi_manager['password'] = $arrConfig['AMPMGRPASS']['valor']; $dsn_agi_manager['host'] = $arrConfig['AMPDBHOST']['valor']; $dsn_agi_manager['user'] = '******'; $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']); $accion = getAction(); $content = ""; switch ($accion) { case "record": $content = new_recording($smarty, $module_name, $local_templates_dir, $arrLang, $dsn_agi_manager, $arrConf, $pDBACL); break; case "save": $content = save_recording($smarty, $module_name, $local_templates_dir, $arrLang, $arrConf, $pDBACL); break; default: $content = form_Recordings($smarty, $module_name, $local_templates_dir, $arrLang, $pDBACL); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/agent_console/configs/default.conf.php"; // For asterisk AMI credentials global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $relative_dir_rich_text = "modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $smarty->assign("relative_dir_rich_text", $relative_dir_rich_text); // Conexión a la base de datos CallCenter y Asterisk (se utiliza root para pruebas) $pDB = new paloDB($cadena_dsn); // $cadena_dsn está ubicado en configs/default.conf.php if ($pDB->connStatus) { return "ERR: failed to connect to database: " . $pDB->errMsg; } // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_agents'; if (isset($_REQUEST['action'])) { $sAction = $_REQUEST['action']; } switch ($sAction) { case 'new_agent': $contenidoModulo = newAgent($pDB, $smarty, $module_name, $local_templates_dir); break; case 'edit_agent': $contenidoModulo = editAgent($pDB, $smarty, $module_name, $local_templates_dir); break; case 'isAdministrator': $contenidoModulo = isAdministrator(); break; case 'existingQueue': $contenidoModulo = existingQueue($pDB); break; case 'list_agents': default: $contenidoModulo = listAgent($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/elastixutils.lib.php"; global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); load_language_module($module_name); $sFuncName = 'handleJSON_' . getParameter('action'); if (function_exists($sFuncName)) { return $sFuncName($smarty, $module_name); } $jsonObject = new PaloSantoJSON(); $jsonObject->set_status('false'); $jsonObject->set_error(_tr('Undefined utility action')); return $jsonObject->createJSON(); }
function _moduleContent(&$smarty, $module_name) { load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; require_once "modules/{$module_name}/libs/paloSantoLoginLogout.class.php"; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $pDB = new paloDB($arrConf["cadena_dsn"]); if (!is_object($pDB->conn) || $pDB->errMsg != "") { $smarty->assign('mb_message', _tr('Error when connecting to database') . " " . $pDB->errMsg); return NULL; } return listadoLoginLogout($pDB, $smarty, $module_name, $local_templates_dir); }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoDHCP_Configuration.class.php"; load_language_module($module_name); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); //global variables global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = new paloDB($arrConf['dsn_conn_database']); //actions $accion = getAction(); $content = ""; switch ($accion) { case "new_dhcpconft": $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "false"); break; case "view_dhcpconf": $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "false"); break; case "edit_dhcpconf": $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "true"); break; case "update_dhacp": $content = saveDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, true); break; case "save_dhcp": $content = saveDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "delete_dhcpConf": $content = deleteDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; default: $content = reportDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { load_language_module($module_name); global $arrConf; require_once "modules/{$module_name}/libs/PaloSantoDontCalls.class.php"; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // se conecta a la base $pDB = new paloDB($arrConf["cadena_dsn"]); if (!empty($pDB->errMsg)) { $smarty->assign("mb_message", _tr('Error when connecting to database') . "<br/>" . $pDB->errMsg); } $smarty->assign("MODULE_NAME", _tr('Add Number')); $smarty->assign("label_file", _tr('Upload File')); $smarty->assign("label_text", _tr('Add new Number')); $smarty->assign("NAME_BUTTON_SUBMIT", _tr('SAVE')); $smarty->assign("NAME_BUTTON_CANCEL", _tr('CANCEL')); $formCampos = array(); $oForm = new paloForm($smarty, $formCampos); if (isset($_POST['submit_Add_Call'])) { $contenidoModulo = AddCalls($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm); } else { if (isset($_POST['submit_new'])) { $contenidoModulo = newCalls($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm); } else { if (isset($_POST['submit_Apply'])) { $contenidoModulo = applyList($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm); } else { if (isset($_POST['submit_delete'])) { $contenidoModulo = deleteCalls($pDB, $smarty, $module_name, $local_templates_dir); } else { if (isset($_POST['submit_cancel'])) { $contenidoModulo = listCalls($pDB, $smarty, $module_name, $local_templates_dir); } else { $contenidoModulo = listCalls($pDB, $smarty, $module_name, $local_templates_dir); } } } } } return $contenidoModulo; }
function _moduleContent($smarty, $module_name) { require_once "modules/{$module_name}/configs/default.conf.php"; load_language_module($module_name); global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; switch (getParameter('action')) { case 'checkqueue': return listarColaFax_json($smarty, $module_name, $local_templates_dir); case 'list': default: return listarColaFax_html($smarty, $module_name, $local_templates_dir); } }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoRegistration.class.php"; load_language_module($module_name); //global variables global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = new paloDB($arrConf['dsn_conn_database']); $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']); // dos bases de datos setting.db and register.db //actions $action = getAction(); $content = ""; switch ($action) { case "save": $content = saveRegister($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $pDBACL); break; case "getDataRegisterServer": $content = getDataRegistration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $pDBACL); break; case "showAboutAs": $content = showFormAboutAs($smarty, $module_name, $local_templates_dir, $arrConf); break; case "showRPMS_Version": $content = showFormRPMS_Version($smarty, $module_name, $local_templates_dir, $arrConf); break; default: // view_form $content = viewFormRegister($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $pDBACL); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/paloSantoPortKnockUsers.class.php"; load_language_module($module_name); global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $pDB = new paloDB($arrConf['dsn_conn_database']); switch (getParameter('action')) { case 'new': case 'edit': return addRemovePortsUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); default: return listPortKnockUsers($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); } }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/configs/default.conf.php"; load_language_module($module_name); global $arrConf; global $arrConfModule; $arrConf = array_merge($arrConf, $arrConfModule); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; switch (getAction()) { case 'edit': return actualizarFax($smarty, $module_name, $local_templates_dir); case 'download_faxFile': return download_faxFile(); case 'report': default: return listarFaxes($smarty, $module_name, $local_templates_dir); } }
function _moduleContent(&$smarty, $module_name) { global $arrConfig; //include elastix framework include_once "libs/paloSantoGrid.class.php"; include_once "libs/paloSantoForm.class.php"; //include module files include_once "modules/{$module_name}/libs/paloSantoConfiguration.class.php"; include_once "modules/{$module_name}/configs/default.conf.php"; load_language_module($module_name); global $arrConf; $oDB = new paloDB($arrConfig['cadena_dsn']); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $accion = getAction(); $content = ""; $content .= form_Service($oDB, $smarty, $module_name, $local_templates_dir, $arrConfig['pid_dialer']); $content .= form_Configuration($oDB, $smarty, $module_name, $local_templates_dir); return $content; }
function _moduleContent(&$smarty, $module_name) { $script_dir = dirname($_SERVER['SCRIPT_FILENAME']); load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $relative_dir_rich_text = "modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $smarty->assign("relative_dir_rich_text", $relative_dir_rich_text); // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_campaign'; if (isset($_GET['action'])) { $sAction = $_GET['action']; } switch ($sAction) { case 'new_campaign': $contenidoModulo = newCampaign($pDB, $smarty, $module_name, $local_templates_dir); break; case 'edit_campaign': $contenidoModulo = editCampaign($pDB, $smarty, $module_name, $local_templates_dir); break; case 'csv_data': $contenidoModulo = displayCampaignCSV($pDB, $smarty, $module_name, $local_templates_dir); break; case 'list_campaign': default: $contenidoModulo = listCampaign($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { //include elastix framework include_once "libs/paloSantoForm.class.php"; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoBuildModule.class.php"; global $arrConf; global $arrConfig; //include lang local module global $arrLangModule; load_language_module($module_name); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; require_once 'libs/paloSantoDB.class.php'; $pDB_acl = new paloDB($arrConf['elastix_dsn']['acl']); if (!empty($pDB_acl->errMsg)) { echo "ERROR DE DB: {$pDB_acl->errMsg} <br>"; } $accion = getAction(); switch ($accion) { case "mostrar_menu": $content = mostrar_menu(); break; case "save_module": $content = save_module($smarty, $module_name, $local_templates_dir, $arrLangModule, $pDB_acl, $arrConf); break; case "check_errors": $content = check_errors(); break; default: $content = new_module($smarty, $module_name, $local_templates_dir, $arrLangModule, $pDB_acl); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; load_language_module($module_name); $arrConf = array_merge($arrConf, $arrConfig); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); switch (getParameter('action')) { case 'new_user': return nuevoUsuario($pDB, $smarty, $module_name, $local_templates_dir); case 'edit_user': return editarUsuario($pDB, $smarty, $module_name, $local_templates_dir); case 'list_user': default: return listarUsuarios($pDB, $smarty, $module_name, $local_templates_dir); } }
function _moduleContent(&$smarty, $module_name) { global $arrConf; global $arrLang; global $arrConfig; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloMonitorCampania.class.php"; load_language_module($module_name); //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // Ember.js requiere jQuery 1.7.2 o superior. modificarReferenciasLibreriasJS($smarty); $sContenido = ''; // Procesar los eventos AJAX. switch (getParameter('action')) { case 'getCampaigns': $sContenido = manejarMonitoreo_getCampaigns($module_name, $smarty, $local_templates_dir); break; case 'getCampaignDetail': $sContenido = manejarMonitoreo_getCampaignDetail($module_name, $smarty, $local_templates_dir); break; case 'checkStatus': $sContenido = manejarMonitoreo_checkStatus($module_name, $smarty, $local_templates_dir); break; case 'loadPreviousLogEntries': $sContenido = manejarMonitoreo_loadPreviousLogEntries($module_name, $smarty, $local_templates_dir); break; default: // Página principal con plantilla $sContenido = manejarMonitoreo_HTML($module_name, $smarty, $local_templates_dir); } return $sContenido; }
function _moduleContent(&$smarty, $module_name) { global $arrConf; global $arrLang; require_once "modules/{$module_name}/libs/elastix2.lib.php"; require_once "modules/{$module_name}/libs/paloSantoConsola.class.php"; require_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/JSON.php"; // Directorio de este módulo $sDirScript = dirname($_SERVER['SCRIPT_FILENAME']); // Se fusiona la configuración del módulo con la configuración global $arrConf = array_merge($arrConf, $arrConfModule); /* Se pide el archivo de inglés, que se elige a menos que el sistema indique otro idioma a usar. Así se dispone al menos de la traducción al inglés si el idioma elegido carece de la cadena. */ load_language_module($module_name); // Asignación de variables comunes y directorios de plantillas $sDirPlantillas = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $sDirLocalPlantillas = "{$sDirScript}/modules/{$module_name}/" . $sDirPlantillas . '/' . $arrConf['theme']; $smarty->assign("MODULE_NAME", $module_name); // Incluir todas las bibliotecas y CSS necesarios generarRutaJQueryModulo($smarty, $module_name); // Estado inicial de la consola del Call Center if (!isset($_SESSION['callcenter'])) { $_SESSION['callcenter'] = generarEstadoInicial(); } /* Al iniciar la sesión del agente, se asignan las variables elastix_agent_user y elastix_extension */ if ($_SESSION['callcenter']['estado_consola'] == 'logged-in') { // Manejo de la sesión activa del agente logoneado return manejarSesionActiva($module_name, $smarty, $sDirLocalPlantillas); } else { // Manejo del inicio de la sesión del agente return manejarLogin($module_name, $smarty, $sDirLocalPlantillas); } }