DUPE_PATRON_EMAIL : 'Found ${0} patron(s) with the same email address',
DUPE_PATRON_IDENT : 'Found ${0} patron(s) with the same identification',
DUPE_PATRON_PHONE : 'Found ${0} patron(s) with the same phone number',
- DUPE_PATRON_ADDR : 'Found ${0} patron(s) with the same address'
+ DUPE_PATRON_ADDR : 'Found ${0} patron(s) with the same address',
+ REPLACED_ADDRESS : '<div>Replaces address <b>${0}</b><br/> ${1} ${2}<br/> ${3}, ${4} ${5}</div>'
}
if(addr.replaces()) {
var div = dojo.query('[name=replaced-addr]', row)[0]
- div.innerHTML = addr.replaces();
+ var replaced = patron.addresses().filter(
+ function(i) { return (i.id() == addr.replaces()) })[0];
+
+ div.innerHTML = dojo.string.substitute(localeStrings.REPLACED_ADDRESS, [
+ replaced.address_type() || '',
+ replaced.street1() || '',
+ replaced.street2() || '',
+ replaced.city() || '',
+ replaced.state() || '',
+ replaced.post_code() || ''
+ ]);
+
} else {
openils.Util.hide(dojo.query('[name=replaced-addr-div]', row)[0]);
}
<span style='padding-right:10px;'>This is a pending address: </span>
<button name='approve-button'>Approve Address</button>
<div name='replaced-addr-div'>
- <span>This address replaces:</span>
<div name='replaced-addr'></div>
</div>
</td>