* show most recent and previous circ chains in item details history tab, with patron...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 26 Apr 2010 09:23:26 +0000 (09:23 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 26 Apr 2010 09:23:26 +0000 (09:23 +0000)
* accesskeys for the Item Details tab box
* fix: don't render 'undefined'

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16299 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul

index c03b5ef..d2130ab 100644 (file)
 <!ENTITY staff.circ.alternate_copy_summary.Barcode.label "Barcode">
 <!ENTITY staff.circ.alternate_copy_summary.Call_Number.label "Call Number">
 <!ENTITY staff.circ.alternate_copy_summary.Cataloging_Info.label "Cataloging Info">
+<!ENTITY staff.circ.alternate_copy_summary.Cataloging_Info.accesskey "I">
 <!ENTITY staff.circ.alternate_copy_summary.Checkin_Scan_Time.label "Checkin Scan Time">
 <!ENTITY staff.circ.alternate_copy_summary.Checkin_Time.label "Checkin Time">
 <!ENTITY staff.circ.alternate_copy_summary.Checkin_Workstation.label "Checkin Workstation">
 <!ENTITY staff.circ.alternate_copy_summary.Circ_Modifier.label "Circ Modifier">
 <!ENTITY staff.circ.alternate_copy_summary.Circulate.label "Circulate">
 <!ENTITY staff.circ.alternate_copy_summary.Circulation_History.label "Circulation History">
+<!ENTITY staff.circ.alternate_copy_summary.Circulation_History.accesskey "H">
 <!ENTITY staff.circ.alternate_copy_summary.Copy_ID.label "Copy ID">
 <!ENTITY staff.circ.alternate_copy_summary.Copy_Location.label "Copy Location">
 <!ENTITY staff.circ.alternate_copy_summary.Renewal_Type.label "Renewal Type">
 <!ENTITY staff.circ.alternate_copy_summary.Holdable.label "Holdable">
 <!ENTITY staff.circ.alternate_copy_summary.Hold_Shelf_Location.label "Hold Shelf Location">
 <!ENTITY staff.circ.alternate_copy_summary.Holds_Transit.label "Holds/Transit">
+<!ENTITY staff.circ.alternate_copy_summary.Holds_Transit.accesskey "">
 <!ENTITY staff.circ.alternate_copy_summary.ISBN.label "ISBN">
 <!ENTITY staff.circ.alternate_copy_summary.Loan_Duration.label "Loan Duration">
 <!ENTITY staff.circ.alternate_copy_summary.Fine_Level.label "Fine Level">
+<!ENTITY staff.circ.alternate_copy_summary.Most_Recent_Circ_Group.label "Most Recent Circ Group">
 <!ENTITY staff.circ.alternate_copy_summary.OPAC_Visible.label "OPAC Visible">
 <!ENTITY staff.circ.alternate_copy_summary.Owning_Library.label "Owning Library">
+<!ENTITY staff.circ.alternate_copy_summary.Patron_Name.label "Patron">
 <!ENTITY staff.circ.alternate_copy_summary.Price.label "Price">
+<!ENTITY staff.circ.alternate_copy_summary.Previous_Circ_Group.label "Previous Circ Group">
 <!ENTITY staff.circ.alternate_copy_summary.Pub_Date.label "Pub Date">
 <!ENTITY staff.circ.alternate_copy_summary.Publisher.label "Publisher">
 <!ENTITY staff.circ.alternate_copy_summary.Quick_Summary.label "Quick Summary">
+<!ENTITY staff.circ.alternate_copy_summary.Quick_Summary.accesskey "Q">
 <!ENTITY staff.circ.alternate_copy_summary.Reference.label "Reference">
 <!ENTITY staff.circ.alternate_copy_summary.Remaining_Renewals.label "Remaining Renewals">
+<!ENTITY staff.circ.alternate_copy_summary.Renewal_Time.label "Last Renewed On">
 <!ENTITY staff.circ.alternate_copy_summary.Renewal_Workstation.label "Renewal Workstation">
 <!ENTITY staff.circ.alternate_copy_summary.Rolling_Counter.label "Rolling Counter">
 <!ENTITY staff.circ.alternate_copy_summary.Status.label "Status">
+<!ENTITY staff.circ.alternate_copy_summary.Stop_Fines.label "Stop Fines Reason">
+<!ENTITY staff.circ.alternate_copy_summary.Stop_Fines_Time.label "Stop Fines Time">
 <!ENTITY staff.circ.alternate_copy_summary.TCN.label "TCN">
 <!ENTITY staff.circ.alternate_copy_summary.Total_Circs___Current_Year.label "Total Circs - Current Year">
 <!ENTITY staff.circ.alternate_copy_summary.Total_Circs.label "Total Circs">
 <!ENTITY staff.circ.alternate_copy_summary.Total_Circs___Prev_Year.label "Total Circs - Prev Year">
+<!ENTITY staff.circ.alternate_copy_summary.Total_Circs_for_circ_chain.label "Total Circs">
 <!ENTITY staff.circ.alternate_copy_summary.Duration_Rule.label "Duration Rule">
 <!ENTITY staff.circ.alternate_copy_summary.Recurring_Fine_Rule.label "Recurring Fine Rule">
 <!ENTITY staff.circ.alternate_copy_summary.Max_Fine_Rule.label "Max Fine Rule">
index 52c8b47..d11b02f 100644 (file)
@@ -211,6 +211,8 @@ var api = {
     'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false },
     'FM_CIRC_CHAIN' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.renewal_chain.retrieve_by_circ.atomic' },
     'FM_CIRC_CHAIN_SUMMARY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.renewal_chain.retrieve_by_circ.summary' },
+    'FM_CIRC_PREV_CHAIN' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.prev_renewal_chain.retrieve_by_circ.atomic' },
+    'FM_CIRC_PREV_CHAIN_SUMMARY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.prev_renewal_chain.retrieve_by_circ.summary' },
     'FM_CIRC_DETAILS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve' },
     'FM_CIRC_DETAILS.authoritative' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve.authoritative' },
     'FM_CIRC_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.retrieve' },
