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