[open-ils-commits] r14106 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/server/locale/en-US xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Sep 22 18:40:08 EDT 2009


Author: phasefx
Date: 2009-09-22 18:40:01 -0400 (Tue, 22 Sep 2009)
New Revision: 14106

Removed:
   trunk/Open-ILS/xul/staff_client/server/patron/hold_notices.xul
Modified:
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
   trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js
   trunk/Open-ILS/xul/staff_client/server/patron/hold_details.xul
   trunk/Open-ILS/xul/staff_client/server/patron/holds.js
   trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
This completes the morphing of the Hold Notifications interface into a dual Notes/Notifications interface, and embeds it into the Holds list with a Detail View/List View toggle.



Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2009-09-22 22:40:01 UTC (rev 14106)
@@ -2009,8 +2009,6 @@
 <!ENTITY staff.circ.holds.show_last_few_circulations.accesskey "L">
 <!ENTITY staff.circ.holds.retrieve_patron "Retrieve Patron">
 <!ENTITY staff.circ.holds.retrieve_patron.accesskey "P">
-<!ENTITY staff.circ.holds.show_details "Show Hold Details">
-<!ENTITY staff.circ.holds.show_details.accesskey "N">
 <!ENTITY staff.circ.holds.edit_pickup_library "Edit Pickup Library">
 <!ENTITY staff.circ.holds.edit_pickup_library.accesskey "L">
 <!ENTITY staff.circ.holds.edit_phone_notification "Edit Phone Notification">
@@ -2516,9 +2514,13 @@
 <!ENTITY staff.patron.hold_details.title "Hold Details">
 <!ENTITY staff.patron.hold_notices.add_record_notification.label "Add Record of Notification">
 <!ENTITY staff.patron.hold_notices.add_record_notification.accesskey "A">
-<!ENTITY staff.patron.hold_notices.close_window.label "Close">
-<!ENTITY staff.patron.hold_notices.close_window.accesskey "C">
 <!ENTITY staff.patron.hold_notices.method.label "Method:">
+<!ENTITY staff.patron.holds.notices_tab.label "Notifications">
+<!ENTITY staff.patron.holds.notices_tab.accesskey "N">
+<!ENTITY staff.patron.holds.notes_tab.label "Notes">
+<!ENTITY staff.patron.holds.notes_tab.accesskey "e">
+<!ENTITY staff.patron.holds.add_note.label "Add Note">
+<!ENTITY staff.patron.holds.add_note.accesskey "A">
 <!ENTITY staff.patron.holds_overlay.pickup_lib.label "Pickup Library">
 <!ENTITY staff.patron.holds_overlay.request_lib.label "Requesting Library">
 <!ENTITY staff.patron.holds_overlay.fulfillment_lib.label "Fulfilling Library">

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-09-22 22:40:01 UTC (rev 14106)
@@ -371,3 +371,7 @@
 staff.circ.holds.unexpected_error.not_likely_activated=Holds not likely activated.
 staff.circ.holds.unexpected_error.not_likely_suspended=Holds not likely suspended.
 staff.circ.holds.error.may_not_edit_pickup_lib_for_hold_intransit=You may not edit the pickup library for holds that are in-transit or ready for pickup.
+staff.circ.holds.alt_view.label=Detail View
+staff.circ.holds.alt_view.accesskey=V
+staff.circ.holds.list_view.label=List View
+staff.circ.holds.list_view.accesskey=V

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2009-09-22 22:40:01 UTC (rev 14106)
@@ -87,6 +87,25 @@
 staff.patron.hold_notices.add_notif_record=Add Notification Record
 staff.patron.hold_notices.add_notif_record_accesskey=A
 staff.patron.hold_notices.new_notification.not_created=The notification was not likely created.
+
+staff.patron.hold_notes.tooltiptext=ID: %1$s Hold ID: %2$s Staff ID: %3$s
+staff.patron.hold_notes.new_note=New Note
+staff.patron.hold_notes.title=Title
+staff.patron.hold_notes.body=Note
+staff.patron.hold_notes.public=Public
+staff.patron.hold_notes.private=Private
+staff.patron.hold_notes.print_on_slip=Print on Slip
+staff.patron.hold_notes.no_print_on_slip=No print on Slip
+staff.patron.hold_notes.by_staff=By Staff
+staff.patron.hold_notes.by_patron=By Patron 
+staff.patron.hold_notes.new_note.public=Public?
+staff.patron.hold_notes.new_note.slip=Print on slip?
+staff.patron.hold_notes.cancel=Cancel
+staff.patron.hold_notes.cancel_accesskey=C
+staff.patron.hold_notes.add_note=Add Note
+staff.patron.hold_notes.add_note.accesskey=A
+staff.patron.hold_notes.new_note.not_created=The note was not likely created.
+
 staff.patron.holds.init.hold_num_error=Error retrieving details for hold #%1$s
 staff.patron.holds.show_notifications.error_rendering_notifs=Error rendering or retrieving hold notifications.
 staff.patron.holds.holds_edit_selection_depth.choose_hold_range=Please choose a Hold Range:

