From: Bill Erickson Date: Fri, 8 Aug 2014 00:39:47 +0000 (-0400) Subject: LP#1329503 avoid run now + later combined schedule X-Git-Tag: sprint4-merge-nov22~1964 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=de728768aec76dc1daeb6ee6d28d2eecb8c18fd1;p=working%2FEvergreen.git 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 --- 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]