From b6a1cf9fe868c46f84b1f20b6e9869c9ab71228b Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 5 Jun 2017 17:32:55 -0400 Subject: [PATCH] lp1691237 webstaff: fix Format Dates and Format Times This change deprecates the existing Format Dates and Format Times settings and adds two settings for use with the webstaff client: Format Dates with this pattern Format Date+Time with this pattern These settings use format strings as documented here: https://docs.angularjs.org/api/ng/filter/date There is overlap with how the Dojo formats worked, but also some differences. The original Format Dates and Format Times settings worked together, but the new settings work independently. Certain field elements will use one, and certain field elements will use the other. These distinctions are hard-coded in the various UI templates, with the idea being that timestamp fields in which the date component alone is sufficient information (for example, DOB) will use the Format Dates setting. Fields where the time component is important (for example, Checkout Time) will use the Format Date+Time setting. When the settings Format Dates and Format Date+Time are unset, we will default to "shortDate" (M/d/yy) and "short" (M/d/yy h:mm a), respectively. Signed-off-by: Jason Etheridge Signed-off-by: Andrea Neiman Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 40 +++++++++++ ....data.webstaff_date_format_ou_settings.sql | 68 +++++++++++++++++++ .../admin/local/circ/neg_balance_users.tt2 | 5 +- .../staff/admin/local/rating/badge.tt2 | 3 +- .../staff/admin/server/config/marc_field.tt2 | 3 +- .../staff/admin/workstation/t_log.tt2 | 8 +-- .../templates/staff/cat/catalog/t_holds.tt2 | 9 +-- .../staff/cat/item/t_circ_list_pane.tt2 | 8 +-- .../templates/staff/cat/item/t_circs_pane.tt2 | 20 +++--- .../templates/staff/cat/item/t_holds_pane.tt2 | 14 ++-- .../src/templates/staff/cat/item/t_list.tt2 | 48 ++++--------- .../staff/cat/item/t_summary_pane.tt2 | 14 ++-- .../staff/cat/share/t_record_summary.tt2 | 2 +- .../templates/staff/cat/volcopy/t_edit.tt2 | 12 ++-- .../src/templates/staff/cat/z3950/t_list.tt2 | 4 +- .../staff/circ/checkin/t_checkin.tt2 | 2 +- .../staff/circ/checkin/t_checkin_table.tt2 | 9 +-- .../staff/circ/holds/t_pull_list.tt2 | 5 +- .../staff/circ/holds/t_shelf_list.tt2 | 9 +-- .../templates/staff/circ/patron/t_alerts.tt2 | 2 +- .../circ/patron/t_bill_history_payments.tt2 | 5 +- .../circ/patron/t_bill_history_xacts.tt2 | 9 +-- .../staff/circ/patron/t_bills_list.tt2 | 5 +- .../staff/circ/patron/t_checkout.tt2 | 5 +- .../templates/staff/circ/patron/t_group.tt2 | 7 +- .../staff/circ/patron/t_holds_list.tt2 | 9 +-- .../staff/circ/patron/t_items_out.tt2 | 12 ++-- .../staff/circ/patron/t_messages.tt2 | 10 +-- .../templates/staff/circ/patron/t_notes.tt2 | 2 +- .../staff/circ/patron/t_pending_list.tt2 | 3 +- .../staff/circ/patron/t_search_results.tt2 | 7 +- .../templates/staff/circ/patron/t_summary.tt2 | 12 ++-- .../staff/circ/patron/t_xact_details.tt2 | 21 +++--- .../templates/staff/circ/renew/t_renew.tt2 | 5 +- .../staff/circ/share/t_bill_patron_dialog.tt2 | 4 +- .../staff/circ/share/t_circ_exists_dialog.tt2 | 4 +- .../circ/share/t_copy_in_transit_dialog.tt2 | 2 +- .../staff/circ/share/t_hold_details.tt2 | 10 +-- .../staff/circ/share/t_hold_shelf_dialog.tt2 | 4 +- .../staff/circ/share/t_transit_dialog.tt2 | 4 +- .../templates/staff/circ/transits/t_list.tt2 | 10 +-- .../share/print_templates/t_bill_payment.tt2 | 2 +- .../share/print_templates/t_bills_current.tt2 | 6 +- .../print_templates/t_bills_historical.tt2 | 6 +- .../staff/share/print_templates/t_checkin.tt2 | 2 +- .../share/print_templates/t_checkout.tt2 | 4 +- .../print_templates/t_hold_shelf_slip.tt2 | 4 +- .../print_templates/t_hold_transit_slip.tt2 | 4 +- .../share/print_templates/t_holds_for_bib.tt2 | 4 +- .../print_templates/t_holds_for_patron.tt2 | 2 +- .../print_templates/t_in_house_use_list.tt2 | 2 +- .../share/print_templates/t_item_status.tt2 | 2 +- .../share/print_templates/t_items_out.tt2 | 4 +- .../share/print_templates/t_patron_note.tt2 | 2 +- .../staff/share/print_templates/t_renew.tt2 | 4 +- .../share/print_templates/t_transit_list.tt2 | 4 +- .../share/print_templates/t_transit_slip.tt2 | 2 +- .../web/js/ui/default/staff/services/grid.js | 10 ++- .../js/ui/default/staff/services/startup.js | 17 ++++- 59 files changed, 325 insertions(+), 191 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.webstaff_date_format_ou_settings.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 2ec447a7a3..ffa673286d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -16836,3 +16836,43 @@ VALUES ( 'ebook_api', 'string' ); + +INSERT into config.org_unit_setting_type ( + name + ,grp + ,label + ,description + ,datatype +) VALUES ( ---------------------------------------- + 'webstaff.format.dates' + ,'gui' + ,oils_i18n_gettext( + 'webstaff.format.dates' + ,'Format Dates with this pattern' + ,'coust' + ,'label' + ) + ,oils_i18n_gettext( + 'webstaff.format.dates' + ,'Format Dates with this pattern (examples: "yyyy-MM-dd" for "2010-04-26", "MMM d, yyyy" for "Apr 26, 2010"). This will be used in areas where a date without a timestamp is sufficient, like Date of Birth.' + ,'coust' + ,'description' + ) + ,'string' +), ( ---------------------------------------- + 'webstaff.format.date_and_time' + ,'gui' + ,oils_i18n_gettext( + 'webstaff.format.date_and_time' + ,'Format Date+Time with this pattern' + ,'coust' + ,'label' + ) + ,oils_i18n_gettext( + 'webstaff.format.date_and_time' + ,'Format Date+Time with this pattern (examples: "yy-MM-dd h:m:s.SSS a" for "16-04-05 2:07:20.666 PM", "yyyy-dd-MMM HH:mm" for "2016-05-Apr 14:07"). This will be used in areas of the client where a date with a timestamp is needed, like Checkout, Due Date, or Record Created.' + ,'coust' + ,'description' + ) + ,'string' +); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.webstaff_date_format_ou_settings.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.webstaff_date_format_ou_settings.sql new file mode 100644 index 0000000000..a7ac6af63d --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.webstaff_date_format_ou_settings.sql @@ -0,0 +1,68 @@ +BEGIN; + +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT into config.org_unit_setting_type ( + name + ,grp + ,label + ,description + ,datatype +) VALUES ( ---------------------------------------- + 'webstaff.format.dates' + ,'gui' + ,oils_i18n_gettext( + 'webstaff.format.dates' + ,'Format Dates with this pattern' + ,'coust' + ,'label' + ) + ,oils_i18n_gettext( + 'webstaff.format.dates' + ,'Format Dates with this pattern (examples: "yyyy-MM-dd" for "2010-04-26", "MMM d, yyyy" for "Apr 26, 2010"). This will be used in areas where a date without a timestamp is sufficient, like Date of Birth.' + ,'coust' + ,'description' + ) + ,'string' +), ( ---------------------------------------- + 'webstaff.format.date_and_time' + ,'gui' + ,oils_i18n_gettext( + 'webstaff.format.date_and_time' + ,'Format Date+Time with this pattern' + ,'coust' + ,'label' + ) + ,oils_i18n_gettext( + 'webstaff.format.date_and_time' + ,'Format Date+Time with this pattern (examples: "yy-MM-dd h:m:s.SSS a" for "16-04-05 2:07:20.666 PM", "yyyy-dd-MMM HH:mm" for "2016-05-Apr 14:07"). This will be used in areas of the client where a date with a timestamp is needed, like Checkout, Due Date, or Record Created.' + ,'coust' + ,'description' + ) + ,'string' +); + +UPDATE + config.org_unit_setting_type +SET + label = 'Deprecated: ' || label -- FIXME: Is this okay? +WHERE + name IN ('format.date','format.time') +; + +-- for testing, setting removal: +--DELETE FROM actor.org_unit_setting WHERE name IN ( +-- 'webstaff.format.dates' +-- ,'webstaff.format.date_and_time' +--); +--DELETE FROM config.org_unit_setting_type_log WHERE field_name IN ( +-- 'webstaff.format.dates' +-- ,'webstaff.format.date_and_time' +--); +--DELETE FROM config.org_unit_setting_type WHERE name IN ( +-- 'webstaff.format.dates' +-- ,'webstaff.format.date_and_time' +--); +--UPDATE config.org_unit_setting_type SET label = REPLACE(label,'Deprecated: ','') WHERE name in ('format.date','format.time'); + +COMMIT; diff --git a/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 b/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 index 9501f6a774..8291796a26 100644 --- a/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 +++ b/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 @@ -34,13 +34,14 @@ features="-sort,-multisort" items-provider="grid_provider" grid-controls="grid_controls" - persist-key="admin.local.circ.neg_balance_users"> + persist-key="admin.local.circ.neg_balance_users" + dateformat="{{$root.egDateAndTimeFormat}}"> - + diff --git a/Open-ILS/src/templates/staff/admin/local/rating/badge.tt2 b/Open-ILS/src/templates/staff/admin/local/rating/badge.tt2 index a67249d65a..ce66fc0927 100644 --- a/Open-ILS/src/templates/staff/admin/local/rating/badge.tt2 +++ b/Open-ILS/src/templates/staff/admin/local/rating/badge.tt2 @@ -43,7 +43,8 @@ idl-class="rb" grid-controls="gridControls" features="-multiselect" - persist-key="admin.local.rating.badge"> + persist-key="admin.local.rating.badge" + dateformat="{{$root.egDateAndTimeFormat}}"> diff --git a/Open-ILS/src/templates/staff/admin/server/config/marc_field.tt2 b/Open-ILS/src/templates/staff/admin/server/config/marc_field.tt2 index 3316ab61e0..b9dbdc1f49 100644 --- a/Open-ILS/src/templates/staff/admin/server/config/marc_field.tt2 +++ b/Open-ILS/src/templates/staff/admin/server/config/marc_field.tt2 @@ -37,7 +37,8 @@ idl-class="cmrcfld" grid-controls="gridControls" features="-multiselect" - persist-key="admin.server.config.marc_field"> + persist-key="admin.server.config.marc_field" + dateformat="{{$root.egDateAndTimeFormat}}"> diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_log.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_log.tt2 index 014d74d2dc..50c9bc54cb 100644 --- a/Open-ILS/src/templates/staff/admin/workstation/t_log.tt2 +++ b/Open-ILS/src/templates/staff/admin/workstation/t_log.tt2 @@ -11,7 +11,7 @@ items-provider="grid_work_log_provider" grid-controls="grid_controls" persist-key="admin.workstation.work_log" -> + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -27,7 +27,7 @@ - + @@ -40,7 +40,7 @@ items-provider="grid_patron_log_provider" grid-controls="grid_controls" persist-key="admin.workstation.patron_log" -> + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -53,7 +53,7 @@ - + diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 index aafa7791fe..175682286a 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 @@ -15,7 +15,8 @@ features="-sort,-multisort" items-provider="hold_grid_data_provider" grid-controls="hold_grid_controls" - persist-key="cat.catalog.holds"> + persist-key="cat.catalog.holds" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -65,9 +66,9 @@ {{item.patron_barcode}} {{item.patron_alias}} - - - + + + diff --git a/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 index 698869b110..3cab22b938 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 @@ -37,13 +37,13 @@
[% l('Check Out Date') %]
-
{{circ.xact_start() | date:'short'}}
+
{{circ.xact_start() | date:egDateAndTimeFormat}}
[% l('Due Date') %]
-
{{circ.due_date() | date:'short'}}
+
{{circ.due_date() | date:egDateAndTimeFormat}}
[% l('Stop Fines Time') %]
-
{{circ.stop_fines_time() | date:'short'}}
+
{{circ.stop_fines_time() | date:egDateAndTimeFormat}}
[% l('Checkin Time') %]
-
{{circ.checkin_time() | date:'short'}}
+
{{circ.checkin_time() | date:egDateAndTimeFormat}}
[% l('Check Out Library') %]
diff --git a/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 index 512f5c3890..8a165b32e1 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 @@ -37,7 +37,7 @@
[% l('Checkout Date') %]
- {{prev_circ_summary.start_time() | date:'short'}} + {{prev_circ_summary.start_time() | date:egDateAndTimeFormat}}
@@ -51,7 +51,7 @@
[% l('Last Renewed On') %]
- {{prev_circ_summary.last_renewal_time() | date:'short'}} + {{prev_circ_summary.last_renewal_time() | date:egDateAndTimeFormat}}
@@ -71,19 +71,19 @@
[% l('Stop Fines Time') %]
- {{prev_circ_summary.last_stop_fines_time() | date:'short'}} + {{prev_circ_summary.last_stop_fines_time() | date:egDateAndTimeFormat}}
[% l('Checkin Time') %]
- {{prev_circ_summary.last_checkin_time() | date:'short'}} + {{prev_circ_summary.last_checkin_time() | date:egDateAndTimeFormat}}
[% l('Checkin Scan Time') %]
- {{prev_circ_summary.last_checkin_scan_time() | date:'short'}} + {{prev_circ_summary.last_checkin_scan_time() | date:egDateAndTimeFormat}}
@@ -129,7 +129,7 @@
[% l('Checkout Date') %]
- {{circ.xact_start() | date:'short'}} + {{circ.xact_start() | date:egDateAndTimeFormat}}
@@ -143,7 +143,7 @@
[% l('Last Renewed On') %]
- {{circ_summary.last_renewal_time() | date:'short'}} + {{circ_summary.last_renewal_time() | date:egDateAndTimeFormat}}
@@ -164,21 +164,21 @@
[% l('Stop Fines Time') %]
- {{circ.stop_fines_time() | date:'short'}} + {{circ.stop_fines_time() | date:egDateAndTimeFormat}}
[% l('Checkin Time') %]
- {{circ.checkin_time() | date:'short'}} + {{circ.checkin_time() | date:egDateAndTimeFormat}}
[% l('Checkin Scan Time') %]
- {{circ.checkin_scan_time() | date:'short'}} + {{circ.checkin_scan_time() | date:egDateAndTimeFormat}}
diff --git a/Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2 index 601c1287bc..b66ba06a53 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2 @@ -50,31 +50,31 @@
[% l('Request Date') %]
- {{hold.request_time() | date:'short'}} + {{hold.request_time() | date:egDateAndTimeFormat}}
[% l('Capture Date') %]
- {{hold.capture_time() | date:'short'}} + {{hold.capture_time() | date:egDateAndTimeFormat}}
[% l('Shelf Time') %]
- {{hold.shelf_time() | date:'short'}} + {{hold.shelf_time() | date:egDateAndTimeFormat}}
[% l('Shelf Expire Time') %]
- {{hold.shelf_expire_time() | date:'short'}} + {{hold.shelf_expire_time() | date:egDateAndTimeFormat}}
[% l('Hold Expire Time') %]
- {{hold.expire_time() | date:'short'}} + {{hold.expire_time() | date:egDateAndTimeFormat}}
@@ -112,13 +112,13 @@
[% l('Transit Send Time') %]
- {{transit.source_send_time() | date:'short'}} + {{transit.source_send_time() | date:egDateAndTimeFormat}}
[% l('Transit Receive Time') %]
- {{transit.source_recv_time() | date:'short'}} + {{transit.source_recv_time() | date:egDateAndTimeFormat}}
diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 index 42dd3f2304..176527cb77 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 @@ -5,7 +5,8 @@ main-label="[% l('Item Status') %]" items-provider="gridDataProvider" grid-controls="gridControls" - persist-key="cat.items"> + persist-key="cat.items" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -61,9 +62,8 @@ - - {{item['_circ']['due_date'] | date:'short'}} - + + - - + + - + @@ -101,26 +95,16 @@ - - - - + + + + - + @@ -137,14 +121,10 @@ - + - + diff --git a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 index 2b5d135b0b..9c60191a12 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 @@ -34,7 +34,7 @@
{{copy.call_number().label()}}
[% l('Due Date') %]
-
{{circ.due_date() | date:'short'}}
+
{{circ.due_date() | date:egDateAndTimeFormat}}
@@ -53,7 +53,7 @@
[% l('Checkout Date') %]
-
{{circ.xact_start() | date:'short'}}
+
{{circ.xact_start() | date:egDateAndTimeFormat}}
@@ -78,7 +78,7 @@
[% l('Date Created') %]
-
{{copy.create_date() | date:'short'}}
+
{{copy.create_date() | date:egDateAndTimeFormat}}
[% l('Fine Level') %]
{{circ.duration_rule().name()}}
@@ -91,7 +91,7 @@
[% l('Date Active') %]
-
{{copy.active_date() | date:'short'}}
+
{{copy.active_date() | date:egDateAndTimeFormat}}
[% l('Reference') %]
{{copy.ref()}}
@@ -105,7 +105,7 @@
[% l('Status Changed') %]
-
{{copy.status_changed_time() | date:'short'}}
+
{{copy.status_changed_time() | date:egDateAndTimeFormat}}
[% l('OPAC Visible') %]
{{copy.opac_visible()}}
@@ -130,7 +130,7 @@
[% l('Checkin Time') %]
{{circ.checkin_time() || - circ_summary.last_checkin_time() | date:'short'}} + circ_summary.last_checkin_time() | date:egDateAndTimeFormat}}
@@ -147,7 +147,7 @@
[% l('Checkin Scan Time') %]
{{circ.checkin_scan_time() || - circ_summary.last_checkin_scan_time() | date:'short'}} + circ_summary.last_checkin_scan_time() | date:egDateAndTimeFormat}}
diff --git a/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2 b/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2 index 045bd93b4f..0675dbadb8 100644 --- a/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2 +++ b/Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2 @@ -100,7 +100,7 @@
{{record.owner().shortname()}}
[% l('Last Edited On:') %]
-
{{record.edit_date() | date:'short'}}
+
{{record.edit_date() | date:$root.egDateAndTimeFormat}}
diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 index 886d41cd40..ba58c126a9 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 @@ -110,7 +110,8 @@ grid-controls="workingGridControls" on-select="handleItemSelect" after-select="afterItemSelect" - persist-key="cat.volcopy.copies"> + persist-key="cat.volcopy.copies" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -119,7 +120,7 @@ - + @@ -143,7 +144,8 @@ features="-pagination,-actions,-index" items-provider="completedGridDataProvider" grid-controls="completedGridControls" - persist-key="cat.volcopy.copies.complete"> + persist-key="cat.volcopy.copies.complete" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -154,8 +156,8 @@ label="[% l('Save & Exit') %]"> - - + + diff --git a/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 b/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 index 5e2ab8beee..e687c93f04 100644 --- a/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/z3950/t_list.tt2 @@ -87,7 +87,8 @@ features="-display,-sort,-multisort,-multiselect" items-provider="z3950SearchGridProvider" grid-controls="gridControls" - persist-key="cat.z3950_results"> + persist-key="cat.z3950_results" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -129,6 +130,5 @@ - diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 index ccc7e5d97f..42d6e67d60 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 @@ -9,7 +9,7 @@
[% l('Backdated Check In [_1]', - '{{checkinArgs.backdate | date:"shortDate"}}') %] + '{{checkinArgs.backdate | date:$root.egDateFormat}}') %]
[% l('Ignore Pre-Cataloged Items') %] diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 index 2dadf6f51e..e7d809b20c 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 @@ -6,7 +6,8 @@ main-label="[% l('Items Checked In') %]" items-provider="gridDataProvider" grid-controls="gridControls" - persist-key="{{grid_persist_key}}"> + persist-key="{{grid_persist_key}}" + dateformat="{{$root.egDateAndTimeFormat}}"> + path='circ.checkin_time' datatype="timestamp"> + path='circ.stop_fines_time' datatype="timestamp"> @@ -69,7 +70,7 @@ + path='circ.due_date' datatype="timestamp" hidden> diff --git a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 index 4016967e1f..e30ed9121d 100644 --- a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 @@ -2,7 +2,8 @@ id-field="id" idl-class="ahopl" grid-controls="gridControls" - persist-key="circ.holds.pull"> + persist-key="circ.holds.pull" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -133,7 +134,7 @@ path='queue_position' hidden> - - - - + + + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_alerts.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_alerts.tt2 index 9281362617..ec1b8a923c 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_alerts.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_alerts.tt2 @@ -64,7 +64,7 @@
{{penalty.note()}}
- {{penalty.set_date() | date:'shortDate'}} + {{penalty.set_date() | date:$root.egDateFormat}}
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bill_history_payments.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bill_history_payments.tt2 index c4fa9d3f93..9c1a53acc0 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_bill_history_payments.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_bill_history_payments.tt2 @@ -4,14 +4,15 @@ + grid-controls="gridControls" + dateformat="{{$root.egDateAndTimeFormat}}"> - + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bill_history_xacts.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bill_history_xacts.tt2 index accbd36a98..d3bb64f275 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_bill_history_xacts.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_bill_history_xacts.tt2 @@ -4,7 +4,8 @@ + grid-controls="gridControls" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -15,8 +16,8 @@ - - + + @@ -41,7 +42,7 @@ path="circulation.target_copy.id" required hidden> - + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 index cde7cbfe99..6d176be1e6 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 @@ -5,7 +5,8 @@ sort="gridSort" grid-controls="gridControls" revision="gridRevision" - persist-key="circ.patron.bills"> + persist-key="circ.patron.bills" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -49,7 +50,7 @@ - + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 index b2df9875a0..1abdf45fdb 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 @@ -62,7 +62,8 @@ features="-sort,-multisort" items-provider="gridDataProvider" grid-controls="gridControls" - persist-key="circ.patron.checkout"> + persist-key="circ.patron.checkout" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -87,7 +88,7 @@ path="acn.label"> + path='circ.due_date' datatype="timestamp"> diff --git a/Open-ILS/src/templates/staff/circ/patron/t_group.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_group.tt2 index aa273ea8d5..d70e746f6d 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_group.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_group.tt2 @@ -12,7 +12,8 @@ + grid-controls="gridControls" + dateformat="{{$root.egDateAndTimeFormat}}"> @@ -32,7 +33,7 @@ - + @@ -45,7 +46,7 @@ - +
-{{current_location.shortname}} {{today | date:'short'}} +{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 index 44fcd57b39..57efdc58a3 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 @@ -1,4 +1,4 @@ - [% l('Date:') %] - {{xact.xact_start | date:'short'}} + {{xact.xact_start | date:$root.egDateAndTimeFormat}} [% l('Type') %]: @@ -54,6 +54,6 @@ You had the following bills:
-{{current_location.shortname}} {{today | date:'short'}} +{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_checkin.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_checkin.tt2 index 3aa276c25a..ee94ae6e01 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_checkin.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_checkin.tt2 @@ -24,6 +24,6 @@ template includes:
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2 index dc884466f7..808f52c212 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2 @@ -18,11 +18,11 @@ Template for printing checkout receipts; fields available include:
{{checkout.title}}
[% l('Barcode: [_1] Due: [_2]', '{{checkout.copy.barcode}}', - '{{checkout.circ.due_date | date:"short"}}') %]
+ '{{checkout.circ.due_date | date:$root.egDateAndTimeFormat}}') %]
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}
[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2 index aef5b8a7f1..c7ff7c8703 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2 @@ -45,8 +45,8 @@ Template for printing hold request slips. Fields include:
[% l('Request Date: [_1]', - '{{hold.request_time | date:"short"}}') %]
-
[% l('Slip Date: [_1]', '{{today | date:"short"}}') %]
+ '{{hold.request_time | date:$root.egDateAndTimeFormat}}') %] +
[% l('Slip Date: [_1]', '{{today | date:$root.egDateAndTimeFormat}}') %]
[% l('Printed by [_1] at [_2]', '{{staff.first_given_name}}', '{{current_location.shortname}}') %]
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 index a0aa6ef501..511881ce03 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 @@ -54,8 +54,8 @@ Template for printing hold transit slips. Fields include:
[% l('Request Date: [_1]', - '{{hold.request_time | date:"short"}}') %]
-
[% l('Slip Date: [_1]', '{{today | date:"short"}}') %]
+ '{{hold.request_time | date:$root.egDateAndTimeFormat}}') %] +
[% l('Slip Date: [_1]', '{{today | date:$root.egDateAndTimeFormat}}') %]
[% l('Printed by [_1] at [_2]', '{{staff.first_given_name}}', '{{current_location.shortname}}') %]
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_bib.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_bib.tt2 index 2a2f9657b0..e3c8c6895e 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_bib.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_bib.tt2 @@ -27,7 +27,7 @@ bib record. Fields include: - {{hold.hold.request_time | date:'short'}} + {{hold.hold.request_time | date:$root.egDateAndTimeFormat}} {{hold.patron_barcode}} {{hold.patron_last}} {{hold.patron_alias}} @@ -36,7 +36,7 @@ bib record. Fields include:
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}
[% l('Printed by [_1]', '{{staff.first_given_name}}') %]

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2 index 0f3a5dadfa..d48bb519fb 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2 @@ -16,7 +16,7 @@ Template for printing a list of hold requests for a patron. Fields include:
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}
[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 index 8bf85335ba..17caa2f806 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 @@ -24,5 +24,5 @@ in_house_uses - list; each entry contains:
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2 index 0de9e1ec3a..8d279b30ae 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2 @@ -22,5 +22,5 @@ with a variety of keys, including
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 index 10564b16e3..91e565ac8f 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 @@ -18,11 +18,11 @@ Fields include:
{{checkout.title}}
[% l('Barcode: [_1] Due: [_2]', '{{checkout.copy.barcode}}', - '{{checkout.circ.due_date | date:"short"}}') %]
+ '{{checkout.circ.due_date | date:$root.egDateAndTimeFormat}}') %]
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}
[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_patron_note.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_patron_note.tt2 index da75ec4f3a..bc6c7c7505 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_patron_note.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_patron_note.tt2 @@ -15,7 +15,7 @@ Template for printing a patron note. Fields include: '{{note.usr.second_given_name}}', '{{note.usr.card.barcode}}') %] -