Modified: trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js	2009-09-22 22:40:01 UTC (rev 14106)
@@ -1,4 +1,3 @@
-
 function $(id) { return document.getElementById(id); }
 
 function my_init() {
@@ -8,7 +7,6 @@
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('/xul/server/');
 
-
         dojo.require('openils.PermaCrud');
         JSAN.use('util.error'); g.error = new util.error();
         JSAN.use('util.network'); g.network = new util.network();
@@ -17,107 +15,135 @@
 
         g.error.sdump('D_TRACE','my_init() for hold_notices.xul');
 
-        g.ahr_id = xul_param('ahr_id');
+        g.pcrud = new openils.PermaCrud({authtoken :ses()});
 
-        g.ahr = g.network.simple_request('FM_AHR_RETRIEVE',[ ses(), g.ahr_id ]);
-        if (typeof g.ahr.ilsevent != 'undefined') { throw(g.ahr); }
-        g.ahr = g.ahr[0];
+        init_list();
 
-        render_patron();
+        if (xulG.ahr_id) fetch_and_render_all();
 
+    } catch(E) {
+        try { g.error.standard_unexpected_error_alert('/xul/server/patron/hold_notices.xul',E); } catch(E) { alert('FIXME: ' + js2JSON(E)); }
+    }
+}
+
+function fetch_and_render_all() {
+    try {
+        if (!xulG.ahr_id) { alert('boo'); return; }
+
+        fetch_hold();
+
+        if (xulG.patron_rendered_elsewhere) {
+            // Hide patron line
+        } else {
+            render_patron();
+        }
+
         a_list_of_one();
 
         var x = document.getElementById('bib_brief_box'); while (x.firstChild) x.removeChild(x.lastChild);
         var bib_brief = document.createElement('iframe'); x.appendChild(bib_brief);
         bib_brief.setAttribute('flex',1);
-        bib_brief.setAttribute('src',urls.XUL_BIB_BRIEF);
+        bib_brief.setAttribute('src',urls.XUL_BIB_BRIEF); 
         get_contentWindow(bib_brief).xulG = { 'docid' : g.ahr.target() };
 
-        refresh();
+        retrieve_notes(); render_notes();
 
+        retrieve_notifications(); render_notifications();
+
     } catch(E) {
-        try { g.error.standard_unexpected_error_alert('/xul/server/patron/hold_notices.xul',E); } catch(E) { alert('FIXME: ' + js2JSON(E)); }
+        alert('Error in hold_details.js, fetch_and_render_all(): ' + E);
     }
 }
 
+function fetch_hold(id) {
+    try {
+        g.ahr_id = xulG.ahr_id;
+        g.ahr = g.network.simple_request('FM_AHR_RETRIEVE',[ ses(), g.ahr_id ]);
+        if (typeof g.ahr.ilsevent != 'undefined') { throw(g.ahr); }
+        g.ahr = g.ahr[0];
+    } catch(E) {
+        alert('Error in hold_details.js, fetch_hold(): ' + E);
+    }
+}
+
 function render_patron() {
     if (g.ahr.usr()) {
-        JSAN.use('patron.util');
+        JSAN.use('patron.util'); 
         var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.ahr.usr() );
-
-        $('patron_name').setAttribute('value',
-                                      ( au_obj.prefix() ? au_obj.prefix() + ' ' : '') +
-                                      au_obj.family_name() + ', ' +
-                                      au_obj.first_given_name() + ' ' +
-                                      ( au_obj.second_given_name() ? au_obj.second_given_name() + ' ' : '' ) +
-                                      ( au_obj.suffix() ? au_obj.suffix() : '')
-                                      + ' : ' + au_obj.card().barcode()
-                                      );
+        
+        $('patron_name').setAttribute('value', 
+            ( au_obj.prefix() ? au_obj.prefix() + ' ' : '') + 
+            au_obj.family_name() + ', ' + 
+            au_obj.first_given_name() + ' ' +
+            ( au_obj.second_given_name() ? au_obj.second_given_name() + ' ' : '' ) +
+            ( au_obj.suffix() ? au_obj.suffix() : '')
+            + ' : ' + au_obj.card().barcode() 
+        );
     }
 }
 
