[open-ils-commits] r13014 - in trunk/Open-ILS/web: js/ui/default/acq/common js/ui/default/acq/picklist templates/default/acq/common templates/default/acq/picklist (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 29 10:34:12 EDT 2009
Author: erickson
Date: 2009-04-29 10:34:10 -0400 (Wed, 29 Apr 2009)
New Revision: 13014
Modified:
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js
trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js
trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
trunk/Open-ILS/web/templates/default/acq/picklist/brief_record.tt2
Log:
added access points to picklist and PO view UI for creating brief records
Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-04-29 13:45:11 UTC (rev 13013)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-04-29 14:34:10 UTC (rev 13014)
@@ -703,6 +703,12 @@
case 'create_assets':
this.createAssets();
break;
+
+ case 'add_brief_record':
+ if(this.isPO)
+ location.href = oilsBasePath + '/acq/picklist/brief_record?po=' + this.isPO;
+ else
+ location.href = oilsBasePath + '/acq/picklist/brief_record?pl=' + this.isPL;
}
}
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js 2009-04-29 13:45:11 UTC (rev 13013)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js 2009-04-29 14:34:10 UTC (rev 13014)
@@ -8,25 +8,59 @@
dojo.require('openils.widget.AutoFieldWidget');
dojo.require('openils.MarcXPathParser');
dojo.require('openils.acq.Picklist');
+dojo.require('openils.CGI');
var attrDefs = {};
+var paramPL = null;
+var paramPO = null;
function drawBriefRecordForm(fields) {
var tbody = dojo.byId('acq-brief-record-tbody');
var rowTmpl = dojo.byId('acq-brief-record-row');
+ var cgi = new openils.CGI();
+ paramPL = cgi.param('pl');
+ paramPO = cgi.param('po');
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.picklist.user.retrieve.atomic'],
- { async: true,
- params: [openils.User.authtoken],
- oncomplete : function(r) {
- var list = openils.Util.readResponse(r);
- plSelector.store =
- new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(list)});
+
+ if(paramPL) {
+ openils.Util.hide('acq-brief-record-po-row');
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.picklist.retrieve'],
+ { async: true,
+ params: [openils.User.authtoken, paramPL],
+ oncomplete : function(r) {
+ var pl = openils.Util.readResponse(r);
+ plSelector.store =
+ new dojo.data.ItemFileReadStore({data:acqpl.toStoreData([pl])});
+ plSelector.attr('value', pl.name());
+ plSelector.attr('disabled', true);
+ }
}
+ );
+
+ } else {
+
+ if(paramPO) {
+ openils.Util.hide('acq-brief-record-pl-row');
+ poNumber.attr('value', paramPO);
+
+ } else {
+ openils.Util.hide('acq-brief-record-po-row');
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.picklist.user.retrieve.atomic'],
+ { async: true,
+ params: [openils.User.authtoken],
+ oncomplete : function(r) {
+ var list = openils.Util.readResponse(r);
+ plSelector.store =
+ new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(list)});
+ }
+ }
+ );
}
- );
+ }
marcEditButton.onClick = function(fields) {
@@ -68,6 +102,20 @@
function saveBriefRecord(fields, editMarc) {
+ if(paramPL) {
+ fields.picklist = paramPL;
+ delete fields.po;
+ compileBriefRecord(fields, editMarc);
+ return false;
+ }
+
+ if(paramPO) {
+ fields.po = paramPO;
+ delete fields.picklist;
+ compileBriefRecord(fields, editMarc);
+ return false;
+ }
+
// first, deal with the selection list
var picklist = plSelector.attr('value');
@@ -88,14 +136,14 @@
openils.acq.Picklist.create(
{name:picklist, org_unit: openils.User.user.ws_ou()},
function(plId) {
- dojo.mixin(fields, {picklist:plId});
+ fields.picklist = plId;
compileBriefRecord(fields, editMarc);
}
);
} else {
var id = plSelector.store.getValue(items[0], 'id');
- dojo.mixin(fields, {picklist:id});
+ fields.picklist = id;
compileBriefRecord(fields, editMarc);
}
}
@@ -143,6 +191,7 @@
var li = new fieldmapper.jub();
li.marc(xmlString);
li.picklist(fields.picklist);
+ if(fields.po) li.purchase_order(fields.po);
li.selector(openils.User.user.id());
li.creator(openils.User.user.id());
li.editor(openils.User.user.id());
@@ -158,7 +207,9 @@
// XXX load marc editor
} else {
if(fields.picklist)
- location.href = location.href + '/../view/' + fields.picklist;
+ location.href = oilsBasePath + '/acq/picklist/view/' + fields.picklist;
+ else
+ location.href = oilsBasePath + '/acq/po/view/' + fields.po;
}
}
}
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js 2009-04-29 13:45:11 UTC (rev 13013)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js 2009-04-29 14:34:10 UTC (rev 13014)
@@ -12,6 +12,7 @@
function load() {
liTable = new AcqLiTable();
+ liTable.isPL = plId;
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.picklist.retrieve'],
{ async: true,
Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-04-29 13:45:11 UTC (rev 13013)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-04-29 14:34:10 UTC (rev 13014)
@@ -17,6 +17,7 @@
<option mask='pl' value='selector_ready'>Mark Ready for Selector</option>
<option mask='pl' value='order_ready'>Mark Ready for Order</option>
<option mask='*' value='delete_selected'>Delete Selected Items</option>
+ <option mask='*' value='add_brief_record'>Add Brief Record</option>
<option mask='po' value='' disabled='disabled'>----PO----</option>
<option mask='sr|pl' value='create_order'>Create Purchase Order</option>
<option mask='po' value='create_assets'>Load Bibs and Items</option>
Modified: trunk/Open-ILS/web/templates/default/acq/picklist/brief_record.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/picklist/brief_record.tt2 2009-04-29 13:45:11 UTC (rev 13013)
+++ trunk/Open-ILS/web/templates/default/acq/picklist/brief_record.tt2 2009-04-29 14:34:10 UTC (rev 13014)
@@ -8,10 +8,14 @@
</script>
<table class='oils-generic-table'>
<tbody id='acq-brief-record-tbody'>
- <tr>
+ <tr id='acq-brief-record-pl-row'>
<td>Add To Selection List</td>
<td><select dojoType='dijit.form.ComboBox' jsId='plSelector'/></td>
</tr>
+ <tr id='acq-brief-record-po-row'>
+ <td>Adding to Purchse Order</td>
+ <td><input dojoType='dijit.form.TextBox' jsId='poNumber' disabled='disabled'/></td>
+ </tr>
<tr id='acq-brief-record-row'>
<td><div name='name'/></td>
<td><div name='widget'/></td>
More information about the open-ils-commits
mailing list