From d981bd3d9e6355887c7e6c32a8205c269578b22d Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 24 May 2006 15:37:34 +0000 Subject: [PATCH] added a 'Mark Lost' button for the patron card and wired it up disabled direct editing of the barcode for existing card git-svn-id: svn://svn.open-ils.org/ILS/trunk@4368 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/ue.js | 38 ++++++++++++++++++- .../xul/staff_client/server/patron/ue.xhtml | 2 + 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/patron/ue.js b/Open-ILS/xul/staff_client/server/patron/ue.js index 88c6cfd9f8..f617265315 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue.js +++ b/Open-ILS/xul/staff_client/server/patron/ue.js @@ -77,16 +77,22 @@ function uEditBuild() { else uEditCreateNewAddr(); } + + if(!patron.isnew()) { + $('ue_barcode').disabled = true; + unHideMe($('ue_mark_card_lost')); + } } /* creates a new patron object with card attached */ +var uEditCardVirtId = -1; function uEditNewPatron() { var patron = new au(); patron.isnew(1); patron.id(-1); card = new ac(); - card.id(-1); + card.id(uEditCardVirtId--); card.isnew(1); patron.card(card); patron.cards([card]); @@ -451,3 +457,33 @@ function uEditShowSearch(link) { else alert('Search would be:\n' + js2JSON(uEditDupHashes[type])); } +function uEditMarkCardLost() { + + for( var c in patron.cards() ) { + + var card = patron.cards()[c]; + if( patron.card().id() == card.id() ) { + + /* de-activite the current card */ + card.ischanged(1); + card.active(0); + + /* create a new card for the patron */ + var newcard = new ac(); + newcard.id(uEditCardVirtId--); + newcard.isnew(1); + patron.card(newcard); + patron.cards().push(newcard); + + + /* reset the widget */ + var field = uEditFindFieldByWId('ue_barcode'); + field.widget.node.disabled = false; + field.widget.node.value = ""; + field.widget.node.onchange(); + field.object = newcard; + } + } +} + + diff --git a/Open-ILS/xul/staff_client/server/patron/ue.xhtml b/Open-ILS/xul/staff_client/server/patron/ue.xhtml index fbba69f28c..79ff7bf672 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue.xhtml +++ b/Open-ILS/xul/staff_client/server/patron/ue.xhtml @@ -193,6 +193,8 @@ + -- 2.43.2