[open-ils-commits] [GIT] Evergreen ILS branch master updated. eab328fb3ad022a82d6fe3fddf1317ba6aa2f2a5

Evergreen Git git at git.evergreen-ils.org
Tue Jan 10 23:53:20 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  eab328fb3ad022a82d6fe3fddf1317ba6aa2f2a5 (commit)
       via  05352daab6b4020af8489f765f53e36a5c8a3042 (commit)
       via  ae137e7bee9990aa4ed12bff384de42d08fe8f8b (commit)
      from  bbc6b3f9fafd0d591ae8b258650bc50ed273be84 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit eab328fb3ad022a82d6fe3fddf1317ba6aa2f2a5
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue Jan 10 23:48:58 2012 -0500

    Relabel Force Context in receipt template editor
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 4a96bb1..8375881 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -2448,7 +2448,7 @@
 <!ENTITY staff.circ.print_list.top_ui.name.label "Name">
 <!ENTITY staff.circ.print_list.top_ui.name.accesskey "N">
 <!ENTITY staff.circ.print_list.top_ui.type.label "Type">
-<!ENTITY staff.circ.print_list.top_ui.context.label "Force Context">
+<!ENTITY staff.circ.print_list.top_ui.context.label "Force Printer Context">
 <!ENTITY staff.circ.print_list.top_ui.actions.label "Actions">
 <!ENTITY staff.circ.print_list.top_ui.preview.label "Preview">
 <!ENTITY staff.circ.print_list.top_ui.preview.accesskey "P">

commit 05352daab6b4020af8489f765f53e36a5c8a3042
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Dec 20 11:49:16 2011 -0500

    Add Context to Receipt Templates
    
    By default the print context is used, but this enabled each template to be
    assigned a specific printer context that it is intended for.
    
    This means that things that normally use "Default" can be forced to, say,
    "Receipt" and such easily.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index e2bc1bb..4a96bb1 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -2448,6 +2448,7 @@
 <!ENTITY staff.circ.print_list.top_ui.name.label "Name">
 <!ENTITY staff.circ.print_list.top_ui.name.accesskey "N">
 <!ENTITY staff.circ.print_list.top_ui.type.label "Type">
+<!ENTITY staff.circ.print_list.top_ui.context.label "Force Context">
 <!ENTITY staff.circ.print_list.top_ui.actions.label "Actions">
 <!ENTITY staff.circ.print_list.top_ui.preview.label "Preview">
 <!ENTITY staff.circ.print_list.top_ui.preview.accesskey "P">
diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
index 0dda428..d6e79a7 100644
--- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
+++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
@@ -343,6 +343,16 @@ OpenILS.data.prototype = {
                 'holds', 
                 /* 'patrons' */
             ];
+            // We define this for the benefit of the editor.
+            // We don't assign them here, leaving that to the user.
+            // Without one assigned per template the context the util.print was created with will be used instead.
+            obj.print_list_contexts = [
+                'default',
+                'receipt',
+                'label',
+                'mail',
+                'offline',
+            ]; 
             obj.print_list_templates = { 
                 'item_status' : {
                     'type' : 'items',
diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js
index 399e61b..414c8d7 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -227,6 +227,7 @@ util.print.prototype = {
         }
         var cols = [];
         var s = '';
+        if (params.context) this.set_context(params.context);
         if (params.header) s += this.template_sub( params.header, cols, params );
         if (params.list) {
             // Pre-templating sort
@@ -303,6 +304,7 @@ util.print.prototype = {
         } else {
             this.simple(s,params);
         }
+        if(this.context != this.default_context) this.set_context(this.default_context);
     },
 
     'template_sub' : function( msg, cols, params ) {
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
index 9dc89df..a9e3137 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
@@ -626,6 +626,7 @@ cat.copy_buckets.prototype = {
                                         'footer' : data.print_list_templates.item_status.footer,
                                         'type' : data.print_list_templates.item_status.type,
                                         'list' : obj.list2.dump_with_keys(),
+                                        'context' : data.print_list_templates.item_status.context,
                                     };
                                     JSAN.use('util.print'); var print = new util.print();
                                     print.tree_list( p );
diff --git a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
index f7b3916..c4d461f 100644
--- a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
+++ b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
@@ -109,6 +109,7 @@ circ.print_list_template_editor.prototype = {
                 obj.controller.view.header.value = tmp.header;
                 obj.controller.view.line_item.value = tmp.line_item;
                 obj.controller.view.footer.value = tmp.footer;
+                obj.controller.view.template_context_menu.value = tmp.context;
                 obj.preview();
             }, 0
         );
@@ -310,6 +311,7 @@ circ.print_list_template_editor.prototype = {
                                             obj.controller.view.header.value = tmp.header;
                                             obj.controller.view.line_item.value = tmp.line_item;
                                             obj.controller.view.footer.value = tmp.footer;
+                                            obj.controller.view.template_context_menu.value = tmp.context;
                                             obj.preview();
                                         },
                                         false
@@ -335,8 +337,29 @@ circ.print_list_template_editor.prototype = {
                                     obj.controller.view.template_type_menu = ml;
                                 }
                             }
+                        ],
+                        'template_context_menu_placeholder' : [
+                            ['render'],
+                            function(e) {
+                                return function() {
+                                    JSAN.use('util.widgets'); JSAN.use('util.functional');
+                                    util.widgets.remove_children(e);
+                                    var ml = util.widgets.make_menulist(
+                                        [['',null]].concat(
+                                            util.functional.map_list(
+                                                obj.data.print_list_contexts,
+                                                function(o) { return [o,o]; }
+                                            )
+                                        )
+                                    );
+                                    ml.setAttribute('id','template_context_menu');
+                                    e.appendChild(ml);
+                                    obj.controller.view.template_context_menu = ml;
+                                }
+                            }
                         ]
 
