function modify_schedulation()
{
    checkPerm('mod');
    //preload schedulation data in session
    require_once $GLOBALS['where_lms'] . '/lib/lib.report.php';
    if ($id_sched = Get::req('id_sched', DOTY_INT, false)) {
        $qry = "SELECT * FROM " . $GLOBALS['prefix_lms'] . "_report_schedule WHERE id_report_schedule={$id_sched}";
        $row = mysql_fetch_assoc(sql_query($qry));
        $recipients = array();
        $qry = "SELECT * FROM " . $GLOBALS['prefix_lms'] . "_report_schedule_recipient WHERE id_report_schedule={$id_sched}";
        $recs = sql_query($qry);
        while ($trow = mysql_fetch_assoc($recs)) {
            $recipients[] = $trow['id_user'];
        }
        $period = explode(',', $row['period']);
        $_SESSION['schedule_update'] = $id_sched;
        //integer value, <>0 and <>false
        $_SESSION['schedule_tempdata'] = array('name' => $row['name'], 'period' => $period[0], 'period_info' => $period[1], 'time' => '', 'recipients' => $recipients);
        $rid = $row['id_report_filter'];
        $_SESSION['report_saved'] = true;
        $_SESSION['report_saved_data'] = array('id' => $rid, 'name' => getReportNameById($rid));
        schedule_report(Get::req('idrep', DOTY_INT, false));
    } else {
        Util::jump_to('index.php?modname=report&op=schedulelist');
        //if error jump to start page
    }
}
Exemple #2
0
function reportDispatch($op)
{
    if (isset($_POST['save_showed'])) {
        $op = 'report_schedule';
    }
    switch ($op) {
        case "reportlist":
            reportlist();
            break;
        case "report_category":
            report_category();
            break;
        case "report_rows_filter":
            report_rows_filter();
            break;
        case "report_sel_columns":
            report_sel_columns();
            break;
        case "report_columns_filter":
            report_columns_filter();
            break;
        case "report_save":
            if (Get::req('nosave', DOTY_INT, 0) > 0) {
                report_show_results(false);
            }
            report_save_filter();
            break;
        case "show_results":
            report_show_results(Get::req('idrep', DOTY_INT, false));
            break;
        case "modify_name":
            report_modify_name();
            break;
        case "modify_rows":
            report_modify_rows();
            break;
        case "modify_cols":
            report_modify_columns();
            break;
        case "sched_mod":
            require_once _lms_ . '/admin/modules/report/report_schedule.php';
            modify_schedulation();
            break;
        case "report_open_filter":
            report_open_filter();
            break;
        case "report_schedule":
            require_once _lms_ . '/admin/modules/report/report_schedule.php';
            schedule_report();
            break;
        case "schedulelist":
            schedulelist();
            break;
    }
    // end switch
}