From e4a022c5f22dc96631bb8db1491ae74273f6e26f Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 21 Feb 2013 18:48:39 -0500 Subject: [PATCH] enhancements based on feedback from CW/MARS Thanks! Major changes includes different patron summary panes based on context, removal of the new-tab behavior when selecting different patron interfaces, and having the patron summary pane for searches replace the search form instead of the list results (I wonder if catalogers would want similar behavior in the z39.50 interface...) For the search interface, the summary pane is mostly used to help identify patrons, and thus focuses on displaying identifying information like addresses and phone numbers. For the patron interface, the summary pane focuses mostly on statuses, alerts, and notifications. I've backed away a little bit from the "only show information if it exists" philosophy. Another school of thought is that information should always be in the same place to take advantage of spatial memory. I was hedging my bets before by hoping column position would be enough for spatial memory. It might still be true, but here's to experimentation. :) For switching between patron interfaces, the different components are still disintegrated, and get completely reloaded on context switch, including the summary pane. I fear this is going to be very noticeable, but it'll take a major overhaul to have persistently loaded sub-interfaces that stay in sync. Still, the load times for retrieving a patron are much faster this way, plus this wrapper for the sub-interfaces is likely easier to maintain, and likely less of a source of memory leaks than before. Signed-off-by: Jason Etheridge --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 1 + .../lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm | 4 +- .../src/templates/opac/PatronSearchSummary.tt2 | 123 ++++++++++++++++++++ Open-ILS/src/templates/opac/PatronSummary.tt2 | 121 +++++++------------- .../src/templates/opac/css/PatronSummary.css.tt2 | 5 +- .../staff_client/chrome/content/main/constants.js | 1 + .../xul/staff_client/server/patron/display.xul | 26 +++-- Open-ILS/xul/staff_client/server/patron/patron.js | 65 +++++++---- Open-ILS/xul/staff_client/server/patron/search.js | 127 +++++++++++++++++---- .../staff_client/server/patron/search_result.js | 3 + 10 files changed, 347 insertions(+), 129 deletions(-) create mode 100644 Open-ILS/src/templates/opac/PatronSearchSummary.tt2 diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 936c21db07..fcbe437f18 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -207,6 +207,7 @@ sub load { return $self->load_myopac_prefs if $path =~ m|opac/myopac/prefs|; return $self->load_sms_cn if $path =~ m|opac/sms_cn|; return $self->load_patron_summary if $path =~ m|opac/PatronSummary|; + return $self->load_patron_summary if $path =~ m|opac/PatronSearchSummary|; return Apache2::Const::OK; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm index 06c4e2a282..a751333193 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm @@ -46,7 +46,9 @@ sub load_patron_summary { 'standing_penalties', 'notes', 'usr_activity', - 'ident_type' + 'home_ou', + 'ident_type', + 'ident_type2' ] ); diff --git a/Open-ILS/src/templates/opac/PatronSearchSummary.tt2 b/Open-ILS/src/templates/opac/PatronSearchSummary.tt2 new file mode 100644 index 0000000000..0ca1d64d42 --- /dev/null +++ b/Open-ILS/src/templates/opac/PatronSearchSummary.tt2 @@ -0,0 +1,123 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "base_nodojo.tt2" + extracss="/eg/opac/css/PatronSummary.css"; + ctx.page_title = l("Patron Summary") %] +
+
+
+ [% IF NOT ctx.error %] +
+
+
+ + [% l( + HUMAN_NAME_FORMAT, + ctx.user.prefix, ctx.user.first_given_name, + ctx.user.second_given_name, ctx.user.family_name, + ctx.user.suffix + ) | html %] +
+ [% IF ctx.user.mailing_address %] + + [% ctx.user.mailing_address.street1 | html %]
+ [% ctx.user.mailing_address.street2 | html %]
+ [% ctx.user.mailing_address.city | html %], + [% ctx.user.mailing_address.state | html %] + [% ctx.user.mailing_address.post_code | html %] +

+ [% END %] +
+
+
+ + [% ctx.user.email OR ' ' | html %] +
+ [% IF ctx.user.billing_address %] + + [% ctx.user.billing_address.street1 | html %]
+ [% ctx.user.billing_address.street2 | html %]
+ [% ctx.user.billing_address.city | html %], + [% ctx.user.billing_address.state | html %] + [% ctx.user.billing_address.post_code | html %] +

