2 This template creates a split screen Dojo layout. The top frame
3 of the screen holds a list of of JUBs, or titles. Clicking on a
4 title in the top frame will load the purchase details for all the
5 copies on order for that title into the bottom frame.
7 To create a display for a set of JUBs, create a Dojo store and
8 model for the set of JUBs, then place the following lines in your
9 HTML where you want the display to appear:
11 <%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
12 ${jubgrid.jubgrid('dom_prefix', 'grid_jsid')}
14 where 'dom_prefix' is a string that will be used as the prefix
15 for the DOM notes that are created by this template, and
16 'grid_jsid' is a valid JavaScript identifier that will name the
17 DOM node to which the list of JUBs will be attached. For example
19 ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid', hideDetails)}
21 will create a Dojo grid with the DOM id of
23 'oils-acq-picklist-JUB-grid'
29 To fill the grid with data, call the javascript function
31 JUBGrid.populate(grid_jsid, model)
33 'grid_jsid' is the same javascript id that was used to
34 instantiate the template, and model is a javascript variable
35 pointing to the JUB model (and store) that you have created.
38 [% UNLESS hide_details %]
39 <div dojoType='dijit.layout.ContentPane' style='height:100%;'>
42 <style type='text/css'>
43 .grid_container {width: 100%; height: 100%;}
46 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/common/jubgrid.js'> </script>
47 <script type="text/javascript" src='[% ctx.media_prefix %]/js/dojo/openils/CopyLocation.js'> </script>
48 <script type="text/javascript">
49 JUBGrid.getPO = function(rowIndex) {
50 var data = JUBGrid.jubGrid.model.getRow(rowIndex);
51 if (!(data && data.purchase_order)) return '';
52 return "<a href='[% ctx.base_path %]/acq/po/view/" + data.purchase_order+"'>"+data.purchase_order+"</a>";
54 JUBGrid.jubGridLayout = [{
57 {name: 'ID', field: 'id', width:'auto'},
58 {name: 'Title', width: "180px", get:JUBGrid.getJUBTitle},
59 {name: 'Author', get:JUBGrid.getJUBAuthor, width:'auto'},
60 {name: 'ISBN', get:JUBGrid.getJUBIsbn, width:'auto'},
61 {name: 'Pubdate', get:JUBGrid.getJUBPubdate, width:'auto'},
62 {name: 'Actual Price',
64 get:JUBGrid.getJUBActualPrice,
65 editor:dojox.grid.editors.Dijit, width:'auto',
66 editorClass: "dijit.form.CurrencyTextBox"
68 {name: 'Estimated Price',
69 field:'estimated_price',
70 get:JUBGrid.getJUBEstimatedPrice, width:'auto',
71 editor:dojox.grid.editors.Dijit,
72 editorClass: "dijit.form.CurrencyTextBox"
74 {name: 'Vendor', width:'auto',
75 field: 'provider', get:JUBGrid.getProvider,
76 editor:openils.editors.ProviderSelectEditor,
78 {name: 'No. Copies', field: 'item_count', width:'auto'},
79 {name: 'State', field: 'state', width:'auto'},
80 {name: 'PO', get:JUBGrid.getPO, width:'auto'}
84 JUBGrid.jubDetailGridLayout = [{
86 {name:"ID", field:"id"},
87 {name:"Fund", field:"fund",
88 get:JUBGrid.getLIDFundCode,
89 editor: openils.editors.FundSelectEditor,
91 {name:"Branch", field:"owning_lib",
92 get:JUBGrid.getLIDLibName,
93 editor: openils.editors.OrgUnitSelectEditor
95 {name:"Barcode", field:"barcode", width:'auto',
96 editor:dojox.grid.editors.Dijit,
97 editorClass: "dijit.form.TextBox"
99 {name:"Call Number", field:"cn_label", width:'auto',
100 editor:dojox.grid.editors.Dijit,
101 editorClass: "dijit.form.TextBox"
103 {name:"Shelving Location", field:"location", width:'auto',
104 editor:openils.editors.CopyLocationSelectEditor,
105 get:JUBGrid.getCopyLocation
107 {name:"Receive Time", width:'auto',
108 get:JUBGrid.getRecvTime
113 JUBGrid.jubDetailGridLayoutReadOnly = [{
115 {name:'ID', field:"id"},
116 {name:'Fund', field:"fund",
117 get:JUBGrid.getLIDFundCode,
119 {name:'Branch', field:"owning_lib",
120 get:JUBGrid.getLIDLibName,
122 {name:'Barcode', field:"barcode", width:'auto'},
123 {name:'Call Number', field:"cn_label", width:'auto'},
124 {name:'Shelving Location', field:"location",
125 width:'auto', get:JUBGrid.getCopyLocation},
130 [% UNLESS hide_details %]
131 <!-- button bar for lineitems -->
132 <script type="text/javascript">JUBGrid.showDetails = true;</script>
133 <div id="[% domprefix %]-container" class='container'
134 dojoType="dijit.layout.ContentPane" sizeMin="" sizeShare="">
135 <div dojoType="dijit.layout.ContentPane"
136 id='[% domprefix %]-jub-buttonbar'>
137 <button dojoType="dijit.form.Button" onclick="JUBGrid.approveJUB">
138 Approve Selected Titles
140 <button dojoType="dijit.form.Button" onclick="JUBGrid.removeSelectedJUBs">
141 Remove Selected Titles
145 <div style='height:40%;'>
147 <div style='height:100%;'>
149 <div structure='JUBGrid.jubGridLayout' jsid='[% grid_jsid %]' class='grid_container'
150 dojoType='dojox.Grid' id="[% domprefix %]-JUB-grid">
153 [% UNLESS hide_details %]
154 <!-- button bar for lineitem details -->
155 <div dojoType="dijit.layout.ContentPane" sizeMin="" sizeShare="" class='container'>
156 <div dojoType="dijit.layout.ContentPane" id='[% domprefix %]-details-buttonbar'>
157 <div dojoType="dijit.form.DropDownButton">
158 <span>New Copy</span>
159 <div dojoType="dijit.TooltipDialog" execute="JUBGrid.createLID(arguments[0]);">
160 <script type='dojo/connect' event='onOpen'>
161 new openils.User().buildPermOrgSelector('MANAGE_FUND', copyOwnerSelect);
162 openils.acq.Fund.buildPermFundSelector('MANAGE_FUND', acqlidFund);
164 <table class="dijitTooltipTable">
166 <td><label for="fund">Fund: </label></td>
168 <input dojoType="openils.widget.FundSelector"
169 jsId="acqlidFund" searchAttr="name" autocomplete="true" name="fund"></input>
173 <td><label for="owning_lib">Location: </label></td>
174 <td><input dojoType="openils.widget.OrgUnitFilteringSelect"
175 jsId="copyOwnerSelect"
176 searchAttr="shortname"
177 name="owning_lib" autocomplete="true"
178 labelAttr="shortname"></input>
182 <td colspan="2" align="center">
183 <button dojotype="dijit.form.Button" type="submit">
191 <button dojoType='dijit.form.Button' onclick='JUBGrid.deleteLID'>
194 <button dojoType='dijit.form.Button' onclick='JUBGrid.receiveLID'>
195 Mark Selected Copies Received
199 <!-- end button bar -->
201 <div style='height:40%;'>
202 <div class='grid_container'>
203 <div structure='JUBGrid.jubDetailGridLayout' jsid="JUBGrid.jubDetailGrid" dojoType="dojox.Grid"
204 id='[% domprefix %]-details-grid'>