action for marking items claimed never checked out
authorJason Etheridge <jason@esilibrary.com>
Tue, 2 Aug 2011 03:07:24 +0000 (23:07 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 9 Aug 2011 17:27:54 +0000 (13:27 -0400)
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 <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/items_overlay.xul

index 1c889f8..6dd1e96 100644 (file)
 <!ENTITY staff.main.menu.circ.renew.label "Renew Items">
 <!ENTITY staff.main.menu.circ.renew.accesskey "n">
 <!ENTITY staff.main.menu.circ.checkout.label "Check Out Items">
-<!ENTITY staff.main.menu.circ.claimed_returned.key "C">
-<!ENTITY staff.main.menu.circ.claimed_returned.label 'Mark as "Claimed Returned"'>
 <!ENTITY staff.main.menu.circ.copy_status.key "I">
 <!ENTITY staff.main.menu.circ.copy_status.label "Display Item">
 <!ENTITY staff.main.menu.circ.found.key "F">
 <!ENTITY staff.patron.items_overlay.items_edit.label "Edit Due Date">
 <!ENTITY staff.patron.items_overlay.items_mark_lost.label "Mark Lost (by Patron)">
 <!ENTITY staff.patron.items_overlay.items_claimed_returned.label "Mark Claimed Returned">
+<!ENTITY staff.patron.items_overlay.items_claimed_never_checked_out.label "Mark Claimed Never Checked Out">
 <!ENTITY staff.patron.items_overlay.items_renew.label "Renew">
 <!ENTITY staff.patron.items_overlay.items_renew_all.label "Renew All">
 <!ENTITY staff.patron.items_overlay.items_renew_with_date.label "Renew with Specific Due Date">
index c3f99be..db13be5 100644 (file)
@@ -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...
index 2aa4cdd..cf9394c 100644 (file)
@@ -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');
index bda65d7..e21e99d 100644 (file)
@@ -21,6 +21,7 @@
     <command id="cmd_items_renew_all" />
     <command id="cmd_items_renew_with_date" />
     <command id="cmd_items_claimed_returned" />
+    <command id="cmd_items_claimed_never_checked_out" />
     <command id="cmd_items_checkin" />
     <command id="cmd_items_edit" />
     <command id="cmd_items_mark_lost" />
@@ -43,6 +44,7 @@
     <command id="cmd_items_renew2" />
     <command id="cmd_items_renew_with_date2" />
     <command id="cmd_items_claimed_returned2" />
+    <command id="cmd_items_claimed_never_checked_out2" />
     <command id="cmd_items_checkin2" />
     <command id="cmd_items_edit2" />
     <command id="cmd_items_mark_lost2" />
@@ -68,6 +70,7 @@
         <menuitem label="&staff.patron.items_overlay.items_edit.label;" command="cmd_items_edit" />
         <menuitem label="&staff.patron.items_overlay.items_mark_lost.label;" command="cmd_items_mark_lost" />
         <menuitem label="&staff.patron.items_overlay.items_claimed_returned.label;" command="cmd_items_claimed_returned" />
+        <menuitem label="&staff.patron.items_overlay.items_claimed_never_checked_out.label;" command="cmd_items_claimed_never_checked_out" />
         <menuitem label="&staff.patron.items_overlay.items_renew.label;" command="cmd_items_renew" />
         <menuitem label="&staff.patron.items_overlay.items_renew_all.label;" command="cmd_items_renew_all" hidden="false"/>
         <menuitem label="&staff.patron.items_overlay.items_renew_with_date.label;" command="cmd_items_renew_with_date" hidden="false"/>
@@ -89,6 +92,7 @@
         <menuitem label="&staff.patron.items_overlay.items_edit.label;" command="cmd_items_edit2" />
         <menuitem label="&staff.patron.items_overlay.items_mark_lost.label;" command="cmd_items_mark_lost2" />
         <menuitem label="&staff.patron.items_overlay.items_claimed_returned.label;" command="cmd_items_claimed_returned2" />
+        <menuitem label="&staff.patron.items_overlay.items_claimed_never_checked_out.label;" command="cmd_items_claimed_never_checked_out2" />
         <menuitem label="&staff.patron.items_overlay.items_renew.label;" command="cmd_items_renew2" />
         <menuitem label="&staff.patron.items_overlay.items_renew_with_date.label;" command="cmd_items_renew_with_date2" />
         <menuitem label="&staff.patron.items_overlay.items_checkin.label;" command="cmd_items_checkin2" />
                 <menuitem label="&staff.patron.items_overlay.items_edit.label;" command="cmd_items_edit" />
                 <menuitem label="&staff.patron.items_overlay.items_mark_lost.label;" command="cmd_items_mark_lost" />
                 <menuitem label="&staff.patron.items_overlay.items_claimed_returned.label;" command="cmd_items_claimed_returned" />
+                <menuitem label="&staff.patron.items_overlay.items_claimed_never_checked_out.label;" command="cmd_items_claimed_never_checked_out" />
                 <menuitem label="&staff.patron.items_overlay.items_renew.label;" command="cmd_items_renew" />
                 <menuitem label="&staff.patron.items_overlay.items_renew_all.label;" command="cmd_items_renew_all" hidden="false"/>
                 <menuitem label="&staff.patron.items_overlay.items_renew_with_date.label;" command="cmd_items_renew_with_date" hidden="false"/>
                 <menuitem label="&staff.patron.items_overlay.items_edit.label;" command="cmd_items_edit2" />
                 <menuitem label="&staff.patron.items_overlay.items_mark_lost.label;" command="cmd_items_mark_lost2" />
                 <menuitem label="&staff.patron.items_overlay.items_claimed_returned.label;" command="cmd_items_claimed_returned2" />
+                <menuitem label="&staff.patron.items_overlay.items_claimed_never_checked_out.label;" command="cmd_items_claimed_never_checked_out2" />
                 <menuitem label="&staff.patron.items_overlay.items_renew.label;" command="cmd_items_renew2" />
                 <menuitem label="&staff.patron.items_overlay.items_renew_with_date.label;" command="cmd_items_renew_with_date2" hidden="false"/>
                 <menuitem label="&staff.patron.items_overlay.items_checkin.label;" command="cmd_items_checkin2" />