<!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">
var fleshedContainers = {};
var holdCache = {};
var holdStatusCache = {};
+var allowPendingAddr = false;
function clearNodes( node, keepArray ) {
}
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() {
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);
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,
fleshedUser.addresses(addrs);
}
}
-
- alert('done');
+ alertId('myopac_addr_changes_saved');
}
);
req.send();
<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'>
<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>
<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>
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>