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