]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/conify/global/acq/distribution_formula.tt2
</link> is not valid HTML
[working/Evergreen.git] / Open-ILS / web / templates / default / conify / global / acq / distribution_formula.tt2
1 [% WRAPPER default/base.tt2 %]
2 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/distribution_formula.js'></script>
3 <script type="text/javascript"> var formulaId = '[% ctx.page_args.0 %]';
4
5 function getFormulaName(rowIndex, item) {
6         if(!item) return '';
7         var name = this.grid.store.getValue(item, 'name');
8         var id = this.grid.store.getValue(item, 'id');
9         return id + ':' + name;
10     }
11
12 function formatName(value) {
13         if(value) {
14             var vals = value.split(/:/);
15             return '<a href="'+location.href+ '/'+vals[0]+'">'+vals[1]+'</a>';
16         }
17 }
18
19 </script>
20
21
22
23
24 <div id='formula-list-div'>
25     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
26         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
27             <div>Distribution Formulas</div>
28             <div>
29                 <button dojoType='dijit.form.Button' onClick='fListGrid.showCreateDialog()'>New Formula</button>
30                 <button dojoType='dijit.form.Button' onClick='fListGrid.deleteSelected()'>Delete Selected</button>
31             </div>
32         </div>
33         <table  jsId="fListGrid"
34                 autoHeight='true'
35                 dojoType="openils.widget.AutoGrid"
36                 fieldOrder="['id', 'name', 'owner', 'item_count', 'skip_count']"
37                 query="{id: '*'}"
38                 defaultCellWidth='12'
39                 fmClass='acqdf'
40                 editOnEnter='true'>
41             <thead>
42                 <tr>
43                     <th field='name' get='getFormulaName' formatter='formatName'/>
44                     <th field='item_count' get='getItemCount'/>
45                 </tr>
46             </thead>
47         </table>
48     </div>
49 </div>
50
51
52
53 <div id='formula-entry-div'>
54     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
55         <div id='formula-summary-pane'/>
56     </div>
57         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
58             <div id="formula_head"></div>
59             <div>
60                 <button dojoType='dijit.form.Button' onClick='dfeListGrid.showCreateDialog()'>New Formula Entry</button>
61                 <button dojoType='dijit.form.Button' onClick='dfeListGrid.deleteSelected()'>Delete Selected</button>
62             </div>
63         </div>
64         <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
65             <table  jsId="dfeListGrid"
66                     autoHeight='true'
67                     dojoType="openils.widget.AutoGrid"
68                     fieldOrder="['id','formula', 'owning_lib', 'location', 'item_count', 'position']"
69                     suppressFields="['formula']"
70                     query="{id: '*'}"
71                     defaultCellWidth='12'
72                     fmClass='acqdfe'
73                     editOnEnter='true'>
74                 <thead>
75                     <tr>
76                         <th field='formula' get='getFormulaId' formatter='formatName'/>
77                     </tr>
78                 </thead>
79             </table>
80         </div>
81     </div>
82 </div>
83 [% END %]
84