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');
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');
};
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);
);
}
- 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 */
}
+ 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') );
<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>