Example #1
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoReportedeCalltypes.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $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";
    }
    //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'];
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $action = getAction();
    $content = "";
    // Lo primero que hace es actualizar la tabla campania_cliente
    if ($arrConf['actualizarCampaniaCliente']) {
        actualizarCampaniaCliente($pDB);
    }
    switch ($action) {
        case "generaOffline":
            generaReporteOffline($module_name);
        default:
            $content = reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    ini_set('max_execution_time', 30);
    return $content;
}
$arrLang = array_merge($arrLang, $arrLangModule);
include_once "/var/www/html/modules/hispana_reporte_calltype/libs/paloSantoGrid.class.php";
include_once "/var/www/html/libs/paloSantoForm.class.php";
//include_once "/var/www/html/libs/paloSantoPDF.class.php";
//folder path for custom templates
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/" . $templates_dir . '/' . $arrConf['theme'];
//conexion resource
$pDB = new paloDB($arrConf['dsn_conn_database']);
//actions
$action = getAction();
$content = "";
//print_R($argv);
// Lo primero que hace es actualizar la tabla campania_cliente
if ($arrConf['actualizarCampaniaCliente']) {
    actualizarCampaniaCliente($pDB);
}
switch ($action) {
    default:
        $content = reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $argv);
        break;
}
//ini_set('max_execution_time', 30);
echo $content;
function actualizarCampaniaCliente($pDB)
{
    $pReportedeCalltypes = new paloSantoReportedeCalltypes($pDB);
    $pReportedeCalltypes->actualizarCampaniaCliente();
}
function reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $argv)
{