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