]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/conify/global/acq/distribution_formula.tt2
distribution formula config UI repairs/enhancements
[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
5 <script type="text/javascript"> 
6     var formulaId = '[% ctx.page_args.0 %]';
7
8     function getFormulaName(rowIndex, item) {
9         if(!item) return '';
10         var name = this.grid.store.getValue(item, 'name');
11         var id = this.grid.store.getValue(item, 'id');
12         return id + ':' + name;
13     }
14
15     function formatName(value) {
16         if(value) {
17             var vals = value.split(/:/);
18             return '<a href="'+location.href+ '/'+vals[0]+'">'+vals[1]+'</a>';
19         }
20     }
21 </script>
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                 <button dojoType='dijit.form.Button' onClick='cloneSelectedFormula()'>Clone Selected</button>
32             </div>
33         </div>
34         <table  jsId="fListGrid"
35                 dojoType="openils.widget.AutoGrid"
36                 fieldOrder="['id', 'name', 'owner', 'item_count']"
37                 suppressFields="['skip_count']"
38                 query="{id: '*'}"
39                 defaultCellWidth='12'
40                 fmClass='acqdf'
41                 editOnEnter='true'>
42             <thead>
43                 <tr>
44                     <th field='name' get='getFormulaName' formatter='formatName'/>
45                     <th field='item_count' get='getItemCount'/>
46                 </tr>
47             </thead>
48         </table>
49     </div>
50 </div>
51
52
53 <div id='formula-entry-div'>
54     <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
55         <div><a href='javascript:void(0);' id="formula_head"></a></div>
56         <div>
57         </div>
58     </div>
59     <br/>
60     <div>
61         <button dojoType='dijit.form.Button' onClick='addEntry()'>New Entry</button>
62         <span style='padding-right:20px;'></span>
63         <button dojoType='dijit.form.Button' onClick='saveFormula()'>Apply Changes</button>
64     </div>
65     <br/>
66     <table class='oils-generic-table'>
67         <thead>
68             <tr>
69                 <th></th>
70                 <th>Owning Library</th>
71                 <th>Shelving Location</th>
72                 <th>Item Count</th>
73                 <th></th>
74             </tr>
75         </thead>
76         <tbody id='formula-entry-tbody'>
77             <tr id='formula-entry-tempate'>
78                 <td><div name='delete' dojoType='dijit.form.Button' style='color:red;' scrollOnFocus='false'>X</div></td>
79                 <td><div name='owning_lib'></td>
80                 <td><div name='location'></td>
81                 <td><div name='item_count'></td>
82                 <td>
83                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
84                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
85                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
86                 <td>
87             </tr>
88         </tbody>
89     </table>
90     <br/>
91     <div>
92         <button dojoType='dijit.form.Button' onClick='addEntry()'>New Entry</button>
93         <span style='padding-right:20px;'></span>
94         <button dojoType='dijit.form.Button' onClick='saveFormula()'>Apply Changes</button>
95     </div>
96 </div>
97
98 [% END %]
99