create new marc record
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 20:37:10 +0000 (20:37 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 20:37:10 +0000 (20:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1552 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/cat/marc.js
Evergreen/staff_client/chrome/content/evergreen/main/app_shell_menus_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/main/app_shell_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js

index 918631e..a151807 100644 (file)
@@ -754,12 +754,20 @@ mw.sdump('D_CAT',' with intra_doc_id = ' + level1.intra_doc_id() + '\n');
        mw.sdump('D_CAT','Auth session: ' + mw.G['auth_ses'][0] + '\n');
        try {
                if (params.import_tree) {
-                       tree = user_request(
+
+                       if (params.new_tree) {
+                               tree = user_request(
+                                       'open-ils.cat',
+                                       'open-ils.cat.biblio.record_tree.create',
+                                       [ mw.G.auth_ses[0], tree ]
+                               )[0];
+                       } else {
+                               tree = user_request(
                                        'open-ils.cat',
                                        'open-ils.cat.biblio.record.tree.import',
                                        [ mw.G['auth_ses'][0], tree ]
-                       )[0];
-       
+                               )[0];
+                       }
                } else {
                        tree = user_request(
                                        'open-ils.cat',
index 2e66610..8d71a30 100644 (file)
@@ -81,6 +81,7 @@
                <menuitem label="&main.menu.cat.bib_search.label;" accesskey="&main.menu.cat.bib_search.key;" observes="cmd_search_opac"/>
                <menuseparator />
                <menuitem disabled="true" label="&main.menu.cat.dedup.label;" accesskey="&main.menu.cat.dedup.key;" observes="cmd_broken"/>
+               <menuitem label="Create New Marc Record" accesskey="n" observes="cmd_create_new_marc_book"/>
                <menuitem label="Z39.50 Import" accesskey="Z" observes="cmd_z39_50_import"/>
        </menupopup>
 </menu>
index 4c053a4..e12687f 100644 (file)
@@ -57,6 +57,9 @@
        <command id="cmd_z39_50_import" oncommand="
                mw.spawn_z3950_import(document,'replace_tab','main_tabbox',{}); "/>     
 
+       <command id="cmd_create_new_marc_book" oncommand="
+               mw.spawn_new_marc_creation(document,'replace_tab','main_tabbox',{}); "/>        
+
        <command id="cmd_console" oncommand="
                mw.spawn_javascript_console(document,'new_tab','main_tabbox',{}); "/>
 
index 1a71f82..9a3c765 100644 (file)
@@ -179,6 +179,23 @@ function spawn_oclc_import(d,placement,place,passthru_params,clone) {
        }
 }
 
+function spawn_new_marc_creation(d,placement,place,passthru_params,clone) {
+       sdump('D_SPAWN','trying to spawn_new_marc_creation('+js2JSON(passthru_params)+')\n');
+       if (! passthru_params.type) passthru_params.type = 'book';
+       try {
+               var record = user_request(
+                       'open-ils.cat',
+                       'open-ils.cat.biblio.marc_template.retrieve',
+                       [ passthru_params.type ]
+               )[0];
+               passthru_params['import_tree'] = record;
+               passthru_params['new_tree'] = true;
+               spawn_marc_editor(d,placement,place,passthru_params);
+       } catch(E) {
+               mw.handle_error(E);
+       }
+}
+
 function spawn_patron_edit(d,placement,place,passthru_params,clone) {
        var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
        return spawn_interface(d,placement,place,chrome,getString('patron_editor_interface_label'),passthru_params,clone);