]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2
LP1873286: Fix Bad End Tags
[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'></th>
26                     <th field='item_count' get='getItemCount'></th>
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('Copy Location') %]</th>
53                 <th>[% l('Fund') %]</th>
54                 <th>[% l('Circ Modifier') %]</th>
55                 <th>[% l('Collection Code') %]</th>
56                 <th>[% l('Item Count') %]</th>
57                 <th></th>
58             </tr>
59         </thead>
60         <tbody id='formula-entry-tbody'>
61             <tr id='formula-entry-tempate'>
62                 <td><div name='delete' dojoType='dijit.form.Button' style='color:red;' scrollOnFocus='false'>X</div></td>
63                 <td><div name='owning_lib'></div></td>
64                 <td><div name='location'></div></td>
65                 <td><div name='fund'></div></td>
66                 <td><div name='circ_modifier'></div></td>
67                 <td><div name='collection_code'></div></td>
68                 <td><div name='item_count'></div></td>
69                 <td>
70                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
71                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
72                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
73                 <td>
74             </tr>
75         </tbody>
76     </table>
77     <br/>
78     <div>
79         <button dojoType='dijit.form.Button' onClick='addEntry()'>[% l('New Entry') %]</button>
80         <span style='padding-right:20px;'></span>
81         <button dojoType='dijit.form.Button' onClick='saveFormula()'>[% l('Apply Changes') %]</button>
82     </div>
83 </div>
84
85 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/distribution_formula.js'></script>
86
87 <script type="text/javascript"> 
88     var formulaId = '[% ctx.page_args.0 %]';
89
90     function getFormulaName(rowIndex, item) {
91         if(!item) return '';
92         var name = this.grid.store.getValue(item, 'name');
93         var id = this.grid.store.getValue(item, 'id');
94         return id + ':' + name;
95     }
96
97     function formatName(value) {
98         if(value) {
99             var vals = value.split(/:/);
100             return '<a href="'+location.href+ '/'+vals[0]+'">'+vals[1]+'</a>';
101         }
102     }
103 </script>
104
105 [% END %]
106