From 21f171fa74bf0698fe6f49d405b6b9bdc2b87d46 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 26 Jul 2005 16:05:40 +0000 Subject: [PATCH] mark as lost git-svn-id: svn://svn.open-ils.org/ILS/trunk@1482 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../content/evergreen/circ/circ_utils.js | 32 +++++++++++++++++++ .../evergreen/patron/patron_display.js | 24 +++++++++++++- .../locale/en-US/evergreen/OpenILS.properties | 2 ++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js b/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js index 8ec90663d0..6ac12aa997 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js +++ b/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js @@ -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 { diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js index 4c72b86ef4..8c5fa2108b 100755 --- a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js +++ b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js @@ -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 ); diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties b/Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties index 5bd3bc38a3..94553b5286 100644 --- a/Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties +++ b/Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties @@ -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 -- 2.43.2