From: Jason Etheridge Date: Tue, 2 Aug 2011 03:07:24 +0000 (-0400) Subject: action for marking items claimed never checked out X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f3f86aba83c2179569413d6f50a2b132f0371a72;p=contrib%2FConifer.git action for marking items claimed never checked out Menu action in Patron Items Out for marking items as Claimed Never Checked Out. Note that this action behaves differently than Claimed Returned, in that the item is actually checked in and the transaction closed, and will not continue to show up in Items Out for the patron. If decide later to provide an option for making the two actions consistent, there is code in the original working branch, collab/phasefx/claimed_never_cko, which modifies the patron display and the .checked_out methods to look for open CLAIMSNEVERCHECKEDOUT transactions. Some cleanup would be needed to avoid merge conflicts. Signed-off-by: Jason Etheridge Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 1c889f8295..6dd1e96a45 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -978,8 +978,6 @@ - - @@ -3376,6 +3374,7 @@ + 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 c3f99be1f5..db13be5a04 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 @@ -325,6 +325,8 @@ staff.patron.items.items_claimed_returned.not_marked_claimed_returned=The items staff.patron.items.set_claim_returned_failure=Override set claimed returned failure? staff.patron.items.items_checkin.confirm_item_check_in.singular=Are you sure you would like to check in item %1$s? staff.patron.items.items_checkin.confirm_item_check_in.plural=Are you sure you would like to check in items %1$s? +staff.patron.items.items_checkin.confirm_item_claimed_never_checked_out.singular=Are you sure you would like to mark this item as Claimed Never Checked Out? %1$s +staff.patron.items.items_checkin.confirm_item_claimed_never_checked_out.plural=Are you sure you would like to mark these items as Claimed Never Checked Out? %1$s staff.patron.items.items_checkin.no_checkin=Checkin probably did not happen. staff.patron.items.show_catalog.barcode_not_cataloged=%1$s is not cataloged staff.patron.items.show_catalog.retrieving_title=Retrieving title... diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index 2aa4cddb27..cf9394c8f3 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -157,6 +157,22 @@ patron.items.prototype = { 'cmd_items_mark_lost2' : [ ['command'], function() { obj.items_mark_lost(2); /*obj.retrieve();*/ } ], 'cmd_items_claimed_returned' : [ ['command'], function() { obj.items_claimed_returned(1); /*obj.retrieve();*/ } ], 'cmd_items_claimed_returned2' : [ ['command'], function() { obj.items_claimed_returned(2); /*obj.retrieve();*/ } ], + 'cmd_items_claimed_never_checked_out' : [ + ['command'], + function() { + obj.items_checkin( + 1,{'claims_never_checked_out':true} + ); + } + ], + 'cmd_items_claimed_never_checked_out2' : [ + ['command'], + function() { + obj.items_checkin( + 2,{'claims_never_checked_out':true} + ); + } + ], 'cmd_items_checkin' : [ ['command'], function() { obj.items_checkin(1); /*obj.retrieve();*/ } ], 'cmd_items_checkin2' : [ ['command'], function() { obj.items_checkin(2); /*obj.retrieve();*/ } ], 'cmd_show_catalog' : [ ['command'], function() { obj.show_catalog(1); } ], @@ -187,6 +203,7 @@ patron.items.prototype = { obj.controller.view.sel_patron2.setAttribute('disabled','true'); obj.controller.view.cmd_triggered_events2.setAttribute('disabled','true'); obj.controller.view.cmd_items_claimed_returned.setAttribute('disabled','true'); + obj.controller.view.cmd_items_claimed_never_checked_out.setAttribute('disabled','true'); obj.controller.view.cmd_items_renew.setAttribute('disabled','true'); obj.controller.view.cmd_items_renew_with_date.setAttribute('disabled','true'); obj.controller.view.cmd_items_checkin.setAttribute('disabled','true'); @@ -194,6 +211,7 @@ patron.items.prototype = { obj.controller.view.cmd_items_mark_lost.setAttribute('disabled','true'); obj.controller.view.cmd_show_catalog.setAttribute('disabled','true'); obj.controller.view.cmd_items_claimed_returned2.setAttribute('disabled','true'); + obj.controller.view.cmd_items_claimed_never_checked_out2.setAttribute('disabled','true'); obj.controller.view.cmd_items_renew2.setAttribute('disabled','true'); obj.controller.view.cmd_items_renew_with_date2.setAttribute('disabled','true'); obj.controller.view.cmd_items_checkin2.setAttribute('disabled','true'); @@ -542,19 +560,53 @@ patron.items.prototype = { } }, - 'items_checkin' : function(which) { + 'items_checkin' : function(which,options) { var obj = this; try { + if (!options) { options = {}; } var retrieve_ids = ( which == 2 ? obj.retrieve_ids2 : obj.retrieve_ids ); if (!retrieve_ids || retrieve_ids.length == 0) return; JSAN.use('util.functional'); var msg = ''; - if (retrieve_ids.length > 1) { - msg += $("patronStrings").getFormattedString('staff.patron.items.items_checkin.confirm_item_check_in.plural', - [util.functional.map_list( retrieve_ids, function(o){return o.barcode;}).join(', ')]); + if (options.claims_never_checked_out) { + if (retrieve_ids.length > 1) { + msg += $("patronStrings").getFormattedString( + 'staff.patron.items.items_checkin.confirm_item_claimed_never_checked_out.plural', + [ + util.functional.map_list( + retrieve_ids, + function(o){return o.barcode;} + ).join(', ') + ] + ); + } else { + msg += $("patronStrings").getFormattedString( + 'staff.patron.items.items_checkin.confirm_item_claimed_never_checked_out.singular', + [ + retrieve_ids[0].barcode, + ] + ); + } } else { - msg += $("patronStrings").getFormattedString('staff.patron.items.items_checkin.confirm_item_check_in.singular', - [util.functional.map_list( retrieve_ids, function(o){return o.barcode;}).join(', ')]); + if (retrieve_ids.length > 1) { + msg += $("patronStrings").getFormattedString( + 'staff.patron.items.items_checkin.confirm_item_check_in.plural', + [ + util.functional.map_list( + retrieve_ids, + function(o){return o.barcode;} + ).join(', ') + ] + ); + } else { + msg += $("patronStrings").getFormattedString( + 'staff.patron.items.items_checkin.confirm_item_check_in.singular', + [ + retrieve_ids[0].barcode, + ] + ); + } + } var r = window.confirm(msg); if (!r) { return; } @@ -564,9 +616,11 @@ patron.items.prototype = { for (var i = 0; i < retrieve_ids.length; i++) { var copy_id = retrieve_ids[i].copy_id; dump('Check in copy_id = ' + copy_id + ' barcode = ' + retrieve_ids[i].barcode + '\n'); + var opt = JSON2js( js2JSON( options || {} ) ); // clone options + opt.copy_id = copy_id; var robj = circ.util.checkin_via_barcode( ses(), - { 'copy_id' : copy_id }, + opt, false /* backdate */, auto_print ); @@ -883,6 +937,7 @@ patron.items.prototype = { var obj = this; obj.controller.view.cmd_items_claimed_returned.setAttribute('disabled','false'); + obj.controller.view.cmd_items_claimed_never_checked_out.setAttribute('disabled','false'); obj.controller.view.cmd_items_renew.setAttribute('disabled','false'); obj.controller.view.cmd_items_renew_with_date.setAttribute('disabled','false'); obj.controller.view.cmd_items_checkin.setAttribute('disabled','false'); @@ -906,6 +961,7 @@ patron.items.prototype = { var obj = this; obj.controller.view.cmd_items_claimed_returned2.setAttribute('disabled','false'); + obj.controller.view.cmd_items_claimed_never_checked_out2.setAttribute('disabled','false'); obj.controller.view.cmd_items_renew2.setAttribute('disabled','false'); obj.controller.view.cmd_items_renew_with_date2.setAttribute('disabled','false'); obj.controller.view.cmd_items_checkin2.setAttribute('disabled','false'); diff --git a/Open-ILS/xul/staff_client/server/patron/items_overlay.xul b/Open-ILS/xul/staff_client/server/patron/items_overlay.xul index bda65d793e..e21e99d2cf 100644 --- a/Open-ILS/xul/staff_client/server/patron/items_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/items_overlay.xul @@ -21,6 +21,7 @@ + @@ -43,6 +44,7 @@ + @@ -68,6 +70,7 @@ +