]> git.mjollnir.org Git - moodle.git/commitdiff
First attempt to view scheduled backup logs.
authorstronk7 <stronk7>
Tue, 24 Feb 2004 13:18:22 +0000 (13:18 +0000)
committerstronk7 <stronk7>
Tue, 24 Feb 2004 13:18:22 +0000 (13:18 +0000)
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...)

admin/backup.php
backup/log.php [new file with mode: 0644]
lang/en/moodle.php

index fd6b99f5919cb63147c0719f7a5c82a9757960b8..3623bb6572d3b890c84568635b279973f6ed627f 100644 (file)
@@ -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);
 
diff --git a/backup/log.php b/backup/log.php
new file mode 100644 (file)
index 0000000..854af50
--- /dev/null
@@ -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();
+
+?>
index e1ff28a5e4bd839d41af8b2146a82cedfdebe4e6..f08bd8102f54cbf6731c797d13458b63d04cab23 100644 (file)
@@ -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';