Fix the Macros button for all template types. Change PINES_CODE to SHORTNAME
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Apr 2008 17:38:53 +0000 (17:38 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Apr 2008 17:38:53 +0000 (17:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@9194 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js

index 19bc1c8..acd686f 100644 (file)
@@ -128,7 +128,7 @@ circ.print_list_template_editor.prototype = {
                                                                try {
                                                                        JSAN.use('util.functional');
                                                                        var template_type = obj.controller.view.template_type_menu.value;
-                                                                       var macros;
+                                                                       var macros = [];
                                                                        switch(template_type) {
                                                                                case 'items':
                                                                                        JSAN.use('circ.util');
@@ -148,6 +148,51 @@ circ.print_list_template_editor.prototype = {
                                                                                                }
                                                                                        );
                                                                                break;
+                                                                               case 'transits':
+                                                                                       JSAN.use('circ.util');
+                                                                                       macros = util.functional.map_list(
+                                                                                               circ.util.transit_columns( {} ),
+                                                                                               function(o) {
+                                                                                                       return '%' + o.id + '%';
+                                                                                               }
+                                                                                       );
+                                                                               break;
+                                                                               case 'offline_checkout':
+                                                                                       JSAN.use('circ.util');
+                                                                                       macros = util.functional.map_list(
+                                                                                               circ.util.offline_checkout_columns( {} ),
+                                                                                               function(o) {
+                                                                                                       return '%' + o.id + '%';
+                                                                                               }
+                                                                                       );
+                                                                               break;
+                                                                               case 'offline_checkin':
+                                                                                       JSAN.use('circ.util');
+                                                                                       macros = util.functional.map_list(
+                                                                                               circ.util.offline_checkin_columns( {} ),
+                                                                                               function(o) {
+                                                                                                       return '%' + o.id + '%';
+                                                                                               }
+                                                                                       );
+                                                                               break;
+                                                                               case 'offline_renew':
+                                                                                       JSAN.use('circ.util');
+                                                                                       macros = util.functional.map_list(
+                                                                                               circ.util.offline_renew_columns( {} ),
+                                                                                               function(o) {
+                                                                                                       return '%' + o.id + '%';
+                                                                                               }
+                                                                                       );
+                                                                               break;
+                                        case 'offline_inhouse_use':
+                                                                                       JSAN.use('circ.util');
+                                                                                       macros = util.functional.map_list(
+                                                                                               circ.util.offline_inhouse_use_columns( {} ),
+                                                                                               function(o) {
+                                                                                                       return '%' + o.id + '%';
+                                                                                               }
+                                                                                       );
+                                                                               break;
                                                                                case 'bills':
                                                                                        JSAN.use('patron.util');
                                                                                        macros = util.functional.map_list(
@@ -179,7 +224,7 @@ circ.print_list_template_editor.prototype = {
                                                                                        + '<head><title>Template Macros</title></head>'
                                                                                        + '<body onload="document.getElementById(\'btn\').focus()">'
                                                                                        + '<h1>General:</h1>'
-                                                                                       + '<p>%PINES_CODE%, %TODAY%, %STAFF_FIRSTNAME%, %STAFF_LASTNAME%, '
+                                                                                       + '<p>%SHORTNAME%, %TODAY%, %STAFF_FIRSTNAME%, %STAFF_LASTNAME%, '
                                                                                        + '%PATRON_FIRSTNAME%, %LIBRARY%</p>'
                                                                                        + '<h1>For type: '
                                                                                        + template_type + '</h1>'