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