Bug 27846: (follow-up) Add id back to breadcrumbs container
[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>Koha &rsaquo; Basket grouping for [% booksellername | html %]</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         $("#basket_groups").tabs();
110
111         $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
112             "aoColumnDefs": [
113                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
114             ],
115             "bAutoWidth": false,
116             "sPaginationType": "full"
117         } ));
118     });
119 </script>
120
121 </head>
122 <body id="acq_basketgroup" class="acq">
123 [% INCLUDE 'header.inc' %]
124 [% INCLUDE 'acquisitions-search.inc' %]
125
126 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
127     <ol>
128         <li>
129             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
130         </li>
131         <li>
132             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
133         </li>
134
135 [% IF ( grouping ) %]
136         <li>
137             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
138         </li>
139         <li>
140             <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
141         </li>
142         <li>
143             <a href="#" aria-current="page">
144                 Add basket group for [% booksellername | html %]
145             </a>
146         </li>
147     </ol>
148 </nav>
149
150 [% ELSE %]
151         <li>
152             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
153         </li>
154         <li>
155             <a href="#" aria-current="page">
156                 Basket grouping
157             </a>
158         </li>
159     </ol>
160 </nav>
161 [% END %]
162
163
164 <div class="main container-fluid">
165     <div class="row">
166         <div class="col-sm-10 col-sm-push-2">
167             <main>
168
169                 [% IF ( grouping ) %]
170                     [% IF (closedbg) %]
171                         <div id="toolbar" class="btn-toolbar">
172                             <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 this basket group</a></div>
173                             <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 this basket group as CSV</a></div>
174                             <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 this basket group in PDF</a></div>
175                         [% IF (ediaccount) %]
176                             <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>
177                         [% END %]
178                         </div>
179                     [% END %]
180                     [% IF (name && closedbg) %]
181                         <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
182                     [% ELSIF (name) %]
183                         <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
184                     [% ELSE %]
185                         <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
186                     [% END %]
187                     <div id="basketgroupcolumns" class="row">
188                         [% UNLESS (closedbg) %]
189                             <div class="col-xs-6 col-xs-push-6">
190                                 <form action="[% scriptname | html %]" method="post" name="basketgroups" id="basketgroups">
191                                     <div id="groups">
192                                         <fieldset class="brief">
193                                             <div class="workarea_alt" >
194                                                 <h3>Ungrouped baskets</h3>
195                                                 <ul id="ungrouped" class="draglist_alt">
196                                                     [% IF ( baskets ) %]
197                                                         [% FOREACH basket IN baskets %]
198                                                             <li class="ungrouped" id="b-[% basket.basketno | html %]" >
199                                                                 <a href="basket.pl?basketno=[% basket.basketno | uri %]">
200                                                                     [% IF ( basket.basketname ) %]
201                                                                         [% basket.basketname | html %]
202                                                                     [% ELSE %]
203                                                                         No name, basketnumber: [% basket.basketno | html %]
204                                                                     [% END %]
205                                                                 </a>, <br />
206                                                                 Total: [% basket.total | $Price %]
207                                                                 <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
208                                                             </li>
209                                                         [% END %]
210                                                     [% END %]
211                                                 </ul>
212                                             </div>
213                                         </fieldset>
214                                     </div>
215                                 </form>
216                             </div>
217                         [% END %]
218                         [% IF ( closedbg ) %]
219                             <div class="col-xs-12">
220                         [% ELSE %]
221                             <div class="col-xs-6 col-xs-pull-6">
222                         [% END %]
223                             <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)">
224                                 <fieldset id="various" class="brief">
225                                     <ol>
226                                         [% UNLESS (closedbg) %]
227                                             <li>
228                                                 <label for="basketgroupname">Basket group name:</label>
229                                                 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
230                                             </li>
231                                         [% ELSE %]
232                                             <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
233                                         [% END %]
234                                         <li>
235                                             [% UNLESS (closedbg) %]
236                                                 <label for="billingplace">Billing place:</label>
237                                                 <select name="billingplace" id="billingplace">
238                                                     <option value="">--</option>
239                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
240                                                 </select>
241                                             [% ELSE %]
242                                                 <span class="label">Billing place:</span>
243                                                 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
244                                             [% END %]
245                                         </li>
246                                         [% UNLESS (closedbg) %]
247                                             <li>
248                                                 <label for="deliveryplace">Delivery place:</label>
249                                                 <select name="deliveryplace" id="deliveryplace">
250                                                     <option value="">--</option>
251                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
252                                                 </select>
253                                             </li>
254                                             <li><p>or</p></li>
255                                             <li>
256                                                 <label for="freedeliveryplace">Delivery place:</label>
257                                                 <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
258                                             </li>
259                                             [% ELSE %]
260                                                 <li>
261                                                     <span class="label">Delivery place:</span>
262                                                     [% IF (freedeliveryplace) %]
263                                                         <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
264                                                         <input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
265                                                     [% ELSE %]
266                                                         <input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
267                                                         <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
268                                                     [% END %]
269                                                 </li>
270                                             [% END %]
271                                             <li>
272                                                 [% UNLESS (closedbg) %]
273                                                     <label for="deliverycomment">Delivery comment:</label>
274                                                     <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
275                                                 [% ELSE %]
276                                                     <span class="label">Delivery comment:</span>[% deliverycomment | html %]
277                                                     <input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
278                                                 [% END %]
279                                             </li>
280                                             <li>
281                                                 <span class="label">Baskets in this group:</span>
282                                                 [% UNLESS (closedbg) %]
283                                                     <ul class="draglist" id="bg">
284                                                 [% ELSE %]
285                                                     <ul>
286                                                 [% END %]
287                                                 [% FOREACH selectedbasket IN selectedbaskets %]
288                                                     <li class="grouped" id="b-[% selectedbasket.basketno | html %]" >
289                                                         <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
290                                                             [% IF ( selectedbasket.basketname ) %]
291                                                                 [% selectedbasket.basketname | html %]
292                                                             [% ELSE %]
293                                                                 No name, basketnumber: [% selectedbasket.basketno | html %]
294                                                             [% END %]
295                                                         </a>, <br />
296                                                         Total: [% selectedbasket.total | $Price %]
297                                                         <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
298                                                     </li>
299                                                 [% END %]
300                                             </ul>
301                                         </li>
302                                             [% UNLESS (closedbg) %]
303                                                 <li><label><input type="checkbox" id="closedbg" name="closedbg" />Close basket group</label></li>
304                                             [% ELSE %]
305                                                 <input type="hidden" id="closedbg" name="closedbg" value ="1"/>
306                                             [% END %]
307                                     </ol>
308                                 </fieldset>
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="ui-tabs-nav">
329                             [% UNLESS ( listclosed) %]<li class="ui-tabs-active"><a href="#opened">Open</a></li>
330                             [% ELSE%]<li><a href="#opened">Open</a></li>[% END %]
331                             [% IF ( listclosed) %]<li class="ui-tabs-active"><a href="#closed">Closed</a></li>
332                             [% ELSE %]<li><a href="#closed">Closed</a></li>[% END %]
333                         </ul>
334                         <div id="opened">
335                             <table id="basket_group_opened">
336                                 <thead>
337                                     <tr>
338                                         <th>Name</th>
339                                         <th>Number</th>
340                                         <th>Billing place</th>
341                                         <th>Delivery place</th>
342                                         <th>Number of baskets</th>
343                                         <th>Action</th>
344                                     </tr>
345                                 </thead>
346                                 <tbody>
347                                     [% FOREACH basketgroup IN basketgroups %]
348                                         [% UNLESS ( basketgroup.closed ) %]
349                                             <tr>
350                                                 <td>[% IF ( basketgroup.name ) %]
351                                                     [% basketgroup.name | html %]
352                                                     [% ELSE %]
353                                                         Basket group no. [% basketgroup.id | html %]
354                                                     [% END %]
355                                                 </td>
356                                                 <td>[% basketgroup.id | html %]</td>
357                                                 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
358                                                 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
359                                                 <td>[% basketgroup.basketsqty | html %]</td>
360                                                 <td>
361                                                     <input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
362                                                     <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>
363                                                     [% UNLESS basketgroup.basketsqty %]
364                                                         <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>
365                                                     [% END %]
366                                                 </td>
367                                             </tr>
368                                         [% END %]
369                                     [% END %]
370                                 </tbody>
371                             </table>
372                         </div>
373                         <div id="closed">
374                             <table id="basket_group_closed">
375                                 <thead>
376                                     <tr>
377                                         <th>Name</th>
378                                         <th>Number</th>
379                                         <th>Billing place</th>
380                                         <th>Delivery place</th>
381                                         <th>Number of baskets</th>
382                                         <th>Action</th>
383                                     </tr>
384                                 </thead>
385                                 <tbody>
386                                     [% FOREACH basketgroup IN basketgroups %]
387                                         [% IF ( basketgroup.closed ) %]
388                                             <tr>
389                                                 <td>
390                                                     [% IF ( basketgroup.name ) %]
391                                                         [% basketgroup.name | html %]
392                                                         [% ELSE %]
393                                                             Basket group no. [% basketgroup.id | html %]
394                                                         [% END %]
395                                                 </td>
396                                                 <td>[% basketgroup.id | html %]</td>
397                                                 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
398                                                 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
399                                                 <td>[% basketgroup.basketsqty | html %]</td>
400                                                 <td>
401                                                     <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>
402                                                     <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>
403                                                     <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>
404                                                     <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>
405                                             [% IF (ediaccount) %]
406                                                     <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>
407                                             [% ELSE %]
408                                                     <div>No EDIFACT configuration for [% booksellername | html %]</div>
409                                             [% END %]
410                                                 </td>
411                                             </tr>
412                                         [% END %]
413                                     [% END %]
414                                 </tbody>
415                             </table>
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' %]