1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › Transport cost matrix</title>
3 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript">
7 function check_transport_cost(e) {
9 if (val && val != '' && !isNaN(parseFloat(val)) && val >= 0.0) {
12 alert("Cost must be expressed as a decimal number >= 0");
14 function disable_transport_cost_chg(e, cost_id) {
15 disable_transport_cost(cost_id, e.checked);
17 function disable_transport_cost(cost_id, disable) {
19 $('#celldiv_'+cost_id).find('input[type=text]').attr("disabled","disabled").addClass('disabled-transfer');
21 $('#celldiv_'+cost_id).find('input:disabled').removeAttr("disabled").removeClass('disabled-transfer');
24 function enable_cost_input(cost_id) {
25 var cell = $('#celldiv_'+cost_id);
26 var cost = $(cell).text();
27 var disabled = $(cell).hasClass('disabled-transfer');
28 $(cell).removeClass('disabled-transfer');
30 $('#celldiv_'+cost_id).html(
31 '<input type="text" name="cost_'+cost_id+'" onblur="check_transport_cost(this);" size="4" value="'+$.trim(cost)+'" />'+
32 '<br/>Disable <input name="disable_'+cost_id+'" value="1" onchange="disable_transport_cost_chg(this, \''+cost_id+'\');" type="checkbox" '+(disabled ? 'checked' : '')+' />'
34 disable_transport_cost(cost_id, disabled);
37 function form_submit (f) {
38 $(f).find('input:disabled').removeAttr("disabled");
42 $(document).ready(function() {
43 show_transport_cost_matrix([% IF UseTransportCostMatrix %]true[% ELSE %]false[% END %]);
47 <style type="text/css">
49 background-color: red;
58 [% INCLUDE 'header.inc' %]
59 [% INCLUDE 'cat-search.inc' %]
61 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Transport cost matrix</div>
63 <div id="doc3" class="yui-t1">
68 <h1 class="parameters">
69 Defining transport costs between libraries
71 [% IF ( WARNING_transport_cost_matrix_off ) %]
72 <div class="dialog message">Because the "UseTransportCostMatrix" system preference is currently not enabled, Transport Cost Matrix is not being used. Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseTransportCostMatrix">here</a> if you wish to enable this feature.</div>
75 <div class="container">
76 <form method="post" action="?" onSubmit="return form_submit(this);">
77 <input type="hidden" name="op" value="set-cost-matrix" />
78 <div id="transport-cost-matrix">
80 <p>Costs are decimal values between some arbitrary maximum value (e.g. 1 or 100) and 0 which is the minimum (no) cost.</p>
81 <p>Red cells signify no transfer allowed.</p>
82 <p>Click on individual cells to edit.</p>
84 <ul class="errors" %]>
92 [% FOR b IN branchloop %]
96 [% FOR bf IN branchfromloop %]
98 <th>[% bf.name %]</th>
99 [% FOR bt IN bf.branchtoloop %]
105 <div id="celldiv_[% bt.id %]" class="disabled-transfer">
107 <div id="celldiv_[% bt.id %]">
109 <div onclick="enable_cost_input('[% bt.id %]');">[% bt.disabled ? ' ' : bt.value %]</div>
110 <input type="hidden" name="cost_[% bt.id %]" value="[% bt.value %]" />
112 <input type="hidden" name="disable_[% bt.id %]" value="1" />
122 <input type="submit" value="Save" class="submit" />
128 [% INCLUDE 'admin-menu.inc' %]
131 [% INCLUDE 'intranet-bottom.inc' %]