[open-ils-commits] r11844 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jan 15 10:42:51 EST 2009
Author: erickson
Date: 2009-01-15 10:42:50 -0500 (Thu, 15 Jan 2009)
New Revision: 11844
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml
trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js
Log:
initial support for approving pending addresses. still need to show which address is being replaced
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-01-15 15:01:07 UTC (rev 11843)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-01-15 15:42:50 UTC (rev 11844)
@@ -2595,6 +2595,8 @@
<!ENTITY ev.staff.patron.ue_xhtml.profile_group.label "Profile Group">
<!ENTITY ev.staff.patron.ue_xhtml.ue_addr_delete.label "Delete this Address">
<!ENTITY ev.staff.patron.ue_xhtml.ue_addr_detach.label "Detach this Address">
+<!ENTITY ev.staff.patron.ue_xhtml.ue_addr_approve.label "Approve Pending Address">
+<!ENTITY ev.staff.patron.ue_xhtml.ue_addr_approve_confirm.label "Approve pending address? This operation will be be instantenous.">
<!ENTITY ev.staff.patron.ue_xhtml.primary_ident_ssn_help.label "(XXX-YY-ZZZZ)">
<!ENTITY ev.staff.patron.ue_xhtml.primary_ident_dl_help.label "(GA-123456789)">
<!ENTITY ev.staff.patron.ue_xhtml.edit.label "Edit">
Modified: trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml 2009-01-15 15:01:07 UTC (rev 11843)
+++ trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml 2009-01-15 15:42:50 UTC (rev 11844)
@@ -549,6 +549,8 @@
<span style='padding-left: 10px;'> </span>
<input type='submit' name='ue_addr_detach'
value='&ev.staff.patron.ue_xhtml.ue_addr_detach.label;' class='hide_me'/>
+ <input type='submit' name='ue_addr_approve'
+ value='&ev.staff.patron.ue_xhtml.ue_addr_approve.label;' class='hide_me'/>
</div>
</td>
</tr>
@@ -993,7 +995,7 @@
<span class='hide_me' id='ue_claims_return_confirm'>&ev.staff.patron.ue_xhtml.claims_return_confirm.label;</span>
<span class='hide_me' id='ue_unsaved_changes'>&ev.staff.patron.ue_xhtml.unsaved_changes.label;</span>
<span class='hide_me' id='ue_xact_collision'>&ev.staff.patron.ue_xhtml.xact_collision.label;</span>
-
+ <span class='hide_me' id='ue_add_approve_confirm'>&ev.staff.patron.ue_xhtml.ue_addr_approve_confirm.label;</span>
</div>
</body>
Modified: trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js 2009-01-15 15:01:07 UTC (rev 11843)
+++ trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js 2009-01-15 15:42:50 UTC (rev 11844)
@@ -9,6 +9,7 @@
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,7 +625,30 @@
}
+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');
var rows = tbody.getElementsByTagName('tr');
@@ -665,7 +689,16 @@
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() {
uEditDeleteAddr(tbody, row, address);
More information about the open-ils-commits
mailing list