From acd47e2b4bd65b07d67eb8dbc8fe9bfc26962853 Mon Sep 17 00:00:00 2001 From: pines Date: Thu, 22 Feb 2007 21:34:32 +0000 Subject: [PATCH] Retrieve last patron who circulated item action for checkin git-svn-id: svn://svn.open-ils.org/ILS/trunk@7001 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/circ/checkin.js | 20 ++++++++++++++++++++ Open-ILS/xul/staff_client/server/circ/checkin.xul | 1 + .../xul/staff_client/server/circ/checkin_overlay.xul | 2 ++ 3 files changed, 23 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 1c07a9407e..05a68087b9 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -54,6 +54,7 @@ circ.checkin.prototype = { obj.controller.view.sel_edit.setAttribute('disabled','true'); obj.controller.view.sel_opac.setAttribute('disabled','true'); obj.controller.view.sel_patron.setAttribute('disabled','true'); + obj.controller.view.sel_last_patron.setAttribute('disabled','true'); obj.controller.view.sel_copy_details.setAttribute('disabled','true'); obj.controller.view.sel_bucket.setAttribute('disabled','true'); obj.controller.view.sel_spine.setAttribute('disabled','true'); @@ -64,6 +65,7 @@ circ.checkin.prototype = { obj.controller.view.sel_edit.setAttribute('disabled','false'); obj.controller.view.sel_opac.setAttribute('disabled','false'); obj.controller.view.sel_patron.setAttribute('disabled','false'); + obj.controller.view.sel_last_patron.setAttribute('disabled','false'); obj.controller.view.sel_copy_details.setAttribute('disabled','false'); obj.controller.view.sel_bucket.setAttribute('disabled','false'); obj.controller.view.sel_spine.setAttribute('disabled','false'); @@ -126,6 +128,23 @@ circ.checkin.prototype = { circ.util.show_last_few_circs(obj.selection_list); } ], + 'sel_last_patron' : [ + ['command'], + function() { + var patrons = {}; + for (var i = 0; i < obj.selection_list.length; i++) { + var circs = obj.network.simple_request('FM_CIRC_RETRIEVE_VIA_COPY',[ses(),obj.selection_list[i].copy_id,1]); + if (circs.length > 0) { + patrons[circs[0].usr()] = 1; + } else { + alert('Item ' + obj.selection_list[i].barcode + ' has never circulated'); + } + } + for (var i in patrons) { + xulG.new_tab(urls.XUL_PATRON_DISPLAY,{},{'id' : i}); + } + } + ], 'sel_copy_details' : [ ['command'], function() { @@ -381,6 +400,7 @@ circ.checkin.prototype = { //I could override map_row_to_column here } ); + obj.list.node.view.selection.select(0); JSAN.use('util.sound'); var sound = new util.sound(); sound.circ_good(); diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.xul b/Open-ILS/xul/staff_client/server/circ/checkin.xul index 741369d6af..77ca067927 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin.xul @@ -90,6 +90,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index 65c0212b27..ceb3bb8525 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -16,6 +16,7 @@ + @@ -79,6 +80,7 @@ + -- 2.11.0