-function a_list_of_one() {
+function init_list() {
     JSAN.use('circ.util');
-    var columns = circ.util.hold_columns(
-                                         {
-                                             'status' : { 'hidden' : true },
-                                             'request_time' : { 'hidden' : false },
-                                             'pickup_lib_shortname' : { 'hidden' : false },
-                                             'current_copy' : { 'hidden' : false },
-                                             'phone_notify' : { 'hidden' : false },
-                                             'email_notify' : { 'hidden' : false },
-                                         }
-                                          );
+    var columns = circ.util.hold_columns( 
+        { 
+            'status' : { 'hidden' : true },
+            'request_time' : { 'hidden' : false },
+            'pickup_lib_shortname' : { 'hidden' : false },
+            'current_copy' : { 'hidden' : false },
+            'phone_notify' : { 'hidden' : false },
+            'email_notify' : { 'hidden' : false },
+        } 
+    );
     JSAN.use('util.list'); g.list = new util.list('holds_list');
     g.list.init(
-                {
-                    'columns' : columns,
-                        'map_row_to_columns' : circ.util.std_map_row_to_columns(),
-                        'retrieve_row' : function(params) {
-                        var row = params.row;
-                        try {
-                            switch(row.my.ahr.hold_type()) {
-                            case 'M' :
-                                row.my.mvr = g.network.request(
-                                                               api.MODS_SLIM_METARECORD_RETRIEVE.app,
-                                                               api.MODS_SLIM_METARECORD_RETRIEVE.method,
-                                                               [ row.my.ahr.target() ]
-                                                               );
-                                break;
-                            default:
-                                row.my.mvr = g.network.simple_request(
-                                                                      'MODS_SLIM_RECORD_RETRIEVE.authoritative',
-                                                                      [ row.my.ahr.target() ]
-                                                                      );
-                                if (row.my.ahr.current_copy()) {
-                                    row.my.acp = g.network.simple_request( 'FM_ACP_RETRIEVE', [ row.my.ahr.current_copy() ]);
-                                }
-                                break;
+        {
+            'columns' : columns,
+            'map_row_to_columns' : circ.util.std_map_row_to_columns(),
+            'retrieve_row' : function(params) {
+                var row = params.row;
+                try {
+                    switch(row.my.ahr.hold_type()) {
+                        case 'M' :
+                            row.my.mvr = g.network.request(
+                                api.MODS_SLIM_METARECORD_RETRIEVE.app,
+                                api.MODS_SLIM_METARECORD_RETRIEVE.method,
+                                [ row.my.ahr.target() ]
+                            );
+                        break;
+                        default:
+                            row.my.mvr = g.network.simple_request(
+                                'MODS_SLIM_RECORD_RETRIEVE.authoritative',
+                                [ row.my.ahr.target() ]
+                            );
+                            if (row.my.ahr.current_copy()) {
+                                row.my.acp = g.network.simple_request( 'FM_ACP_RETRIEVE', [ row.my.ahr.current_copy() ]);
                             }
-                        } catch(E) {
-                            g.error.sdump('D_ERROR','retrieve_row: ' + E );
-                        }
-                        if (typeof params.on_retrieve == 'function') {
-                            params.on_retrieve(row);
-                        }
-                        return row;
-                    },
-                        }
-                );
-    g.list.append(
-                  {
-                      'row' : {
-                          'my' : {
-                              'ahr' : g.ahr,
-                                  }
-                      },
-                          'no_auto_select' : true,
-                              }
-                  );
+                        break;
+                    }
+                } catch(E) {
+                    g.error.sdump('D_ERROR','retrieve_row: ' + E );
+                }
+                if (typeof params.on_retrieve == 'function') {
+                    params.on_retrieve(row);
+                }
+                return row;
+            },
+        }
+    );
 }
 
-function refresh() {
-    retrieve_notifications(); render_notifications(); retrieve_notes(); render_notes();
+function a_list_of_one() {
+    g.list.clear();
+    g.list.append(
+        {
+            'row' : {
+                'my' : {
+                    'ahr' : g.ahr,
+                }
+            },
+            'no_auto_select' : true,
+        }
+    );
 }
 
 function retrieve_notifications() {
@@ -125,30 +151,21 @@
 }
 
 function retrieve_notes() {
-    try{
-        g.ahr_id = xul_param('ahr_id');
-
-        g.notes = new openils.PermaCrud(
-                                      {
-                                          authtoken :ses()
-                                      }
-                                       ).search('ahrn', {hold:g.ahr_id});
-    }
-    catch(E){alert(E);}
-
+    g.notes = g.pcrud.search('ahrn',{'hold':g.ahr_id});
+    g.notes = g.notes.reverse();
 }
 
 function apply(node,field,value) {
     util.widgets.apply(
-                       node,'name',field,
-                       function(n) {
-                           switch(n.nodeName) {
-                           case 'description' : n.appendChild( document.createTextNode( value ) ); break;
-                           case 'label' : n.value = value; break;
-                           default : n.value = value; break;
-                           }
-                       }
-                       );
+        node,'name',field,
+        function(n) {
+            switch(n.nodeName) {
+                case 'description' : n.appendChild( document.createTextNode( value ) ); break;
+                case 'label' : n.value = value; break;
+                default : n.value = value; break;
+            }
+        }
+    );
 }
 
 function render_notifications() {
@@ -160,13 +177,13 @@
         /* template */
         var node = $('notification_template').cloneNode(true); np.appendChild(node); node.hidden = false;
         util.widgets.apply(node,'name','notify_time',
-                           function(n){
-                               n.setAttribute(
-                                              "tooltiptext",
-                                              $("patronStrings").getFormattedString('staff.patron.hold_notices.tooltiptext',[g.notifications[i].id(), g.notifications[i].hold(), g.notifications[i].notify_staff()])
-                                              );
-                           }
-                           );
+            function(n){
+                n.setAttribute(
+                    "tooltiptext", 
+                    $("patronStrings").getFormattedString('staff.patron.hold_notices.tooltiptext',[g.notifications[i].id(), g.notifications[i].hold(), g.notifications[i].notify_staff()])
+                );
+            }
+        );
         apply(node,'method',g.notifications[i].method() ? g.notifications[i].method() : '');
         apply(node,'note',g.notifications[i].note() ? g.notifications[i].note() : '');
         apply(node,'notify_time',g.notifications[i].notify_time() ? g.notifications[i].notify_time().toString().substr(0,10) : '');
@@ -175,26 +192,32 @@
 }
 
 function render_notes() {
-
     JSAN.use('util.widgets'); util.widgets.remove_children('notes_panel');
-    var notep = $('notes_panel');
+    var np = $('notes_panel');
 
     for (var i = 0; i < g.notes.length; i++) {
 
-        // template
-        var notenode = $('note_template').cloneNode(true); notep.appendChild(notenode); notenode.hidden = false;
+        /* template */
+        var node = $('note_template').cloneNode(true); np.appendChild(node); node.hidden = false;
+        util.widgets.apply(node,'name','create_date',
+            function(n){
+                n.setAttribute(
+                    "tooltiptext", 
+                    $("patronStrings").getFormattedString('staff.patron.hold_notes.tooltiptext',[g.notes[i].id(), g.notes[i].hold(), g.notes[i].staff()])
+                );
+            }
+        );
+        apply(node,'title',g.notes[i].title() ? g.notes[i].title() : '');
+        apply(node,'note',g.notes[i].body() ? g.notes[i].body() : '');
+        //apply(node,'create_date',g.notes[i].create_date() ? g.notes[i].create_date().toString().substr(0,10) : ''); // FIXME -- need to rework date display more intelligently
+        apply(node,'pub',get_bool( g.notes[i].pub() ) ? $("patronStrings").getString('staff.patron.hold_notes.public') : $("patronStrings").getString('staff.patron.hold_notes.private') )
+        apply(node,'slip',get_bool( g.notes[i].slip() ) ? $("patronStrings").getString('staff.patron.hold_notes.print_on_slip') : $("patronStrings").getString('staff.patron.hold_notes.no_print_on_slip') )
+        apply(node,'staff',get_bool( g.notes[i].staff() ) ? $("patronStrings").getString('staff.patron.hold_notes.by_staff') : $("patronStrings").getString('staff.patron.hold_notes.by_patron') )
+    }
 
-        /* alert('notenode = '
-              + notenode + ' title = ' + g.notes[i].title() + ' note = ' +
-              g.notes[i].body() + ' pub = ' + g.notes[i].pub() + ' slip = ' +
-              g.notes[i].slip() );*/
+}
 
