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

Evergreen Git git at git.evergreen-ils.org
Mon Oct 17 13:51:11 EDT 2011


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  c3ada14743a66e686f1ae5b2579c3a3b027739c9 (commit)
       via  552003348b8401db102b971c0dc7df1a838faf99 (commit)
      from  4cdaec700215f07cf3bf35c8f09fb6dc347c0b4e (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 c3ada14743a66e686f1ae5b2579c3a3b027739c9
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Sep 14 13:58:27 2011 -0400

    Save MARC Default Template per-server
    
    In case you use multiple servers with different template lists
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/xul/staff_client/server/cat/marc_new.xul b/Open-ILS/xul/staff_client/server/cat/marc_new.xul
index 859f410..7a9209d 100644
--- a/Open-ILS/xul/staff_client/server/cat/marc_new.xul
+++ b/Open-ILS/xul/staff_client/server/cat/marc_new.xul
@@ -66,7 +66,7 @@
                 if (typeof templates.ilsevent != 'undefined') throw(templates);
                 var default_template;
                 g.prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
-                var default_template_key = 'oils.marc_new.default_template';
+                var default_template_key = 'oils.marc_new.default_template.' + window.location.hostname;
                 if(g.data.last_marc_template) default_template = g.data.last_marc_template;
                 if(!default_template) {
                     var has_key = g.prefs.prefHasUserValue(default_template_key);

commit 552003348b8401db102b971c0dc7df1a838faf99
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Sep 14 13:37:27 2011 -0400

    Remember MARC Template selection
    
    Implement both a workstation default and "last used" for the MARC template
    selector.
    
    Workstation default is set with a new "Set Workstation Default" button.
    
    "Last used" will override the workstation default, and is updated every
    time you load a template. It is forgotten when you close the client.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 4714957..741b58d 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -2772,6 +2772,8 @@
 <!ENTITY staff.cat.marcedit.source.submit.label "Update source">
 <!ENTITY staff.cat.marc_new.load.label "Load">
 <!ENTITY staff.cat.marc_new.load.accesskey "L">
+<!ENTITY staff.cat.marc_new.set_default.label "Set Workstation Default">
+<!ENTITY staff.cat.marc_new.set_default.accesskey "S">
 <!ENTITY staff.cat.marc_view.title "MARC View">
 <!ENTITY staff.cat.opac.menuitem.opacview.label "OPAC View">
 <!ENTITY staff.cat.opac.menuitem.opacview.accesskey "O">
diff --git a/Open-ILS/xul/staff_client/server/cat/marc_new.xul b/Open-ILS/xul/staff_client/server/cat/marc_new.xul
index 633d047..859f410 100644
--- a/Open-ILS/xul/staff_client/server/cat/marc_new.xul
+++ b/Open-ILS/xul/staff_client/server/cat/marc_new.xul
@@ -64,13 +64,21 @@
 
                 var templates = g.network.simple_request('MARC_XML_TEMPLATE_LIST',[]);
                 if (typeof templates.ilsevent != 'undefined') throw(templates);
+                var default_template;
+                g.prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+                var default_template_key = 'oils.marc_new.default_template';
+                if(g.data.last_marc_template) default_template = g.data.last_marc_template;
+                if(!default_template) {
+                    var has_key = g.prefs.prefHasUserValue(default_template_key);
+                    if(has_key) default_template = g.prefs.getCharPref(default_template_key);
+                }
                 var ml = util.widgets.make_menulist(
                     util.functional.map_list(
                         templates.sort(),
                         function(el) {
                             return [ el /* The menu entry label */, el /* The menu entry value */ ];
                         }
-                    )
+                    ), default_template
                 );
                 $('menu_placeholder').appendChild(ml);
 
@@ -87,7 +95,11 @@
                                 [ template_name ]
                             );
                             if (typeof marc.ilsevent != 'undefined') throw(marc);
-    
+
+                            g.data.stash_retrieve();
+                            g.data.last_marc_template = template_name;
+                            g.data.stash('last_marc_template');
+
                             var url = urls.XUL_MARC_EDIT;
                             var params = {
                                 'record' : { 'marc' : marc },
@@ -164,6 +176,24 @@
                     false
                 );
 
+                $('set_default').addEventListener(
+                    'command',
+                    function(ev) {
+                        var template_name;
+                        try {
+                            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                            template_name = $('menu_placeholder').firstChild.value;
+                            g.prefs.setCharPref(default_template_key, template_name);
+                            alert(catStrings.getFormattedString('staff.cat.marc_new.set_default.success', [template_name]));
+                        } catch (E) {
+                            g.error.standard_unexpected_error_alert(
+                                catStrings.getFormattedString('staff.cat.marc_new.set_default.error', [template_name]), E
+                            );
+                        }
+                    },
+                    false
+                );
+
             } catch(E) {
                 g.error.standard_unexpected_error_alert('cat/marc_new.xul',E);
             }
@@ -179,6 +209,7 @@
         <hbox id="actions">
             <hbox id="menu_placeholder" />
             <button id="load" label="&staff.cat.marc_new.load.label;" accesskey="&staff.cat.marc_new.load.accesskey;"/>
+            <button id="set_default" label="&staff.cat.marc_new.set_default.label;" accesskey="&staff.cat.marc_new.set_default.accesskey;"/>
         </hbox>
     </vbox>
 
diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
index 79807a5..3e8b411 100644
--- a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
+++ b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
@@ -274,6 +274,8 @@ staff.cat.marc_new.system_local.label=System Local
 staff.cat.marc_new.retrieving.label=Retrieving title...
 staff.cat.marc_new.creating_record.error=Error creating MARC record.
 staff.cat.marc_new.loading_template.error=Error loading MARC template: %1$s
+staff.cat.marc_new.set_default.error=Error setting default MARC template: %1$s
+staff.cat.marc_new.set_default.success=Default template set to %1$s
 staff.cat.opac.set_marc_edit.alert=Record successfully saved.
 staff.cat.opac.set_marc_edit.std_unexpected_error=Record not likely updated.
 staff.cat.opac.refresh.function_not_implemented.alert=Not yet implemented.  Work around: Choose Duplicate in New Tab option

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

Summary of changes:
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    2 +
 Open-ILS/xul/staff_client/server/cat/marc_new.xul  |   35 ++++++++++++++++++-
 .../server/locale/en-US/cat.properties             |    2 +
 3 files changed, 37 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list