From de728768aec76dc1daeb6ee6d28d2eecb8c18fd1 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 7 Aug 2014 20:39:47 -0400 Subject: [PATCH] LP#1329503 avoid run now + later combined schedule When editing a report, ensure only one of "now" vs. "schedule for later" options is selected by default. Similarly, if the schedule option is activated by default, ensure the date fields are enabled. If the run time of the most recent report is in the past, default to the current date for the schedule instead of the no longer valid date. Signed-off-by: Bill Erickson Signed-off-by: Ben Shum --- Open-ILS/web/reports/oils_rpt_report_editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/reports/oils_rpt_report_editor.js b/Open-ILS/web/reports/oils_rpt_report_editor.js index 5bc5e89ef9..5db7a33fb5 100644 --- a/Open-ILS/web/reports/oils_rpt_report_editor.js +++ b/Open-ILS/web/reports/oils_rpt_report_editor.js @@ -125,11 +125,15 @@ oils_rpt_editor_pivot_data DOM.oils_rpt_param_editor_sched_email.value = run.email(); if (run.run_time()) { + DOM.oils_rpt_report_editor_run_now.checked = false; DOM.oils_rpt_report_editor_schedule.checked = true; + DOM.oils_rpt_param_editor_sched_start_date.disabled = false; + DOM.oils_rpt_param_editor_sched_start_hour.disabled = false; + if (new Date(Date.parse(run.run_time())) < new Date()) { // editing a report with a past-tense run time // clear the value so the user will have to edit - DOM.oils_rpt_param_editor_sched_start_date.value = ''; + DOM.oils_rpt_param_editor_sched_start_date.value = mkYearMonDay(); } else { DOM.oils_rpt_param_editor_sched_start_date.value = run.run_time().match(/(\d\d\d\d-\d\d-\d\d)/)[1] -- 2.11.0