mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 11:46:19 +01:00
First attempt to view scheduled backup logs.
Currently it shows laststatus only. Detailed view comming this afternoon. ==== Note: As you have released 1.2beta and this is a new little functionality, please, let me know if I must "delete" it from CVS before 1.2 (although I think that we are on time to add this...)
This commit is contained in:
parent
740f08cb01
commit
e39a04d573
@ -72,7 +72,9 @@
|
||||
print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname,
|
||||
"<a href=\"index.php\">$stradmin</a> -> ".
|
||||
"<a href=\"configure.php\">$strconfiguration</a> -> ".
|
||||
"<a href=\"backup.php\">$strbackup</a>");
|
||||
$strbackup);
|
||||
|
||||
echo "<p align=right><a href=\"../backup/log.php\">".get_string("logs")."</a></p>";
|
||||
|
||||
print_heading($strbackup);
|
||||
|
||||
|
89
backup/log.php
Normal file
89
backup/log.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?PHP // $Id$
|
||||
// backup.php - allows admin to edit all configuration variables for scheduled backups
|
||||
|
||||
require_once("../config.php");
|
||||
require_once("../backup/lib.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only an admin can use this page");
|
||||
}
|
||||
|
||||
if (!$site = get_site()) {
|
||||
error("Site isn't defined!");
|
||||
}
|
||||
|
||||
/// Otherwise print the form.
|
||||
|
||||
$stradmin = get_string("administration");
|
||||
$strconfiguration = get_string("configuration");
|
||||
$strbackup = get_string("backup");
|
||||
$strlogs = get_string("logs");
|
||||
$strftimedatetime = get_string("strftimerecent");
|
||||
$strerror = get_string("error");
|
||||
$strok = get_string("ok");
|
||||
$strcourse = get_string("course");
|
||||
$strtimetaken = get_string("timetaken","quiz");
|
||||
$strstatus = get_string("status");
|
||||
$strnext = get_string("next");
|
||||
|
||||
print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname,
|
||||
"<a href=\"../admin/index.php\">$stradmin</a> -> ".
|
||||
"<a href=\"../admin/configure.php\">$strconfiguration</a> -> ".
|
||||
"<a href=\"../admin/backup.php\">$strbackup</a> -> ".
|
||||
$strlogs);
|
||||
|
||||
print_heading($strbackup);
|
||||
|
||||
print_simple_box("<center>".get_string("backuploglaststatus")."</center>", "center", "50%");
|
||||
echo "<br />";
|
||||
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
|
||||
//Now, get every record from backup_courses
|
||||
$courses = get_records("backup_courses");
|
||||
|
||||
if (!$courses) {
|
||||
notify("No logs found!");
|
||||
} else {
|
||||
echo "<table border=0 align=center cellpadding=3 cellspacing=3>";
|
||||
//Print table header
|
||||
echo "<tr nowrap>";
|
||||
echo "<td nowrap align=center><font size=3>$strcourse</font></td>";
|
||||
echo "<td nowrap align=center colspan=3><font size=3>$strtimetaken</font></td>";
|
||||
echo "<td nowrap align=center><font size=3>$strstatus</font></td>";
|
||||
echo "<td nowrap align=center><font size=3>$strnext</font></td>";
|
||||
foreach ($courses as $course) {
|
||||
//Get the course shortname
|
||||
$coursename = get_field ("course","fullname","id",$course->courseid);
|
||||
if ($coursename) {
|
||||
echo "<tr nowrap>";
|
||||
echo "<td nowrap><font size=2><a href=\"../course/view.php?id=$course->courseid\">".$coursename."</a></td>";
|
||||
echo "<td nowrap><font size=2>".userdate($course->laststarttime,$strftimedatetime)."</td>";
|
||||
echo "<td nowrap><font size=2> - </td>";
|
||||
echo "<td nowrap><font size=2>".userdate($course->lastendtime,$strftimedatetime)."</td>";
|
||||
if (!$course->laststatus) {
|
||||
echo "<td nowrap align=center><font size=2 color=red>".$strerror."</td>";
|
||||
} else {
|
||||
echo "<td nowrap align=center><font size=2 color=green>".$strok."</td>";
|
||||
}
|
||||
echo "<td nowrap><font size=2>".userdate($course->nextstarttime,$strftimedatetime)."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
print_simple_box_end();
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
@ -88,6 +88,7 @@ $string['backupfilename'] = 'backup';
|
||||
$string['backupfinished'] = 'Backup completed successfully';
|
||||
$string['backupincludemoduleshelp'] = 'Choose whether you want to include course modules, with or without user data, in automated backups';
|
||||
$string['backupkeephelp'] = 'How many recent backups for each course do you want to keep? (older ones will be deleted automatically)';
|
||||
$string['backuploglaststatus'] = 'Backup last status log';
|
||||
$string['backuplogshelp'] = 'If enabled, then course logs will be included in automated backups';
|
||||
$string['backupnameformat'] = '%%Y%%m%%d-%%H%%M';
|
||||
$string['backuporiginalname'] = 'Backup Name';
|
||||
|
Loading…
x
Reference in New Issue
Block a user