From: erickson Date: Thu, 15 Jan 2009 15:42:50 +0000 (+0000) Subject: initial support for approving pending addresses. still need to show which address... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=43da9fc2e963a13982f6f1d6db8878256111619b;p=Evergreen.git initial support for approving pending addresses. still need to show which address is being replaced git-svn-id: svn://svn.open-ils.org/ILS/trunk@11844 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index c1aecacad1..2ee0ed991f 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2595,6 +2595,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/ue.xhtml b/Open-ILS/xul/staff_client/server/patron/ue.xhtml index fe54be7025..05e5454716 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue.xhtml +++ b/Open-ILS/xul/staff_client/server/patron/ue.xhtml @@ -549,6 +549,8 @@ + @@ -993,7 +995,7 @@ &ev.staff.patron.ue_xhtml.claims_return_confirm.label; &ev.staff.patron.ue_xhtml.unsaved_changes.label; &ev.staff.patron.ue_xhtml.xact_collision.label; - + &ev.staff.patron.ue_xhtml.ue_addr_approve_confirm.label; diff --git a/Open-ILS/xul/staff_client/server/patron/ue_config.js b/Open-ILS/xul/staff_client/server/patron/ue_config.js index b4a6b017b8..ebfb3c2201 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue_config.js +++ b/Open-ILS/xul/staff_client/server/patron/ue_config.js @@ -9,6 +9,7 @@ const FETCH_NET_LEVELS = 'open-ils.actor:open-ils.actor.net_access_level.retriev const UPDATE_PATRON = 'open-ils.actor:open-ils.actor.patron.update'; const PATRON_SEARCH = 'open-ils.actor:open-ils.actor.patron.search.advanced'; const ZIP_SEARCH = 'open-ils.search:open-ils.search.zip'; +const APPROVE_ADDR = 'open-ils.actor:open-ils.actor.user.pending_address.approve'; const FETCH_ADDR_MEMS = 'open-ils.actor:open-ils.actor.address.members'; const FETCH_GRP_MEMS = 'open-ils.actor:open-ils.actor.usergroup.members.retrieve'; const CREATE_USER_NOTE = 'open-ils.actor:open-ils.actor.note.create'; @@ -624,6 +625,29 @@ function uEditDeleteAddr( tbody, row, address, detach ) { } +function uEditApproveAddr( tbody, row, address ) { + if(!confirm($('ue_add_approve_confirm').innerHTML)) return; + var req = new Request(APPROVE_ADDR, SESSION, address.id()); + req.callback( + function(r) { + var oldId = r.getResultObject(); + if(oldId != null) { + // remove the replaced address + patron.addresses( + grep( patron.addresses(), + function(i) { return (i.id() != oldId); } + ) + ); + // update the ID on the new address + address.id(oldId); + removeChildren($('ue_address_tbody')); + uEditBuildAddrs(patron); + } + } + ); + req.send(); +} + function uEditFindAddrInput(type, id) { var tbody = $('ue_address_tbody'); @@ -665,6 +689,15 @@ function uEditBuildAddrFields(patron, address) { uEditAddrTemplate.cloneNode(true)); uEditCheckSharedAddr(patron, address, tbody, row); + + // see if this is a pending address + if( address.replaces() != null ) { + var button = $n(row, 'ue_addr_approve'); + unHideMe(button); + button.onclick = + function() { uEditApproveAddr( tbody, row, address ); } + } + $n(row, 'ue_addr_delete').onclick = function() {