Bug 22023: Further improve responsive layout handling of staff client menu bar
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basketgroup.tt
blob4ce2bd8147c33d12797dde10363aa0b047702cb5
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. */
26 #ungrouped {
27         overflow: auto;
28         height: 400px;
31 .draglist{
32         width: 200px;
33         height: 300px;
34         overflow: auto;
37 div.workarea_alt { padding: 5px; float:left; width: 95%;}
38 div.closed { background-color: pink; padding:10px; float:left; width: 45%;}
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;
50 ul.draglist li {
51     margin: 1px;
52     cursor: move;
53     list-style: none;
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;
66 ul.draglist_alt li {
67     margin: 1px;
68     list-style: none;
71 li.grouped {
72     background-color: #D1E6EC;
73     border:1px solid #7EA6B2;
74     list-style: none;
77 li.ungrouped {
78     background-color: #D8D4E2;
79     border:1px solid #6B4C86;
82 fieldset.various li {
83     list-style: none;
84     clear: none;
87 </style>
88  [% END %]
89 <script type="text/javascript">
90 //<![CDATA[
91         YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
93 var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
94 var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
95 var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
96 var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
97 var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
99 function submitForm(form) {
100     if (form.close.checked == true) {
101         var input = document.createElement("input");
102         input.setAttribute("type", "hidden");
103         input.setAttribute("name", "closed");
104         input.setAttribute("value", "1");
105         form.appendChild(input);
106     }
109  $(document).ready(function() {
110     $("#basket_groups").tabs();
112     $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
113         "aoColumnDefs": [
114             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
115         ],
116         "bAutoWidth": false,
117         "sPaginationType": "four_button"
118     } ));
120  });
123 //]]>
124 </script>
125 </head>
126 <body id="acq_basketgroup" class="acq">
127 [% INCLUDE 'header.inc' %]
128 [% INCLUDE 'acquisitions-search.inc' %]
130 <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;
131 [% IF ( grouping ) %]
132     <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>
133 [% ELSE %]
134     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a> &rsaquo; Basket grouping</div>
135 [% END %]
138 <div class="main container-fluid">
139     <div class="row">
140         <div class="col-sm-10 col-sm-push-2">
141             <main>
143                 [% IF ( grouping ) %]
144                     [% IF (closedbg) %]
145                         <div id="toolbar" class="btn-toolbar">
146                             <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>
147                             <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>
148                             <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>
149                         [% IF (ediaccount) %]
150                             <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>
151                         [% END %]
152                         </div>
153                     [% END %]
154                     [% IF (name && closedbg) %]
155                         <h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
156                     [% ELSIF (name) %]
157                         <h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
158                     [% ELSE %]
159                         <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
160                     [% END %]
161                     <div id="basketgroupcolumns" class="row">
162                         [% UNLESS (closedbg) %]
163                             <div class="col-xs-6 col-xs-push-6">
164                                 <form action="[% scriptname | html %]" method="post" name="basketgroups" id="basketgroups">
165                                     <div id="groups">
166                                         <fieldset class="brief">
167                                             <div class="workarea_alt" >
168                                                 <h3>Ungrouped baskets</h3>
169                                                 <ul id="ungrouped" class="draglist_alt">
170                                                     [% IF ( baskets ) %]
171                                                         [% FOREACH basket IN baskets %]
172                                                             <li class="ungrouped" id="b-[% basket.basketno | html %]" >
173                                                                 <a href="basket.pl?basketno=[% basket.basketno | uri %]">
174                                                                     [% IF ( basket.basketname ) %]
175                                                                         [% basket.basketname | html %]
176                                                                     [% ELSE %]
177                                                                         No name, basketnumber: [% basket.basketno | html %]
178                                                                     [% END %]
179                                                                 </a>, <br />
180                                                                 Total: [% basket.total | $Price %]
181                                                                 <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
182                                                             </li>
183                                                         [% END %]
184                                                     [% END %]
185                                                 </ul>
186                                             </div>
187                                         </fieldset>
188                                     </div>
189                                 </form>
190                             </div>
191                         [% END %]
192                         [% IF ( closedbg ) %]
193                             <div class="col-xs-12">
194                         [% ELSE %]
195                             <div class="col-xs-6 col-xs-pull-6">
196                         [% END %]
197                             <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)">
198                                 <fieldset id="various" class="brief">
199                                     <ol>
200                                         [% UNLESS (closedbg) %]
201                                             <li>
202                                                 <label for="basketgroupname">Basket group name:</label>
203                                                 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
204                                             </li>
205                                         [% ELSE %]
206                                             <input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
207                                         [% END %]
208                                         <li>
209                                             [% UNLESS (closedbg) %]
210                                                 <label for="billingplace">Billing place:</label>
211                                                 <select name="billingplace" id="billingplace">
212                                                     <option value="">--</option>
213                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
214                                                 </select>
215                                             [% ELSE %]
216                                                 <span class="label">Billing place:</span>
217                                                 <input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
218                                             [% END %]
219                                         </li>
220                                         [% UNLESS (closedbg) %]
221                                             <li>
222                                                 <label for="deliveryplace">Delivery place:</label>
223                                                 <select name="deliveryplace" id="deliveryplace">
224                                                     <option value="">--</option>
225                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
226                                                 </select>
227                                             </li>
228                                             <li><p>or</p></li>
229                                             <li>
230                                                 <label for="freedeliveryplace">Delivery place:</label>
231                                                 <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
232                                             </li>
233                                             [% ELSE %]
234                                                 <li>
235                                                     <span class="label">Delivery place:</span>
236                                                     [% IF (freedeliveryplace) %]
237                                                         <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
238                                                         <input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
239                                                     [% ELSE %]
240                                                         <input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
241                                                         <input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
242                                                     [% END %]
243                                                 </li>
244                                             [% END %]
245                                             <li>
246                                                 [% UNLESS (closedbg) %]
247                                                     <label for="deliverycomment">Delivery comment:</label>
248                                                     <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
249                                                 [% ELSE %]
250                                                     <span class="label">Delivery comment:</span>[% deliverycomment | html %]
251                                                     <input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
252                                                 [% END %]
253                                             </li>
254                                             <li>
255                                                 <span class="label">Baskets in this group:</span>
256                                                 [% UNLESS (closedbg) %]
257                                                     <ul class="draglist" id="bg">
258                                                 [% ELSE %]
259                                                     <ul>
260                                                 [% END %]
261                                                 [% FOREACH selectedbasket IN selectedbaskets %]
262                                                     <li class="grouped" id="b-[% selectedbasket.basketno | html %]" >
263                                                         <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
264                                                             [% IF ( selectedbasket.basketname ) %]
265                                                                 [% selectedbasket.basketname | html %]
266                                                             [% ELSE %]
267                                                                 No name, basketnumber: [% selectedbasket.basketno | html %]
268                                                             [% END %]
269                                                         </a>, <br />
270                                                         Total: [% selectedbasket.total | $Price %]
271                                                         <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
272                                                     </li>
273                                                 [% END %]
274                                             </ul>
275                                         </li>
276                                             [% UNLESS (closedbg) %]
277                                                 <li><label><input type="checkbox" id="closedbg" name="closedbg" />Close basket group</label></li>
278                                             [% ELSE %]
279                                                 <input type="hidden" id="closedbg" name="closedbg" value ="1"/>
280                                             [% END %]
281                                     </ol>
282                                 </fieldset>
283                                 [% UNLESS (closedbg) %]
284                                     <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
285                                         [% IF ( basketgroupid ) %]
286                                             <input type="hidden" name="basketgroupid" value="[% basketgroupid | html %]" />
287                                         [% END %]
288                                         <input type="hidden" name="op" value="attachbasket" />
289                                         <input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]" class="cancel">Cancel</a>
290                                     </fieldset>
291                                 [% END %]
292                             </form>
293                         </div>
294                     </div>
295                 [% ELSE %]
296                     <div id="toolbar" class="btn-toolbar">
297                         <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>
298                     </div>
299                     <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
300                     [% IF (NoEDIMessage) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
301                     <div id="basket_groups" class="toptabs">
302                         <ul class="ui-tabs-nav">
303                             [% UNLESS ( listclosed) %]<li class="ui-tabs-active"><a href="#opened">Open</a></li>
304                             [% ELSE%]<li><a href="#opened">Open</a></li>[% END %]
305                             [% IF ( listclosed) %]<li class="ui-tabs-active"><a href="#closed">Closed</a></li>
306                             [% ELSE %]<li><a href="#closed">Closed</a></li>[% END %]
307                         </ul>
308                         <div id="opened">
309                             <table id="basket_group_opened">
310                                 <thead>
311                                     <tr>
312                                         <th>Name</th>
313                                         <th>Number</th>
314                                         <th>Billing place</th>
315                                         <th>Delivery place</th>
316                                         <th>Number of baskets</th>
317                                         <th>Action</th>
318                                     </tr>
319                                 </thead>
320                                 <tbody>
321                                     [% FOREACH basketgroup IN basketgroups %]
322                                         [% UNLESS ( basketgroup.closed ) %]
323                                             <tr>
324                                                 <td>[% IF ( basketgroup.name ) %]
325                                                     [% basketgroup.name | html %]
326                                                     [% ELSE %]
327                                                         Basket group no. [% basketgroup.id | html %]
328                                                     [% END %]
329                                                 </td>
330                                                 <td>[% basketgroup.id | html %]</td>
331                                                 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
332                                                 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
333                                                 <td>[% basketgroup.basketsqty | html %]</td>
334                                                 <td>
335                                                     <input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
336                                                     <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>
337                                                     [% UNLESS basketgroup.basketsqty %]
338                                                         <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>
339                                                     [% END %]
340                                                 </td>
341                                             </tr>
342                                         [% END %]
343                                     [% END %]
344                                 </tbody>
345                             </table>
346                         </div>
347                         <div id="closed">
348                             <table id="basket_group_closed">
349                                 <thead>
350                                     <tr>
351                                         <th>Name</th>
352                                         <th>Number</th>
353                                         <th>Billing place</th>
354                                         <th>Delivery place</th>
355                                         <th>Number of baskets</th>
356                                         <th>Action</th>
357                                     </tr>
358                                 </thead>
359                                 <tbody>
360                                     [% FOREACH basketgroup IN basketgroups %]
361                                         [% IF ( basketgroup.closed ) %]
362                                             <tr>
363                                                 <td>
364                                                     [% IF ( basketgroup.name ) %]
365                                                         [% basketgroup.name | html %]
366                                                         [% ELSE %]
367                                                             Basket group no. [% basketgroup.id | html %]
368                                                         [% END %]
369                                                 </td>
370                                                 <td>[% basketgroup.id | html %]</td>
371                                                 <td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
372                                                 <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
373                                                 <td>[% basketgroup.basketsqty | html %]</td>
374                                                 <td>
375                                                     <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>
376                                                     <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>
377                                                     <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>
378                                                     <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>
379                                             [% IF (ediaccount) %]
380                                                     <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>
381                                             [% ELSE %]
382                                                     <div>No EDIFACT configuration for [% booksellername | html %]</div>
383                                             [% END %]
384                                                 </td>
385                                             </tr>
386                                         [% END %]
387                                     [% END %]
388                                 </tbody>
389                             </table>
390                         </div>
391                     </div>
392                 [% END %]
393             </main>
394         </div> <!-- /.col-sm-10.col-sm-push-2 -->
396         <div class="col-sm-2 col-sm-pull-10">
397             <aside>
398                 [% IF ( booksellerid ) %]
399                     [% INCLUDE 'vendor-menu.inc' %]
400                 [% END %]
401                 [% INCLUDE 'acquisitions-menu.inc' %]
402             </aside>
403         </div>
404     </div> <!-- /.row -->
405     [% INCLUDE 'intranet-bottom.inc' %]