[open-ils-commits] r16928 - in branches/seials-integration/Open-ILS: src/perlmods/OpenILS/Utils web/opac/locale/en-US xul/staff_client/chrome/content/cat xul/staff_client/chrome/content/main (dbwells)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 14 11:03:17 EDT 2010


Author: dbwells
Date: 2010-07-14 11:03:15 -0400 (Wed, 14 Jul 2010)
New Revision: 16928

Modified:
   branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm
   branches/seials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd
   branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
   branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
   branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js
Log:
- Establish client menu entries for MFHD editing (moving the functionality out of the catalog page) and setting the Serial Control View
- Setup some of the backend constants/entities
- Small MFHD comment change


Modified: branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm
===================================================================
--- branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm	2010-07-14 12:07:19 UTC (rev 16927)
+++ branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm	2010-07-14 15:03:15 UTC (rev 16928)
@@ -224,7 +224,7 @@
     my $self  = shift;
     my $tag = shift;
 
-    # TODO: add support for caption types as argument? (base, index, supplement)
+    # TODO: add support for caption types as argument? (basic, index, supplement)
     my @captions;
     my @active_captions;
 

Modified: branches/seials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/seials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-07-14 12:07:19 UTC (rev 16927)
+++ branches/seials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-07-14 15:03:15 UTC (rev 16928)
@@ -1508,6 +1508,29 @@
 <!ENTITY staff.record_list.title "Title">
 <!ENTITY staff.record_list.win_title "Cataloging">
 <!ENTITY staff.retrieving.record "Retrieving...">
+<!ENTITY staff.serial.mfhd_menu.label "MFHD Holdings">
+<!ENTITY staff.serial.mfhd_menu.add.label "Add MFHD Record">
+<!ENTITY staff.serial.mfhd_menu.edit.label "Edit MFHD Record">
+<!ENTITY staff.serial.mfhd_menu.delete.label "Delete MFHD Record">
+<!ENTITY staff.serial.scap_editor.modify "Modify Caption and Pattern(s)">
+<!ENTITY staff.serial.scap_editor.modify.accesskey "M">
+<!ENTITY staff.serial.scap_editor.create "Create Caption and Pattern(s)">
+<!ENTITY staff.serial.scap_editor.create.accesskey "C">
+<!ENTITY staff.serial.scap_editor.notes "Caption and Pattern Notes">
+<!ENTITY staff.serial.scap_editor.notes.accesskey "N">
+<!ENTITY staff.serial.sdist_editor.modify "Modify Distribution(s)">
+<!ENTITY staff.serial.sdist_editor.modify.accesskey "M">
+<!ENTITY staff.serial.sdist_editor.create "Create Distribution(s)">
+<!ENTITY staff.serial.sdist_editor.create.accesskey "C">
+<!ENTITY staff.serial.sdist_editor.notes "Distribution Notes">
+<!ENTITY staff.serial.sdist_editor.notes.accesskey "N">
+<!ENTITY staff.serial.serctrl_view.label "Serial Control View">
+<!ENTITY staff.serial.ssub_editor.modify "Modify Subscription(s)">
+<!ENTITY staff.serial.ssub_editor.modify.accesskey "M">
+<!ENTITY staff.serial.ssub_editor.create "Create Subscription(s)">
+<!ENTITY staff.serial.ssub_editor.create.accesskey "C">
+<!ENTITY staff.serial.ssub_editor.notes "Subscription Notes">
+<!ENTITY staff.serial.ssub_editor.notes.accesskey "N">
 <!ENTITY staff.survey.wizard.page1 "Initial Settings">
 <!ENTITY staff.survey.wizard.page2 "Add Questions for Survey:">
 <!ENTITY staff.survey.wizard.title "Add a Survey Wizard">

Modified: branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
===================================================================
--- branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2010-07-14 12:07:19 UTC (rev 16927)
+++ branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2010-07-14 15:03:15 UTC (rev 16928)
@@ -4,6 +4,7 @@
 var marc_edit_reset = true;
 var copy_browser_reset = true;
 var hold_browser_reset = true;