+ [% END %] +
+
+
+ + [% l('D: [_1] ', ctx.user.day_phone) | html %]
+ [% l('E: [_1] ', ctx.user.evening_phone) | html %]
+ [% l('O: [_1] ', ctx.user.other_phone) | html %]
+
+ [% IF ctx.user.ident_value %] + + [% l( + '[_1]: [_2]', + ctx.user.ident_type.name, + ctx.user.ident_value + ) | html %] +
+ [% END %] + [% IF ctx.user.ident_value2 %] + + [% l( + '[_1]: [_2]', + ctx.user.ident_type2.name, + ctx.user.ident_value2 + ) | html %] +
+ [% END %] +
+
+
+ [% ctx.user.profile.name | html %]
+ [% ctx.user.home_ou.shortname | html %]
+ + [% l( + 'Items Overdue: [_1] Total: [_2]', + ctx.checked_out_count.overdue + ctx.checked_out_count.long_overdue, + ctx.checked_out_count.out + ) | html %] +
+ + [% l( + 'Holds Ready: [_1] Total: [_2]', + ctx.holds_count.ready, + ctx.holds_count.total + ) | html %] +
+ + [% IF ctx.money_open_user_summary %] + [% l( + 'Bills: [_1]', + ctx.money_open_user_summary.balance_owed + ) | html %] + [% ELSE %] + [% l( + 'Bills: [_1]', + '0.00' + ) | html %] + [% END %] +
+
+
+
+ [% ELSE %] +
+ + Error loading user with database id = [% ctx.au_id | html %] +
+ + Description: [% ctx.error.desc | html %] +
+ Server Time: [% ctx.error.servertime | html %]
+ Text Code: [% ctx.error.textcode | html %]
+ ILS Event: [% ctx.error.ilsevent | html %]
+ PID: [% ctx.error.pid | html %]
+ Stack Trace: [% ctx.error.stacktrace | html %]
+
+ [% END %] +
+
+
+[% END %] diff --git a/Open-ILS/src/templates/opac/PatronSummary.tt2 b/Open-ILS/src/templates/opac/PatronSummary.tt2 index a831ff71e3..9832bdd25b 100644 --- a/Open-ILS/src/templates/opac/PatronSummary.tt2 +++ b/Open-ILS/src/templates/opac/PatronSummary.tt2 @@ -17,40 +17,18 @@ ctx.user.suffix ) | html %]
- [% IF ctx.addr %] - - [% ctx.addr.street1 | html %]
- [% ctx.addr.street2 | html %]
- [% ctx.addr.city | html %], - [% ctx.addr.state | html %] - [% ctx.post_code | html %] -

