Beispiel #1
0
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 delete_faxFile($smarty, $module_name, $local_templates_dir, $pDB, $credentials)
{
    $oFax = new paloFaxVisor($pDB);
    $id_organization = null;
    if ($credentials['userlevel'] != 'superadmin') {
        $id_organization = $credentials['id_organization'];
    }
    // Ejecutar el borrado, si se ha validado.
    if (is_array($_POST['faxes']) && count($_POST['faxes']) > 0) {
        $msgError = NULL;
        foreach ($_POST['faxes'] as $idFax) {
            if (!$oFax->deleteInfoFax($idFax, $id_organization)) {
                if ($oFax->errMsg = '') {
                    $msgError = _tr('Unable to eliminate pdf file from the path.');
                } else {
                    $msgError = _tr('Unable to eliminate pdf file from the database.') . ' - ' . $oFax->errMsg;
                }
            }
        }
        if (!is_null($msgError)) {
            $smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oFax->errMsg));
        }
    } else {
        $smarty->assign("mb_title", _tr('ERROR'));
        $smarty->assign("mb_message", _tr('You must select at least one fax'));
    }
    return listarFaxes($smarty, $module_name, $local_templates_dir, $pDB, $credentials);
}