Bug 33908: Improve translation of title tags: Acquisitions
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basketgroup.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% USE Price %]
5 [% USE Koha %]
6 [% PROCESS 'i18n.inc' %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9     [% tx("Basket grouping for '{vendor}'", { vendor = booksellername }) %] &rsaquo;
10     [% t("Koha") | html %]
11 [% END %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% INCLUDE 'datatables.inc' %]
14 <script>
15
16     var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
17     var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
18     var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
19     var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
20     var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
21
22     function submitForm(form) {
23         if (form.close.checked == true) {
24             var input = document.createElement("input");
25             input.setAttribute("type", "hidden");
26             input.setAttribute("name", "closed");
27             input.setAttribute("value", "1");
28             form.appendChild(input);
29         }
30     }
31
32     function closeandprint(bg){
33         if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&amp;basketgroupid=' + bg ){
34             setTimeout("window.location.reload();", 3000);
35         } else {
36             alert(MSG_FILE_DOWNLOAD_ERROR);
37         }
38     }
39
40     $(document).ready(function() {
41         [% IF ( listclosed) %]
42             $("#basket_groups a[href='#closed']").tab("show");
43         [% ELSE %]
44             $("#basket_groups a[href='#opened']").tab("show");
45         [% END %]
46         [% UNLESS ( grouping ) %]
47             $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
48                 "aoColumnDefs": [
49                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
50                 ],
51                 "bAutoWidth": false,
52                 "sPaginationType": "full"
53             } ));
54         [% ELSE %]
55             grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
56                 "dom": 't',
57                 "columnDefs": [
58                     { 'sortable': false, 'targets': [ 'NoSort' ] }
59                 ],
60                 'autoWidth': false,
61                 "language": {
62                     "emptyTable": _("There are no baskets in this group")
63                 }
64             } ));
65             ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
66                 "dom": 't',
67                 "columnDefs": [
68                     { 'sortable': false, 'targets': [ 'NoSort' ] }
69                 ],
70                 'autoWidth': false,
71                 "language": {
72                     "emptyTable": _("There are no ungrouped baskets")
73                 }
74             } ));
75         [% END %]
76
77         $("#basketgroupcolumns").on("click", ".addtogroup", function(){
78             const row = $("#" + $(this).data("basketid") );
79             if( row ){
80                 $(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash-can\" aria-hidden=\"true\"></i> " + _("Remove") );
81                 row.removeClass("ungrouped").addClass("grouped");
82                 ungrouped.row( row ).remove().draw();
83                 grouped.row.add( row ).draw();
84             }
85         });
86
87         $("#basketgroupcolumns").on("click", ".removefromgroup", function(){
88             const row = $("#" + $(this).data("basketid") );
89             if( row ){
90                 $(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") );
91                 $(this).removeClass("").addClass("");
92                 row.removeClass("grouped").addClass("ungrouped");
93                 grouped.row( row ).remove().draw();
94                 ungrouped.row.add( row ).draw();
95             }
96         });
97     });
98 </script>
99
100 </head>
101 <body id="acq_basketgroup" class="acq">
102 [% WRAPPER 'header.inc' %]
103     [% INCLUDE 'acquisitions-search.inc' %]
104 [% END %]
105
106 [% WRAPPER 'sub-header.inc' %]
107     [% WRAPPER breadcrumbs %]
108         [% WRAPPER breadcrumb_item %]
109             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
110         [% END %]
111         [% IF ( grouping ) %]
112             [% WRAPPER breadcrumb_item %]
113                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
114             [% END %]
115             [% WRAPPER breadcrumb_item %]
116                 <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
117             [% END %]
118             [% WRAPPER breadcrumb_item bc_active= 1 %]
119                 <span>Add basket group for [% booksellername | html %]</span>
120             [% END %]
121         [% ELSE %]
122             [% WRAPPER breadcrumb_item %]
123                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
124             [% END %]
125             [% WRAPPER breadcrumb_item bc_active= 1 %]
126                 <span>Basket grouping</span>
127             [% END %]
128         [% END  # /IF grouping %]
129     [% END #/ WRAPPER breadcrumbs %]
130 [% END #/ WRAPPER sub-header.inc %]
131
132 <div class="main container-fluid">
133     <div class="row">
134         <div class="col-sm-10 col-sm-push-2">
135             <main>
136
137                 [% IF ( grouping ) %]
138                     [% IF (closedbg) %]
139                         <div id="toolbar" class="btn-toolbar">
140                             <div class="btn-group"><a href="[% script_name | url %]?op=reopen&amp;basketgroupid=[% basketgroupid | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;mode=singlebg" class="btn btn-default" id="reopenbutton"><i class="fa fa-download"></i> Reopen basket group</a></div>
141                             <div class="btn-group"><a href="[% script_name | url %]?op=export&amp;basketgroupid=[% basketgroupid | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="exportbutton"><i class="fa fa-download"></i> Export basket group as CSV</a></div>
142                             <div class="btn-group"><a href="[% script_name | url %]?op=print&amp;basketgroupid=[% basketgroupid | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="printbutton"><i class="fa fa-download"></i> Print basket group in PDF</a></div>
143                         [% IF (ediaccount) %]
144                             <div class="btn-group"><a href="[% script_name | url %]?op=ediprint&amp;basketgroupid=[% basketgroupid | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="printbutton"><i class="fa fa-download"></i> Generate EDIFACT order</a></div>
145                         [% END %]
146                         </div>
147                     [% END %]
148                     [% IF (name && closedbg) %]
149                         <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
150                     [% ELSIF (name) %]
151                         <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
152                     [% ELSE %]
153                         <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
154                     [% END %]
155                     <div id="basketgroupcolumns" class="row">
156                         [% UNLESS (closedbg) %]
157                             <div class="col-xs-6 col-xs-push-6">
158                                     <div id="groups">
159                                         <div class="workarea_alt" >
160                                             <h3>Ungrouped baskets</h3>
161                                                 <div class="page-section">
162                                                     <table id="ungrouped" class="basketgroup_baskets">
163                                                         <thead>
164                                                             <tr>
165                                                                 <th>Basket</th>
166                                                                 <th>Total</th>
167                                                                 <th class="NoSort"></th>
168                                                             </tr>
169                                                         </thead>
170                                                         <tbody>
171                                                             [% IF ( baskets ) %]
172                                                                 [% FOREACH basket IN baskets %]
173                                                                     <tr class="ungrouped" id="b-[% basket.basketno | html %]">
174                                                                         <td>
175                                                                             <a href="basket.pl?basketno=[% basket.basketno | uri %]">
176                                                                                 [% IF ( basket.basketname ) %]
177                                                                                     [% basket.basketname | html %]
178                                                                                 [% ELSE %]
179                                                                                     <span>No name, basketnumber: [% basket.basketno | html %]</span>
180                                                                                 [% END %]
181                                                                             </a>
182                                                                         </td>
183                                                                         <td data-sort="[% basket.total | html %]">
184                                                                             [% basket.total | $Price %]
185                                                                             <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
186                                                                         </td>
187                                                                         <td>
188                                                                             <a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]">
189                                                                                 <i class="fa fa-plus" aria-hidden="true"></i> Add to group
190                                                                             </a>
191                                                                         </td>
192                                                                     </tr>
193                                                                 [% END %]
194                                                             [% END %]
195                                                         </tbody>
196                                                     </table>
197                                                 </div><!--/.page-section -->
198                                         </div><!-- /#groups -->
199                                     </div><!-- /.col-xs-6 -->
200
201                             </div>
202                         [% END %]
203                         [% IF ( closedbg ) %]
204                             <div class="col-xs-12">
205                         [% ELSE %]
206                             <div class="col-xs-6 col-xs-pull-6">
207                         [% END %]
208                             <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform" onsubmit="return submitForm(this)">
209                                 <fieldset id="various" class="brief">
210                                     <ol>
211                                         [% UNLESS (closedbg) %]
212                                             <li>
213                                                 <label for="basketgroupname">Basket group name:</label>
214                                                 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
215                                             </li>
216                                         [% ELSE %]
217                                             <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
218                                         [% END %]
219                                         <li>
220                                             [% UNLESS (closedbg) %]
221                                                 <label for="billingplace">Billing place:</label>
222                                                 <select name="billingplace" id="billingplace">
223                                                     <option value="">--</option>
224                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
225                                                 </select>
226                                             [% ELSE %]
227                                                 <span class="label">Billing place:</span>
228                                                 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
229                                             [% END %]
230                                         </li>
231                                         [% UNLESS (closedbg) %]
232                                             <li>
233                                                 <label for="deliveryplace">Delivery place:</label>
234                                                 <select name="deliveryplace" id="deliveryplace">
235                                                     <option value="">--</option>
236                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
237                                                 </select>
238                                             </li>
239                                         </ol>
240                                         <p>or</p>
241                                         <ol>
242                                             <li>
243                                                 <label for="freedeliveryplace">Delivery place:</label>
244                                                 <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
245                                             </li>
246                                             [% ELSE %]
247                                                 <li>
248                                                     <span class="label">Delivery place:</span>
249                                                     [% IF (freedeliveryplace) %]
250                                                         <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
251                                                         <input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
252                                                     [% ELSE %]
253                                                         <input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
254                                                         <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
255                                                     [% END %]
256                                                 </li>
257                                             [% END %]
258                                             <li>
259                                                 [% UNLESS (closedbg) %]
260                                                     <label for="deliverycomment">Delivery comment:</label>
261                                                     <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
262                                                 [% ELSE %]
263                                                     <span class="label">Delivery comment:</span>[% deliverycomment | html %]
264                                                     <input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
265                                                 [% END %]
266                                             </li>
267                                         </ol>
268                                         <h3>Baskets in this group:</h3>
269                                         <table id="grouped" class="basketgroup_baskets">
270                                             <thead>
271                                                 <tr>
272                                                     <th>Basket</th>
273                                                     <th>Total</th>
274                                                     <th class="NoSort"></th>
275                                                 </tr>
276                                             </thead>
277                                             <tbody>
278                                                 [% FOREACH selectedbasket IN selectedbaskets %]
279                                                     <tr id="b-[% selectedbasket.basketno | html %]">
280                                                         <td>
281                                                             <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
282                                                                 [% IF ( selectedbasket.basketname ) %]
283                                                                     [% selectedbasket.basketname | html %]
284                                                                 [% ELSE %]
285                                                                     <span>No name, basketnumber: [% selectedbasket.basketno | html %]</span>
286                                                                 [% END %]
287                                                             </a>
288                                                         </td>
289                                                         <td data-sort="[% selectedbasket.total | html %]">
290                                                             [% selectedbasket.total | $Price %]
291                                                             <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
292                                                         </td>
293                                                         <td>
294                                                             [% IF ( closedbg ) %]
295                                                             [% ELSE %]
296                                                                 <a class="removefromgroup btn btn-default btn-xs" data-basketid="b-[% selectedbasket.basketno | html %]" id="addtogroup[% selectedbasket.basketno | html %]">
297                                                                     <i class="fa fa-trash-can" aria-hidden="true"></i> Remove
298                                                                 </a>
299                                                             [% END %]
300                                                         </td>
301                                                     </tr>
302                                                 [% END %]
303                                             </tbody>
304                                         </table>
305                                         [% UNLESS (closedbg) %]
306                                             <ol>
307                                                 <li><label for="closedbg">Close basket group</label><input type="checkbox" id="closedbg" name="closedbg" /></li>
308                                             </ol>
309                                         [% ELSE %]
310                                             <input type="hidden" id="closedbg" name="closedbg" value ="1"/>
311                                         [% END %]
312                                 </fieldset>
313
314                                 [% UNLESS (closedbg) %]
315                                     <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
316                                         [% IF ( basketgroupid ) %]
317                                             <input type="hidden" name="basketgroupid" value="[% basketgroupid | html %]" />
318                                         [% END %]
319                                         <input type="hidden" name="op" value="attachbasket" />
320                                         <input type="submit" class="btn btn-primary" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]" class="cancel">Cancel</a>
321                                     </fieldset>
322                                 [% END %]
323                             </form>
324                         </div>
325                     </div>
326                 [% ELSE %]
327                     <div id="toolbar" class="btn-toolbar">
328                         <div class="btn-group"><a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="newbasketgroup"><i class="fa fa-plus"></i> New basket group</a></div>
329                     </div>
330                     <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
331                     [% IF (NoEDIMessage && Koha.Preference('EDIFACT')) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
332
333                     [% WRAPPER tabs id= "basket_groups" %]
334                         [% WRAPPER tabs_nav %]
335                             [% WRAPPER tab_item tabname= "opened" bt_active= 1 %] <span>Open</span> [% END %]
336                             [% WRAPPER tab_item tabname= "closed" %] <span>Closed</span> [% END %]
337                         [% END %]
338                         [% WRAPPER tab_panels %]
339                             [% WRAPPER tab_panel tabname="opened" bt_active= 1 %]
340                                 <table id="basket_group_opened">
341                                     <thead>
342                                         <tr>
343                                             <th>Name</th>
344                                             <th>Number</th>
345                                             <th>Billing place</th>
346                                             <th>Delivery place</th>
347                                             <th>Number of baskets</th>
348                                             <th>Action</th>
349                                         </tr>
350                                     </thead>
351                                     <tbody>
352                                         [% FOREACH basketgroup IN basketgroups %]
353                                             [% UNLESS ( basketgroup.closed ) %]
354                                                 <tr>
355                                                     <td>[% IF ( basketgroup.name ) %]
356                                                         [% basketgroup.name | html %]
357                                                         [% ELSE %]
358                                                             <span>Basket group no. [% basketgroup.id | html %]</span>
359                                                         [% END %]
360                                                     </td>
361                                                     <td>[% basketgroup.id | html %]</td>
362                                                     <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
363                                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
364                                                     <td>[% basketgroup.basketsqty | html %]</td>
365                                                     <td>
366                                                         <input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
367                                                         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Edit" /></form>
368                                                         [% UNLESS basketgroup.basketsqty %]
369                                                             <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="delete" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Delete" /></form>
370                                                         [% END %]
371                                                     </td>
372                                                 </tr>
373                                             [% END %]
374                                         [% END %]
375                                     </tbody>
376                                 </table>
377                             [% END #/opened %]
378
379                             [% WRAPPER tab_panel tabname="closed" %]
380                                 <table id="basket_group_closed">
381                                     <thead>
382                                         <tr>
383                                             <th>Name</th>
384                                             <th>Number</th>
385                                             <th>Billing place</th>
386                                             <th>Delivery place</th>
387                                             <th>Number of baskets</th>
388                                             <th>Action</th>
389                                         </tr>
390                                     </thead>
391                                     <tbody>
392                                         [% FOREACH basketgroup IN basketgroups %]
393                                             [% IF ( basketgroup.closed ) %]
394                                                 <tr>
395                                                     <td>
396                                                         [% IF ( basketgroup.name ) %]
397                                                             [% basketgroup.name | html %]
398                                                             [% ELSE %]
399                                                                 <span>Basket group no. [% basketgroup.id | html %]</span>
400                                                             [% END %]
401                                                     </td>
402                                                     <td>[% basketgroup.id | html %]</td>
403                                                     <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
404                                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
405                                                     <td>[% basketgroup.basketsqty | html %]</td>
406                                                     <td>
407                                                         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="View" /></form>
408                                                         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="reopen" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Reopen" /></form>
409                                                         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="print" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Export as PDF" /></form>
410                                                         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="export" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Export as CSV" /></form>
411                                                         [% IF Koha.Preference('EDIFACT') %]
412                                                             [% IF (ediaccount) %]
413                                                                  <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="ediprint" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" class="btn btn-primary" value="Generate EDIFACT order" /></form>
414                                                             [% ELSE %]
415                                                                 <div>No EDIFACT configuration for [% booksellername | html %]</div>
416                                                             [% END %]
417                                                         [% END %]
418                                                     </td>
419                                                 </tr>
420                                             [% END %]
421                                         [% END %]
422                                     </tbody>
423                                 </table>
424                             [% END #/closed %]
425                         [% END # /WRAPPER tab_panels %]
426                     [% END # /#basket_groups %]
427                 [% END %]
428             </main>
429         </div> <!-- /.col-sm-10.col-sm-push-2 -->
430
431         <div class="col-sm-2 col-sm-pull-10">
432             <aside>
433                 [% IF ( booksellerid ) %]
434                     [% INCLUDE 'vendor-menu.inc' %]
435                 [% END %]
436                 [% INCLUDE 'acquisitions-menu.inc' %]
437             </aside>
438         </div>
439     </div> <!-- /.row -->
440     [% INCLUDE 'intranet-bottom.inc' %]