-        apply(notenode,'title',g.notes[i].title() ? g.notes[i].title() : '');
-        apply(notenode,'note',g.notes[i].body() ? g.notes[i].body() : '');
-        apply(notenode,'pub',g.notes[i].pub() ? g.notes[i].pub() : '');
-        apply(notenode,'slip',g.notes[i].slip() ? g.notes[i].slip() : '');
-    }
-}
+
 function new_notification() {
     try {
         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
@@ -208,10 +231,10 @@
         xml += 'accesskey="' + $("patronStrings").getString('staff.patron.hold_notices.add_notif_record_accesskey') + '" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
         JSAN.use('util.window'); var win = new util.window();
         var fancy_prompt_data = win.open(
-                                         urls.XUL_FANCY_PROMPT,
-                                         'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
-                                         { 'xml' : xml, 'focus' : 'method', 'title' : $("patronStrings").getString('staff.patron.hold_notices.add_notif_record') }
-                                         );
+            urls.XUL_FANCY_PROMPT,
+            'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
+            { 'xml' : xml, 'focus' : 'method', 'title' : $("patronStrings").getString('staff.patron.hold_notices.add_notif_record') }
+        );
         if (fancy_prompt_data.fancy_status == 'complete') {
             var notification = new ahn();
             notification.isnew(1);
@@ -219,39 +242,50 @@
             notification.method( fancy_prompt_data.method );
             notification.note( fancy_prompt_data.note );
             var r = g.network.simple_request('FM_AHN_CREATE',[ ses(), notification ]); if (typeof r.ilsevent != 'undefined') throw(r);
-            setTimeout(function(){refresh();},0);
+            setTimeout(function(){fetch_and_render_all();},0);
         }
     } catch(E) {
         g.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.hold_notices.new_notification.not_created'),E);
-        setTimeout(function(){refresh();},0);
+        setTimeout(function(){fetch_and_render_all();},0);
     }
 }
 
 function new_note() {
-     try{
-     var newNote = new fieldmapper.ahrn();
-     newNote.isnew("t");
-     newNote.body(document.getElementById('hold_note_text').value);
-     newNote.hold(g.ahr_id);
-     newNote.title(document.getElementById('hold_note_title').value);
+    try {
+        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
+        var xml = '<groupbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1">';
+        xml += '<caption label="' + $("patronStrings").getString('staff.patron.hold_notes.new_note') + '"/><grid flex="1"><columns><column/><column flex="1"/></columns><rows>';
+        xml += '<row><label value="' + $('patronStrings').getString('staff.patron.hold_notes.new_note.public') + '"/><checkbox id="pub" name="fancy_data" checked="false"/></row>';
+        xml += '<row><label value="' + $('patronStrings').getString('staff.patron.hold_notes.new_note.slip') + '"/><checkbox id="slip" name="fancy_data" checked="false"/></row>';
+        xml += '<row><label value="' + $("patronStrings").getString('staff.patron.hold_notes.title') + '"/><textbox id="title" name="fancy_data" context="clipboard"/></row>';
+        xml += '<row><label value="' + $("patronStrings").getString('staff.patron.hold_notes.body') + '"/><textbox multiline="true" id="note" name="fancy_data" context="clipboard"/></row>';
+        xml += '<row><spacer/><hbox><button label="' + $("patronStrings").getString('staff.patron.hold_notes.cancel') + '" name="fancy_cancel" ';
+        xml += 'accesskey="' + $("patronStrings").getString('staff.patron.hold_notes.cancel_accesskey') + '"/>';
+        xml += '<button label="' + $("patronStrings").getString('staff.patron.hold_notes.add_note') + '" ';
+        xml += 'accesskey="' + $("patronStrings").getString('staff.patron.hold_notes.add_note.accesskey') + '" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
+        JSAN.use('util.window'); var win = new util.window();
+        var fancy_prompt_data = win.open(
+            urls.XUL_FANCY_PROMPT,
+            'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
+            { 'xml' : xml, 'focus' : 'title', 'title' : $("patronStrings").getString('staff.patron.hold_notes.add_note') }
+        );
+        if (fancy_prompt_data.fancy_status == 'complete') {
+            var note = new ahrn();
+            note.isnew(1);
+            note.hold(g.ahr_id);
+            note.title( fancy_prompt_data.title );
+            note.body( fancy_prompt_data.note );
+            note.pub( get_bool( fancy_prompt_data.pub ) ? get_db_true() : get_db_false() );
+            note.slip( get_bool( fancy_prompt_data.slip ) ? get_db_true() : get_db_false() );
+            note.staff( true );
+            //var r = g.network.simple_request('FM_AHN_CREATE',[ ses(), notification ]); if (typeof r.ilsevent != 'undefined') throw(r);
+            g.pcrud.create(note);
+            setTimeout(function(){fetch_and_render_all();},0);
+        }
+    } catch(E) {
+        g.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.hold_notes.new_note.not_created'),E);
+        setTimeout(function(){fetch_and_render_all();},0);
+    }
+}
 
-     if($('pub_bool').checked){
-         newNote.pub("t");
-     }else {
-         newNote.pub("f");
-     }
-     if($('print_bool').checked){
-         newNote.slip("t");
-     }else{
-         newNote.slip("f");
-     }
-     newNote.staff("t");
 
-     new openils.PermaCrud({authtoken :ses()}).create(newNote);
-
-     }
-     catch(E) {
-         alert('new_note FAILED');
-     }
-     refresh();
-}
\ No newline at end of file

Modified: trunk/Open-ILS/xul/staff_client/server/patron/hold_details.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_details.xul	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_details.xul	2009-09-22 22:40:01 UTC (rev 14106)
@@ -12,87 +12,95 @@
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- LOCALIZATION -->
 <!DOCTYPE window PUBLIC "" ""[
-	  <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
-          ]>
+	<!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- OVERLAYS -->
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
 
-<window id="hold_notices_win" oils_persist="sizemode width height"
-	onload="try{ my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }" title="&staff.patron.hold_details.title;"
+<window id="hold_notices_win" width="700" height="550" oils_persist="sizemode width height"
+	onload="try{ my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }" title="&staff.patron.hold_notices.title;"
 	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"/>
+	<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+	<!-- 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 type="text/javascript" src="/xul/server/patron/hold_details.js" />
+	<script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+	<script type="text/javascript" src="hold_notices.js"/>
 
-    <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale' -->/circ.properties"/>
-    <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties"/>
+	<messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale' -->/circ.properties"/>
+	<messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties"/>
 
