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']"
25 <th field='name' get='getFormulaName' formatter='formatName'/>
26 <th field='item_count' get='getItemCount'/>
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>
42 <button dojoType='dijit.form.Button' onClick='addEntry()'>New Entry</button>
43 <span style='padding-right:20px;'></span>
44 <button dojoType='dijit.form.Button' onClick='saveFormula()'>Apply Changes</button>
47 <table class='oils-generic-table'>
51 <th>Owning Library</th>
52 <th>Shelving Location</th>
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>
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'/>
73 <button dojoType='dijit.form.Button' onClick='addEntry()'>New Entry</button>
74 <span style='padding-right:20px;'></span>
75 <button dojoType='dijit.form.Button' onClick='saveFormula()'>Apply Changes</button>
79 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/distribution_formula.js'></script>
81 <script type="text/javascript">
82 var formulaId = '[% ctx.page_args.0 %]';
84 function getFormulaName(rowIndex, item) {
86 var name = this.grid.store.getValue(item, 'name');
87 var id = this.grid.store.getValue(item, 'id');
88 return id + ':' + name;
91 function formatName(value) {
93 var vals = value.split(/:/);
94 return '<a href="'+location.href+ '/'+vals[0]+'">'+vals[1]+'</a>';