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