Bug 16237: Allow entering of EDI accounts with plugins disabled
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / edi_accounts.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; EDI accounts
3 [% IF acct_form %]
4   [% IF account %]
5      &rsquo; Modify account
6   [% ELSE %]
7      &rsquo; Add new account
8   [% END %]
9 [% END %]
10 [% IF delete_confirm %]
11      &rsquo; Confirm deletion of account
12 [% END %]
13 </title>
14 [% INCLUDE 'doc-head-close.inc' %]
15 </head>
16 <body id="admin_edi_acct" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'cat-search.inc' %]
19
20 <div id="breadcrumbs">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22  &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
23  &rsaquo; <a href="/cgi-bin/koha/admin/edi_accounts.pl">EDI accounts</a>
24 [% IF acct_form %]
25   [% IF account %]
26      &rsaquo; Modify account
27   [% ELSE %]
28      &rsaquo; Add new account
29   [% END %]
30 [% ELSIF delete_confirm %]
31      &rsaquo; Confirm deletion of account
32 [% ELSE %]
33      &rsaquo; Accounts
34 [% END %]
35 </div>
36
37 <div id="doc3" class="yui-t2">
38
39 <div id="bd">
40 <div id="yui-main">
41 <div class="yui-b">
42 [% IF display %]
43     <div id="toolbar" class="btn-toolbar">
44     <a class="btn btn-small" id="newediacct" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form">
45          <i class="icon-plus"></i>
46          New account
47     </a>
48     </div>
49 [% END %]
50
51 [% IF acct_form %]
52 <form action="/cgi-bin/koha/admin/edi_accounts.pl" name="Actform" method="post">
53   <input type="hidden" name="op" value="save" />
54   [% IF account %]
55   <input type="hidden" name="id" value="[% account.id %]" />
56   [% END %]
57   <fieldset class="rows">
58   <legend>
59   [% IF account %]
60      Modify account
61   [% ELSE %]
62     New account
63   [% END %]
64   </legend>
65
66   <ol>
67   <li>
68      <label for="vendor_id">Vendor: </label>
69      <select name="vendor_id" id="vendor_id">
70      [% FOREACH vendor IN vendors %]
71        [% IF account.vendor_id == vendor.id %]
72           <option value="[% vendor.id %]" selected="selected">[% vendor.name %]</option>
73        [% ELSE %]
74           <option value="[% vendor.id %]">[% vendor.name %]</option>
75        [% END %]
76      [% END %]
77      </select>
78   </li>
79   [% IF plugins_enabled %]
80   <li>
81      <label for="plugin">Plugin: </label>
82      <select name="plugin" id="plugin">
83         <option value="">Do not use plugin</option>
84         [% FOREACH plugin IN plugins %]
85             [% IF account.plugin == plugin.class %]
86                 <option value="[% plugin.class %]" selected="selected">[% plugin.metadata.name %]</option>
87             [% ELSE %]
88                 <option value="[% plugin.class %]">[% plugin.metadata.name %]</option>
89             [% END %]
90         [% END %]
91      </select>
92   </li>
93   [% ELSE %]
94   <input type="hidden" name="plugin" value="" />
95   [% END %]
96   <li>
97      <label for="description">Description: </label>
98      <input type="text" name="description" id="description" size="20" maxlength="90" value="[% account.description %]" />
99   </li>
100   <li>
101      [% transport_types = [
102                  'FTP', 'SFTP', 'FILE'
103             ]
104      %]
105      <label for="transport">Transport: </label>
106      <select name="transport" title="valid types of transport are FTP and SFTP"
107       id="transport">
108       [% FOREACH transport_type IN transport_types %]
109            [% IF transport_type == account.transport %]
110               <option value="[% transport_type %]" selected="selected">[% transport_type %]</option>
111            [% ELSE %]
112               <option value="[% transport_type %]">[% transport_type %]</option>
113            [% END %]
114        [% END %]
115      </select>
116   </li>
117   <li>
118      <label for="host">Remote host: </label>
119      <input type="text" name="host" id="host" size="20" maxlength="90" value="[% account.host %]" />
120   </li>
121   <li>
122      <label for="username">Username: </label>
123      <input type="text" name="username" id="username" size="20" maxlength="90" value="[% account.username %]" />
124   </li>
125   <li>
126      <label for="password">Password: </label>
127      <input type="text" name="password" id="password" size="20" maxlength="90" value="[% account.password %]" />
128   </li>
129   <li>
130      <label for="download_directory">Download directory: </label>
131      <input type="text" name="download_directory" id="download_directory" size="20" maxlength="90"
132       title="The download directory specifies the directory on the ftpsite from which we download quotes and invoices"
133       value="[% account.download_directory %]" />
134   </li>
135   <li>
136      <label for="upload_directory">Upload directory: </label>
137      <input type="text" name="upload_directory" id="upload_directory" size="20" maxlength="90"
138       title="The upload directory specifies the directory on the ftp site to which we upload orders"
139       value="[% account.upload_directory %]" />
140   </li>
141   <li>
142      <label for="id_code_qualifier">Qualifier:</label>
143      <select name="id_code_qualifier" id="id_code_qualifier">
144      [% FOREACH qualifier IN code_qualifiers %]
145         [% IF qualifier.code == account.id_code_qualifier %]
146            <option value="[% qualifier.code %]" selected="selected">
147                [% qualifier.description %] ([% qualifier.code %])
148            </option>
149         [% ELSE %]
150            <option value="[% qualifier.code %]">
151               [% qualifier.description %] ([% qualifier.code %])
152            </option>
153         [% END %]
154      [% END %]
155    </select>
156   </li>
157   <li>
158      <label for="san">SAN: </label>
159      <input type="text" name="san" id="san" size="20" maxlength="90" value="[% account.san %]" />
160   </li>
161   <li>
162      <label for="quotes_enabled">Quotes enabled: </label>
163       [% IF account.quotes_enabled %]
164      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="[% account.quotes_enabled %]" checked />
165       [% ELSE %]
166      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="[% account.quotes_enabled %]" />
167       [% END %]
168   </li>
169   <li>
170      <label for="orders_enabled">Orders enabled: </label>
171 [% IF account.orders_enabled %]
172      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="[% account.orders_enabled %]" checked />
173 [% ELSE %]
174      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="[% account.orders_enabled %]" />
175 [% END %]
176   </li>
177   <li>
178      <label for="invoices_enabled">Invoices enabled: </label>
179 [% IF account.invoices_enabled %]
180      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="[% account.invoices_enabled %]" checked />
181 [% ELSE %]
182      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="[% account.invoices_enabled %]" />
183 [% END %]
184   </li>
185   <li>
186      <label for="responses_enabled">Responses enabled: </label>
187 [% IF account.responses_enabled %]
188      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="[% account.responses_enabled %]" checked />
189 [% ELSE %]
190      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="[% account.responses_enabled %]" />
191 [% END %]
192   </li>
193   <li>
194      <label for="auto_orders">Automatic ordering (Quotes generate orders without staff intervention): </label>
195 [% IF account.auto_orders %]
196      <input type="checkbox" name="auto_orders" id="auto_orders" value="[% account.auto_orders %]" checked />
197 [% ELSE %]
198      <input type="checkbox" name="auto_orders" id="auto_orders" value="[% account.auto_orders %]" />
199 [% END %]
200   </li>
201   </ol>
202   </fieldset>
203
204   <fieldset class="action">
205     <input type="submit" value="Submit" />
206     <a href="/cgi-bin/koha/admin/edi_accounts.pl" class="cancel">Cancel</a>
207   </fieldset>
208 </form>
209
210 [% END %]
211 [% IF delete_confirm %]
212 <div class="dialog alert">
213 <h3>Delete this account?</h3>
214 <table>
215     <tr>
216     <th>Vendor</th>
217     <td>[% account.vendor %]</td>
218     </tr>
219     <tr>
220     <th>Description</th>
221     <td>[% account.description %]</td>
222     </tr>
223     <tr>
224     <th>SAN</th>
225     <td>[% account.san %]</td>
226     </tr>
227 </table>
228 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="post">
229     <table>
230     </table>
231     <input type="hidden" name="op" value="delete_confirmed" />
232     <input type="hidden" name="id" value="[% account.id %]" />
233     <input type="submit" class="approve" value="Yes, Delete" />
234 </form>
235 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="get">
236     <input type="submit" class="deny" value="No, do not Delete" />
237 </form>
238 [% END %]
239 [% IF display %]
240 <h2>Vendor EDI accounts</h2>
241
242     <table>
243     <tr>
244        <th>ID</th>
245        <th>Vendor</th>
246        <th>Description</th>
247        <th>Transport</th>
248        <th>Remote host</th>
249        <th>Username</th>
250        <th>Password</th>
251        <th>Download Directory</th>
252        <th>Upload Directory</th>
253        <th>Qualifier</th>
254        <th>SAN</th>
255        <th>Quotes</th>
256        <th>Orders</th>
257        <th>Invoices</th>
258        <th>Responses</th>
259        <th>Auto ordering</th>
260        <th>Actions</th>
261     </tr>
262     [% FOREACH account IN ediaccounts %]
263     [% IF loop.even %]<tr>
264     [% ELSE %]<tr class="highlight">
265     [% END %]
266       <td>[% account.id %]</td>
267       <td><a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% account.vendor_id %]">[% account.vendor.name %]</a></td>
268       <td>[% account.description %]</td>
269       <td>[% account.transport %]</td>
270       <td>[% account.host %]</td>
271       <td>[% account.username %]</td>
272       <td>[% IF account.password %]*****[% END %]</td>
273       <td>[% account.download_directory %]</td>
274       <td>[% account.upload_directory %]</td>
275       <td>
276          [% FOREACH qualifier IN code_qualifiers %]
277             [% IF qualifier.code == account.id_code_qualifier %]
278                    [% qualifier.description %]
279             [% END %]
280          [% END %]
281          ([% account.id_code_qualifier %])
282      </td>
283       <td>[% account.san %]</td>
284       [% IF account.quotes_enabled %]
285          <td>Y</td>
286       [% ELSE %]
287          <td>N</td>
288       [% END %]
289       [% IF account.orders_enabled %]
290          <td>Y</td>
291       [% ELSE %]
292          <td>N</td>
293       [% END %]
294       [% IF account.invoices_enabled %]
295          <td>Y</td>
296       [% ELSE %]
297          <td>N</td>
298       [% END %]
299       [% IF account.responses_enabled %]
300          <td>Y</td>
301       [% ELSE %]
302          <td>N</td>
303       [% END %]
304       [% IF account.auto_orders %]
305          <td>Y</td>
306       [% ELSE %]
307          <td>N</td>
308       [% END %]
309       <td align="center">
310           <a href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form&id=[% account.id %]">Edit</a> | <a href="/cgi-bin/koha/admin/edi_accounts.pl?op=delete_confirm&id=[% account.id %]">Delete</a>
311       </td>
312     </tr>
313     [% END %]
314     </table>
315 [% END %]
316
317 </div>
318 </div>
319 <div class="yui-b">
320     [% INCLUDE 'admin-menu.inc' %]
321 </div>
322 </div>
323 [% INCLUDE 'intranet-bottom.inc' %]