Bug 10649 - Upgrade DataTables and move scripts out of theme directory
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basketgroup.tt
1 [% USE KohaBranchName %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Basket grouping for [% booksellername |html %]</title>
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script>
8 <script type="text/javascript" src="[% yuipath %]/button/button-min.js"></script>
9 <script type="text/javascript" src="[% yuipath %]/container/container_core-min.js"></script>
10 <script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
11 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
12 [% IF ( grouping ) %]
13 <script type="text/javascript" src="[% yuipath %]/yahoo-dom-event/yahoo-dom-event.js"></script>
14 <script type="text/javascript" src="[% yuipath %]/animation/animation-min.js"></script>
15 <script type="text/javascript" src="[% yuipath %]/dragdrop/dragdrop-min.js"></script>
16 <script type="text/javascript" src="[% yuipath %]/element/element-min.js"></script>
17 <style type="text/css">
18 /*margin and padding on body element
19   can introduce errors in determining
20   element position and are not recommended;
21   we turn them off as a foundation for YUI
22   CSS treatments. */
23 body {
24         margin:0;
25         padding:0;
26 }
27 #basketgroupcolumns {
28     width: 58em;
29 }
30 #ungrouped {
31         overflow: auto;
32         height: 400px;
33 }
34
35 .draglist{
36         width: 200px;
37         height: 300px;
38         overflow: auto;
39 }
40
41 div.workarea_alt { padding: 5px; float:left; width: 95%;}
42 div.closed { background-color: pink; padding:10px; float:left; width: 45%;}
43
44 ul.draglist {
45     position: relative;
46     background: #EEE;
47     padding-bottom:10;
48     border: 1px inset gray;
49     list-style: none;
50     margin:0;
51     padding: 5px;
52 }
53
54 ul.draglist li {
55     margin: 1px;
56     cursor: move;
57     list-style: none;
58 }
59
60 ul.draglist_alt {
61     position: relative;
62     border: 1px solid gray;
63     list-style: none;
64     margin: 0;
65     background: #f7f7f7;
66     padding: 5px;
67     cursor: move;
68 }
69
70 ul.draglist_alt li {
71     margin: 1px;
72     list-style: none;
73 }
74
75 li.grouped {
76     background-color: #D1E6EC;
77     border:1px solid #7EA6B2;
78     list-style: none;
79 }
80
81 li.ungrouped {
82     background-color: #D8D4E2;
83     border:1px solid #6B4C86;
84 }
85
86 fieldset.various li {
87     list-style: none;
88     clear: none;
89 }
90
91 </style>
92  [% END %]
93 <script type="text/javascript">
94 //<![CDATA[
95         YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
96
97 var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
98 var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
99 var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
100 var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
101 var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
102
103 function submitForm(form) {
104     if (form.close.checked == true) {
105         var input = document.createElement("input");
106         input.setAttribute("type", "hidden");
107         input.setAttribute("name", "closed");
108         input.setAttribute("value", "1");
109         form.appendChild(input);
110     }
111 }
112
113  $(document).ready(function() {
114     $("#basket_groups").tabs();
115
116     $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
117         "aoColumnDefs": [
118             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
119         ],
120         sDom: 't',
121         "bAutoWidth": false
122     } ));
123
124  });
125
126
127 //]]>
128 </script>
129 </head>
130 <body id="acq_basketgroup" class="acq">
131 [% INCLUDE 'header.inc' %]
132 [% INCLUDE 'acquisitions-search.inc' %]
133
134 <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;
135 [% IF ( grouping ) %]
136     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]">Basket grouping</a> &rsaquo; Add basket group for [% booksellername |html %]</div>
137 [% ELSE %]
138     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a> &rsaquo; Basket grouping</div>
139 [% END %]
140
141 <div id="doc3" class="yui-t2">
142     <div id="bd">
143     <div id="yui-main">
144     <div class="yui-b">
145
146 [% IF ( grouping ) %]
147     <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
148         <div id="basketgroupcolumns" class="yui-g">
149                     <div class="yui-u">
150
151                                 <form action="[% scriptname %]" method="post" name="basketgroups" id="basketgroups">
152                     <div id="groups">
153                     <fieldset class="brief">
154                     <div class="workarea_alt" >
155                 <h3>Ungrouped baskets</h3>
156                     <ul id="ungrouped" class="draglist_alt">
157                     [% IF ( baskets ) %]
158                         [% FOREACH basket IN baskets %]
159                             <li class="ungrouped" id="b-[% basket.basketno %]" >
160                                 <a href="basket.pl?basketno=[% basket.basketno %]">
161                                 [% IF ( basket.basketname ) %]
162                                     [% basket.basketname %]
163                                 [% ELSE %]
164                                     No name, basketnumber: [% basket.basketno %]
165                                 [% END %]
166                                 </a>, <br />
167                                 Total: [% basket.total %]
168                                 <input type="hidden" class="basket" name="basket" value="[% basket.basketno %]" />
169                             </li>
170                             [% END %]
171                         [% END %]
172                         </ul>
173                     </div>
174                     </fieldset>
175                     </div>
176                     </form>
177
178                         </div> 
179                         
180                     <div class="yui-u first"> 
181                         <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)">
182                                         <fieldset id="various" class="brief">
183                                         <ol>
184                         <li><label for="basketgroupname">Basket group name:</label>
185                                                         <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" /></li>
186                         <li><label for="billingplace">Billing place:</label>
187                                                         <select name="billingplace" id="billingplace" style="width:13em;">
188                                 <option value="">--</option>
189                                                                 [% FOREACH billingplaceloo IN billingplaceloop %]
190                                         [% IF ( billingplaceloo.selected ) %]<option value="[% billingplaceloo.value %]" selected="selected">[% billingplaceloo.branchname %]</option>
191                                         [% ELSE %]<option value="[% billingplaceloo.value %]">[% billingplaceloo.branchname %]</option>[% END%]
192                                                                 [% END %]
193                                                                                                 </select></li>
194                         <li><label for="deliveryplace">Delivery place:</label>
195                                                         <select name="deliveryplace" id="deliveryplace" style="width:13em;">
196                                                                 <option value="">--</option>
197                                                                 [% FOREACH deliveryplaceloo IN deliveryplaceloop %]
198                                         [% IF ( deliveryplaceloo.selected ) %]<option value="[% deliveryplaceloo.value %]" selected="selected">[% deliveryplaceloo.branchname %]</option>
199                                         [% ELSE %]<option value="[% deliveryplaceloo.value %]">[% deliveryplaceloo.branchname %]</option>[% END %]
200                                                                 [% END %]
201                                                                                                 </select></li>
202                         <li><p>or</p></li>
203                         <li><label for="freedeliveryplace">Delivery place:</label>
204                             <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace %]</textarea></li>
205                                                 <li><label for="deliverycomment">Delivery comment:</label>
206                                                         <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment %]</textarea>
207                                                 </li>
208                                                 <li><span class="label">Baskets in this group:</span>
209                                                         <ul class="draglist" id="bg">
210                                                                 [% FOREACH selectedbasket IN selectedbaskets %]
211                                                     <li class="grouped" id="b-[% selectedbasket.basketno %]" >
212                                                         <a href="basket.pl?basketno=[% selectedbasket.basketno %]">
213                                                         [% IF ( selectedbasket.basketname ) %]
214                                                             [% selectedbasket.basketname %]
215                                                         [% ELSE %]
216                                                             No name, basketnumber: [% selectedbasket.basketno %]
217                                                         [% END %]
218                                                         </a>, <br />
219                                                         Total: [% selectedbasket.total %]
220                                                         <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno %]" />
221                                                     </li>
222                                             [% END %]
223                                                         </ul>
224                                                 </li>
225                                                 <li><label><input type="checkbox" id="close" name="close" /> Close basket group</label></li>
226                                                 </ol>
227                                         </fieldset>
228
229                         <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid %]" />
230                                 [% IF ( basketgroupid ) %]
231                                         <input type="hidden" name="basketgroupid" value="[% basketgroupid %]" />
232                                 [% END %]
233                                 <input type="hidden" name="op" value="attachbasket" />
234                         <input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]" class="cancel">Cancel</a>
235                         </fieldset>
236                                 </form>
237                         </div> 
238                 </div>   
239 [% ELSE %]
240
241     <div id="toolbar" class="btn-toolbar">
242         <div class="btn-group"><a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="newbasketgroup"><i class="icon-plus"></i> New basket group</a></div>
243     </div>
244     <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
245
246         <div id="basket_groups" class="toptabs">
247         <ul class="ui-tabs-nav">
248         [% UNLESS ( closed ) %]<li class="ui-tabs-selected"><a href="#opened">Open</a></li>
249         [% ELSE%]<li><a href="#opened">Open</a></li>[% END %]
250         [% IF ( closed ) %]<li class="ui-tabs-selected"><a href="#closed">Closed</a></li>
251         [% ELSE %]<li><a href="#closed">Closed</a></li>[% END %]
252     </ul>
253     <div id="opened">
254         <table id="basket_group_opened">
255                         <thead>
256                                 <tr>
257                                         <th>Name</th>
258                                         <th>Number</th>
259                                         <th>Billing place</th>
260                                         <th>Delivery place</th>
261                                         <th>Number of baskets</th>
262                                         <th>Action</th>
263                                 </tr>
264                         </thead>
265                         <tbody>
266                         [% FOREACH basketgroup IN basketgroups %]
267                                 [% UNLESS ( basketgroup.closed ) %]
268                                         <tr>
269                                                 <td>[% IF ( basketgroup.name ) %]
270                                                                                                         [% basketgroup.name %]
271                                                                                                 [% ELSE %]
272                                                                                                         Basket group no. [% basketgroup.id %]
273                                                                                                 [% END %]
274                                                 </td>
275                                     <td>[% basketgroup.id %]</td>
276                                     <td>[% basketgroup.billingplace | $KohaBranchName %]</td>
277                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %]</td>
278                                     <td>[% basketgroup.basketsqty %]</td>
279                                                         <td>
280                                                                 <input type="button" onclick="closeandprint([% basketgroup.id %])" value="Close and print" />
281                                                                 <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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Edit" /></form>
282                                                                 <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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Delete" /></form>
283                                                         </td>
284                                         </tr>
285                                 [% END %]
286                         [% END %]
287                         </tbody>
288                 </table>
289     </div>
290     <div id="closed">
291         <table id="basket_group_closed">
292                         <thead>
293                                 <tr>
294                                         <th>Name</th>
295                                         <th>Number</th>
296                                         <th>Billing place</th>
297                                         <th>Delivery place</th>
298                                         <th>Number of baskets</th>
299                                         <th>Action</th>
300                                 </tr>
301                         </thead>
302                         <tbody>
303                                 [% FOREACH basketgroup IN basketgroups %]
304                                 [% IF ( basketgroup.closed ) %]
305                                 <tr>
306                                 <td>
307                                      [% IF ( basketgroup.name ) %]
308                                                                                         [% basketgroup.name %]
309                                                                                 [% ELSE %]
310                                                                                         Basket group no. [% basketgroup.id %]
311                                                                                 [% END %]
312                                         </td>
313                                     <td>[% basketgroup.id %]</td>
314                                     <td>[% basketgroup.billingplace | $KohaBranchName %]</td>
315                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %]</td>
316                                     <td>[% basketgroup.basketsqty %]</td>
317                                         <td>
318                                                         <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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Reopen" /></form>
319                                                         <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 %]" /><input type="submit" value="Print" /></form>
320                                                         <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 %]" /><input type="submit" value="Export as CSV" /></form>
321                     </td>
322                                 </tr>
323                                 [% END %]
324                                 [% END %]
325                                 </tbody>
326                         </table>
327                         </div>
328         </div>
329 [% END %]
330 </div>
331 </div>
332 <div class="yui-b">
333 [% IF ( booksellerid ) %]
334 [% INCLUDE 'vendor-menu.inc' %]
335 [% END %]
336 [% INCLUDE 'acquisitions-menu.inc' %]
337 </div>
338 </div>
339 [% INCLUDE 'intranet-bottom.inc' %]