[open-ils-commits] r12893 - in trunk/Open-ILS: src/perlmods/OpenILS/Application/Acq web/js/ui/default/acq/common web/js/ui/default/acq/picklist web/js/ui/default/acq/po web/templates/default/acq/common (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 16 11:57:51 EDT 2009
Author: erickson
Date: 2009-04-16 11:57:49 -0400 (Thu, 16 Apr 2009)
New Revision: 12893
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js
trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
initial support for lineitem notes
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm 2009-04-16 15:29:54 UTC (rev 12892)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm 2009-04-16 15:57:49 UTC (rev 12893)
@@ -90,14 +90,15 @@
my $li;
- if($$options{flesh_attrs}) {
- $li = $e->retrieve_acq_lineitem([
- $li_id, {flesh => 1, flesh_fields => {jub => ['attributes']}}])
- or return $e->event;
- } else {
- $li = $e->retrieve_acq_lineitem($li_id) or return $e->event;
+ my $flesh = {};
+ if($$options{flesh_attrs} or $$options{flesh_notes}) {
+ $flesh = {flesh => 1, flesh_fields => {jub => []}};
+ push(@{$flesh->{flesh_fields}->{jub}}, 'lineitem_notes') if $$options{flesh_notes};
+ push(@{$flesh->{flesh_fields}->{jub}}, 'attributes') if $$options{flesh_attrs};
}
+ $li = $e->retrieve_acq_lineitem([$li_id, $flesh]);
+
if($$options{flesh_li_details}) {
my $ops = {
flesh => 1,
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm 2009-04-16 15:29:54 UTC (rev 12892)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm 2009-04-16 15:57:49 UTC (rev 12893)
@@ -333,6 +333,7 @@
"idlist", return a list of IDs instead of objects
"flesh_attrs", additionaly return the list of flattened attributes
"clear_marc", discards the raw MARC data to reduce data size
+ "flesh_notes", flesh lineitem notes
/,
type => 'hash'}
],
@@ -393,8 +394,12 @@
}
my $entry;
- my $flesh = ($$options{flesh_attrs}) ?
- {flesh => 1, flesh_fields => {jub => ['attributes']}} : {};
+ my $flesh = {};
+ if($$options{flesh_attrs} or $$options{flesh_notes}) {
+ $flesh = {flesh => 1, flesh_fields => {jub => []}};
+ push(@{$flesh->{flesh_fields}->{jub}}, 'lineitem_notes') if $$options{flesh_notes};
+ push(@{$flesh->{flesh_fields}->{jub}}, 'attributes') if $$options{flesh_attrs};
+ }
$entry = $e->retrieve_acq_lineitem([$id, $flesh]);
my $details = $e->search_acq_lineitem_detail({lineitem => $id}, {idlist=>1});
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-16 15:29:54 UTC (rev 12892)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-04-16 15:57:49 UTC (rev 12893)
@@ -125,6 +125,7 @@
this.addLineitem = function(li) {
this.liCache[li.id()] = li;
+ if(!li.lineitem_notes()) li.lineitem_notes([]);
var liWrapper = new openils.acq.Lineitem({lineitem:li});
var row = self.rowTemplate.cloneNode(true);
row.setAttribute('li', li.id());
@@ -140,7 +141,9 @@
dojo.query('[attr=title]', row)[0].onclick = function() {self.drawInfo(li.id())};
dojo.query('[name=copieslink]', row)[0].onclick = function() {self.drawCopies(li.id())};
- dojo.query('[name=count]', row)[0].appendChild(document.createTextNode(li.item_count()));
+ dojo.query('[name=count]', row)[0].innerHTML = li.item_count();
+ dojo.query('[name=notes_count]', row)[0].innerHTML = li.lineitem_notes().length;
+ dojo.query('[name=noteslink]', row)[0].onclick = function() {self.drawLiNotes(li)};
var priceInput = dojo.query('[name=estimated_price]', row)[0];
var priceData = liWrapper.getPrice();
@@ -151,8 +154,11 @@
self.selectors.push(dojo.query('[name=selectbox]', row)[0]);
};
- self.updateLiPrice = function(input, li) {
+ this.drawLiNotes = function(li) {
+ }
+ this.updateLiPrice = function(input, li) {
+
var price = input.value;
var liWrapper = new openils.acq.Lineitem({lineitem:li});
var oldPrice = liWrapper.getPrice() || null;
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-16 15:29:54 UTC (rev 12892)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js 2009-04-16 15:57:49 UTC (rev 12893)
@@ -77,7 +77,7 @@
['open-ils.acq', 'open-ils.acq.lineitem.picklist.retrieve'],
{ async: true,
params: [openils.User.authtoken, plId,
- {flesh_attrs:true, clear_marc:true, offset:plOffset, limit:plLimit}],
+ {flesh_notes:true, flesh_attrs:true, clear_marc:true, offset:plOffset, limit:plLimit}],
onresponse: function(r) {
liTable.show('list');
liTable.addLineitem(openils.Util.readResponse(r));
Modified: trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js 2009-04-16 15:29:54 UTC (rev 12892)
+++ trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js 2009-04-16 15:57:49 UTC (rev 12893)
@@ -24,7 +24,7 @@
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.lineitem.search'],
{ async: true,
- params: [openils.User.authtoken, {purchase_order:poId}, {flesh_attrs:true}],
+ params: [openils.User.authtoken, {purchase_order:poId}, {flesh_attrs:true, flesh_notes:true}],
onresponse: function(r) {
liTable.show('list');
liTable.addLineitem(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-04-16 15:29:54 UTC (rev 12892)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-04-16 15:57:49 UTC (rev 12893)
@@ -47,7 +47,8 @@
<td><span><a id='acq-lit-select-toggle' href='javascript:void(0);'>✓</a></span></td>
<td>Line Items</td>
<td>Estimated Price</td>
- <td>Copies</td>
+ <td>Items</td>
+ <td>Notes</td>
</tr>
</tbody>
<tbody id='acq-lit-tbody'>
@@ -80,9 +81,12 @@
<input type='text' size='8' name='estimated_price'/>
</td>
<td>
- <a name='copieslink' href='javascript:void(0);'
- style='margin-right:20px;'>Copies(<span name='count'></span>)</a>
+ <a name='copieslink' href='javascript:void(0);'>Copies(<span name='count'>0</span>)</a>
</td>
+ <td>
+ <a name='noteslink' href='javascript:void(0);'
+ style='margin-right:15px;'>Notes(<span name='notes_count'>0</span>)</a>
+ </td>
</tr>
</tbody>
</table>
More information about the open-ils-commits
mailing list