From 73d753c79df3ff30ec99ab2a0461f7623b95cf38 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sat, 8 Sep 2007 22:41:27 +0000 Subject: [PATCH] Redirecting old backup log to the new one. MDL-7850 Merged from MOODLE_18_STABLE --- backup/log.php | 141 ++----------------------------------------------- 1 file changed, 3 insertions(+), 138 deletions(-) diff --git a/backup/log.php b/backup/log.php index d85b36a8b8..48e0250938 100644 --- a/backup/log.php +++ b/backup/log.php @@ -1,148 +1,13 @@ $stradmin, 'link' => "../$CFG->admin/index.php", 'type' => 'misc'); - $navlinks[] = array('name' => $strconfiguration, 'link' => "../$CFG->admin/configure.php", 'type' => 'misc'); - $navlinks[] = array('name' => $strbackup, 'link' => "../$CFG->admin/backup.php?sesskey=$USER->sesskey", 'type' => 'misc'); - $navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc'); - $navigation = build_navigation($navlinks); - - print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname, $navigation); - - print_heading($backuploglaststatus); - print_simple_box_start('center'); - //Now, get every record from backup_courses - $courses = get_records("backup_courses"); - - if (!$courses) { - notify("No logs found!"); - } else { - echo ""; - //Print table header - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - foreach ($courses as $course) { - //Get the course shortname - $coursename = get_field ("course","fullname","id",$course->courseid); - if ($coursename) { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - if ($course->laststatus == 1) { - echo ""; - } else if ($course->laststatus == 2) { - echo ""; - } else if ($course->laststatus == 3) { - echo ""; - } else { - echo ""; - } - echo ""; - echo ""; - } - } - echo "
$strcourse$strtimetaken$strstatus$strnext
courseid\">".$coursename."".userdate($course->laststarttime,$strftimedatetime)." - ".userdate($course->lastendtime,$strftimedatetime)."".$strok."".$strunfinished."".$strskipped."".$strerror."".userdate($course->nextstarttime,$strftimedatetime)."
"; - } - print_simple_box_end(); - //Detailed View !! - } else { - $navlinks = array(); - $navlinks[] = array('name' => $stradmin, 'link' => "../$CFG->admin/index.php", 'type' => 'misc'); - $navlinks[] = array('name' => $strconfiguration, 'link' => "../$CFG->admin/configure.php", 'type' => 'misc'); - $navlinks[] = array('name' => $strbackup, 'link' => "../$CFG->admin/backup.php?sesskey=$USER->sesskey", 'type' => 'misc'); - $navlinks[] = array('name' => $strlogs, 'link' => 'log.php', 'type' => 'misc'); - $navlinks[] = array('name' => $strbackupdetails, 'link' => null, 'type' => 'misc'); - $navigation = build_navigation($navlinks); - - print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname, $navigation); - - print_heading($backuplogdetailed); - - $coursename = get_field("course","fullname","id","$courseid"); - print_heading("$strcourse: $coursename"); - - print_simple_box_start('center'); - - //First, me get all the distinct backups for that course in backup_log - $executions = get_records_sql("SELECT DISTINCT laststarttime,laststarttime - FROM {$CFG->prefix}backup_log - WHERE courseid = '$courseid' - ORDER BY laststarttime DESC"); - - //Iterate over backup executions - if (!$executions) { - notify("No logs found!"); - } else { - echo ""; - foreach($executions as $execution) { - echo ""; - echo ""; - echo ""; - $logs = get_records_sql("SELECT * - FROM {$CFG->prefix}backup_log - WHERE courseid = '$courseid' AND - laststarttime = '$execution->laststarttime' - ORDER BY id"); - if ($logs) { - foreach ($logs as $log) { - echo ""; - echo ""; - $log->info = str_replace("- ERROR!!","- ERROR!!",$log->info); - $log->info = str_replace("- OK","- OK",$log->info); - echo ""; - echo ""; - } - } - } - echo "
"; - print_simple_box("
".userdate($execution->laststarttime)."
", "center"); - echo "
".userdate($log->time,$strftimetime)."".str_replace(" ","    ",$log->info)."
"; - } - print_simple_box_end(); - } - - - print_footer(); + redirect("$CFG->wwwroot/$CFG->admin/report/backups/index.php", '', 'admin', 1); ?> -- 2.39.5