+var serctrl_view_reset = true;
 
 function $(id) { return document.getElementById(id); }
 
@@ -303,6 +304,41 @@
                         }
                     }
                 );
+
+                $('mfhd_add').setAttribute('oncommand','create_mfhd()');
+                var mfhd_edit_menu = $('mfhd_edit');
+                var mfhd_delete_menu = $('mfhd_delete');
+
+                // clear menus on subsequent loads
+                if (mfhd_edit_menu.firstChild) {
+                    mfhd_edit_menu.removeChild(mfhd_edit_menu.firstChild);
+                    mfhd_delete_menu.removeChild(mfhd_delete_menu.firstChild);
+                }
+
+                mfhd_edit_menu.disabled = true;
+                mfhd_delete_menu.disabled = true;
+
+                win.attachEvt("rdetail", "MFHDDrawn",
+                    function() {
+                        if (win.mfhdDetails && win.mfhdDetails.length > 0) {
+                            g.data.mfhd = {};
+                            g.data.mfhd.details = win.mfhdDetails;
+                            g.data.stash('mfhd');
+                            mfhd_edit_menu.disabled = false;
+                            mfhd_delete_menu.disabled = false;
+                            for (var i = 0; i < win.mfhdDetails.length; i++) {
+                                var mfhd_details = win.mfhdDetails[i];
+                                var num = mfhd_details.entryNum;
+                                num++;
+                                var label = mfhd_details.label + ' (' + num + ')';
+                                var item = mfhd_edit_menu.appendItem(label);
+                                item.setAttribute('oncommand','open_mfhd_editor('+mfhd_details.id+')');
+                                item = mfhd_delete_menu.appendItem(label);
+                                item.setAttribute('oncommand','delete_mfhd('+mfhd_details.id+')');
+                            }
+                        }
+                    }
+                );
             },
             'url_prefix' : xulG.url_prefix,
         };
@@ -331,6 +367,97 @@
     }
 }
 
