mark as lost
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 16:05:40 +0000 (16:05 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 16:05:40 +0000 (16:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1482 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js
Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties

index 8ec9066..6ac12aa 100644 (file)
@@ -23,6 +23,38 @@ function cancel_hold( hold ) {
        }
 }
 
+function mark_circ_as_lost(circ) {
+       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
+       try {
+               var result = user_request(
+                       'open-ils.circ',
+                       'open-ils.circ.circulation.set_lost',
+                       [ mw.G.auth_ses[0], circ.id() ]
+               )[0];
+               sdump('D_CIRC_UTILS','result = ' + result + '\n');
+               return result;
+       } catch(E) {
+               handle_error(E);
+               return null;
+       }
+}
+
+function mark_circ_as_missing(circ) {
+       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
+       try {
+               var result = user_request(
+                       'open-ils.circ',
+                       'open-ils.circ.circulation.set_missing',
+                       [ mw.G.auth_ses[0], circ.id() ]
+               )[0];
+               sdump('D_CIRC_UTILS','result = ' + result + '\n');
+               return result;
+       } catch(E) {
+               handle_error(E);
+               return null;
+       }
+}
+
 function checkout_permit(barcode, patron_id, num_of_open_async_checkout_requests, f) {
        sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true,1:true,2:true}));
        try {
index 4c72b86..8c5fa21 100755 (executable)
@@ -192,7 +192,7 @@ function patron_display_patron_items_init(p) {
                                                try {
                                                        var idx = patron_items[i].getAttribute('record_id'); 
                                                        var circ = p._patron.checkouts()[ idx ].circ;
-                                                       alert( js2JSON(renew_by_circ_id( circ.id() )) );
+                                                       renew_by_circ_id( circ.id() );
                                                        p.refresh();
                                                } catch(E) {
                                                        alert(E);
@@ -229,6 +229,28 @@ function patron_display_patron_items_init(p) {
                                false
                        );
 
+                       /*** LOST ***/
+                       var menuitem_pi_r = p.patron_items.paged_tree.w.document.createElement('menuitem');
+                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_r );
+                       menuitem_pi_r.setAttribute('label',getString('circ.context_lost'));
+                       menuitem_pi_r.addEventListener(
+                               'command',
+                               function (ev) {
+                                       sdump('D_PATRON_DISPLAY','Firing lost context for patron_items\n');
+                                       for (var i = 0; i < patron_items.length; i++) {
+                                               try {
+                                                       var idx = patron_items[i].getAttribute('record_id'); 
+                                                       var circ = p._patron.checkouts()[ idx ].circ;
+                                                       mark_circ_as_lost( circ ) ;
+                                                       p.refresh();
+                                               } catch(E) {
+                                                       alert(E);
+                                               }
+                                       }
+                               },
+                               false
+                       );
+
                        /* separator */
                        var menuitem_pi_s = p.patron_items.paged_tree.w.document.createElement('menuseparator');
                        p.patron_items.paged_tree.popup.appendChild( menuitem_pi_s );
index 5bd3bc3..94553b5 100644 (file)
@@ -31,6 +31,8 @@ circ.context_checkin=Check In
 circ.context_renew=Renew
 circ.context_opac=Show Title in OPAC
 circ.context_edit=Edit Copy
+circ.context_lost=Mark as Lost
+circ.context_missing=Mark as Missing
 patron.context_display=Retrieve Patron
 
 checkin_label_status=Status