edit copy context commands
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 21:19:49 +0000 (21:19 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 21:19:49 +0000 (21:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1557 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.js
Evergreen/staff_client/chrome/content/evergreen/circ/checkin.js
Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js

index 83fa9ca..88f00ee 100644 (file)
@@ -26,7 +26,7 @@ function copy_edit_init() {
                mw.sdump('D_CAT','id_mapped_list.length = ' + id_mapped_list.length + '\n');
        }
        if (params.copy_ids) {
-               id_mapped_list = id_mapped_list.concat( copy_ids );
+               id_mapped_list = id_mapped_list.concat( params.copy_ids );
        }
        var result = [];
        try {
@@ -42,8 +42,8 @@ function copy_edit_init() {
        cn_list = new Array();
        for (var i in result) {
                cn_list[i] = new acn();
-               cn_list[i].label( filtered_list[i].getAttribute('callnumber') );
-               cn_list[i].owning_lib( filtered_list[i].getAttribute('ou_id') );
+               try { cn_list[i].label( filtered_list[i].getAttribute('callnumber') ); } catch(E) { cn_list[i].label( 'dummy callnumber' ); }
+               try { cn_list[i].owning_lib( filtered_list[i].getAttribute('ou_id') ); } catch(E) { cn_list[i].owning_lib( 1 ); }
                cn_list[i].copies( [ result[i] ] );
        }
        mw.sdump('D_CAT','cn_list = ' + js2JSON(cn_list) + '\n');
index 20dfe0f..aa7ae95 100755 (executable)
@@ -139,10 +139,15 @@ function checkin_checkin_items_init(p) {
                        menuitem.addEventListener(
                                'command',
                                function (ev) {
-                                       alert('Not Yet Implemented');
                                        for (var i = 0; i < checkin_items.length; i++) {
                                                var idx = checkin_items[i].getAttribute('record_id');
+                                               var copy = checkins[idx].copy;
                                                sdump('D_CHECKIN','Firing copy edit context\n');
+                                               spawn_batch_copy_editor(
+                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
+                                                               'copy_ids' : [ copy.id() ]
+                                                       }
+                                               );
                                        }
                                },
                                false
index 9edfc8b..b7b1388 100755 (executable)
@@ -127,10 +127,15 @@ function hold_capture_hold_capture_items_init(p) {
                        menuitem.addEventListener(
                                'command',
                                function (ev) {
-                                       alert('Not Yet Implemented');
                                        for (var i = 0; i < hold_capture_items.length; i++) {
                                                var idx = hold_capture_items[i].getAttribute('record_id');
+                                               var copy = hold_captures[idx].copy;
                                                sdump('D_HOLD_CAPTURE','Firing copy edit context\n');
+                                               spawn_batch_copy_editor(
+                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
+                                                               'copy_ids' : [ copy.id() ]
+                                                       }
+                                               );
                                        }
                                },
                                false
index 947698a..74db90f 100755 (executable)
@@ -271,10 +271,16 @@ function patron_display_patron_items_init(p) {
                        menuitem_pi_ce.addEventListener(
                                'command',
                                function (ev) {
-                                       alert('Not Yet Implemented');
                                        sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_items\n');
                                        for (var i = 0; i < patron_items.length; i++) {
                                                sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
+                                               var idx = patron_items[i].getAttribute('record_id'); 
+                                               var copy = p._patron.checkouts()[ idx ].copy;
+                                               spawn_batch_copy_editor(
+                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
+                                                               'copy_ids' : [ copy.id() ]
+                                                       }
+                                               );
                                        }
                                },
                                false
@@ -447,11 +453,16 @@ function patron_display_patron_checkout_items_init(p) {
                        menuitem_pci_ce.addEventListener(
                                'command',
                                function (ev) {
-                                       alert('Not Yet Implemented');
                                        sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_checkout_items\n');
                                        for (var i = 0; i < patron_checkout_items.length; i++) {
                                                var idx = patron_checkout_items[i].getAttribute('record_id');
+                                               var copy = checkouts[ idx ].copy;
                                                sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
+                                               spawn_batch_copy_editor(
+                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
+                                                               'copy_ids' : [ copy.id() ]
+                                                       }
+                                               );
                                        }
                                },
                                false
@@ -550,10 +561,16 @@ function patron_display_patron_holds_init(p) {
                        menuitem_ph_ce.addEventListener(
                                'command',
                                function (ev) {
-                                       alert('Not Yet Implemented');
                                        sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_holds\n');
                                        for (var i = 0; i < patron_holds.length; i++) {
                                                sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
+                                               var idx = patron_holds[i].getAttribute('record_id'); 
+                                               var copy = p._patron.hold_requests()[ idx ].copy;
+                                               spawn_batch_copy_editor(
+                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
+                                                               'copy_ids' : [ copy.id() ]
+                                                       }
+                                               );
                                        }
                                },
                                false