index 837be9a..e9d0723 100644 (file)
@@ -16,6 +16,29 @@ function my_init() {
         JSAN.use('util.date');
         JSAN.use('cat.util');
 
+        var x = document.getElementById('patron_name');
+        if (x) {
+            x.addEventListener(
+                'command',
+                function(ev) {
+                    var usr = ev.target.getAttribute('data');
+                    if (usr) { window.xulG.new_patron_tab( {}, { 'id' : usr } ); }
+                },
+                false
+            );
+        }
+        var y = document.getElementById('prev_patron_name');
+        if (y) {
+            y.addEventListener(
+                'command',
+                function(ev) {
+                    var usr = ev.target.getAttribute('data');
+                    if (usr) { window.xulG.new_patron_tab( {}, { 'id' : usr } ); }
+                },
+                false
+            );
+        }
+
         // timeout so xulG gets a chance to get pushed in
         setTimeout(
             function () { xulG.from_item_details_new = false; load_item(); },
@@ -27,14 +50,26 @@ function my_init() {
     }
 }
 
-function set(name,value) { 
+function set(name,value,data) { 
+    if (typeof value == 'undefined' || typeof value == 'null') { return; }
     var nodes = document.getElementsByAttribute('name',name); 
     for (var i = 0; i < nodes.length; i++) {
-        nodes[i].setAttribute('value',value); nodes[i].value = value; 
+        if (nodes[i].nodeName == 'button') {
+            nodes[i].setAttribute('label',value);
+            if (data) {
+                nodes[i].setAttribute('data',data); 
+            } else {
+                nodes[i].setAttribute('data',''); 
+            }
+        } else {
+            nodes[i].setAttribute('value',value);
+        }
+        nodes[i].value = value; 
     }
 }
 
 function set_tooltip(name,value) { 
+    if (typeof value == 'undefined' || typeof value == 'null') { return; }
     var nodes = document.getElementsByAttribute('name',name); 
     for (var i = 0; i < nodes.length; i++) {
         nodes[i].setAttribute('tooltiptext',value);
@@ -294,7 +329,7 @@ function load_item() {
         set("stop_fines", '');
         set("stop_fines_time", '');
         set("target_copy", '');
-        set("usr", '');
+        set("circ_usr", '');
         set("xact_finish", '');
         set("xact_start", '');
         set("create_time", '');
@@ -307,6 +342,19 @@ function load_item() {
         set("circ_type", '');
         set("billing_total", '');
         set("payment_total", '');
+        set("patron_name", '');
+        set("prev_patron_name", '');
+        set("prev_num_circs", '');
+        set("prev_num_renewals", '');
+        set("prev_xact_start", '');
+        set("prev_checkout_workstation", '');
+        set("prev_renewal_time", '');
+        set("prev_stop_fines", '');
+        set("prev_stop_fines_time", '');
+        set("prev_renewal_workstation", '');
+        set("prev_checkin_workstation", '');
+        set("prev_last_checkin_time", '');
+        set("prev_last_checkin_scan_time", '');
 
         if (details.circ) {
             try { set("checkin_lib", typeof details.circ.checkin_lib() == 'object' ? details.circ.checkin_lib().shortname() : data.hash.aou[ details.circ.checkin_lib() ].shortname() );  } catch(E) {};
@@ -334,7 +382,16 @@ function load_item() {
             set("stop_fines", details.circ.stop_fines()); 
             set("stop_fines_time", util.date.formatted_date( details.circ.stop_fines_time(), '%{localized}' )); 
             set("target_copy", details.circ.target_copy()); 
-            set("usr", details.circ.usr()); 
+            set("circ_usr", details.circ.usr()); 
+            network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ ses(), details.circ.usr() ], function(preq) {
+                var r_au = preq.getResultObject();
+                JSAN.use('patron.util');
+                set(
+                    'patron_name', 
+                    patron.util.format_name( r_au ) + ' : ' + r_au.card().barcode(),
+                    details.circ.usr()
+                );
+            });
             set("xact_finish", util.date.formatted_date( details.circ.xact_finish(), '%{localized}' )); 
             set("xact_start", util.date.formatted_date( details.circ.xact_start(), '%{localized}' )); 
             set("create_time", util.date.formatted_date( details.circ.create_time(), '%{localized}' )); 
@@ -344,12 +401,17 @@ function load_item() {
                 network.simple_request('FM_CIRC_CHAIN_SUMMARY', [ses(), details.circ.id() ], function(req) {
                     try {
                         var summary = req.getResultObject();
+                        set("num_circs", summary.num_circs());
+                        set("num_renewals", Number(summary.num_circs()) - 1);
+                        set("xact_start", util.date.formatted_date( summary.start_time(), '%{localized}' )); 
                         set("checkout_workstation", summary.checkout_workstation());
-                        set("renewal_workstation", summary.last_renewal_workstation());
-                        set("checkin_workstation", summary.last_checkin_workstation());
+                        set("renewal_time", util.date.formatted_date( summary.last_renewal_time(), '%{localized}' )); 
                         set("stop_fines", summary.last_stop_fines());
                         set("stop_fines_time", util.date.formatted_date( summary.last_stop_fines_time(), '%{localized}' )); 
-                        set("renewal_time", util.date.formatted_date( summary.last_renewal_time(), '%{localized}' )); 
+                        set("renewal_workstation", summary.last_renewal_workstation());
+                        set("checkin_workstation", summary.last_checkin_workstation());
+                        set("last_checkin_time", util.date.formatted_date( summary.last_checkin_time(), '%{localized}' )); 
+                        set("last_checkin_scan_time", util.date.formatted_date( summary.last_checkin_scan_time(), '%{localized}' )); 
                     } catch(E) {
                         alert('Error in alternate_copy_summary.js, FM_CIRC_CHAIN: ' + E);
                     }
@@ -357,6 +419,35 @@ function load_item() {
             } else {
                 set("checkout_workstation", (typeof details.circ.workstation() == 'object' && details.circ.workstation() != null) ? details.circ.workstation().name() : details.circ.workstation() );
             }
+            network.simple_request('FM_CIRC_PREV_CHAIN_SUMMARY', [ses(), details.circ.id() ], function(req) {
+                try {
+                    var robj = req.getResultObject();
+                    if (!robj || typeof robj == 'null') { return; }
+                    var summary = robj['summary'];
+                    network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ ses(), robj['usr'] ], function(preq) {
+                        var r_au = preq.getResultObject();
+                        JSAN.use('patron.util');
+                        set(
+                            'prev_patron_name', 
+                            patron.util.format_name( r_au ) + ' : ' + r_au.card().barcode(),
+                            robj['usr']
+                        );
+                    });
+                    set("prev_num_circs", summary.num_circs());
+                    set("prev_num_renewals", Number(summary.num_circs()) - 1);
+                    set("prev_xact_start", util.date.formatted_date( summary.start_time(), '%{localized}' )); 
+                    set("prev_checkout_workstation", summary.checkout_workstation());
+                    set("prev_renewal_time", util.date.formatted_date( summary.last_renewal_time(), '%{localized}' )); 
+                    set("prev_stop_fines", summary.last_stop_fines());
+                    set("prev_stop_fines_time", util.date.formatted_date( summary.last_stop_fines_time(), '%{localized}' )); 
+                    set("prev_renewal_workstation", summary.last_renewal_workstation());
+                    set("prev_checkin_workstation", summary.last_checkin_workstation());
+                    set("prev_last_checkin_time", util.date.formatted_date( summary.last_checkin_time(), '%{localized}' )); 
+                    set("prev_last_checkin_scan_time", util.date.formatted_date( summary.last_checkin_scan_time(), '%{localized}' )); 
+                } catch(E) {
+                    alert('Error in alternate_copy_summary.js, FM_CIRC_PREV_CHAIN: ' + E);
+                }
+            });
             set("billings", details.circ.billings()); 
             set("payments", details.circ.payments()); 
             set("billable_transaction", details.circ.billable_transaction()); 
@@ -454,7 +545,7 @@ function load_item() {
         set("selection_ou", '');
         set_tooltip("selection_ou", '');
         set("target", '');
-        set("usr", '');
+        set("hold_usr", '');
         set("cancel_time", '');
         set("notify_time", '');
         set("notify_count", '');
@@ -494,7 +585,7 @@ function load_item() {
             set("selection_ou" , typeof details.hold.selection_ou() == 'object' ? details.hold.selection_ou().shortname() : data.hash.aou[ details.hold.selection_ou() ].shortname() ); 
             set_tooltip("selection_ou" , typeof details.hold.selection_ou() == 'object' ? details.hold.selection_ou().name() : data.hash.aou[ details.hold.selection_ou() ].name() ); 
             set("target", details.hold.target()); 
-            set("usr", details.hold.usr()); 
+            set("hold_usr", details.hold.usr()); 
             set("cancel_time", util.date.formatted_date( details.hold.cancel_time(), '%{localized}' )); 
             set("notify_time", util.date.formatted_date( details.hold.notify_time(), '%{localized}' )); 
             set("notify_count", details.hold.notify_count()); 
index dd85f98..9068505 100644 (file)
 
         <tabbox flex="1">
             <tabs>
-                <tab label="&staff.circ.alternate_copy_summary.Quick_Summary.label;" />
-                <tab label="&staff.circ.alternate_copy_summary.Circulation_History.label;" />
-                <tab label="&staff.circ.alternate_copy_summary.Holds_Transit.label;" />
-                <tab label="&staff.circ.alternate_copy_summary.Cataloging_Info.label;" />
+                <tab label="&staff.circ.alternate_copy_summary.Quick_Summary.label;" accesskey="&staff.circ.alternate_copy_summary.Quick_Summary.accesskey;" />
+                <tab label="&staff.circ.alternate_copy_summary.Circulation_History.label;" accesskey="&staff.circ.alternate_copy_summary.Circulation_History.accesskey;" />
+                <tab label="&staff.circ.alternate_copy_summary.Holds_Transit.label;" accesskey="&staff.circ.alternate_copy_summary.Holds_Transit.accesskey;" />
+                <tab label="&staff.circ.alternate_copy_summary.Cataloging_Info.label;" accesskey="&staff.circ.alternate_copy_summary.Cataloging_Info.accesskey;" />
             </tabs>
             <tabpanels flex="1">
-                <tabpanel orient="vertical">
+                <tabpanel orient="vertical"><!-- Quick Summary -->
                     <grid id="grid1" flex="0">
                         <columns>
                             <column id="g1column1"/>
                         </rows>
                     </grid>
                 </tabpanel>
-                <tabpanel />
-                <tabpanel />
-                <tabpanel>
+                <tabpanel><!-- Circulation History -->
+                    <grid>
+                        <columns>
+                            <column/>
+                            <column/>
+                            <column flex="1"/>
+                            <column/>
+                            <column/>
+                        </columns>
+                        <rows>
+                            <row>
+                                <label class="header1" value="&staff.circ.alternate_copy_summary.Previous_Circ_Group.label;" />
+                                <spacer />
+                                <spacer />
+                                <label class="header1" value="&staff.circ.alternate_copy_summary.Most_Recent_Circ_Group.label;" />
+                                <spacer />
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Patron_Name.label;" />
+                                <button id="prev_patron_name" name="prev_patron_name" readonly="true" />
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Patron_Name.label;" />
+                                <button id="patron_name" name="patron_name" readonly="true" />
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Total_Circs_for_circ_chain.label;" />
+                                <textbox name="prev_num_circs" readonly="true"  context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Total_Circs_for_circ_chain.label;" />
+                                <textbox name="num_circs" readonly="true"  context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Checkout_Date.label;" />
+                                <textbox name="prev_xact_start" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Checkout_Date.label;" />
+                                <textbox name="xact_start" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Checkout_Workstation.label;" />
+                                <textbox name="prev_checkout_workstation" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Checkout_Workstation.label;" />
+                                <textbox name="checkout_workstation" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Renewal_Time.label;" />
+                                <textbox name="prev_renewal_time" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Renewal_Time.label;" />
+                                <textbox name="renewal_time" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Renewal_Workstation.label;" />
+                                <textbox name="prev_renewal_workstation" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Renewal_Workstation.label;" />
+                                <textbox name="renewal_workstation" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Stop_Fines.label;" />
+                                <textbox name="prev_stop_fines" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Stop_Fines.label;" />
+                                <textbox name="stop_fines" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Stop_Fines_Time.label;" />
+                                <textbox name="prev_stop_fines_time" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Stop_Fines_Time.label;" />
+                                <textbox name="stop_fines_time" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Checkin_Time.label;" />
+                                <textbox name="prev_last_checkin_time" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Checkin_Time.label;" />
+                                <textbox name="last_checkin_time" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Checkin_Scan_Time.label;" />
+                                <textbox name="prev_last_checkin_scan_time" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Checkin_Scan_Time.label;" />
+                                <textbox name="last_checkin_scan_time" readonly="true" context="clipboard"/>
+                            </row><row>
+                                <label value="&staff.circ.alternate_copy_summary.Checkin_Workstation.label;" />
+                                <textbox name="prev_checkin_workstation" readonly="true" context="clipboard"/>
+                                <spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Checkin_Workstation.label;" />
+                                <textbox name="checkin_workstation" readonly="true" context="clipboard"/>
+                            </row>
+                        </rows>
+                    </grid>
+                </tabpanel>
+                <tabpanel><!-- Hold/Transit -->
+                </tabpanel>
+                <tabpanel><!-- Cataloging Info -->
                     <deck id="cat_deck" flex="1"/>
                 </tabpanel>
             </tabpanels>