+	<stack hidden="true" id="notification_template" flex="1">
+		<groupbox flex="1" style="background-color: black;"/>
+		<groupbox flex="1" style="background-color: #FFDE00; -moz-border-radius-topright: 35px;" >
+			<hbox>
+				<description name="method" label="&staff.patron.hold_notices.method.label;" style="font-weight: bold"/>
+				<spacer flex="1"/>
+				<description name="notify_time" style="font-weight: bold"/>
+			</hbox>
+			<description name="note"/>
+		</groupbox>
+	</stack>
+
+    <stack hidden="true" id="note_template" flex="1">
+        <groupbox flex="1" style="background-color: black;"/>
+        <groupbox flex="1" style="background-color: #FFDE00; -moz-border-radius-topright: 35px;" >
+            <hbox>
+                <description name="title" style="font-weight: bold"/>
+                <spacer flex="1"/>
+                <description name="create_date" style="font-weight: bold"/>
+                <description name="staff" style="font-weight: bold"/>
+                <description name="pub" style="font-weight: bold"/>
+                <description name="slip" style="font-weight: bold"/>
+            </hbox>
+            <description name="note"/>
+        </groupbox>
+    </stack>
+
     <vbox id="v1" flex="1" oils_persist="height">
         <label id="patron_name" class="patronNameLarge"/>
-        <vbox id="bib_brief_box" height="200"/>
-    </vbox> 
-    <spacer flex="1"/>
+        <vbox id="bib_brief_box" flex="1" style="min-height: 10em;"/>
+    </vbox>
+
+    <splitter><grippy/></splitter>
+
     <vbox id="v2" flex="1" oils_persist="height">
         <vbox flex="1">
-            <tree id="holds_list" enableColumnDrag="true" height="100"/>
+            <tree id="holds_list" flex="1" enableColumnDrag="true" style="min-height: 4em;"/>
+            <spacer/>
         </vbox>
-    </vbox>
-    <groupbox style="border: 2px black" id="notification_template">
-	<hbox>
-	    <description name="method" label="&staff.patron.hold_notices.method.label;" style="font-weight: bold"/>
-	    <description name="notify_time" style="font-weight: bold"/>
-	</hbox>
-	<description name="note"/>
-    </groupbox>
-    
-    <groupbox id="note_template" style="border: 2px black">
-        <hbox orient="vertical">
-            <description name="title" style="font-weight: bold"/>
-            <description name="note"/>
-	    <description name="pub" label="&staff.patron.hold_note.public.label;" style="font-weight: bold"/>
-            <description name="slip" label="&staff.patron.hold_note.print.label;" style="font-weight: bold"/>
-        </hbox>
-    </groupbox>
+	</vbox>
 
-    <tabbox>
+    <splitter><grippy/></splitter>
+
+    <tabbox flex="1">
         <tabs>
-            <tab label="Add/View Notes"/>
-            <tab label="Add/View Notifications"/>
+            <tab label="&staff.patron.holds.notes_tab.label;" accesskey="&staff.patron.holds.notes_tab.accesskey;" />
+            <tab label="&staff.patron.holds.notices_tab.label;" accesskey="&staff.patron.holds.notices_tab.accesskey;" />
         </tabs>
-        <tabpanels>
-            <tabpanel id="notes" orient="vertical" overflow="scroll">
-                <vbox oils_persist="height" class="my_overflow" id="notes_panel">
+        <tabpanels flex="1">
+            <tabpanel flex="1" orient="vertical">
+                <hbox>
+                    <button label="&staff.patron.holds.add_note.label;" accesskey="&staff.patron.holds.add_note.accesskey;" oncommand="new_note()"/>
+                    <spacer flex="1"/>
+                </hbox>
+                <vbox oils_persist="height" flex="1" class="my_overflow" id="notes_panel">
                 </vbox>
-                
-                <textbox id="hold_note_title" multiline="false" value="circStrings-ADD NOTE TITLE HERE" onfocus="$('hold_note_title').value=''; $('hold_note_title').onfocus=''"/>
-                
-                <textbox id="hold_note_text" multiline="true" value="circStrings-Enter Notes Here." onfocus="$('hold_note_text').value=''; $('hold_note_text').onfocus=''"/>
-                <hbox>  
-                    <checkbox id="pub_bool" label="circStrings--Public Note" checked="{true | *false}" />
-                    <checkbox id="print_bool"  label="circStrings--Print Note" checked="{true | *false}" />
+            </tabpanel>
+            <tabpanel flex="1" orient="vertical">
+                <hbox>
+                    <button label="&staff.patron.hold_notices.add_record_notification.label;" accesskey="&staff.patron.hold_notices.add_record_notification.accesskey;" oncommand="new_notification()"/>
+                    <spacer flex="1"/>
                 </hbox>
-                <hbox>
-                    <button label="circStrings--Add New Note" accesskey="" oncommand="new_note()"/>
-                    <button label="&staff.patron.hold_notices.close_window.label;" accesskey="&staff.patron.hold_notices.close_window.accesskey;" oncommand="window.close()"/>
-                </hbox>               
-                
-            </tabpanel>
-            <tabpanel id="notification" orient="vertical">
-                <vbox oils_persist="height" class="my_overflow" id="notifications_panel">
+                <vbox oils_persist="height" flex="1" class="my_overflow" id="notifications_panel">
                 </vbox>
-                <button label="&staff.patron.hold_notices.add_record_notification.label;" accesskey="&staff.patron.hold_notices.add_record_notification.accesskey;" oncommand="new_notification()"/>
-                <button label="&staff.patron.hold_notices.close_window.label;" accesskey="&staff.patron.hold_notices.close_window.accesskey;" oncommand="window.close()"/>
             </tabpanel>
         </tabpanels>
     </tabbox>
-    
 
 </window>
 

