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