- [% END %] - - [% IF ctx.user.day_phone %] - [% l('D: [_1] ', ctx.user.day_phone) | html %] - [% ELSIF ctx.user.evening_phone %] - [% l('E: [_1] ', ctx.user.evening_phone) | html %] - [% ELSIF ctx.user.other_phone %] - [% l('O: [_1] ', ctx.user.other_phone) | html %] - [% END %] -
- [% IF ctx.user.email %] - - [% ctx.user.email | html %] - - [% END %] - -
-
[% IF ctx.barred %] - [% l('Patron is BARRED') %] + [% l('Patron is BARRED') | html %]
[% END %] [% IF ctx.holds_count.ready > 0 %] - [% l('[_1] holds Ready for Pickup', ctx.holds_count.ready) %] + [% IF ctx.holds_count.ready == 1 %] + [% l('1 hold Ready for Pickup') | html %] + [% ELSE %] + [% l('[_1] holds Ready for Pickup', ctx.holds_count.ready) | html %] + [% END %]
[% END %] [% IF ctx.user.alert_message %] @@ -58,6 +36,14 @@ [% ctx.user.alert_message | html %]
[% END %] + [% IF ctx.user.notes.size == 1 %] + [% l('1 note') | html %] + [% ELSIF ctx.user.notes.size > 1 %] + [% l('[_1] notes', ctx.user.notes.size) | html %] + [% END %] +
+
+
[% FOREACH p IN ctx.user.standing_penalties %] [% p.standing_penalty.label | html %] @@ -69,96 +55,71 @@
- [% ctx.user.profile.name | html %]
- [% IF ctx.user.card AND ctx.user.card.active %] + + [% l('D: [_1] ', ctx.user.day_phone) | html %]
+ [% l('E: [_1] ', ctx.user.evening_phone) | html %]
+ [% l('O: [_1] ', ctx.user.other_phone) | html %]
+
[% l( 'Card: [_1]', ctx.user.card.barcode ) | html %]
- [% END %] [% l( 'OPAC: [_1]', ctx.user.usrname ) | html %]
- [% IF ctx.user.ident_value %] - - [% l( - '[_1]: [_2]', - ctx.user.ident_type.name, - ctx.user.ident_value - ) | html %] -
- [% END %] - - [% l( - 'Last Updated: [_1]', - date.format(ctx.user.last_update_time, DATE_FORMAT) - ) | html %] -
- [% IF ctx.user.dob %] + [% ctx.user.profile.name | html %]
+ [% ctx.user.home_ou.shortname | html %]
[% l( - 'DOB: [_1]', - date.format(ctx.user.dob, DATE_FORMAT) + 'Items Overdue: [_1] Total: [_2]', + ctx.checked_out_count.overdue + ctx.checked_out_count.long_overdue, + ctx.checked_out_count.out ) | html %] -
- [% END %] +
[% l( - 'Exp: [_1]', - date.format(ctx.user.expire_date, DATE_FORMAT) + 'Holds Ready: [_1] Total: [_2]', + ctx.holds_count.ready, + ctx.holds_count.total ) | html %]
- [% IF ctx.user.usr_activity AND ctx.user.usr_activity.0 %] + [% IF ctx.money_open_user_summary %] [% l( - 'Last Activity: [_1]', - date.format( - ctx.user.usr_activity.0.event_time, - DATE_FORMAT - ) + 'Bills: [_1]', + ctx.money_open_user_summary.balance_owed ) | html %] -
- [% END %] - [% IF ctx.user.credit_forward_balance %] - + [% ELSE %] [% l( - 'Credit: [_1]', - ctx.user.credit_forward_balance + 'Bills: [_1]', + '0.00' ) | html %] -
[% END %] - [% IF ctx.money_open_user_summary %] - - [% l( - 'Balance: [_1]', - ctx.money_open_user_summary.balance_owed - ) | html %]
- [% END %]
[% ELSE %]
- Error loading user with database id = [% ctx.au_id %] + Error loading user with database id = [% ctx.au_id | html %]
- Description: [% ctx.error.desc %] + Description: [% ctx.error.desc | html %]
- Server Time: [% ctx.error.servertime %]
- Text Code: [% ctx.error.textcode %]
- ILS Event: [% ctx.error.ilsevent %]
- PID: [% ctx.error.pid %]
- Stack Trace: [% ctx.error.stacktrace %]
+ Server Time: [% ctx.error.servertime | html %]
+ Text Code: [% ctx.error.textcode | html %]
+ ILS Event: [% ctx.error.ilsevent | html %]
+ PID: [% ctx.error.pid | html %]
+ Stack Trace: [% ctx.error.stacktrace | html %]
[% END %]
diff --git a/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 b/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 index 7d4f98a0bd..0ccccdd9d2 100644 --- a/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 +++ b/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 @@ -29,7 +29,10 @@ body { padding-left: 10px; padding-right: 10px; } -.alerts { font-weight: bold; } +.alerts { + font-weight: bold; + overflow: auto; +} .patronNameLarge { font-weight: bold; } .patronSummaryDiv { border: solid thick transparent; padding: 10px; } .NO_PENALTIES .patronSummaryDiv { border-color: lime; } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 7b4d4d8777..d5dce8251f 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -522,4 +522,5 @@ var urls = { 'XUL_SEARCH_PREFS' : 'chrome://open_ils_staff_client/content/main/search_prefs.xul', 'XUL_SERVER_ADDONS' : 'oils://remote/xul/server/addon/addons.xul', 'EG_PATRON_SUMMARY' : 'oils://remote/eg/opac/PatronSummary', + 'EG_PATRON_SEARCH_SUMMARY' : 'oils://remote/eg/opac/PatronSearchSummary' } diff --git a/Open-ILS/xul/staff_client/server/patron/display.xul b/Open-ILS/xul/staff_client/server/patron/display.xul index 915e0b881a..95d5e5b66a 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.xul +++ b/Open-ILS/xul/staff_client/server/patron/display.xul @@ -30,6 +30,7 @@ + @@ -62,6 +63,7 @@ + @@ -175,12 +177,12 @@ - +