Deleted: trunk/Open-ILS/xul/staff_client/server/patron/hold_notices.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_notices.xul	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_notices.xul	2009-09-22 22:40:01 UTC (rev 14106)
@@ -1,268 +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="hold_notices_win" width="700" height="550" oils_persist="sizemode width height"
-	onload="try{ my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }" title="&staff.patron.hold_notices.title;"
-	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[
-
-		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('patron.util');
-				JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
-
-				g.error.sdump('D_TRACE','my_init() for hold_notices.xul');
-
-				g.ahr_id = xul_param('ahr_id');
-				g.ahr = g.network.simple_request('FM_AHR_RETRIEVE',[ ses(), g.ahr_id ]);
-				if (typeof g.ahr.ilsevent != 'undefined') { throw(g.ahr); }
-				g.ahr = g.ahr[0];
-
-				render_patron();
-
-				a_list_of_one();
-
-				var x = document.getElementById('bib_brief_box'); while (x.firstChild) x.removeChild(x.lastChild);
-                var bib_brief = document.createElement('iframe'); x.appendChild(bib_brief);
-                bib_brief.setAttribute('flex',1);
-                bib_brief.setAttribute('src',urls.XUL_BIB_BRIEF); 
-				get_contentWindow(bib_brief).xulG = { 'docid' : g.ahr.target() };
-
-				refresh();
-
-			} catch(E) {
-				try { g.error.standard_unexpected_error_alert('/xul/server/patron/hold_notices.xul',E); } catch(E) { alert('FIXME: ' + js2JSON(E)); }
-			}
-		}
-
-		function render_patron() {
-			if (g.ahr.usr()) {
-				JSAN.use('patron.util'); 
-				var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.ahr.usr() );
-				
-				$('patron_name').setAttribute('value', 
-					( au_obj.prefix() ? au_obj.prefix() + ' ' : '') + 
-					au_obj.family_name() + ', ' + 
-					au_obj.first_given_name() + ' ' +
-					( au_obj.second_given_name() ? au_obj.second_given_name() + ' ' : '' ) +
-					( au_obj.suffix() ? au_obj.suffix() : '')
-					+ ' : ' + au_obj.card().barcode() 
-				);
-			}
-		}
-
-		function a_list_of_one() {
-			JSAN.use('circ.util');
-			var columns = circ.util.hold_columns( 
-				{ 
-					'status' : { 'hidden' : true },
-					'request_time' : { 'hidden' : false },
-					'pickup_lib_shortname' : { 'hidden' : false },
-					'current_copy' : { 'hidden' : false },
-					'phone_notify' : { 'hidden' : false },
-					'email_notify' : { 'hidden' : false },
-				} 
-			);
-			JSAN.use('util.list'); g.list = new util.list('holds_list');
-			g.list.init(
-				{
-					'columns' : columns,
-					'map_row_to_columns' : circ.util.std_map_row_to_columns(),
-					'retrieve_row' : function(params) {
-						var row = params.row;
-						try {
-							switch(row.my.ahr.hold_type()) {
-								case 'M' :
-									row.my.mvr = g.network.request(
-										api.MODS_SLIM_METARECORD_RETRIEVE.app,
-										api.MODS_SLIM_METARECORD_RETRIEVE.method,
-										[ row.my.ahr.target() ]
-									);
-								break;
-								default:
-									row.my.mvr = g.network.simple_request(
-										'MODS_SLIM_RECORD_RETRIEVE.authoritative',
-										[ row.my.ahr.target() ]
-									);
-									if (row.my.ahr.current_copy()) {
-										row.my.acp = g.network.simple_request( 'FM_ACP_RETRIEVE', [ row.my.ahr.current_copy() ]);
-									}
-								break;
-							}
-						} catch(E) {
-							g.error.sdump('D_ERROR','retrieve_row: ' + E );
-						}
-						if (typeof params.on_retrieve == 'function') {
-							params.on_retrieve(row);
-						}
-						return row;
-					},
-				}
-			);
-			g.list.append(
-				{
-					'row' : {
-						'my' : {
-							'ahr' : g.ahr,
-						}
-					},
-					'no_auto_select' : true,
-				}
-			);
-		}
-
-		function refresh() {
-			retrieve_notifications(); render_notifications();
-		}
-
-		function retrieve_notifications() {
-			g.notifications = g.network.simple_request('FM_AHN_RETRIEVE_VIA_AHR',[ ses(), g.ahr_id ]).reverse();
-		}
-
-		function apply(node,field,value) {
-			util.widgets.apply(
-				node,'name',field,
-				function(n) {
-					switch(n.nodeName) {
-						case 'description' : n.appendChild( document.createTextNode( value ) ); break;
-						case 'label' : n.value = value; break;
-						default : n.value = value; break;
-					}
-				}
-			);
-		}
-
-		function render_notifications() {
-			JSAN.use('util.widgets'); util.widgets.remove_children('notifications_panel');
-			var np = $('notifications_panel');
-
-			for (var i = 0; i < g.notifications.length; i++) {
-
-				/* template */
-				var node = $('notification_template').cloneNode(true); np.appendChild(node); node.hidden = false;
-				util.widgets.apply(node,'name','notify_time',
-					function(n){
-                        n.setAttribute(
-                            "tooltiptext", 
-                            $("patronStrings").getFormattedString('staff.patron.hold_notices.tooltiptext',[g.notifications[i].id(), g.notifications[i].hold(), g.notifications[i].notify_staff()])
-                        );
-                    }
-				);
-				apply(node,'method',g.notifications[i].method() ? g.notifications[i].method() : '');
-				apply(node,'note',g.notifications[i].note() ? g.notifications[i].note() : '');
-				apply(node,'notify_time',g.notifications[i].notify_time() ? g.notifications[i].notify_time().toString().substr(0,10) : '');
-			}
-
-		}
-		
-		function new_notification() {
-			try {
-				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
-				var xml = '<groupbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1">';
-				xml += '<caption label="' + $("patronStrings").getString('staff.patron.hold_notices.new_notification_record') + '"/><grid flex="1"><columns><column/><column flex="1"/></columns><rows>';
-				xml += '<row><label value="' + $("patronStrings").getString('staff.patron.hold_notices.method') + '"/><textbox id="method" name="fancy_data" context="clipboard"/></row>';
-				xml += '<row><label value="' + $("patronStrings").getString('staff.patron.hold_notices.note') + '"/><textbox multiline="true" id="note" name="fancy_data" context="clipboard"/></row>';
-				xml += '<row><spacer/><hbox><button label="' + $("patronStrings").getString('staff.patron.hold_notices.cancel') + '" name="fancy_cancel" ';
-				xml += 'accesskey="' + $("patronStrings").getString('staff.patron.hold_notices.cancel_accesskey') + '"/>';
-				xml += '<button label="' + $("patronStrings").getString('staff.patron.hold_notices.add_notif_record') + '" ';
-				xml += 'accesskey="' + $("patronStrings").getString('staff.patron.hold_notices.add_notif_record_accesskey') + '" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
-				JSAN.use('util.window'); var win = new util.window();
-				var fancy_prompt_data = win.open(
-					urls.XUL_FANCY_PROMPT,
-					'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
-					{ 'xml' : xml, 'focus' : 'method', 'title' : $("patronStrings").getString('staff.patron.hold_notices.add_notif_record') }
-				);
-				if (fancy_prompt_data.fancy_status == 'complete') {
-					var notification = new ahn();
-					notification.isnew(1);
-					notification.hold(g.ahr_id);
-					notification.method( fancy_prompt_data.method );
-					notification.note( fancy_prompt_data.note );
-					var r = g.network.simple_request('FM_AHN_CREATE',[ ses(), notification ]); if (typeof r.ilsevent != 'undefined') throw(r);
-					setTimeout(function(){refresh();},0);
-				}
-			} catch(E) {
-				g.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.hold_notices.new_notification.not_created'),E);
-				setTimeout(function(){refresh();},0);
-			}
-		}
-
-	]]>
-	</script>
-
-	<messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale' -->/circ.properties"/>
-	<messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties"/>
-
-	<stack hidden="true" id="notification_template" flex="1">
-		<groupbox flex="1" style="background-color: black;"/>
-		<groupbox flex="1" style="background-color: #FFDE00; -moz-border-radius-topright: 35px;" >
-			<hbox>
-				<description name="method" label="&staff.patron.hold_notices.method.label;" style="font-weight: bold"/>
-				<spacer flex="1"/>
-				<description name="notify_time" style="font-weight: bold"/>
-			</hbox>
-			<description name="note"/>
-		</groupbox>
-	</stack>
-
-    <vbox id="v1" flex="1" oils_persist="height">
-        <label id="patron_name" class="patronNameLarge"/>
-        <vbox id="bib_brief_box" flex="1"/>
-    </vbox>
-
-    <splitter><grippy/></splitter>
-
-    <vbox id="v2" flex="1" oils_persist="height">
-        <vbox flex="1">
-            <tree id="holds_list" flex="1" enableColumnDrag="true" style=""/>
-        </vbox>
-        <hbox>
-            <button label="&staff.patron.hold_notices.add_record_notification.label;" accesskey="&staff.patron.hold_notices.add_record_notification.accesskey;" oncommand="new_notification()"/>
-            <spacer flex="1"/>
-            <button label="&staff.patron.hold_notices.close_window.label;" accesskey="&staff.patron.hold_notices.close_window.accesskey;" oncommand="window.close()"/>
-        </hbox>
-	</vbox>
-
-    <splitter><grippy/></splitter>
-
-	<vbox oils_persist="height" flex="9" class="my_overflow" id="notifications_panel">
-	</vbox>
-
-
-</window>
-

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2009-09-22 22:40:01 UTC (rev 14106)
@@ -185,6 +185,41 @@
 							circ.util.show_last_few_circs(obj.retrieve_ids);
 						}
 					],
