From a60039c11a1cbfb9e5363b98da2274ed5db170b9 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 20 Apr 2009 20:36:41 +0000 Subject: [PATCH] if the bibs and holdings have already been loaded into the ILS, the marc from the order record is no longer of much use. by default, let's show the live marc record and give a link to open the marc editor for the live marc record from the lineitem info page 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 | 59 ++++++++++++++++++++-- .../web/templates/default/acq/common/li_table.tt2 | 12 +++-- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 19ce27085..4997f5e99 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -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') ); diff --git a/Open-ILS/web/templates/default/acq/common/li_table.tt2 b/Open-ILS/web/templates/default/acq/common/li_table.tt2 index 9be7b0570..2fae5d8f2 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -16,11 +16,13 @@ - + + - + + @@ -104,9 +106,11 @@ View in the Catalog
-

MARC Record

+

MARC Order Record

+

MARC ILS Record

-
Edit MARC Record
+
Edit MARC Order Record
+
Edit MARC ILS Record
-- 2.11.0