From: Mike Rylander Date: Thu, 3 Aug 2017 18:18:30 +0000 (-0400) Subject: LP#1705524: Minor cleanup in prep for committing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0f0203bb230fce6b44137e8203b999a5de326b46;p=evergreen%2Fmasslnc.git LP#1705524: Minor cleanup in prep for committing 1. Provide an admin-friendly summary of changes at the top of the release notes. 2. Change quoting of optional post-upgrade SQL echoing in the upgrade script. 3. Fix preexisting issue with variable interpolation inside an alert modal. 4. Protect against null or empty date fields when formatting. Signed-off-by: Mike Rylander 5. Added if (date == 'now') check. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.tz_org_setting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.tz_org_setting.sql index 4d7f24c9bd..22b4c9a4d7 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.tz_org_setting.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.tz_org_setting.sql @@ -47,31 +47,31 @@ $$ LANGUAGE PLPGSQL; COMMIT; \qecho The following query will adjust all historical, unaged circulations so -\qecho that if their due date field pushed to the end of the day, it is done -\qecho in the circulating library's time zone, and not the server time zone. +\qecho that if their due date field is pushed to the end of the day, it is done +\qecho in the circulating library'''s time zone, and not the server time zone. \qecho \qecho It is safe to run this after any change to library time zones. \qecho \qecho Running this is not required, as no code before this change has -\qecho depended on the time string of '23:59:59'. It is also not necessary +\qecho depended on the time string of '''23:59:59'''. It is also not necessary \qecho if all of your libraries are in the same time zone, and that time zone -\qecho is the same as the databases configured time zone. +\qecho is the same as the database'''s configured time zone. \qecho -\qecho DO $$ -\qecho declare -\qecho new_tz text; -\qecho ou_id int; -\qecho begin -\qecho for ou_id in select id from actor.org_unit loop -\qecho for new_tz in select oils_json_to_text(value) from actor.org_unit_ancestor_setting('lib.timezone',ou_id) loop -\qecho if new_tz is not null then -\qecho update action.circulation -\qecho set due_date = (due_date::timestamp || ' ' || new_tz)::timestamptz -\qecho where circ_lib = ou_id -\qecho and substring((due_date at time zone new_tz)::time::text from 1 for 8) <> '23:59:59'; -\qecho end if; -\qecho end loop; -\qecho end loop; -\qecho end; -\qecho $$; +\qecho 'DO $$' +\qecho 'declare' +\qecho ' new_tz text;' +\qecho ' ou_id int;' +\qecho 'begin' +\qecho ' for ou_id in select id from actor.org_unit loop' +\qecho ' for new_tz in select oils_json_to_text(value) from actor.org_unit_ancestor_setting('''lib.timezone''',ou_id) loop' +\qecho ' if new_tz is not null then' +\qecho ' update action.circulation' +\qecho ' set due_date = (due_date::timestamp || ''' ''' || new_tz)::timestamptz' +\qecho ' where circ_lib = ou_id' +\qecho ' and substring((due_date at time zone new_tz)::time::text from 1 for 8) <> '''23:59:59''';' +\qecho ' end if;' +\qecho ' end loop;' +\qecho ' end loop;' +\qecho 'end;' +\qecho '$$;' \qecho diff --git a/Open-ILS/src/templates/staff/circ/share/t_circ_exists_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_circ_exists_dialog.tt2 index d4b4aeb426..552de0426a 100644 --- a/Open-ILS/src/templates/staff/circ/share/t_circ_exists_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/share/t_circ_exists_dialog.tt2 @@ -8,13 +8,13 @@