silent macro updates
authorJason Etheridge <jason@esilibrary.com>
Fri, 23 Sep 2011 18:58:25 +0000 (14:58 -0400)
committerJason Etheridge <jason@esilibrary.com>
Fri, 23 Sep 2011 20:30:53 +0000 (16:30 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js

index 73fbc61..c256315 100644 (file)
@@ -270,6 +270,25 @@ OpenILS.data.prototype = {
                         for (var i in x) {
                             obj.print_list_templates[i] = x[i];
                         }
+                        // handle macro changes
+                        var templates = [ 'bills_current', 'bills_historical' ];
+                        for (var i = 0; i < templates.length; i++) {
+                            if (obj.print_list_templates[templates[i]]) {
+                                // mbts_id
+                                obj.print_list_templates[templates[i]].line_item =
+                                    obj.print_list_templates[templates[i]].line_item.replace(
+                                        /%id%/g, '%mbts_id%');
+                                // mbts_xact_start
+                                obj.print_list_templates[templates[i]].line_item =
+                                    obj.print_list_templates[templates[i]].line_item.replace(
+                                        /%xact_start%/g, '%mbts_xact_start%');
+                                // mbts_xact_finish
+                                obj.print_list_templates[templates[i]].line_item =
+                                    obj.print_list_templates[templates[i]].line_item.replace(
+                                        /%xact_finish%/g, '%mbts_xact_finish%');
+                            }
+                        }
+                        //
                         obj.stash('print_list_templates');
                         obj.data_progress('Saved print templates retrieved from file. ');
                     }