if the bibs and holdings have already been loaded into the ILS, the marc from the...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Apr 2009 20:36:41 +0000 (20:36 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Apr 2009 20:36:41 +0000 (20:36 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12930 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/templates/default/acq/common/li_table.tt2

index 19ce270..4997f5e 100644 (file)
@@ -13,6 +13,8 @@ dojo.require('openils.acq.Picklist');
 dojo.require('openils.widget.AutoFieldWidget');
 dojo.require('dojo.data.ItemFileReadStore');
 dojo.require('openils.widget.ProgressDialog');
+dojo.require('openils.PermaCrud');
+
 dojo.requireLocalization('openils.acq', 'acq');
 var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq');
 
@@ -354,7 +356,21 @@ function AcqLiTable() {
 
     this._drawInfo = function(li) {
 
-        acqLitEditMarc.onClick = function() { self.editMarc(li); }
+        acqLitEditOrderMarc.onClick = function() { self.editOrderMarc(li); }
+        acqLitEditILSMarc.onClick = function() { self.editILSMarc(li); }
+
+        if(li.eg_bib_id()) {
+            openils.Util.hide('acq-lit-marc-order-record-label');
+            openils.Util.hide(acqLitEditOrderMarc.domNode);
+            openils.Util.show('acq-lit-marc-real-record-label');
+            openils.Util.show(acqLitEditILSMarc.domNode);
+        } else {
+            openils.Util.show('acq-lit-marc-order-record-label');
+            openils.Util.show(acqLitEditOrderMarc.domNode);
+            openils.Util.hide('acq-lit-marc-real-record-label');
+            openils.Util.hide(acqLitEditILSMarc.domNode);
+        }
+
         this.drawMarcHTML(li);
         this.infoTbody = dojo.byId('acq-lit-info-tbody');
 
@@ -391,10 +407,14 @@ function AcqLiTable() {
     };
 
     this.drawMarcHTML = function(li) {
+        var params = [null, true, li.marc()];
+        if(li.eg_bib_id()) 
+            params = [li.eg_bib_id(), true];
+
         fieldmapper.standardRequest(
             ['open-ils.search', 'open-ils.search.biblio.record.html'],
             {   async: true,
-                params: [null, true, li.marc()],
+                params: params,
                 oncomplete: function(r) {
                     dojo.byId('acq-lit-marc-div').innerHTML = 
                         openils.Util.readResponse(r);
@@ -813,7 +833,7 @@ function AcqLiTable() {
         );
     }
 
-    this.editMarc = function(li) {
+    this.editOrderMarc = function(li) {
 
         /*  To run in Firefox directly, must set signed.applets.codebase_principal_support
             to true in about:config */
@@ -845,6 +865,39 @@ function AcqLiTable() {
     }
 
 
+    this.editILSMarc = function(li) {
+
+        /*  To run in Firefox directly, must set signed.applets.codebase_principal_support
+            to true in about:config */
+
+        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+        win = window.open('/xul/server/cat/marcedit.xul'); // XXX version?
+
+        var bib = new openils.PermaCrud().retrieve('bre', li.eg_bib_id());
+
+        var self = this;
+        win.xulG = {
+            record : {marc : li.marc()},
+            save : {
+                label: 'Save Record', // XXX I18N
+                func: function(xmlString) {
+                    bib.marc(xmlString);
+                    fieldmapper.standardRequest(
+                        ['open-ils.cat', 'open-ils.cat.biblio.record_entry.update'],
+                        {   async: true,
+                            params: [openils.User.authtoken, bib],
+                            oncomplete: function(r) {
+                                openils.Util.readResponse(r);
+                                win.close();
+                                self.drawInfo(li.id())
+                            }
+                        }
+                    );
+                },
+            }
+        };
+    }
+
     this._savePl = function(values) {
         var self = this;
         var selected = this.getSelected( (values.which == 'all') );
index 9be7b05..2fae5d8 100644 (file)
                                             <option mask='sr' value='save_picklist'>Save Items To Selection List</option>
                                             <option mask='pl' value='selector_ready'>Mark Ready for Selector</option>
                                             <option mask='pl' value='order_ready'>Mark Ready for Order</option>
-                                            <option mask='pl' value='create_order'>Create Purchase Order</option>
+                                            <option mask='po' value='' disabled='disabled'>------</option>
+                                            <option mask='po' value='create_order'>Create Purchase Order</option>
                                             <option mask='po' value='receive_po'>Mark Purchase Order as Received</option>
                                             <option mask='po' value='rollback_receive_po'>Un-Receive Purchase Order</option>
                                             <option mask='po' value='print_po'>Print Purchase Order</option>
-                                            <option mask='po' value='create_assets'>Create PO Assets</option>
+                                            <option mask='po' value='create_assets'>Load Bibs and Items</option>
+                                            <option mask='po' value='' disabled='disabled'>------</option>
                                             <option mask='*'  value='delete_selected'>Delete Selected Items</option>
                                         </select>
                                     </span>
             View in the <a href='/opac/en-US/skin/default/xml/rdetail.xml?r='>Catalog</a>
         </div>
         <div style='margin-top:40px;'>
-            <h3>MARC Record</h3>
+            <h3 id='acq-lit-marc-order-record-label'>MARC Order Record</h3>
+            <h3 id='acq-lit-marc-real-record-label'>MARC ILS Record</h3>
             <div>
-                <div dojoType='dijit.form.Button' jsId='acqLitEditMarc'>Edit MARC Record</div>
+                <div dojoType='dijit.form.Button' jsId='acqLitEditOrderMarc'>Edit MARC Order Record</div>
+                <div dojoType='dijit.form.Button' jsId='acqLitEditILSMarc'>Edit MARC ILS Record</div>
             </div>
             <div id='acq-lit-marc-div' style='margin-top:20px;'> </div>
         </div>