[% l('Created on [_1]', '{{note.create_date | date:"short"}}') %]

+

[% l('Created on [_1]', '{{note.create_date | date:$root.egDateAndTimeFormat}}') %]

{{note.title}}

{{note.value}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2 index d5046b2561..3e17647100 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2 @@ -17,11 +17,11 @@ Template for printing a renewal receipt. Fields include:
{{renewal.title}}
[% l('Barcode: [_1] Due: [_2]', '{{renewal.copy.barcode}}', - '{{renewal.circ.due_date | date:"short"}}') %]
+ '{{renewal.circ.due_date | date:$root.egDateAndTimeFormat}}') %]
-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}
[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_transit_list.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_transit_list.tt2 index 09e8333553..d347c48d3e 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_transit_list.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_transit_list.tt2 @@ -20,11 +20,11 @@ transits - list; each entry contains:
[% l('From: [_1] To: [_2]
When: [_3]
Barcode: [_4] Title: [_5]', '{{transit.source.shortname}}', '{{transit.dest.shortname}}', - "{{transit.source_send_time | date:'short'}}", + "{{transit.source_send_time | date:$root.egDateAndTimeFormat}}", '{{transit.target_copy.barcode}}', '{{transit.target_copy.call_number.record.simple_record.title}}') %]

-
{{current_location.shortname}} {{today | date:'short'}}
+
{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 index ccf9e8c05d..a9b7124bbd 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 @@ -33,7 +33,7 @@ Template for printing a transit slip. Fields include:
-
[% l('Slip Date: [_1]', '{{today | date:"short"}}') %]
+
[% l('Slip Date: [_1]', '{{today | date:$root.egDateAndTimeFormat}}') %]
[% l('Printed by [_1] at [_2]', '{{staff.first_given_name}}', '{{current_location.shortname}}') %]
diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index 7cbf9f29de..5fe43557a2 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -63,6 +63,8 @@ angular.module('egGridMod', // optional context menu label menuLabel : '@', + dateformat : '@', // optional: passed down to egGridValueFilter + // Hash of control functions. // // These functions are defined by the calling scope and @@ -179,7 +181,8 @@ angular.module('egGridMod', idlClass : grid.idlClass, defaultToHidden : (features.indexOf('-display') > -1), defaultToNoSort : (features.indexOf('-sort') > -1), - defaultToNoMultiSort : (features.indexOf('-multisort') > -1) + defaultToNoMultiSort : (features.indexOf('-multisort') > -1), + defaultDateFormat : $scope.dateformat }); $scope.canMultiSelect = (features.indexOf('-multiselect') == -1); @@ -1170,6 +1173,7 @@ angular.module('egGridMod', cols.defaultToHidden = args.defaultToHidden; cols.defaultToNoSort = args.defaultToNoSort; cols.defaultToNoMultiSort = args.defaultToNoMultiSort; + cols.defaultDateFormat = args.defaultDateFormat; // resets column width, visibility, and sort behavior // Visibility resets to the visibility settings defined in the @@ -1414,6 +1418,10 @@ angular.module('egGridMod', (!cols.defaultToNoMultiSort && !column.nonmultisortable)) column.multisortable = true; + if (cols.defaultDateFormat && ! column.dateformat) { + column.dateformat = cols.defaultDateFormat; + } + cols.columns.push(column); // Track which columns are visible by default in case we diff --git a/Open-ILS/web/js/ui/default/staff/services/startup.js b/Open-ILS/web/js/ui/default/staff/services/startup.js index 670248ceae..682317b77f 100644 --- a/Open-ILS/web/js/ui/default/staff/services/startup.js +++ b/Open-ILS/web/js/ui/default/staff/services/startup.js @@ -14,8 +14,8 @@ angular.module('egCoreMod') .factory('egStartup', - ['$q','$rootScope','$location','$window','egIDL','egAuth','egEnv', -function($q, $rootScope, $location, $window, egIDL, egAuth, egEnv) { + ['$q','$rootScope','$location','$window','egIDL','egAuth','egEnv','egOrg', +function($q, $rootScope, $location, $window, egIDL, egAuth, egEnv , egOrg ) { var service = { promise : null } @@ -67,6 +67,19 @@ function($q, $rootScope, $location, $window, egIDL, egAuth, egEnv) { deferred.reject('egEnv did not resolve') } ); + egOrg.settings([ + 'webstaff.format.dates', + 'webstaff.format.date_and_time' + ]).then( + function(set) { + $rootScope.egDateFormat = set['webstaff.format.dates'] || 'shortDate'; + $rootScope.egDateAndTimeFormat = set['webstaff.format.date_and_time'] || 'short'; + deferred.resolve(); + }, + function() { + deferred.reject('egOrg did not resolve'); + } + ); }, // testAuthToken rejected -- 2.43.2