[open-ils-commits] r11711 - in trunk/Open-ILS/web/opac: locale/en-US skin/default/js skin/default/xml/myopac
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 30 14:44:55 EST 2008
Author: erickson
Date: 2008-12-30 14:44:51 -0500 (Tue, 30 Dec 2008)
New Revision: 11711
Modified:
trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
trunk/Open-ILS/web/opac/skin/default/js/myopac.js
trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml
Log:
rudimentary support for showing pending addrs
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-12-30 19:17:01 UTC (rev 11710)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-12-30 19:44:51 UTC (rev 11711)
@@ -272,6 +272,7 @@
<!ENTITY myopac.summary.home "Home Library">
<!ENTITY myopac.summary.genesis "Account Creation Date">
<!ENTITY myopac.summary.addresses "Addresses">
+<!ENTITY myopac.summary.addresses.pending "Pending Addresses">
<!ENTITY myopac.summary.address.type "Address Type">
<!ENTITY myopac.summary.address.street "Street">
<!ENTITY myopac.summary.address.city "City">
Modified: trunk/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2008-12-30 19:17:01 UTC (rev 11710)
+++ trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2008-12-30 19:44:51 UTC (rev 11711)
@@ -426,7 +426,7 @@
if(false) {
var node = $n(row, 'hold_qstats');
// XXX best way to display this info + dojo i18n
- node.appendChild(text(qstats.queue_position+' of '+qstats.queue_position+' with '+qstats.potential_copies+' copies'));
+ node.appendChild(text('hold #' + qstats.queue_position+' of '+qstats.queue_position+' and '+qstats.potential_copies+' item(s)'));
unHideMe(node);
} else {
@@ -833,9 +833,12 @@
}
removeChildren(tbody);
- for( var a in user.addresses() ) {
+ var addrs = user.addresses();
+ for( var a in addrs ) {
+ var addr = addrs[a];
+ if(addr.replaces() != null) continue;
var row = template.cloneNode(true);
- myOPACDrawAddr(row, user.addresses()[a]);
+ myOPACDrawAddr(row, addr, addrs);
tbody.appendChild(row);
}
}
@@ -861,15 +864,33 @@
-function myOPACDrawAddr(row, addr) {
+function myOPACDrawAddr(row, addr, addrs) {
+ appendClear($n(row, 'myopac_addr_type'),text(addr.address_type()));
+ var street = (addr.street2()) ? addr.street1() + ", " + addr.street2() : addr.street1();
+ appendClear($n(row, 'myopac_addr_street'),text(street));
+ appendClear($n(row, 'myopac_addr_city'),text(addr.city()));
+ appendClear($n(row, 'myopac_addr_county'),text(addr.county()));
+ appendClear($n(row, 'myopac_addr_state'),text(addr.state()));
+ appendClear($n(row, 'myopac_addr_zip'),text(addr.post_code()));
- appendClear($n(row, 'myopac_addr_type'),text(addr.address_type()));
- var street = (addr.street2()) ? addr.street1() + ", " + addr.street2() : addr.street1();
- appendClear($n(row, 'myopac_addr_street'),text(street));
- appendClear($n(row, 'myopac_addr_city'),text(addr.city()));
- appendClear($n(row, 'myopac_addr_county'),text(addr.county()));
- appendClear($n(row, 'myopac_addr_state'),text(addr.state()));
- appendClear($n(row, 'myopac_addr_zip'),text(addr.post_code()));
+ /* if we have a replacement address, plop it into the table next to this addr */
+ var repl = grep(addrs,
+ function(a) {
+ return a.replaces() == addr.id();
+ }
+ );
+
+ if(repl) {
+ repl = repl[0];
+ unHideMe($n(row, 'myopac_pending_addr_td'));
+ $n(row, 'myopac_pending_addr_type').value = repl.address_type();
+ var street = (repl.street2()) ? repl.street1() + ", " + repl.street2() : repl.street1();
+ $n(row, 'myopac_pending_addr_street').value = street;
+ $n(row, 'myopac_pending_addr_city').value = repl.city();
+ $n(row, 'myopac_pending_addr_county').value = repl.county();
+ $n(row, 'myopac_pending_addr_state').value = repl.state();
+ $n(row, 'myopac_pending_addr_zip').value = repl.post_code();
+ }
}
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 2008-12-30 19:17:01 UTC (rev 11710)
+++ trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml 2008-12-30 19:44:51 UTC (rev 11711)
@@ -169,32 +169,72 @@
<br/><hr/><br/>
-
- <!--
- <br/><br/><br/>
- -->
<table width='100%' class='light_border data_grid'>
- <thead class='color_4'>
- <tr><td style='background: none; border-bottom: none' align='center' colspan='7'><b>&myopac.summary.addresses;</b></td></tr>
- <tr>
- <td width='16%'>&myopac.summary.address.type;</td>
- <td width='16%'>&myopac.summary.address.street;</td>
- <td width='16%'>&myopac.summary.address.city;</td>
- <td width='16%'>&myopac.summary.address.county;</td>
- <td width='16%'>&myopac.summary.address.state;</td>
- <td width='16%'>&myopac.summary.address.zip;</td>
- </tr>
- </thead>
-
+ <thead>
+ <tr>
+ <td>&myopac.summary.addresses;</td>
+ <td>&myopac.summary.addresses.pending;</td>
+ </tr>
+ </thead>
<tbody id='myopac_addr_tbody'>
<tr id='myopac_addr_row' class='light_border'>
- <td name='myopac_addr_type'> </td>
- <td name='myopac_addr_street'> </td>
- <td name='myopac_addr_city'> </td>
- <td name='myopac_addr_county'> </td>
- <td name='myopac_addr_state'> </td>
- <td name='myopac_addr_zip'> </td>
- </tr>
+ <td>
+ <table>
+ <tr>
+ <td>&myopac.summary.address.type;</td>
+ <td name='myopac_addr_type'> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.street;</td>
+ <td name='myopac_addr_street'> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.city;</td>
+ <td name='myopac_addr_city'> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.county;</td>
+ <td name='myopac_addr_county'> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.state;</td>
+ <td name='myopac_addr_state'> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.zip;</td>
+ <td name='myopac_addr_zip'> </td>
+ </tr>
+ </table>
+ </td>
+ <td class='hide_me' name='myopac_pending_addr_td'>
+ <table>
+ <tr>
+ <td>&myopac.summary.address.type;</td>
+ <td><input name='myopac_pending_addr_type'/> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.street;</td>
+ <td><input name='myopac_pending_addr_street'/> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.city;</td>
+ <td><input name='myopac_pending_addr_city'/> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.county;</td>
+ <td><input name='myopac_pending_addr_county'/> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.state;</td>
+ <td><input name='myopac_pending_addr_state'/> </td>
+ </tr>
+ <tr>
+ <td>&myopac.summary.address.zip;</td>
+ <td><input name='myopac_pending_addr_zip'/> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
</tbody>
</table>
More information about the open-ils-commits
mailing list