public/private wording with notes, and note printing
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 26 Aug 2006 04:59:38 +0000 (04:59 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 26 Aug 2006 04:59:38 +0000 (04:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5699 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/info_notes.xul
Open-ILS/xul/staff_client/server/patron/util.js

index ce4227d..cbf58f9 100644 (file)
                                        function(n){n.setAttribute("tooltiptext","Note ID: " + g.notes[i].id() + " Creator ID: " + g.notes[i].creator());}
                                );
                                apply(node,'title',g.notes[i].title());
-                               apply(node,'pub',get_bool(g.notes[i].pub()) ? "Public" : "Private");
+                               apply(node,'pub',get_bool(g.notes[i].pub()) ? "Patron Visible" : "Staff Only");
                                apply(node,'value',g.notes[i].value());
                                apply(node,'id',g.notes[i].id());
                                apply(node,'creator',g.notes[i].creator());
                                                        } }(i),
                                                        false
                                                );
+                                       var btn2 = document.createElement('button'); hb.appendChild(btn2);
+                                               btn2.setAttribute('label','Print');
+                                               btn2.setAttribute('image',"/xul/server/skin/media/images/up_arrow.gif");
+
+                                               btn2.addEventListener(
+                                                       'command',
+                                                       function(id){ return function() { 
+                                                               try {
+                                                                       JSAN.use('patron.util'); 
+                                                                       var patron_obj = patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id);
+                                                                       var staff_obj = patron.util.retrieve_name_via_id( ses(), g.notes[id].creator() );
+                                                                       JSAN.use('util.print'); var p = new util.print();
+                                                                       p.simple(
+                                                                               '<hr/>'
+                                                                               + '<p>Pertaining to ' + patron_obj.family_name() + ', ' + patron_obj.first_given_name() + ' ' + patron_obj.second_given_name() + ' : ' 
+                                                                               + patron_obj.card().barcode() + '</p>'
+                                                                               + '<p><b>"' 
+                                                                               + g.notes[id].title() + '"</b> created on ' + g.notes[id].create_date().toString().substr(0,10) 
+                                                                               + ' by ' + staff_obj[0] + ' @ ' + g.data.hash.aou[ staff_obj[3] ].shortname()
+                                                                               + '</p><p>'
+                                                                               + g.notes[id].value()
+                                                                               + '</p><hr/>'
+                                                                       );
+                                                               } catch(E) {
+                                                                       g.error.standard_unexpected_error_alert('printing note #' + g.notes[id].id(), E);
+                                                               }
+                                                       } }(i),
+                                                       false
+                                               );
                        }
 
                }
                function new_note() {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
-                               var xml = '<groupbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1"><caption label="New Note"/><grid flex="1"><columns><column/><column flex="1"/></columns><rows><row><label value="Public?"/><checkbox id="pub" name="fancy_data"/></row><row><label value="Title"/><textbox id="title" name="fancy_data"/></row><row><label value="Note"/><textbox multiline="true" id="note" name="fancy_data"/></row><row><spacer/><hbox><button label="Cancel" name="fancy_cancel" accesskey="C"/><button label="Add Note" accesskey="A" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
+                               var xml = '<groupbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1"><caption label="New Note"/><grid flex="1"><columns><column/><column flex="1"/></columns><rows><row><label value="Patron Visible?"/><checkbox id="pub" name="fancy_data"/></row><row><label value="Title"/><textbox id="title" name="fancy_data"/></row><row><label value="Note"/><textbox multiline="true" id="note" name="fancy_data"/></row><row><spacer/><hbox><button label="Cancel" name="fancy_cancel" accesskey="C"/><button label="Add Note" accesskey="A" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
                                window.open(
                                        urls.XUL_FANCY_PROMPT
                                        + '?xml=' + window.escape(xml)
index 40a5e65..1861879 100644 (file)
@@ -409,7 +409,7 @@ patron.util.retrieve_name_via_id = function(session, id) {
        var network = new util.network();
        var parts = network.simple_request(
                'BLOB_AU_PARTS_RETRIEVE',
-               [ session, id, ['family_name', 'first_given_name', 'second_given_name' ] ]
+               [ session, id, ['family_name', 'first_given_name', 'second_given_name', 'home_ou' ] ]
        );
        return parts;
 }