[open-ils-commits] r13324 - in trunk/Open-ILS: web/opac/locale/en-US web/opac/skin/default/js web/opac/skin/default/xml/myopac xul/staff_client/server/admin (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jun 5 10:11:33 EDT 2009
Author: erickson
Date: 2009-06-05 10:11:31 -0400 (Fri, 05 Jun 2009)
New Revision: 13324
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/web/opac/skin/default/js/myopac.js
trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml
trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
Log:
created setting to enable the creation of pending addresses
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-06-04 22:33:33 UTC (rev 13323)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-06-05 14:11:31 UTC (rev 13324)
@@ -1637,6 +1637,8 @@
<!ENTITY staff.server.admin.org_settings.circ.restore_overdue_on_lost_return.desc "Restore overdue fines on lost item return">
<!ENTITY staff.server.admin.org_settings.circ.lost_immediately_available "Circ: Lost items usable on checkin">
<!ENTITY staff.server.admin.org_settings.circ.lost_immediately_available.desc "Lost items are usable on checkin instead of going \'home\' first">
+<!ENTITY staff.server.admin.org_settings.opac.allow_pending_address "OPAC: Allow pending addresses">
+<!ENTITY staff.server.admin.org_settings.opac.allow_pending_address.desc "If enabled, patrons can create and edit existing addresses. Addresses are kept in a pending state until staff approves the changes">
<!ENTITY staff.server.admin.stat_cat.title "Evergreen: Statistical Category Editor">
Modified: trunk/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2009-06-04 22:33:33 UTC (rev 13323)
+++ trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2009-06-05 14:11:31 UTC (rev 13324)
@@ -7,6 +7,7 @@
var fleshedContainers = {};
var holdCache = {};
var holdStatusCache = {};
+var allowPendingAddr = false;
function clearNodes( node, keepArray ) {
@@ -17,13 +18,23 @@
}
function myOPACInit() {
- if(!(G.user && G.user.session)) initLogin();
- else myOPACChangePage( "summary" );
+ if(!(G.user && G.user.session)) {
+ initLogin();
+
+ } else {
+
+ allowPendingAddr = fetchOrgSettingDefault(G.user.home_ou(), 'opac.allow_pending_address');
+ if(allowPendingAddr)
+ unHideMe($('myopac_pending_addr_td'));
+ myOPACChangePage( "summary" );
+ }
+
$('myopac_holds_thaw_date_input').onkeyup =
function(){holdsVerifyThawDateUI('myopac_holds_thaw_date_input'); }
$('myopac_holds_thaw_date_input').onchange =
function(){holdsVerifyThawDateUI('myopac_holds_thaw_date_input'); }
+
}
function myopacReload() {
@@ -838,6 +849,8 @@
var addrs = user.addresses();
for( var a in addrs ) {
var addr = addrs[a];
+ if(!allowPendingAddr && isTrue(addr.pending()))
+ continue;
if(addr.replaces() != null) continue;
var row = template.cloneNode(true);
myOPACDrawAddr(row, addr, addrs);
@@ -875,7 +888,11 @@
appendClear($n(row, 'myopac_addr_state'),text(addr.state()));
appendClear($n(row, 'myopac_addr_country'),text(addr.country()));
appendClear($n(row, 'myopac_addr_zip'),text(addr.post_code()));
+
+ if(!allowPendingAddr) return;
+
$n(row, 'myopac_addr_edit_link').onclick = function(){myopacEditAddress(addr)};
+ unHideMe($n(row, 'myopac_addr_edit_td'));
/* if we have a replacement address, plop it into the table next to this addr */
var repl = grep(addrs,
@@ -972,8 +989,7 @@
fleshedUser.addresses(addrs);
}
}
-
- alert('done');
+ alertId('myopac_addr_changes_saved');
}
);
req.send();
Modified: trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml 2009-06-04 22:33:33 UTC (rev 13323)
+++ trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml 2009-06-05 14:11:31 UTC (rev 13324)
@@ -173,7 +173,7 @@
<thead>
<tr>
<td>&myopac.summary.addresses;</td>
- <td>&myopac.summary.addresses.pending;</td>
+ <td id='myopac_pending_addr_td' class='hide_me'>&myopac.summary.addresses.pending;</td>
</tr>
</thead>
<tbody id='myopac_addr_tbody'>
@@ -213,7 +213,7 @@
<td name='myopac_addr_zip'> </td>
</tr>
<tr>
- <td name='myopac_addr_edit_td' colspan='2'>
+ <td name='myopac_addr_edit_td' colspan='2' class='hide_me'>
<a class='classic_link' name='myopac_addr_edit_link' href='javascript:void(0);'>Edit Address</a>
</td>
</tr>
@@ -280,6 +280,7 @@
<div class='hide_me' id='myopac_password_success'>&myopac.summary.password.success;</div>
<div class='hide_me' id='myopac_password_failure'>&myopac.summary.password.failure;</div>
<span class='hide_me' id='myopac_invalid_username'>&myopac.summary.username.invalid;</span>
+ <span class='hide_me' id='myopac_addr_changes_saved'>Address Saved</span>
</div>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml 2009-06-04 22:33:33 UTC (rev 13323)
+++ trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml 2009-06-05 14:11:31 UTC (rev 13324)
@@ -184,6 +184,11 @@
label : '&staff.server.admin.org_settings.circ.lost_immediately_available;',
desc : '&staff.server.admin.org_settings.circ.lost_immediately_available.desc;',
type : 'bool'
+ },
+ 'opac.allow_pending_address' : {
+ label : '&staff.server.admin.org_settings.opac.allow_pending_address;',
+ desc : '&staff.server.admin.org_settings.opac.allow_pending_address.desc;',
+ type : 'bool'
}
};
</script>
More information about the open-ils-commits
mailing list