[open-ils-commits] r12556 - in trunk/Open-ILS/web: js/ui/default/acq/common templates/default/acq/common (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 17 10:17:57 EDT 2009
Author: erickson
Date: 2009-03-17 10:17:55 -0400 (Tue, 17 Mar 2009)
New Revision: 12556
Modified:
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
started lineitem info pane, which shows marc record and (eventually) all lineitem attrs. will also link to li_details
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-03-17 03:13:11 UTC (rev 12555)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-03-17 14:17:55 UTC (rev 12556)
@@ -1,3 +1,5 @@
+dojo.require('openils.User');
+dojo.require('openils.Util');
dojo.require('openils.acq.Lineitem');
function AcqLiTable() {
@@ -8,6 +10,7 @@
this.tbody = dojo.byId('acq-lit-tbody');
this.selectors = [];
this.rowTemplate = this.tbody.removeChild(dojo.byId('acq-lit-row'));
+ this.authtoken = openils.User.authtoken;
dojo.byId('acq-lit-select-toggle').onclick = function(){self.toggleSelect()};
this.reset = function() {
@@ -62,9 +65,64 @@
var tds = dojo.query('[attr]', row);
dojo.forEach(tds, function(td) {self.setRowAttr(td, liWrapper, td.getAttribute('attr'));});
dojo.query('[name=source_label]', row)[0].appendChild(document.createTextNode(li.source_label()));
+ var isbn = liWrapper.findAttr('isbn', 'lineitem_marc_attr_definition');
+ if(isbn) {
+ // XXX media prefix for added content
+ dojo.query('[name=jacket]', row)[0].setAttribute('src', '/opac/extras/ac/jacket/small/' + isbn);
+ }
+ dojo.query('[attr=title]', row)[0].onclick = function() {self.drawInfo(li.id())};
self.tbody.appendChild(row);
self.selectors.push(dojo.query('[name=selectbox]', row)[0]);
};
+
+ this.drawInfo = function(liId) {
+ //if(!this.liAttrDefs)
+
+ this.showInfo();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem.retrieve'],
+ { async: true,
+
+ params: [self.authtoken, liId, {
+ flesh_attrs: true,
+ flesh_li_details: true,
+ flesh_fund: true,
+ flesh_fund_debit: true }],
+
+ oncomplete: function(r) {
+ var li = openils.Util.readResponse(r);
+ self._drawInfo(li);
+ }
+ }
+ );
+ };
+
+ this._drawInfo = function(li) {
+ this.drawMarcHTML(li);
+ this.infoTbody = dojo.byId('acq-lit-info-tbody');
+ if(!this.infoRow)
+ this.infoRow = this.infoTbody.removeChild(dojo.byId('acq-lit-info-row'));
+ for(var i = 0; i < li.attributes().length; i++) {
+ var attr = li.attributes()[i];
+ var row = this.infoRow.cloneNode(true);
+ dojo.query('[name=label]', row)[0].appendChild(document.createTextNode(attr.attr_name()));
+ dojo.query('[name=value]', row)[0].appendChild(document.createTextNode(attr.attr_value()));
+ this.infoTbody.appendChild(row);
+ }
+ };
+
+ this.drawMarcHTML = function(li) {
+ fieldmapper.standardRequest(
+ ['open-ils.search', 'open-ils.search.biblio.record.html'],
+ { async: true,
+ params: [null, true, li.marc()],
+ oncomplete: function(r) {
+ dojo.byId('acq-lit-marc-div').innerHTML =
+ openils.Util.readResponse(r);
+ }
+ }
+ );
+ }
}
Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-03-17 03:13:11 UTC (rev 12555)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-03-17 14:17:55 UTC (rev 12556)
@@ -12,7 +12,10 @@
<td name='selector'><input type='checkbox' name='selectbox'/></td>
<td>
<table>
- <tr><td attr='title' colspan='0'/></tr>
+ <tr>
+ <td rowspan='3'><img style='width:40px;height:65px;' name='jacket' onerror='dojo.style(this, "display", "none")'/></td>
+ <td colspan='0'><a href='javascript:void(0);' attr='title'></a></td>
+ </tr>
<tr class='acq-lit-alt-row'>
<td/>
<td attr='author'/>
@@ -33,6 +36,15 @@
</table>
</div>
<div id='acq-lit-info-div' class='hidden'>
+ <table>
+ <tbody id='acq-lit-info-tbody'>
+ <tr id='acq-lit-info-row'><td name='label'/><td name='value'/></tr>
+ </tbody>
+ </table>
+ <div style='margin-top:40px;'>
+ <h3>MARC Record</h3>
+ <div id='acq-lit-marc-div' style='margin-top:20px;'/>
+ </div>
</div>
</div>
More information about the open-ils-commits
mailing list