From ae6e3d2f6d0453c3ac375a4ed1ce0964c06a8ff2 Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Fri, 8 Apr 2016 11:38:57 -0700 Subject: [PATCH] CAT-56 Offline Circ Loan Duration Mods Remove options for 3 and 30 days. Add options for same day, 42 days, and full year. Merge in year handling from dev/berick/cat-56-offline-due-date-experiment. Change ev.target.value handling for the non-option to allow for same-day handling. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/web/opac/locale/en-US/lang.dtd modified: Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js modified: Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.xul --- Open-ILS/web/opac/locale/en-US/lang.dtd | 3 +++ .../staff_client/chrome/content/circ/offline_checkout.js | 14 ++++++++++++-- .../staff_client/chrome/content/circ/offline_checkout.xul | 7 ++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index b5ad9c5dda..6610dbb48e 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -6,12 +6,15 @@ + + + diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js index 3190b3a24e..cb1fc0ae7d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js @@ -184,11 +184,21 @@ function handle_enter(ev) { } function handle_duedate_menu(ev) { - if (ev.target.value=='0') return; + var duration = ev.target.value; + if (duration=='none') return; JSAN.use('util.date'); var today = new Date(); var todayPlus = new Date(); - todayPlus.setTime( today.getTime() + 24*60*60*1000*ev.target.value ); + if (duration == '0') { + todayPlus.setTime(today.getTime()); + } else if (duration.match(/year/)) { + // duration is represented in years + var count = duration.split(/ /)[0]; + todayPlus.setFullYear(todayPlus.getFullYear() + parseInt(count)); + } else { + // assume the duration is counted in days + todayPlus.setTime( today.getTime() + 24*60*60*1000*ev.target.value ); + } todayPlus = util.date.formatted_date(todayPlus,'%F'); $('duedate').setAttribute('value',todayPlus); $('duedate').value = todayPlus; diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.xul b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.xul index a66f3dfb1d..2bea215246 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.xul +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.xul @@ -64,13 +64,14 @@ - - + + - + + -- 2.11.0