+function set_serctrl_view() {
+    g.view = 'serctrl_view';
+    if (serctrl_view_reset) {
+        bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_SERIAL_SERCTRL_MAIN ) + '?docid=' + window.escape(docid), {}, xulG);
+        serctrl_view_reset =false;
+    } else {
+        bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_SERIAL_SERCTRL_MAIN ) + '?docid=' + window.escape(docid), {}, xulG);
+    }
+}
+
+function create_mfhd() {
+    try {
+        g.data.create_mfhd_aou = '';
+        JSAN.use('util.window'); var win = new util.window();
+        win.open(
+            xulG.url_prefix(urls.XUL_SERIAL_SELECT_AOU),
+            'sel_bucket_win' + win.window_name_increment(),
+            'chrome,resizable,modal,centerscreen'
+        );
+        if (!g.data.create_mfhd_aou) {
+            return;
+        }
+        var r = g.network.simple_request(
+                'MFHD_XML_RECORD_CREATE',
+                [ ses(), 1, g.data.create_mfhd_aou, docid ]
+            );
+        if (typeof r.ilsevent != 'undefined') {
+            throw(r);
+        }
+        alert("MFHD record created."); //TODO: better success message
+        //TODO: refresh opac display
+    } catch(E) {
+        g.error.standard_unexpected_error_alert("Create MFHD failed", E); //TODO: better error handling
+    }
+}
+
+function delete_mfhd(sre_id) {
+    if (g.error.yns_alert(
+        document.getElementById('offlineStrings').getFormattedString('serial.delete_record.confirm', [sre_id]),
+        document.getElementById('offlineStrings').getString('cat.opac.delete_record'),
+        document.getElementById('offlineStrings').getString('cat.opac.delete'),
+        document.getElementById('offlineStrings').getString('cat.opac.cancel'),
+        null,
+        document.getElementById('offlineStrings').getString('cat.opac.record_deleted.confirm')) == 0) {
+        var robj = g.network.request(
+                'open-ils.permacrud',
+                'open-ils.permacrud.delete.sre',
+                [ses(),sre_id]);
+        if (typeof robj.ilsevent != 'undefined') {
+            alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_deleted.error',  [docid, robj.textcode, robj.desc]) + '\n');
+        } else {
+            alert(document.getElementById('offlineStrings').getString('cat.opac.record_deleted'));
+            //TODO: refresh opac display
+        }
+    }
+}
+
+function open_mfhd_editor(sre_id) {
+    try {
+        var r = g.network.simple_request(
+                'FM_SRE_RETRIEVE',
+                [ ses(), sre_id ]
+              );
+        if (typeof r.ilsevent != 'undefined') {
+            throw(r);
+        }
+        open_marc_editor(r, 'MFHD');
+    } catch(E) {
+        g.error.standard_unexpected_error_alert("Create MFHD failed", E); //TODO: better error handling
+    }
+}
+
+function open_marc_editor(rec, label) {
+    win = window.open( xulG.url_prefix('/xul/server/cat/marcedit.xul') );
+
+    win.xulG = {
+        record : {marc : rec.marc()},
+        save : {
+            label: 'Save ' + label,
+            func: function(xmlString) {  // TODO: switch to pcrud, or define an sre update method in Serial.pm?
+                var method = 'open-ils.permacrud.update.' + rec.classname;
+                rec.marc(xmlString);
+                g.network.request(
+                    'open-ils.permacrud', method,
+                    [ses(), rec]
+                );
+            }
+        }
+    };
+}
+
 function bib_in_new_tab() {
     try {
         var url = browser_frame.contentWindow.g.browser.controller.view.browser_browser.contentWindow.wrappedJSObject.location.href;
@@ -353,7 +480,7 @@
     win.open(
         xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK),
         'sel_bucket_win' + win.window_name_increment(),
-        'chrome,resizable,modal,center',
+        'chrome,resizable,modal,centerscreen',
         {
             record_ids: [ docid ]
         }
@@ -485,6 +612,7 @@
             case 'marc_edit' : set_marc_edit(); break;
             case 'copy_browser' : set_copy_browser(); break;
             case 'hold_browser' : set_hold_browser(); break;
+            case 'serctrl_view' : set_serctrl_view(); break;
             case 'opac' :
             default: set_opac(); break;
         }

Modified: branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
===================================================================
--- branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul	2010-07-14 12:07:19 UTC (rev 16927)
+++ branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul	2010-07-14 15:03:15 UTC (rev 16928)
@@ -64,6 +64,15 @@
                 <menuseparator/>
                 <menuitem label="&staff.cat.opac.default.label;" id="default" oncommand="set_default();"/>
                 <menuitem label="&staff.cat.opac.refresh_me.label;" id="refresh_me" oncommand="refresh_display(docid);"/>
+                <menuseparator/>
+                <menu id="mfhd_menu" label="&staff.serial.mfhd_menu.label;">
+                    <menupopup id="mfhd_popup">
+                        <menuitem id="mfhd_add" label="&staff.serial.mfhd_menu.add.label;"/>
+                        <menu id="mfhd_edit" label="&staff.serial.mfhd_menu.edit.label;"/>
+                        <menu id="mfhd_delete" label="&staff.serial.mfhd_menu.delete.label;"/>
+                    </menupopup>
+                </menu>
+                <menuitem id="serctrl_view" label="&staff.serial.serctrl_view.label;" oncommand="set_serctrl_view();"/>
                 </menupopup>
                 </menu>
             </menubar>

Modified: branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2010-07-14 12:07:19 UTC (rev 16927)
+++ branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2010-07-14 15:03:15 UTC (rev 16928)
@@ -273,6 +273,37 @@
     'MARC_HTML_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.record.html', 'secure' : false },
     'FM_BLOB_RETRIEVE_VIA_Z3950_SEARCH' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.search_class' },
     'FM_BLOB_RETRIEVE_VIA_Z3950_RAW_SEARCH' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.search_service' },
