From a7a13b9f0b5ebfaef18004a94ede7e23efa6c5b2 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 27 Feb 2012 16:26:48 -0500 Subject: [PATCH] User activity tracking : staff client last activity display This adds the Last Activity date to the patron summary (horizontal and vertical) just below the Expires date. The Last Activity value will come from the most recent activity of any type which is configured to be tracked. A tooltip on the field will show the activity type. Signed-off-by: Bill Erickson Signed-off-by: Thomas Berezansky --- .../server/locale/en-US/patron.properties | 1 + Open-ILS/xul/staff_client/server/patron/summary.js | 22 ++++++++++++++++++++++ .../staff_client/server/patron/summary_overlay.xul | 3 +++ .../server/patron/summary_overlay_horiz.xul | 3 +++ 4 files changed, 29 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index bd55f5922f..55b750c5b3 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -369,6 +369,7 @@ staff.patron.summary.retrieve.no_barcode=summary: No barcode or ID staff.patron.summary.patron_net_access=Internet staff.patron.summary.create_date=Account created on staff.patron.summary.expires_on=Expires on +staff.patron.summary.last_activity=Last Activity staff.patron.summary.updated_on=Last updated on staff.patron.summary.standing_penalty.remove=Remove staff.patron.summary.standing_penalty.none=No Blocks/Penalties diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index fd6b91a0b2..7e1272f8c4 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -556,6 +556,28 @@ patron.summary.prototype = { }; } ], + 'patron_last_activity_date' : [ + ['render'], + function(e) { + return function() { + var act = obj.patron.usr_activity(); + if (act && act.length) { + act = act[0]; + util.widgets.set_text(e, + patronStrings.getString('staff.patron.summary.last_activity') + ' ' + + util.date.formatted_date( act.event_time(), '%{localized_date}' ) + ); + e.setAttribute('tooltiptext', act.etype().label()); + } else { + + util.widgets.set_text(e, + patronStrings.getString('staff.patron.summary.last_activity') + ' ' + + patronStrings.getString('staff.patron.field.unset') + ); + } + }; + } + ], 'patron_date_of_last_update' : [ ['render'], function(e) { diff --git a/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul b/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul index b93cd38000..ae9ff7a031 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul @@ -50,6 +50,9 @@ + + + diff --git a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul index 544b3a41c0..ac495ac03a 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul @@ -90,6 +90,9 @@ + + + -- 2.11.0