Exemplo n.º 1
0
require_once "../shared/common.php";
$tab = "reports";
$nav = "reportcriteria";
require_once "../shared/logincheck.php";
require_once "../classes/Report.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
if (isset($_SESSION['postVars']['type'])) {
    $type = $_SESSION['postVars']['type'];
} elseif (isset($_REQUEST['type'])) {
    $type = $_REQUEST['type'];
} else {
    header('Location: ../reports/index.php');
    exit(0);
}
list($rpt, $err) = Report::create_e($type);
if ($err) {
    header('Location: ../reports/index.php');
    exit(0);
}
Nav::node('reportcriteria', 'Report Criteria');
include "../shared/header.php";
#****************************************************************************
#*  getting form vars
#****************************************************************************
require "../shared/get_form_vars.php";
echo '<h1>' . $loc->getText($rpt->title()) . '</h1>';
if (isset($_REQUEST['msg'])) {
    echo '<p><font class="error">' . H($_REQUEST['msg']) . '</font></p>';
}
?>
Exemplo n.º 2
0
$helpPage = "reports";
include "../shared/logincheck.php";
require_once "../classes/Report.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
$navLoc = new Localize(OBIB_LOCALE, 'navbars');
define("REPORT_DEFS_DIR", "../reports/defs");
#****************************************************************************
#*  Read report definitions
#****************************************************************************
$reports = array();
$errors = array();
if ($handle = opendir(REPORT_DEFS_DIR)) {
    while (($file = readdir($handle)) !== false) {
        if (preg_match('/^([^._][^.]*)\\.(rpt|php)$/', $file, $m)) {
            list($rpt, $err) = Report::create_e($m[1]);
            if (!$err) {
                if (!isset($reports[$rpt->category()])) {
                    $reports[$rpt->category()] = array();
                }
                $reports[$rpt->category()][$rpt->type()] = $loc->getText($rpt->title());
            } else {
                $errors[] = $err;
            }
        }
    }
    closedir($handle);
}
ksort($reports);
foreach (array_keys($reports) as $k) {
    asort($reports[$k]);
Exemplo n.º 3
0
 function variant_el($newParams, $newName = NULL)
 {
     assert('is_array($this->cache["params"])');
     if ($newName === NULL) {
         $newName = $this->name;
     }
     list($rpt, $err) = Report::create_e($this->cache['type'], $newName);
     if ($err) {
         Fatal::internalError("Unexpected report creation error: " . $err->toStr());
     }
     $params = new Params();
     $params->loadDict($this->cache['params']);
     $errs = $params->load_el($rpt->rpt->paramDefs(), $newParams);
     if (!empty($errs)) {
         return array(NULL, $errs);
     }
     $errs = $rpt->_init_el($params);
     if (!empty($errs)) {
         return array(NULL, $errs);
     }
     return array($rpt, array());
 }
Exemplo n.º 4
0
            echo ' ';
        }
    }
    if ($currPage < $pageCount) {
        echolink($currPage + 1, $loc->getText("Next&raquo;"));
        echo ' ';
    }
}
if (!$_REQUEST['type']) {
    header('Location: ../reports/index.php');
    exit(0);
}
if ($_REQUEST['type'] == 'previous') {
    $rpt = Report::load('Report');
} else {
    list($rpt, $err) = Report::create_e($_REQUEST['type'], 'Report');
    if ($err) {
        $rpt = NULL;
    }
}
if (!$rpt) {
    header('Location: ../reports/index.php');
    exit(0);
}
if ($_REQUEST['type'] == 'previous') {
    if (isset($_REQUEST['rpt_order_by'])) {
        list($rpt, $errs) = $rpt->variant_el(array('order_by' => $_REQUEST['rpt_order_by']));
        assert('empty($errs)');
    }
} else {
    $errs = $rpt->initCgi_el();