From 6c928b4cfeb7d29f86c864bb84709c5446b7ec67 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 2 Jan 2009 17:59:01 +0000 Subject: [PATCH] MDL-12922 restore roll dates - prevent wrong rolls to 0 happening to teachers. Merged from 19_STABLE --- backup/restore_check.html | 4 ++-- backup/restore_form.html | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backup/restore_check.html b/backup/restore_check.html index 350885d5ea..ac35bedda1 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -25,8 +25,8 @@ $course_header->course_fullname = $form1->fullname; //"update_FullName"; /// Roll dates only if the backup course has a start date /// (some formats like main page, social..., haven't it and rolling dates - /// from 0 produces crazy dates. MDL-10125 - if ($course_header->course_startdate) { + /// from 0 produces crazy dates. MDL-10125 and we have passed some custom startyear/month/day. MDL-12922 + if ($course_header->course_startdate && !empty($form1->startyear)) { $form1->startdate = make_timestamp($form1->startyear, $form1->startmonth, $form1->startday); $currentcoursestartdate = $course_header->course_startdate; $coursestartdatedateoffset = $form1->startdate - $currentcoursestartdate; diff --git a/backup/restore_form.html b/backup/restore_form.html index 8f806f681e..704e37f7be 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -294,6 +294,11 @@ function selectItemInCheckboxByName(formId, checkName, checked ) { echo ''; } echo ""; + } else { + /// If user cannot create course, prevent any change in startyear/month/day (so restore wont calculate any roll. MDL-12922 + echo ''; + echo ''; + echo ''; } //Line echo "
"; -- 2.39.5