2009-11-01 10:42:45 +00:00
|
|
|
<?php
|
2011-11-02 09:12:28 +01:00
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
2009-01-13 21:13:16 +00:00
|
|
|
|
2011-11-02 09:12:28 +01:00
|
|
|
/**
|
|
|
|
* Config changes report
|
|
|
|
*
|
|
|
|
* @package report
|
|
|
|
* @subpackage configlog
|
|
|
|
* @copyright 2009 Petr Skoda
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
2016-02-26 17:47:58 +11:00
|
|
|
require(__DIR__.'/../../config.php');
|
2009-01-13 21:13:16 +00:00
|
|
|
require_once($CFG->libdir.'/adminlib.php');
|
|
|
|
|
2011-11-20 18:58:49 +00:00
|
|
|
admin_externalpage_setup('reportconfiglog', '', null, '', array('pagelayout'=>'report'));
|
2009-01-13 21:13:16 +00:00
|
|
|
|
2019-10-18 16:06:38 +01:00
|
|
|
echo $OUTPUT->header();
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading(get_string('configlog', 'report_configlog'));
|
2009-01-13 21:13:16 +00:00
|
|
|
|
2019-10-18 16:06:38 +01:00
|
|
|
$mform = new \report_configlog\form\search();
|
|
|
|
|
|
|
|
/** @var cache_session $cache */
|
|
|
|
$cache = cache::make_from_params(cache_store::MODE_SESSION, 'report_customlog', 'search');
|
|
|
|
if ($cachedata = $cache->get('data')) {
|
|
|
|
$mform->set_data($cachedata);
|
|
|
|
}
|
|
|
|
|
|
|
|
$searchclauses = [];
|
|
|
|
|
|
|
|
// Check if we have a form submission, or a cached submission.
|
|
|
|
$data = ($mform->is_submitted() ? $mform->get_data() : fullclone($cachedata));
|
|
|
|
if ($data instanceof stdClass) {
|
|
|
|
if (!empty($data->value)) {
|
|
|
|
$searchclauses[] = $data->value;
|
|
|
|
}
|
|
|
|
if (!empty($data->setting)) {
|
|
|
|
$searchclauses[] = "setting:{$data->setting}";
|
|
|
|
}
|
|
|
|
if (!empty($data->user)) {
|
|
|
|
$searchclauses[] = "user:{$data->user}";
|
|
|
|
}
|
|
|
|
if (!empty($data->datefrom)) {
|
|
|
|
$searchclauses[] = "datefrom:{$data->datefrom}";
|
|
|
|
}
|
|
|
|
if (!empty($data->dateto)) {
|
|
|
|
$dateto = $data->dateto + DAYSECS - 1;
|
|
|
|
$searchclauses[] = "dateto:{$dateto}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cache form submission so that it is preserved while paging through the report.
|
|
|
|
unset($data->submitbutton);
|
|
|
|
$cache->set('data', $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
$mform->display();
|
|
|
|
|
|
|
|
$table = new \report_configlog\output\report_table(implode(' ', $searchclauses));
|
2019-06-06 10:39:52 +01:00
|
|
|
$table->define_baseurl($PAGE->url);
|
2009-01-13 21:13:16 +00:00
|
|
|
|
2019-06-06 10:39:52 +01:00
|
|
|
echo $PAGE->get_renderer('report_configlog')->render($table);
|
2009-01-13 21:13:16 +00:00
|
|
|
|
2019-10-18 16:06:38 +01:00
|
|
|
echo $OUTPUT->footer();
|