re-arrange the button bar in the patron display
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Mar 2009 04:39:41 +0000 (04:39 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Mar 2009 04:39:41 +0000 (04:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12412 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/display.xul
Open-ILS/xul/staff_client/server/patron/display_overlay.xul
Open-ILS/xul/staff_client/server/patron/info.xul [deleted file]

index 53f8888..065767f 100644 (file)
 <!ENTITY staff.patron_navbar.edit.accesskey 'E'>
 <!ENTITY staff.patron_navbar.holds 'Holds'>
 <!ENTITY staff.patron_navbar.holds.accesskey 'H'>
-<!ENTITY staff.patron_navbar.info 'Display Info'>
-<!ENTITY staff.patron_navbar.info.accesskey 'o'>
 <!ENTITY staff.patron_navbar.alert 'Display Alert and Messages'>
 <!ENTITY staff.patron_navbar.alert.accesskey 'A'>
 <!ENTITY staff.patron_navbar.other 'Other'>
 <!ENTITY staff.patron_navbar.retrieve.accesskey 'R'>
 <!ENTITY staff.patron_navbar.actions.menu.label 'Actions for this Patron'>
 <!ENTITY staff.patron_navbar.actions.menu.accesskey 'A'>
-<!ENTITY staff.patron_navbar.actions.menu.standing_penalties.label 'Modify Blocks/Standing Penalties'>
+<!ENTITY staff.patron_navbar.actions.menu.standing_penalties.label 'Messages'>
 <!ENTITY staff.patron_navbar.actions.menu.standing_penalties.accesskey 'M'>
 <!ENTITY staff.patron_register_interface_label "New Patron">
 <!ENTITY staff.patron_search_form.caption 'Search for Patron'>
index 1332819..c8eff26 100644 (file)
@@ -298,7 +298,6 @@ const urls = {
        'XUL_PATRON_EDIT' : '/xul/server/patron/ue.xhtml',
        'XUL_USER_PERM_EDITOR' : '/xul/server/patron/user_edit.xhtml',
        'XUL_PATRON_HOLDS' : '/xul/server/patron/holds.xul',
-       'XUL_PATRON_INFO' : '/xul/server/patron/info.xul',
        'XUL_PATRON_INFO_NOTES' : '/xul/server/patron/info_notes.xul',
        'XUL_PATRON_INFO_STAT_CATS' : '/xul/server/patron/info_stat_cats.xul',
        'XUL_PATRON_INFO_SURVEYS' : '/xul/server/patron/info_surveys.xul',
index 6ffec36..e58ead9 100644 (file)
@@ -274,11 +274,53 @@ patron.display.prototype = {
                             try { document.getElementById('PatronNavBar_other').firstChild.showPopup(); } catch(E) {};
                         }
                     ],
-                                       'cmd_patron_info' : [
+                                       'cmd_patron_info_notes' : [
                                                ['command'],
                                                function(ev) {
                                                        obj.right_deck.set_iframe(
-                                                               urls.XUL_PATRON_INFO, // + '?patron_id=' + window.escape( obj.patron.id() ),
+                                urls.XUL_PATRON_INFO_NOTES,
+                                                               {},
+                                                               {
+                                                                       'patron_id' : obj.patron.id(),
+                                                                       'url_prefix' : xulG.url_prefix,
+                                                                       'new_tab' : xulG.new_tab
+                                                               }
+                                                       );
+                                               }
+                                       ],
+                                       'cmd_patron_info_stats' : [
+                                               ['command'],
+                                               function(ev) {
+                                                       obj.right_deck.set_iframe(
+                                urls.XUL_PATRON_INFO_STAT_CATS,
+                                                               {},
+                                                               {
+                                                                       'patron_id' : obj.patron.id(),
+                                                                       'url_prefix' : xulG.url_prefix,
+                                                                       'new_tab' : xulG.new_tab
+                                                               }
+                                                       );
+                                               }
+                                       ],
+                                       'cmd_patron_info_surveys' : [
+                                               ['command'],
+                                               function(ev) {
+                                                       obj.right_deck.set_iframe(
+                                urls.XUL_PATRON_INFO_SURVEYS,
+                                                               {},
+                                                               {
+                                                                       'patron_id' : obj.patron.id(),
+                                                                       'url_prefix' : xulG.url_prefix,
+                                                                       'new_tab' : xulG.new_tab
+                                                               }
+                                                       );
+                                               }
+                                       ],
+                                       'cmd_patron_info_groups' : [
+                                               ['command'],
+                                               function(ev) {
+                                                       obj.right_deck.set_iframe(
+                                urls.XUL_PATRON_INFO_GROUP,
                                                                {},
                                                                {
                                                                        'patron_id' : obj.patron.id(),
@@ -402,6 +444,8 @@ patron.display.prototype = {
                         ['command'],
                         function() {
                             function penalty_interface() {
+                                try { document.getElementById("PatronNavBarScrollbox").ensureElementIsVisible( document.getElementById("PatronNavBar_messages" ) ); } catch(E) {};
+                                                           obj.reset_nav_styling('cmd_standing_penalties');
                                 return obj.right_deck.reset_iframe(
                                     urls.XUL_STANDING_PENALTIES,
                                     {},
@@ -434,7 +478,7 @@ patron.display.prototype = {
         x.addEventListener( 'focus', function(xx) { return function() { try { document.getElementById("PatronNavBarScrollbox").ensureElementIsVisible(xx); } catch(E) {}; } }(x), false);
         var x = document.getElementById("PatronNavBar_bills");
         x.addEventListener( 'focus', function(xx) { return function() { try { document.getElementById("PatronNavBarScrollbox").ensureElementIsVisible(xx); } catch(E) {}; } }(x), false);
-        var x = document.getElementById("PatronNavBar_exit");
+        var x = document.getElementById("PatronNavBar_messages");
         x.addEventListener( 'focus', function(xx) { return function() { try { document.getElementById("PatronNavBarScrollbox").ensureElementIsVisible(xx); } catch(E) {}; } }(x), false);
 
                if (obj.barcode || obj.id) {
@@ -605,6 +649,7 @@ patron.display.prototype = {
             this.controller.view.cmd_patron_other.setAttribute('style','');
             this.controller.view.cmd_patron_holds.setAttribute('style','');
             this.controller.view.cmd_patron_bills.setAttribute('style','');
+            this.controller.view.cmd_standing_penalties.setAttribute('style','');
             this.controller.view[ btn ].setAttribute('style','background: blue; color: white;');
         } catch(E) {
             alert(E);
index 1acc79c..98cfa6c 100644 (file)
                <command id="cmd_patron_holds" />
                <command id="cmd_patron_bills" />
                <command id="cmd_patron_edit" />
-               <command id="cmd_patron_info" />
+               <command id="cmd_patron_info_notes" />
+               <command id="cmd_patron_info_stats" />
+               <command id="cmd_patron_info_surveys" />
+               <command id="cmd_patron_info_groups" />
                <command id="cmd_patron_other" />
                <command id="cmd_patron_alert" />
                <command id="cmd_patron_exit" />
index 4fd6979..594a2e3 100644 (file)
                                 label="&staff.patron_navbar.bills;" accesskey="&staff.patron_navbar.bills.accesskey;"/>
                             <button id="PatronNavBar_edit" command="cmd_patron_edit" class="nav"
                                 label="&staff.patron_navbar.edit;" accesskey="&staff.patron_navbar.edit.accesskey;"/>
+                            <button id="PatronNavBar_messages" label="&staff.patron_navbar.actions.menu.standing_penalties.label;" accesskey="&staff.patron_navbar.actions.menu.standing_penalties.accesskey;" command="cmd_standing_penalties" class="nav"/>
                             <button id="PatronNavBar_other" command="cmd_patron_other" class="nav" label="&staff.patron_navbar.other;" accesskey="&staff.patron_navbar.other.accesskey;" type="menu">
                                 <menupopup>
                                     <menuitem label="&staff.patron_navbar.alert;" accesskey="&staff.patron_navbar.alert.accesskey;" command="cmd_patron_alert"/>
-                                    <menuitem label="&staff.patron_navbar.info;" conflicting_accesskey="&staff.patron_navbar.info.accesskey;" command="cmd_patron_info"/>
+                                    <menuitem label="&staff.patron.info.notes.label;" accesskey="&staff.patron.info.notes.accesskey;" command="cmd_patron_info_notes"/>
+                                    <menuitem label="&staff.patron.info.stat_cats.label;" accesskey="&staff.patron.info.stat_cats.accesskey;" command="cmd_patron_info_stats"/>
+                                    <menuitem label="&staff.patron.info.surveys.label;" accesskey="&staff.patron.info.surveys.accesskey;" command="cmd_patron_info_surveys"/>
+                                    <menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
                                     <menuitem label="&staff.patron_display.verify_password.label;" accesskey="&staff.patron_display.verify_password.accesskey;" command="cmd_verify_credentials"/>
                                     <menuitem label="&staff.main.menu.admin.user_edit.label;" accesskey="&staff.main.menu.admin.user_edit.accesskey;" command="cmd_perm_editor"/>
-                                    <menuitem label="&staff.patron_navbar.actions.menu.standing_penalties.label;" accesskey="&staff.patron_navbar.actions.menu.standing_penalties.accesskey;" 
-                                        command="cmd_standing_penalties"/>
+                                    <menuitem label="&staff.patron.display_overlay.exit.label;" accesskey="&staff.patron.display_overlay.exit.accesskey;" command="cmd_patron_exit"/>
                                 </menupopup>
                             </button>
-                            <button id="PatronNavBar_exit" command="cmd_patron_exit" class="nav"
-                                label="&staff.patron.display_overlay.exit.label;" accesskey="&staff.patron.display_overlay.exit.accesskey;"/>
                         </row>
                         <row>
                             <label id="under_refresh"/>
diff --git a/Open-ILS/xul/staff_client/server/patron/info.xul b/Open-ILS/xul/staff_client/server/patron/info.xul
deleted file mode 100644 (file)
index 07e2432..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Patron Display -->
-
-<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-<!-- STYLESHEETS -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
-<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
-<?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
-
-<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-<!-- LOCALIZATION -->
-<!DOCTYPE window PUBLIC "" ""[
-       <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
-]>
-
-<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-<!-- OVERLAYS -->
-<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
-
-<window id="patron_info_win" width="700" height="550"
-       onload="try{ my_init(); font_helper(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
-       <!-- BEHAVIOR -->
-        <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
-        <scripts id="openils_util_scripts"/>
-
-       <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
-       <script>
-       <![CDATA[
-
-               // FIXME - change this to load each tab/sub-interface as needed and not all at once
-
-               function $(id) { return document.getElementById(id); }
-
-               function my_init() {
-                       try {
-                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                               if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
-                               JSAN.errorLevel = "die"; // none, warn, or die
-                               JSAN.addRepository('/xul/server/');
-
-                               JSAN.use('util.error'); g.error = new util.error();
-                               JSAN.use('util.network'); g.network = new util.network();
-                               JSAN.use('util.date'); JSAN.use('util.money'); 
-                               JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
-
-                               g.error.sdump('D_TRACE','my_init() for patron_info.xul');
-
-                               g.patron_id = xul_param('patron_id');
-
-                               try{
-                    var np = $('notes_panel'); while (np.firstChild) np.deleteChild(np.lastChild);
-                    var notes_frame = document.createElement('iframe'); np.appendChild(notes_frame);
-                                       notes_frame.setAttribute('src',urls.XUL_PATRON_INFO_NOTES); 
-                                       notes_frame.setAttribute('flex','1');
-                                       get_contentWindow(notes_frame).xulG = 
-                                               { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
-                               }catch(E){alert(E);}
-                               try{
-                                       var scp = $('stat_cats_panel'); while (scp.firstChild) scp.deleteChild(scp.lastChild);
-                    var stat_cats_frame = document.createElement('iframe'); scp.appendChild(stat_cats_frame);
-                    stat_cats_frame.setAttribute('src',urls.XUL_PATRON_INFO_STAT_CATS);
-                    stat_cats_frame.setAttribute('flex','1');
-                                       get_contentWindow(stat_cats_frame).xulG = 
-                                               { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
-                               }catch(E){alert(E);}
-                               try{
-                    var sp = $('surveys_panel'); while (sp.firstChild) sp.deleteChild(sp.lastChild);
-                    var surveys_frame = document.createElement('iframe'); sp.appendChild(surveys_frame);
-                                       surveys_frame.setAttribute('src',urls.XUL_PATRON_INFO_SURVEYS);
-                                       surveys_frame.setAttribute('flex','1');
-                                       get_contentWindow(surveys_frame).xulG = 
-                                               { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
-                               }catch(E){alert(E);}
-                               try{
-                    var gp = $('group_panel'); while (gp.firstChild) gp.deleteChild(gp.lastChild);
-                    var group_frame = document.createElement('iframe'); gp.appendChild(group_frame);
-                                       group_frame.setAttribute('src',urls.XUL_PATRON_INFO_GROUP);
-                                       group_frame.setAttribute('flex','1');
-                                       get_contentWindow(group_frame).xulG = 
-                                               { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
-                               }catch(E){alert(E);}
-
-                       } catch(E) {
-                               var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/info.xul', E]);
-                               try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
-                               alert(err_msg);
-                       }
-               }
-
-               function refresh() {
-                       try {
-                               netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-                               for (var i in [ 'notes_frame', 'stat_cats_frame', 'surveys_frame', 'group_frame' ]) {
-                                       if (get_contentWindow($(i)) && typeof get_contentWindow($(i)).refresh == 'function') {
-                                               get_contentWindow($(i)).refresh();
-                                       }
-                               }
-                       } catch(E) {
-                               alert(E);
-                       }
-               }
-
-       ]]>
-       </script>
-
-       <vbox flex="1" class="my_overflow2">
-               <tabbox flex="1" orient="horizontal">
-                       <tabs orient="vertical" class="tabs-left">
-                               <tab accesskey="&staff.patron.info.notes.accesskey;" label="&staff.patron.info.notes.label;"/>
-                               <tab accesskey="&staff.patron.info.stat_cats.accesskey;" label="&staff.patron.info.stat_cats.label;"/>
-                               <tab accesskey="&staff.patron.info.surveys.accesskey;" label="&staff.patron.info.surveys.label;"/>
-                               <tab accesskey="&staff.patron.info.group.accesskey;" label="&staff.patron.info.group.label;"/>
-                               <tab label=" " disabled="true" linkedpanel="notes_panel" flex="1"/>
-                               <tab label=" " disabled="true" linkedpanel="notes_panel" flex="1"/>
-                               <tab label=" " disabled="true" linkedpanel="notes_panel" flex="1"/>
-                               <tab label=" " disabled="true" linkedpanel="notes_panel" flex="1"/>
-                       </tabs>
-                       <tabpanels flex="1">
-                               <tabpanel id="notes_panel" orient="vertical" />
-                               <tabpanel id="stat_cats_panel" orient="vertical" />
-                               <tabpanel id="surveys_panel" orient="vertical" />
-                               <tabpanel id="group_panel" orient="vertical" />
-                       </tabpanels>
-               </tabbox>
-       </vbox>
-
-
-</window>
-