User activity tracking : staff client last activity display
authorBill Erickson <berick@esilibrary.com>
Mon, 27 Feb 2012 21:26:48 +0000 (16:26 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Thu, 8 Mar 2012 18:50:06 +0000 (13:50 -0500)
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 <berick@esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/summary.js
Open-ILS/xul/staff_client/server/patron/summary_overlay.xul
Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul

index bd55f59..55b750c 100644 (file)
@@ -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
index fd6b91a..7e1272f 100644 (file)
@@ -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) {
index b93cd38..ae9ff7a 100644 (file)
@@ -50,6 +50,9 @@
         <row id="pdsgr5aa">
             <description id="patron_date_of_exp" class="copyable expire_date value"/>
         </row>
+        <row id="pdsgr5aac">
+            <description id="patron_last_activity_date" class="copyable last_activity_date value"/>
+        </row>
         <row id="pdsgr5aaa">
             <description id="patron_date_of_last_update" class="copyable last_update_time value"/>
         </row>
index 544b3a4..ac495ac 100644 (file)
@@ -90,6 +90,9 @@
             <row id="pdsgr5aa">
                 <description id="patron_date_of_exp" class="copyable expire_date value"/>
             </row>
+            <row id="pdsgr5aac">
+                <description id="patron_last_activity_date" class="copyable last_activity_date value"/>
+            </row>
         </rows>
     </grid>
 </vbox>