+                    'alt_view_btn' : [
+                        ['render'],
+                        function(e) {
+                            e.setAttribute('label', document.getElementById("circStrings").getString('staff.circ.holds.alt_view.label'));
+                            e.setAttribute('accesskey', document.getElementById("circStrings").getString('staff.circ.holds.alt_view.accesskey'));
+                        }
+                    ],
+                    'cmd_alt_view' : [
+                        ['command'],
+                        function(ev) {
+                            try {
+                                var n = obj.controller.view.alt_view_btn;
+                                if (n.getAttribute('toggle') == '1') {
+                                    document.getElementById('deck').selectedIndex = 0;
+                                    n.setAttribute('toggle','0');
+                                    n.setAttribute('label', document.getElementById("circStrings").getString('staff.circ.holds.alt_view.label'));
+                                    n.setAttribute('accesskey', document.getElementById("circStrings").getString('staff.circ.holds.alt_view.accesskey'));
+                                } else {
+                                    document.getElementById('deck').selectedIndex = 1;
+                                    n.setAttribute('toggle','1');
+                                    n.setAttribute('label', document.getElementById("circStrings").getString('staff.circ.holds.list_view.label'));
+                                    n.setAttribute('accesskey', document.getElementById("circStrings").getString('staff.circ.holds.list_view.accesskey'));
+                                    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+                                    if (obj.retrieve_ids.length == 0) return;
+                                    var f = obj.browser.get_content();
+                                    xulG.ahr_id = obj.retrieve_ids[0].id;
+                                    xulG.patron_rendered_elsewhere = (obj.hold_interface_type == 'patron');
+                                    f.xulG = xulG;
+                                    f.fetch_and_render_all();
+                                }
+                            } catch(E) {
+                                alert('Error in holds.js, cmd_alt_view handler: ' + E);
+                            }
+                        },
+                    ],
 					'sel_mark_items_damaged' : [
 						['command'],
 						function() {
@@ -209,29 +244,7 @@
 						}
 					],
 