+    'FM_SCAP_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.caption_and_pattern.batch.retrieve', 'secure' : false },
+    'FM_SCAP_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.caption_and_pattern.batch.retrieve', 'secure' : false },
+    'FM_SDIST_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution.fleshed.batch.retrieve', 'secure' : false },
+    'FM_SDIST_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution.fleshed.batch.retrieve.authoritative', 'secure' : false },
+    'FM_SDIST_ID_LIST' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.id_list.sdist'},
+    'FM_SDIST_RETRIEVE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.sdist'},
+    'FM_SDIST_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sdist'},
+    'FM_SDISTN_CREATE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_note.create' },
+    'FM_SDISTN_DELETE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_note.delete', 'secure' : false },
+    'FM_SDISTN_RETRIEVE_ALL' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_note.retrieve.all', 'secure' : false },
+    'FM_SIN_CREATE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item_note.create' },
+    'FM_SIN_DELETE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item_note.delete', 'secure' : false },
+    'FM_SIN_RETRIEVE_ALL' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item_note.retrieve.all', 'secure' : false },
+    'FM_SISS_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.issuance.fleshed.batch.retrieve', 'secure' : false },
+    'FM_SISS_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.issuance.fleshed.batch.retrieve.authoritative', 'secure' : false },
+    'FM_SITEM_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item.fleshed.batch.retrieve', 'secure' : false },
+    'FM_SITEM_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item.fleshed.batch.retrieve.authoritative', 'secure' : false },
+    'FM_SITEM_ID_LIST' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.id_list.sitem'},
+    'FM_SITEM_RETRIEVE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.sitem'},
+    'FM_SITEM_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sitem'},
+    'FM_SRE_RETRIEVE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.sre'},
+    'FM_SRE_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sre'},
+    'FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.retrieve_orgs_by_title', 'secure' : false },
+    'FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.retrieve_orgs_by_title.authoritative', 'secure' : false },
+    'FM_SSUB_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.fleshed.batch.retrieve', 'secure' : false },
+    'FM_SSUB_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.fleshed.batch.retrieve.authoritative', 'secure' : false },
+    'FM_SSUB_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription_tree.retrieve', 'secure' : false },
+    'FM_SSUB_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription_tree.retrieve.authoritative', 'secure' : false },
+    'FM_SSUBN_CREATE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription_note.create' },
+    'FM_SSUBN_DELETE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription_note.delete', 'secure' : false },
+    'FM_SSUBN_RETRIEVE_ALL' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription_note.retrieve.all', 'secure' : false },
     'RETRIEVE_Z3950_SERVICES' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.retrieve_services', 'secure' : false },
     'MARK_ITEM_DAMAGED' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.mark_item_damaged' },
     'MARK_ITEM_MISSING' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.mark_item_missing' },
@@ -392,6 +423,10 @@
     'XUL_RECORD_BUCKETS' : '/xul/server/cat/record_buckets.xul',
     'XUL_RECORD_BUCKETS_QUICK' : '/xul/server/cat/record_buckets_quick.xul',
     'XUL_REMOTE_BROWSER' : '/xul/server/util/rbrowser.xul',
+    'XUL_SERIAL_ITEM_EDITOR' : '/xul/server/serial/item_editor.xul',
+    'XUL_SERIAL_NOTES' : '/xul/server/serial/notes.xul',
+    'XUL_SERIAL_SELECT_AOU' : '/xul/server/serial/select_aou.xul',
+    'XUL_SERIAL_SERCTRL_MAIN' : '/xul/server/serial/serctrl_main.xul',
     'XUL_SPINE_LABEL' : '/xul/server/cat/spine_labels.xul',
     'XUL_STAGED_PATRONS' : '/xul/server/patron/staged.xul',
     'XUL_STANDALONE' : 'chrome://open_ils_staff_client/content/circ/offline.xul',



More information about the open-ils-commits mailing list