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

Evergreen Git git at git.evergreen-ils.org
Thu Sep 22 00:09:21 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  e0d8dbf11299207399fd471afeca45cd1bb8346b (commit)
       via  cedf3685e166614a7c4fe68b60ac1ae950f88c82 (commit)
      from  760b324ab8e9db5dcef03d3b8fff819eb17417ae (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 e0d8dbf11299207399fd471afeca45cd1bb8346b
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Sep 21 13:25:38 2011 -0400

    Add Toggle option to portal for TPac use
    
    In testing I didn't have to restart the staff client, but as constants.js
    is loaded pretty much everywhere I have no clue where the URL array may
    be stale.
    
    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 16b3325..a63abdf 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -3642,6 +3642,9 @@
 <!ENTITY staff.client.portal.receipts "Edit Receipt Templates">
 <!ENTITY staff.client.portal.copyright "Copyright &copy; 2006-2011 Georgia Public Library Service, and others">
 <!ENTITY staff.client.portal.poweredby "Powered by">
+<!ENTITY staff.client.portal.toggle_tpac "Toggle Template Toolkit OPAC Use">
+<!ENTITY staff.client.portal.toggle_tpac.message_on "The use of the Template Toolkit OPAC has been enabled. You may need to restart the staff client for this to take effect.">
+<!ENTITY staff.client.portal.toggle_tpac.message_off "The use of the Template Toolkit OPAC has been disabled. You may need to restart the staff client for this to take effect.">
 <!ENTITY staff.item.batch.hold.groupbox_caption "Request Details">
 <!ENTITY staff.item.batch.hold.hold_type_menu.label "Hold Type">
 <!ENTITY staff.item.batch.hold.hold_type_menu.accesskey "T">
diff --git a/Open-ILS/xul/staff_client/server/index.xhtml b/Open-ILS/xul/staff_client/server/index.xhtml
index 0068c4d..b60be0d 100644
--- a/Open-ILS/xul/staff_client/server/index.xhtml
+++ b/Open-ILS/xul/staff_client/server/index.xhtml
@@ -257,6 +257,24 @@
                         else
                                 xulG.set_tab(loc, {}, content_params);
                 }
+                function toggle_tpac(mode) {
+                    var use_tpac = false;
+                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+                    try {
+                        use_tpac = prefs.getBoolPref('oils.use_tpac');
+                    } catch (E) {
+                        dump('Failed to get current use_tpac setting - Assuming false: ' + E);
+                    }
+                    use_tpac = !use_tpac;
+                    prefs.setBoolPref('oils.use_tpac', use_tpac);
+                    var message = document.getElementById('tpac_toggled_on');
+                    if(!use_tpac) {
+                        message = document.getElementById('tpac_toggled_off');
+                    }
+                    message = message.textContent;
+                    alert(message);
+                }
                 // ]]>
   </script>
   <style type="text/css">
@@ -547,8 +565,18 @@
               "#" onclick=
               "try { receipt_editor(false); } catch(E) { alert(E); }; return false;">&staff.client.portal.receipts;</a></td>
             </tr>
+
+            <tr>
+              <td height="50"><img src="skin/media/images/portal/book.png" height="48" width="48"
+              onclick="try { toggle_tpac(); } catch(E) { alert(E) }; return false;" alt="&staff.client.portal.toggle_tpac;" /></td>
+
+              <td><a href="#"
+              onclick="try { toggle_tpac(); } catch(E) { alert(E); }; return false;">&staff.client.portal.toggle_tpac;</a></td>
+            </tr>
           </table>
         </div>
+        <span style="display:none" id="tpac_toggled_on">&staff.client.portal.toggle_tpac.message_on;</span>
+        <span style="display:none" id="tpac_toggled_off">&staff.client.portal.toggle_tpac.message_off;</span>
       </td>
     </tr>
   </table>

commit cedf3685e166614a7c4fe68b60ac1ae950f88c82
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Sep 21 11:35:24 2011 -0400

    Create preference for opac used in staff client
    
    If enabled use the TPac. Otherwise JSPac.
    
    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/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index 257dea7..6e2391c 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -13,9 +13,9 @@ dump('Loading constants.js\n');
 
 /* Get locale from preferences */
 var LOCALE = '';
+netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
 try {
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-    var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
     LOCALE = pref.getCharPref('general.useragent.locale');
 } catch (E) {
     dump("Failed to fetch a locale from preferences: " + E + "\n");
@@ -26,6 +26,13 @@ if (!LOCALE) {
     LOCALE = 'en-US';
 }
 
+var use_tpac = false;
+try {
+    use_tpac = pref.getBoolPref('oils.use_tpac');
+} catch (E) {
+    dump("Failed to get TPac preference: " + E + "\n");
+}
+
 const MODE_RDONLY   = 0x01;
 const MODE_WRONLY   = 0x02;
 const MODE_CREATE   = 0x08;
@@ -502,3 +509,11 @@ var urls = {
     'EG_ACQ_USER_REQUESTS' : '/eg/acq/picklist/user_request',
     'XUL_SERIAL_BATCH_RECEIVE': '/xul/server/serial/batch_receive.xul'
 }
+
+if(use_tpac) {
+    urls['opac'] = '/eg/opac/advanced';
+    urls['opac_rdetail'] = '/eg/opac/record/';
+    urls['opac_rresult'] = '/eg/opac/results';
+    urls['opac_rresult_metarecord'] = '/eg/opac/results?metarecord=';
+    urls['browser'] = urls.opac;
+}
diff --git a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
index 19dcd2a..3870af4 100644
--- a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
+++ b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
@@ -26,3 +26,6 @@ pref("open-ils.menu.toolbar.iconsize", "");
 pref("open-ils.menu.toolbar.mode", "");
 pref("open-ils.menu.toolbar.labelbelow", false);
 pref("open-ils.toolbar.defaultnewtab", false);
+
+// Template Toolkit Opac Enabled in Staff Client
+pref("oils.use_tpac", false);

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

Summary of changes:
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    3 ++
 .../staff_client/chrome/content/main/constants.js  |   19 ++++++++++++-
 .../xul/staff_client/defaults/preferences/prefs.js |    3 ++
 Open-ILS/xul/staff_client/server/index.xhtml       |   28 ++++++++++++++++++++
 4 files changed, 51 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list