Bug 8938: Transport cost matrix script and template contain untranslatable strings
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / transport-cost-matrix.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Transport cost matrix</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4
5 <script type="text/javascript">
6 //<![CDATA[
7 function check_transport_cost(e) {
8     var val = e.value;
9     if (val && val != '' && !isNaN(parseFloat(val)) && val >= 0.0) {
10         return;
11     }
12     alert(_("Cost must be expressed as a decimal number >= 0"));
13 }
14 function disable_transport_cost_chg(e, cost_id) {
15     disable_transport_cost(cost_id, e.checked);
16 }
17 function disable_transport_cost(cost_id, disable) {
18     if (disable) {
19         $('#celldiv_'+cost_id).find('input[type=text]').attr("disabled","disabled").addClass('disabled-transfer');
20     } else {
21         $('#celldiv_'+cost_id).find('input:disabled').removeAttr("disabled").removeClass('disabled-transfer');
22     }
23 }
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');
29
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' : '')+' />'
33     );
34     disable_transport_cost(cost_id, disabled);
35 }
36
37 function form_submit (f) {
38     $(f).find('input:disabled').removeAttr("disabled");
39     return true;
40 }
41 //]]>
42 </script>
43 <style type="text/css">
44 .disabled-transfer {
45     background-color: #FF8888;
46 }
47 </style>
48
49 </head>
50 <body>
51 [% INCLUDE 'header.inc' %]
52 [% INCLUDE 'cat-search.inc' %]
53
54 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Transport cost matrix</div>
55
56 <div id="doc3" class="yui-t1">
57
58 <div id="bd">
59     <div id="yui-main">
60     <div class="yui-b">
61     <h1 class="parameters">
62             Defining transport costs between libraries
63     </h1>
64 [% IF ( WARNING_transport_cost_matrix_off ) %]
65 <div class="dialog message">Because the "UseTransportCostMatrix" system preference is currently not enabled, the transport cost matrix is not being used.  Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=UseTransportCostMatrix">here</a> if you wish to enable this feature.</div>
66 [% END %]
67
68     [% IF ( errors ) %]<div class="dialog alert">
69         <h4>There were problems with your submission</h4>
70         <ul>
71             [% FOR e IN errors %]
72                 <li>Invalid value for [% e %]</li>
73             [% END %]
74         </ul>
75     </div>[% END %]
76
77         <form method="post" action="?" onsubmit="return form_submit(this);">
78             <input type="hidden" name="op" value="set-cost-matrix" />
79             <fieldset id="transport-cost-matrix">
80                 <div class="help">
81                     <p>Costs are decimal values between some arbitrary maximum value (e.g. 1 or 100) and 0 which is the minimum (no) cost.</p>
82                     <p>Red cells signify no transfer allowed.</p>
83                     <p>Click on individual cells to edit.</p>
84                 </div>
85
86                 <table>
87                     <tr>
88                         <th>From \ To</th>
89                         [% FOR b IN branchloop %]
90                         <th>[% b.name %]</th>
91                         [% END %]
92                     </tr>
93                 [% FOR bf IN branchfromloop %]
94                     <tr>
95                         <th>[% bf.name %]</th>
96                     [% FOR bt IN bf.branchtoloop %]
97                         <td>
98                         [% IF bt.skip %]
99                             &nbsp;
100                         [% ELSE %]
101                             [% IF bt.disabled %]
102                             <div id="celldiv_[% bt.id %]" class="disabled-transfer">
103                             [% ELSE %]
104                             <div id="celldiv_[% bt.id %]">
105                             [% END %]
106                             <div onclick="enable_cost_input('[% bt.id %]');">[% bt.disabled ? '&nbsp;' : bt.value %]</div>
107                             <input type="hidden" name="cost_[% bt.id %]" value="[% bt.value %]" />
108                             [% IF bt.disabled %]
109                             <input type="hidden" name="disable_[% bt.id %]" value="1" />
110                             [% END %]
111                             </div>
112                         [% END %]
113                         </td>
114                     [% END %]
115                     </tr>
116                 [% END %]
117                 </table>
118             </fieldset>
119             <fieldset class="action">
120                 <input type="submit" value="Save" class="submit" /> <a href="/cgi-bin/koha/admin/transport-cost-matrix.pl" class="cancel">Cancel</a>
121             </fieldset>
122         </form>
123     </div>
124     </div>
125 <div class="yui-b">
126 [% INCLUDE 'admin-menu.inc' %]
127 </div>
128 </div>
129 [% INCLUDE 'intranet-bottom.inc' %]