entry point and function stub for Mark Item as Missing Pieces
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jul 2010 22:32:56 +0000 (22:32 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jul 2010 22:32:56 +0000 (22:32 +0000)
entry point for scanning item as missing pieces and stub dialog

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17044 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/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
Open-ILS/xul/staff_client/server/cat/util.js
Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
Open-ILS/xul/staff_client/server/circ/missing_pieces.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/circ/missing_pieces.xul [new file with mode: 0644]

index 3cb28bf..df0b8a7 100644 (file)
 <!ENTITY staff.main.menu.circ.hold_pull.label "Pull List for Hold Requests">
 <!ENTITY staff.main.menu.circ.in_house.accesskey "I">
 <!ENTITY staff.main.menu.circ.in_house.label "Record In-House Use">
+<!ENTITY staff.main.menu.circ.scan_item_as_missing_pieces.accesskey "M">
+<!ENTITY staff.main.menu.circ.scan_item_as_missing_pieces.label "Scan Item as Missing Pieces">
 <!ENTITY staff.main.menu.circ.accesskey "C">
 <!ENTITY staff.main.menu.circ.label "Circulation">
 <!ENTITY staff.main.menu.circ.lost.key "L">
 <!ENTITY staff.circ.checkin_overlay.sel_backdate.accesskey "B">
 <!ENTITY staff.circ.checkin_overlay.sel_mark_items_damaged.label "Mark Item Damaged">
 <!ENTITY staff.circ.checkin_overlay.sel_mark_items_damaged.accesskey "D">
+<!ENTITY staff.circ.checkin_overlay.sel_mark_missing_pieces.label "Mark Item as Missing Pieces">
+<!ENTITY staff.circ.checkin_overlay.sel_mark_missing_pieces.accesskey "M">
 <!ENTITY staff.circ.checkin_overlay.sel_transit_abort.label "Abort Transit">
 <!ENTITY staff.circ.checkin_overlay.sel_spine.label "Print Spine Label">
 <!ENTITY staff.circ.checkin_overlay.sel_spine.accesskey "P">
index 3e8cb1b..cd5fab4 100644 (file)
@@ -402,6 +402,7 @@ var urls = {
     'XUL_STANDING_PENALTIES' : '/xul/server/patron/standing_penalties.xul',
     'XUL_NEW_STANDING_PENALTY' : '/xul/server/patron/new_standing_penalty.xul',
     'XUL_EDIT_STANDING_PENALTY' : '/xul/server/patron/edit_standing_penalty.xul',
+    'XUL_SCAN_ITEM_AS_MISSING_PIECES' : '/xul/server/circ/missing_pieces.xul',
     'XUL_STAT_CAT_EDIT' : '/xul/server/admin/stat_cat_editor.xhtml',
     'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul',
     'XUL_TIMESTAMP_DIALOG' : '/xul/server/util/timestamp.xul',
index bcda264..98db9fe 100644 (file)
@@ -504,6 +504,13 @@ main.menu.prototype = {
                 }
             ],
 
+            'cmd_scan_item_as_missing_pieces' : [
+                ['oncommand'],
+                function() { 
+                    xulG.window.open(obj.url_prefix(urls.XUL_SCAN_ITEM_AS_MISSING_PIECES),'scan_missing_pieces','chrome'); 
+                }
+            ],
+
             'cmd_standalone' : [
                 ['oncommand'],
                 function() { 
index 56731f5..d239dbe 100644 (file)
@@ -33,6 +33,7 @@
     <command id="cmd_browse_holds" />
     <command id="cmd_browse_holds_shelf" />
     <command id="cmd_in_house_use" key="circ-in-house-use" />
+    <command id="cmd_scan_item_as_missing_pieces" label="&staff.main.menu.circ.scan_item_as_missing_pieces.label;" accesskey="&staff.main.menu.circ.scan_item_as_missing_pieces.accesskey;" />
     <command id="cmd_copy_status" key="copy-status-key" />
     <command id="cmd_search_opac" key="search-opac-key" />
     <command id="cmd_public_opac" />
         <menuitem label="&staff.main.menu.circ.verify_credentials;" accesskey="&staff.main.menu.circ.verify_credentials.accesskey;" command="cmd_verify_credentials"/>
         <menuitem label="&staff.main.menu.replace_barcode.label;" command="cmd_replace_barcode"/>
         <menuitem label="&staff.main.menu.circ.in_house.label;" accesskey="&staff.main.menu.circ.in_house.accesskey;" key="circ-in-house-use-key" command="cmd_in_house_use"/>
+        <menuitem command="cmd_scan_item_as_missing_pieces"/>
         <menuseparator />
         <menuitem label="&staff.main.menu.circ.reprint.label;" accesskey="&staff.main.menu.circ.reprint.accesskey;" key="reprint-receipt-key" command="cmd_reprint"/>
         <menuitem label="&staff.main.menu.circ.offline.label;" command="cmd_standalone" accesskey="&staff.main.menu.circ.offline.accesskey;"/>
index 8e9a187..89d5bb3 100644 (file)
@@ -9,7 +9,7 @@ cat.util.EXPORT_OK    = [
     'spawn_copy_editor', 'add_copies_to_bucket', 'show_in_opac', 'spawn_spine_editor', 'transfer_copies', 
     'transfer_title_holds', 'mark_item_missing', 'mark_item_damaged', 'replace_barcode', 'fast_item_add', 
     'make_bookable', 'edit_new_brsrc', 'edit_new_bresv', 'batch_edit_volumes', 'render_fine_level',
-    'render_loan_duration'
+    'render_loan_duration', 'mark_item_as_missing_pieces'
 ];
 cat.util.EXPORT_TAGS    = { ':all' : cat.util.EXPORT_OK };
 
@@ -739,4 +739,7 @@ cat.util.render_loan_duration = function(value) {
     return text;
 }
 
+cat.util.mark_item_as_missing_pieces = function(copy_ids) {
+}
+
 dump('exiting cat/util.js\n');
index c895f0c..80441ec 100644 (file)
@@ -70,6 +70,7 @@ circ.checkin.prototype = {
                             obj.controller.view.sel_transit_abort.setAttribute('disabled','true');
                             obj.controller.view.sel_clip.setAttribute('disabled','true');
                             obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true');
+                            obj.controller.view.sel_mark_missing_pieces.setAttribute('disabled','true');
                         } else {
                             obj.controller.view.sel_edit.setAttribute('disabled','false');
                             obj.controller.view.sel_backdate.setAttribute('disabled','false');
@@ -82,6 +83,7 @@ circ.checkin.prototype = {
                             obj.controller.view.sel_transit_abort.setAttribute('disabled','false');
                             obj.controller.view.sel_clip.setAttribute('disabled','false');
                             obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','false');
+                            obj.controller.view.sel_mark_missing_pieces.setAttribute('disabled','false');
                         }
                     } catch(E) {
                         alert('FIXME: ' + E);
@@ -222,6 +224,14 @@ circ.checkin.prototype = {
                             cat.util.mark_item_damaged( util.functional.map_list( obj.selection_list, function(o) { return o.copy_id; } ) );
                         }
                     ],
+                    'sel_mark_missing_pieces' : [
+                        ['command'],
+                        function() {
+                            var funcs = [];
+                            JSAN.use('cat.util'); JSAN.use('util.functional');
+                            cat.util.mark_item_as_missing_pieces( util.functional.map_list( obj.selection_list, function(o) { return o.copy_id; } ) );
+                        }
+                    ],
                     'sel_bucket' : [
                         ['command'],
                         function() {
index ed4acec..1561a68 100644 (file)
@@ -29,6 +29,7 @@
     <command id="sel_spine" disabled="true"/>
     <command id="sel_transit_abort" disabled="true"/>
     <command id="sel_mark_items_damaged" disabled="true"/>
+    <command id="sel_mark_missing_pieces" disabled="true" label="&staff.circ.checkin_overlay.sel_mark_missing_pieces.label;" accesskey="&staff.circ.checkin_overlay.sel_mark_missing_pieces.accesskey;"/>
 
     <command id="cmd_do_not_alert_on_precat" />
     <command id="cmd_suppress_holds_and_transits" />
@@ -50,6 +51,7 @@
         <menuitem command="sel_backdate" label="&staff.circ.checkin_overlay.sel_backdate.label;" accesskey="&staff.circ.checkin_overlay.sel_backdate.accesskey;" />
         <menuseparator />
         <menuitem command="sel_mark_items_damaged" label="&staff.circ.checkin_overlay.sel_mark_items_damaged.label;" accesskey="&staff.circ.checkin_overlay.sel_mark_items_damaged.accesskey;"/>
+        <menuitem command="sel_mark_missing_pieces" />
         <menuseparator />
         <menuitem command="sel_transit_abort" label="&staff.circ.checkin_overlay.sel_transit_abort.label;" />
         <menuseparator />
                     <menuitem command="sel_backdate" label="&staff.circ.checkin_overlay.sel_backdate.label;" accesskey="&staff.circ.checkin_overlay.sel_backdate.accesskey;" />
                     <menuseparator />
                     <menuitem command="sel_mark_items_damaged" label="&staff.circ.checkin_overlay.sel_mark_items_damaged.label;" accesskey="&staff.circ.checkin_overlay.sel_mark_items_damaged.accesskey;"/>
+                    <menuitem command="sel_mark_missing_pieces" />
                     <menuseparator />
                     <menuitem command="sel_transit_abort" label="&staff.circ.checkin_overlay.sel_transit_abort.label;" />
                     <menuseparator />
diff --git a/Open-ILS/xul/staff_client/server/circ/missing_pieces.js b/Open-ILS/xul/staff_client/server/circ/missing_pieces.js
new file mode 100644 (file)
index 0000000..99eca39
--- /dev/null
@@ -0,0 +1,35 @@
+var error;
+
+function my_init() {
+    try {
+        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+        if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+        JSAN.errorLevel = "die"; // none, warn, or die
+        JSAN.addRepository('/xul/server/');
+        JSAN.use('util.error'); error = new util.error();
+        error.sdump('D_TRACE','my_init() for main_test.xul');
+
+        dojo.require('openils.PermaCrud');
+
+        var types = new openils.PermaCrud(
+            {
+                authtoken :ses()
+            }
+        ).retrieveAll('coust');
+
+        dojo.forEach(types,
+            function(type) {
+                alert( js2JSON(type) );
+            }
+        );
+
+        if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
+            try { window.xulG.set_tab_name('Test'); } catch(E) { alert(E); }
+        }
+
+    } catch(E) {
+        try { error.standard_unexpected_error_alert('main/test.xul',E); } catch(F) { alert(E); }
+    }
+}
+
+
diff --git a/Open-ILS/xul/staff_client/server/circ/missing_pieces.xul b/Open-ILS/xul/staff_client/server/circ/missing_pieces.xul
new file mode 100644 (file)
index 0000000..6e0602b
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Example Template for remote xul -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/global.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="main_test_win" 
+    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;
+    </script>
+    <scripts id="openils_util_scripts"/>
+
+    <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+    <script type="text/javascript" src="missing_pieces.js"/>
+
+    <label value="retrieving coust's with dojo and PermaCrud..."/>
+
+</window>
+