[open-ils-commits] r12560 - in trunk/Open-ILS/web: js/ui/default/acq/picklist templates/default/acq/picklist (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 17 11:32:14 EDT 2009
Author: erickson
Date: 2009-03-17 11:32:12 -0400 (Tue, 17 Mar 2009)
New Revision: 12560
Added:
trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js
Modified:
trunk/Open-ILS/web/templates/default/acq/picklist/view.tt2
Log:
plug in li table to picklist display
Added: trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/view.js 2009-03-17 15:32:12 UTC (rev 12560)
@@ -0,0 +1,61 @@
+dojo.require('dojo.date.stamp');
+dojo.require('dojo.date.locale');
+dojo.require('openils.User');
+dojo.require('openils.Util');
+dojo.require('dijit.layout.ContentPane');
+
+var plist;
+var plOffset = 0;
+var plLimit = 20;
+var liTable;
+
+
+function load() {
+ liTable = new AcqLiTable();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.picklist.retrieve'],
+ { async: true,
+ params: [openils.User.authtoken, plId,
+ {flesh_lineitem_count:true, flesh_owner:true}],
+ oncomplete: function(r) {
+ plist = openils.Util.readResponse(r);
+ drawPl(plist);
+ }
+ }
+ );
+
+}
+
+function drawPl() {
+
+ dojo.byId("oils-acq-picklist-name").innerHTML = plist.name();
+ dojo.byId("oils-acq-picklist-attr-owner").innerHTML = plist.owner().usrname();
+
+ dojo.byId("oils-acq-picklist-attr-cdate").innerHTML =
+ dojo.date.locale.format(
+ dojo.date.stamp.fromISOString(plist.create_time()),
+ {selector:'date'}
+ );
+
+ dojo.byId("oils-acq-picklist-attr-edate").innerHTML =
+ dojo.date.locale.format(
+ dojo.date.stamp.fromISOString(plist.edit_time()),
+ {selector:'date'}
+ );
+
+ fieldmapper.standardRequest(
+ ['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}],
+ onresponse: function(r) {
+ liTable.showTable();
+ liTable.addLineitem(openils.Util.readResponse(r));
+ }
+ }
+ );
+}
+
+openils.Util.addOnLoad(load);
+
+
Modified: trunk/Open-ILS/web/templates/default/acq/picklist/view.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/picklist/view.tt2 2009-03-17 15:31:57 UTC (rev 12559)
+++ trunk/Open-ILS/web/templates/default/acq/picklist/view.tt2 2009-03-17 15:32:12 UTC (rev 12560)
@@ -1,11 +1,6 @@
[% WRAPPER 'default/base.tt2' %]
-<script type='text/javascript'>
- dojo.require('dijit.layout.LayoutContainer');
- dojo.require('dijit.layout.ContentPane');
- dojo.require('openils.acq.Picklist');
-</script>
-
-<div dojoType="dijit.layout.LayoutContainer" style="height:100%">
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/view.js'> </script>
+<div dojoType="dijit.layout.ContentPane" style="height:100%">
<div class='container'>
<div id='oils-acq-picklist-header'>
Picklist
@@ -18,24 +13,8 @@
</div>
</div>
</div>
- <script type="text/javascript">
- dojo.require('openils.Util');
- var plist = null;
- function loadPL() {
- plist = new openils.acq.Picklist([% ctx.page_args.0 %],
- function(model) {
- dojo.byId("oils-acq-picklist-name").innerHTML = plist.name();
- dojo.byId("oils-acq-picklist-attr-cdate").innerHTML = plist.create_time();
- dojo.byId("oils-acq-picklist-attr-edate").innerHTML = plist.edit_time();
- dojo.byId("oils-acq-picklist-attr-owner").innerHTML = plist.owner();
- JUBGrid.populate(pickListGrid, model, plist._items);
- }
- );
- }
- openils.Util.addOnLoad(loadPL);
- </script>
- [% grid_jsid = 'pickListGrid'; domprefix = 'oils-acq-picklist' %]
- [% INCLUDE 'default/acq/common/jubgrid.tt2' %]
+ <script type="text/javascript">var plId = '[% ctx.page_args.0 %]';</script>
+ [% INCLUDE 'default/acq/common/li_table.tt2' %]
</div>
[% END %]
More information about the open-ils-commits
mailing list