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