+
                     }
                 }
             );
@@ -378,6 +401,7 @@ circ.print_list_template_editor.prototype = {
         obj.data.print_list_templates[name].line_item = obj.controller.view.line_item.value;
         obj.data.print_list_templates[name].footer = obj.controller.view.footer.value;
         obj.data.print_list_templates[name].type = obj.controller.view.template_type_menu.value;
+        obj.data.print_list_templates[name].context = obj.controller.view.template_context_menu.value;
         obj.data.stash( 'print_list_templates' );
         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         JSAN.use('util.file'); var file = new util.file('print_list_templates');
diff --git a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.xul b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.xul
index 534b16c..0450cfa 100644
--- a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.xul
+++ b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.xul
@@ -82,6 +82,8 @@
                 <hbox>
                     <label value="&staff.circ.print_list.top_ui.type.label;" />
                     <hbox id="template_type_menu_placeholder" />
+                    <label value="&staff.circ.print_list.top_ui.context.label;" />
+                    <hbox id="template_context_menu_placeholder" />
                 </hbox>
             </groupbox>
             <groupbox orient="horizontal">
diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index de7f0e3..c692edd 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -3043,7 +3043,8 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                                     'footer' : data.print_list_templates[ template ].footer,
                                     'type' : data.print_list_templates[ template ].type,
                                     'list' : print_list,
-                                    'data' : print_data
+                                    'data' : print_data,
+                                    'context' : data.print_list_templates[ template ].context,
                                 };
                                 if ($('printer_prompt')) {
                                     if (! $('printer_prompt').checked) { parms.no_prompt = true; }
@@ -3448,7 +3449,8 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                             'footer' : data.print_list_templates[ template ].footer,
                             'type' : data.print_list_templates[ template ].type,
                             'list' : print_list,
-                            'data' : print_data 
+                            'data' : print_data,
+                            'context' : data.print_list_templates[ template ].context,
                         };
                         if ($('printer_prompt')) {
                             if (! $('printer_prompt').checked) { parms.no_prompt = true; }
diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js
index 6ee86cf..567dffb 100644
--- a/Open-ILS/xul/staff_client/server/patron/bill2.js
+++ b/Open-ILS/xul/staff_client/server/patron/bill2.js
@@ -866,7 +866,8 @@ function apply_payment() {
                             };
                         }
                     ),
-                    'data' : g.previous_summary
+                    'data' : g.previous_summary,
+                    'context' : g.data.print_list_templates[template].context,
                 };
                 g.error.sdump('D_DEBUG',js2JSON(params));
                 if ($('printer_prompt').hasAttribute('checked')) {

commit ae137e7bee9990aa4ed12bff384de42d08fe8f8b
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Dec 19 17:08:09 2011 -0500

    Make Reprint Last printing context aware
    
    Allows for re-use of previous printer context and all settings thereof.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js
index b64d207..399e61b 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -11,18 +11,11 @@ util.print = function (context) {
     JSAN.use('util.functional');
     JSAN.use('util.file');
 
-    this.context = context || 'default';
-
-    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
-    var key = 'oils.printer.external.cmd.' + this.context;
-    var has_key = prefs.prefHasUserValue(key);
-    if(!has_key && this.context != 'default') {
-        key = 'oils.printer.external.cmd.default';
-        has_key = prefs.prefHasUserValue(key);
-    }
-    this.oils_printer_external_cmd = has_key ? prefs.getCharPref(key) : '';
+    this.set_context(context, true);
 
     try {
+        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+
         if (prefs.prefHasUserValue('print.always_print_silent')) {
             if (! prefs.getBoolPref('print.always_print_silent')) {
                 prefs.clearUserPref('print.always_print_silent');
@@ -37,6 +30,22 @@ util.print = function (context) {
 
 util.print.prototype = {
 
+    'set_context' : function(context, set_default) {
+        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+        this.context = context || 'default';
+        if(set_default) this.default_context = this.context;
+    
+        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+        var key = 'oils.printer.external.cmd.' + this.context;
+        var has_key = prefs.prefHasUserValue(key);
+        if(!has_key && this.context != 'default') {
+            key = 'oils.printer.external.cmd.default';
+            has_key = prefs.prefHasUserValue(key);
+        }
+        this.oils_printer_external_cmd = has_key ? prefs.getCharPref(key) : '';
+    },
+
     'reprint_last' : function() {
         try {
             var obj = this; obj.data.init({'via':'stash'});
@@ -46,12 +55,14 @@ util.print.prototype = {
                 );
                 return;
             }
+            if(obj.data.last_print.context) this.set_context(obj.data.last_print.context);
             var msg = obj.data.last_print.msg;
             var params = obj.data.last_print.params; params.no_prompt = false;
             obj.simple( msg, params );
         } catch(E) {
             this.error.standard_unexpected_error_alert('util.print.reprint_last',E);
         }
+        if(this.context != this.default_context) this.set_context(this.default_context);
     },
 
     'html2txt' : function(html) {

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    1 +
 .../staff_client/chrome/content/OpenILS/data.js    |   10 ++++++
 .../xul/staff_client/chrome/content/util/print.js  |   33 ++++++++++++++------
 .../xul/staff_client/server/cat/copy_buckets.js    |    1 +
 .../server/circ/print_list_template_editor.js      |   24 ++++++++++++++
 .../server/circ/print_list_template_editor.xul     |    2 +
 Open-ILS/xul/staff_client/server/circ/util.js      |    6 ++-
 Open-ILS/xul/staff_client/server/patron/bill2.js   |    3 +-
 8 files changed, 67 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list