1 [% WRAPPER default/base.tt2 %]
2 [% ctx.page_title = 'Distribution Formulas' %]
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>Distribution Formulas</div>
9 <button dojoType='dijit.form.Button' onClick='fListGrid.showCreateDialog()'>New Formula</button>
10 <button dojoType='dijit.form.Button' onClick='fListGrid.deleteSelected()'>Delete Selected</button>
11 <button dojoType='dijit.form.Button' onClick='cloneSelectedFormula()'>Clone Selected</button>
14 <table jsId="fListGrid"
15 dojoType="openils.widget.AutoGrid"
16 fieldOrder="['id', 'name', 'owner', 'item_count']"
17 suppressFields="['skip_count']"
24 <th field='name' get='getFormulaName' formatter='formatName'/>
25 <th field='item_count' get='getItemCount'/>
33 <div id='formula-entry-div'>
34 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
35 <div><a href='javascript:void(0);' id="formula_head"></a></div>
41 <button dojoType='dijit.form.Button' onClick='addEntry()'>New Entry</button>
42 <span style='padding-right:20px;'></span>
43 <button dojoType='dijit.form.Button' onClick='saveFormula()'>Apply Changes</button>
46 <table class='oils-generic-table'>
50 <th>Owning Library</th>
51 <th>Shelving Location</th>
56 <tbody id='formula-entry-tbody'>
57 <tr id='formula-entry-tempate'>
58 <td><div name='delete' dojoType='dijit.form.Button' style='color:red;' scrollOnFocus='false'>X</div></td>
59 <td><div name='owning_lib'></td>
60 <td><div name='location'></td>
61 <td><div name='item_count'></td>
63 <img src='[% ctx.media_prefix %]/images/dimple.png'/>
64 <img src='[% ctx.media_prefix %]/images/dimple.png'/>
65 <img src='[% ctx.media_prefix %]/images/dimple.png'/>
72 <button dojoType='dijit.form.Button' onClick='addEntry()'>New Entry</button>
73 <span style='padding-right:20px;'></span>
74 <button dojoType='dijit.form.Button' onClick='saveFormula()'>Apply Changes</button>
78 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/distribution_formula.js'></script>
80 <script type="text/javascript">
81 var formulaId = '[% ctx.page_args.0 %]';
83 function getFormulaName(rowIndex, item) {
85 var name = this.grid.store.getValue(item, 'name');
86 var id = this.grid.store.getValue(item, 'id');
87 return id + ':' + name;
90 function formatName(value) {
92 var vals = value.split(/:/);
93 return '<a href="'+location.href+ '/'+vals[0]+'">'+vals[1]+'</a>';