-                                            ///////////////////////////////////////////////////////////////////THIS IS MY CURRENT CODE
-                                         'cmd_hold_note' : [
-                                                            ['command'],
-                                                            function() {
-                                                                try {
-                                                                    JSAN.use('util.window'); var win = new util.window();
-                                                                    for (var i = 0; i < obj.retrieve_ids.length; i++) {
-									netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-									win.open(
-                                                                                 xulG.url_prefix(urls.XUL_HOLD_NOTE), // + '?ahr_id=' + obj.retrieve_ids[i].id,
-                                                                                 'hold_note_' + obj.retrieve_ids[i].id,
-                                                                                 'chrome,resizable',
-                                                                                 { 'ahrn_id' : obj.retrieve_ids[i].id }
-                                                                                 );
-                                                                    }
-                                                                } catch(E) {
-                                                                    obj.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.holds.show_note.error_rendering_note'),E);
-                                                                }
-                                                            }
-                                         ],
-
-                                            //////////////////////////////////////////////////////////////////////////////////
-                                         'cmd_holds_print' : [
+                    'cmd_holds_print' : [
 						['command'],
 						function() {
 							try {
@@ -250,25 +263,6 @@
 					'cmd_csv_to_printer' : [ ['command'], function() { obj.list.dump_csv_to_printer(); } ],
 					'cmd_csv_to_file' : [ ['command'], function() { obj.list.dump_csv_to_file( { 'defaultFileName' : 'holds.txt' } ); } ],
 
-					'cmd_show_details' : [
-						['command'],
-						function() {
-							try {
-								JSAN.use('util.window'); var win = new util.window();
-								for (var i = 0; i < obj.retrieve_ids.length; i++) {
-									netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-									win.open(
-										xulG.url_prefix(urls.XUL_HOLD_DETAILS), // + '?ahr_id=' + obj.retrieve_ids[i].id,
-										'hold_notices_' + obj.retrieve_ids[i].id,
-										'chrome,resizable',
-										{ 'ahr_id' : obj.retrieve_ids[i].id }
-									);
-								}
-							} catch(E) {
-								obj.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.holds.show_notifications.error_rendering_notifs'),E);
-							}
-						}
-					],
 					'cmd_holds_edit_selection_depth' : [
 						['command'],
 						function() {
@@ -1034,6 +1028,20 @@
                 obj.controller.view.cmd_show_catalog.setAttribute('disabled','true');
             }, 0
         );
+
+        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+        JSAN.use('util.browser');
+        obj.browser = new util.browser();
+        obj.browser.init(
+            {
+                'url' : urls.XUL_HOLD_DETAILS,
+                'push_xulG' : true,
+                'alt_print' : false,
+                'browser_id' : 'hold_detail_frame',
+                'passthru_content_params' : xulG,
+            }
+        );
+
 	},
 
     'determine_hold_interface_type' : function() {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2009-09-22 21:15:44 UTC (rev 14105)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2009-09-22 22:40:01 UTC (rev 14106)
@@ -20,7 +20,6 @@
 	<command id="cmd_holds_print" />
 	<command id="cmd_show_catalog" />
 	<command id="cmd_retrieve_patron" />
-	<command id="cmd_show_details" />
 	<command id="cmd_holds_edit_pickup_lib" />
 	<command id="cmd_holds_edit_phone_notify" />
 	<command id="cmd_holds_edit_email_notify" />
@@ -34,6 +33,7 @@
 	<command id="cmd_holds_cancel" />
 	<command id="cmd_search_opac" />
 	<command id="save_columns" />
+	<command id="cmd_alt_view" />
     </commandset>
 
     <popupset id="holds_popupset">
@@ -44,7 +44,6 @@
 	    <menuitem command="sel_patron" label="&staff.circ.holds.show_last_few_circulations;" accesskey="&staff.circ.holds.show_last_few_circulations.accesskey;"/>
 	    <menuseparator />
 	    <menuitem label="&staff.circ.holds.retrieve_patron;" command="cmd_retrieve_patron" accesskey="&staff.circ.holds.retrieve_patron.accesskey;"/>
-	    <menuitem label="&staff.circ.holds.show_details;" command="cmd_show_details" accesskey="&staff.circ.holds.show_details.accesskey;" />
 	    <menuseparator />
 	    <menuitem label="&staff.circ.holds.edit_pickup_library;" command="cmd_holds_edit_pickup_lib" accesskey="&staff.circ.holds.edit_pickup_library.accesskey;"/>
 	    <menuitem label="&staff.circ.holds.edit_phone_notification;" command="cmd_holds_edit_phone_notify" accesskey="&staff.circ.holds.edit_phone_notification.accesskey;"/>
@@ -76,7 +75,10 @@
 	    <vbox flex="0">
 		<hbox id="holds_top_ui" />
 	    </vbox>
-	    <tree id="holds_list" flex="1" enableColumnDrag="true" context="holds_actions"/>
+        <deck id="deck" flex="1">
+            <tree id="holds_list" flex="1" enableColumnDrag="true" context="holds_actions"/>
+            <browser id="hold_detail_frame" src="" flex="1" />
+        </deck>
 	    <vbox flex="0">
 		<hbox id="holds_bottom_ui" />
 	    </vbox>
@@ -99,6 +101,7 @@
         <vbox id="lib_menu_placeholder" hidden="true"/>
         <button id="fetch_more" label="&staff.patron.holds_overlay.fetch_more.label;" accesskey="&staff.patron.holds_overlay.fetch_more.accesskey;" hidden="true"/>
 	<spacer flex="1"/>
+        <button id="alt_view_btn" command="cmd_alt_view" />
         <menubar>
             <menu label="&staff.patron.holds_overlay.actions_for_holds.label;" accesskey="&staff.patron.holds_overlay.actions_for_holds.accesskey;">
                 <menupopup>
@@ -108,7 +111,6 @@
                     <menuitem command="sel_patron" label="&staff.circ.holds.show_last_few_circulations;" accesskey="&staff.circ.holds.show_last_few_circulations.accesskey;"/>
                     <menuseparator />
                     <menuitem label="&staff.circ.holds.retrieve_patron;" command="cmd_retrieve_patron" accesskey="&staff.circ.holds.retrieve_patron.accesskey;"/>
-                    <menuitem label="&staff.circ.holds.show_details;" command="cmd_show_details" accesskey="&staff.circ.holds.show_details.accesskey;" />
                     <menuseparator />
                     <menuitem label="&staff.circ.holds.edit_pickup_library;" command="cmd_holds_edit_pickup_lib" accesskey="&staff.circ.holds.edit_pickup_library.accesskey;"/>
                     <menuitem label="&staff.circ.holds.edit_phone_notification;" command="cmd_holds_edit_phone_notify" accesskey="&staff.circ.holds.edit_phone_notification.accesskey;"/>



More information about the open-ils-commits mailing list