[open-ils-commits] r9923 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/common
templates/oils/default/acq/picklist templates/oils/default/common
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jun 25 12:30:37 EDT 2008
Author: erickson
Date: 2008-06-25 12:30:34 -0400 (Wed, 25 Jun 2008)
New Revision: 9923
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
Log:
added the ability to hide the lineite details display in the jubgrid. hiding in bib search
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-06-25 16:03:12 UTC (rev 9922)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-06-25 16:30:34 UTC (rev 9923)
@@ -75,22 +75,24 @@
}
JUBGrid.jubGrid = gridWidget;
JUBGrid.jubGrid.setModel(model);
- dojo.connect(gridWidget, "onRowClick",
- function(evt) {
- var jub = model.getRow(evt.rowIndex);
- var grid;
+ if(JUBGrid.showDetails) {
+ dojo.connect(gridWidget, "onRowClick",
+ function(evt) {
+ var jub = model.getRow(evt.rowIndex);
+ var grid;
- JUBGrid.jubDetailGrid.lineitemID = jub.id;
+ JUBGrid.jubDetailGrid.lineitemID = jub.id;
- if (jub.state == "approved") {
- grid = JUBGrid.jubDetailGridLayoutReadOnly;
- } else {
- grid = JUBGrid.jubDetailGridLayout;
- }
- openils.acq.Lineitems.loadGrid(
- JUBGrid.jubDetailGrid,
- JUBGrid.jubGrid.model.getRow(evt.rowIndex).id, grid);
- });
+ if (jub.state == "approved") {
+ grid = JUBGrid.jubDetailGridLayoutReadOnly;
+ } else {
+ grid = JUBGrid.jubDetailGridLayout;
+ }
+ openils.acq.Lineitems.loadGrid(
+ JUBGrid.jubDetailGrid,
+ JUBGrid.jubGrid.model.getRow(evt.rowIndex).id, grid);
+ });
+ }
gridWidget.update();
},
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-06-25 16:03:12 UTC (rev 9922)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-06-25 16:30:34 UTC (rev 9923)
@@ -80,7 +80,7 @@
</table>
</div>
</div>
- ${jubgrid.jubgrid('oils-acq-lineitem', 'plResultGrid')}
+ ${jubgrid.jubgrid('oils-acq-lineitem', 'plResultGrid', True)}
</div>
<script>dojo.style('oils-acq-pl-search-results', 'visibility', 'hidden');</script>
</%def>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-06-25 16:03:12 UTC (rev 9922)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-06-25 16:30:34 UTC (rev 9923)
@@ -1,4 +1,4 @@
-<%def name='jubgrid(domprefix, grid_jsid)'>
+<%def name='jubgrid(domprefix, grid_jsid, hide_details=False)'>
<%doc>
This template creates a split screen Dojo layout. The top frame
of the screen holds a list of of JUBs, or titles. Clicking on a
@@ -17,7 +17,7 @@
'grid_jsid' is a valid JavaScript identifier that will name the
DOM node to which the list of JUBs will be attached. For example
- ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid')}
+ ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid', hideDetails)}
will create a Dojo grid with the DOM id of
@@ -37,12 +37,19 @@
</%doc>
+% if not hide_details:
<div dojoType="dijit.layout.SplitContainer" style='height:100%'
orientation="vertical" sizerWidth="5"
activeSizing="1" layoutAlign="client">
+% endif
<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/common/jubgrid.js'> </script>
<script type="text/javascript">
+ JUBGrid.getPO = function(rowIndex) {
+ var data = JUBGrid.jubGrid.model.getRow(rowIndex);
+ if (!(data && data.purchase_order)) return '';
+ return "<a href='${c.oils.core.prefix.value}/acq/po/view/" + data.purchase_order+"'>"+data.purchase_order+"</a>";
+ }
JUBGrid.jubGridLayout = [{
cells: [[
{name: "ID", field: 'id'},
@@ -52,8 +59,9 @@
{name: '${_("Pubdate")}', get:JUBGrid.getJUBPubdate},
{name: "Price", get:JUBGrid.getJUBPrice},
{name: "Vendor", get:JUBGrid.getProvider},
- {name: "# of Copies", field: 'item_count'},
- {name: "State", field: 'state'}
+ {name: "# Copies", field: 'item_count'},
+ {name: "State", field: 'state'},
+ {name: "PO", get:JUBGrid.getPO}
]]
}];
@@ -84,17 +92,21 @@
}];
</script>
+% if not hide_details:
+ <script>JUBGrid.showDetails = true;</script>
<div id="${domprefix + '-container'}"
- dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="50">
- <div dojoType="dijit.layout.ContentPane"
- id=${domprefix+"-jub-buttonbar"}>
- <button dojoType="dijit.form.Button" onclick="JUBGrid.approveJUB">
- ${_('Approve Selected Titles')}
- </button>
- </div>
- <div structure='JUBGrid.jubGridLayout' jsid='${grid_jsid}'
- dojoType='dojox.Grid' id="${domprefix + '-JUB-grid'}">
- </div>
+ dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="50">
+% endif
+ <div dojoType="dijit.layout.ContentPane"
+ id=${domprefix+"-jub-buttonbar"}>
+ <button dojoType="dijit.form.Button" onclick="JUBGrid.approveJUB">
+ ${_('Approve Selected Titles')}
+ </button>
+ </div>
+ <div structure='JUBGrid.jubGridLayout' jsid='${grid_jsid}'
+ dojoType='dojox.Grid' id="${domprefix + '-JUB-grid'}">
+ </div>
+% if not hide_details:
</div>
<div dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="50">
<div dojoType="dijit.layout.ContentPane"
@@ -145,6 +157,7 @@
</div>
</div>
</div>
+% endif
</%def>
<!-- Local Variables: -->
<!-- mmm-classes: html-js -->
More information about the open-ils-commits
mailing list