show the replaced address along with the pending address
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Jan 2009 16:47:15 +0000 (16:47 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Jan 2009 16:47:15 +0000 (16:47 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11845 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/ue.xhtml
Open-ILS/xul/staff_client/server/patron/ue_config.js

index 6c5df62..385a637 100644 (file)
@@ -276,3 +276,4 @@ staff.patron.usr_buckets.merge_records.catch.std_unex_error=Records were not lik
 
 web.staff.patron.ue.session_no_defined=User session is not defined
 web.staff.patron.ue.uedit_show_search.search_would_be=Search would be:\n%1$s
+web.staff.patron.ue.uedit_show_addr_replacement=<div>Replaces address <b>%1$s</b><br/> %2$s %3$s<br/> %4$s, %5$s %6$s</div>
index 05e5454..9b102cd 100644 (file)
                                                                                                                        </div>
                                                                                                                </td>
                                                                                                        </tr>
+                                                                                                       <tr class='hide_me' name='ue_addr_replaced_row'>
+                                                                                                               <td colspan='6'>
+                                                                                                                       <div class='button_row' name='ue_addr_replaced_div'>
+                                                            </div>
+                                                        </td>
+                                                    </tr>
                                                                                                </tbody>
                                                                                        </table>
                                                                                </td>
index ebfb3c2..5cdb247 100644 (file)
@@ -640,6 +640,7 @@ function uEditApproveAddr( tbody, row, address ) {
                        );
                 // update the ID on the new address
                 address.id(oldId);
+                address.replaces(null);
                 removeChildren($('ue_address_tbody'));
                    uEditBuildAddrs(patron);
             }
@@ -694,11 +695,24 @@ function uEditBuildAddrFields(patron, address) {
     if( address.replaces() != null ) {
         var button = $n(row, 'ue_addr_approve');
         unHideMe(button);
-        button.onclick = 
-            function() { uEditApproveAddr( tbody, row, address ); }
+        button.onclick = function() { uEditApproveAddr( tbody, row, address ); }
+        var oldaddr = grep(patron.addresses(), function(a){return (a.id() == address.replaces());});
+        if(oldaddr) {
+            oldaddr = oldaddr[0];
+            unHideMe($n(row, 'ue_addr_replaced_row')); 
+            $n(row, 'ue_addr_replaced_div').innerHTML = 
+                $("patronStrings").getFormattedString(
+                    'web.staff.patron.ue.uedit_show_addr_replacement', [
+                    oldaddr.address_type(),
+                    oldaddr.street1(),
+                    oldaddr.street2(),
+                    oldaddr.city(),
+                    oldaddr.state(),
+                    oldaddr.post_code() 
+                ]);
+        }
     }
 
-
        $n(row, 'ue_addr_delete').onclick = 
                function() { 
                        uEditDeleteAddr(tbody, row, address);