Bug 9806 : QA Followup - use template plugin for branch names
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basketgroup.tt
1 [% USE KohaBranchName %] [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Basket grouping for [% booksellername |html %]</title>
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
7 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
8 [% IF ( grouping ) %]
9 <script type="text/javascript" src="[% yuipath %]/yahoo-dom-event/yahoo-dom-event.js"></script>
10 <script type="text/javascript" src="[% yuipath %]/animation/animation-min.js"></script>
11 <script type="text/javascript" src="[% yuipath %]/dragdrop/dragdrop-min.js"></script>
12 <script type="text/javascript" src="[% yuipath %]/element/element-min.js"></script>
13 <style type="text/css">
14 /*margin and padding on body element
15   can introduce errors in determining
16   element position and are not recommended;
17   we turn them off as a foundation for YUI
18   CSS treatments. */
19 body {
20         margin:0;
21         padding:0;
22 }
23 #basketgroupcolumns {
24     width: 58em;
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 type="text/javascript">
90 //<![CDATA[
91         YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
92
93 function submitForm(form) {
94     if (form.close.checked == true) {
95         var input = document.createElement("input");
96         input.setAttribute("type", "hidden");
97         input.setAttribute("name", "closed");
98         input.setAttribute("value", "1");
99         form.appendChild(input);
100     }
101 }
102
103  $(document).ready(function() {
104     $("#basket_groups").tabs();
105
106     $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
107         "aoColumnDefs": [
108             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
109         ],
110         "bAutoWidth": false,
111         "bPaginate": false,
112         "bInfo": false,
113         "bFilter": false,
114     } ));
115
116  });
117
118
119 //]]>
120 </script>
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 %]">[% 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>
129 [% ELSE %]
130     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a> &rsaquo; Basket grouping</div>
131 [% END %]
132
133 <div id="doc3" class="yui-t2">
134     <div id="bd">
135     <div id="yui-main">
136     <div class="yui-b">
137
138 [% IF ( grouping ) %]
139     <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
140         <div id="basketgroupcolumns" class="yui-g">
141                     <div class="yui-u">
142
143                                 <form action="[% scriptname %]" method="post" name="basketgroups" id="basketgroups">
144                     <div id="groups">
145                     <fieldset class="brief">
146                     <div class="workarea_alt" >
147                 <h3>Ungrouped baskets</h3>
148                     <ul id="ungrouped" class="draglist_alt">
149                     [% IF ( baskets ) %]
150                         [% FOREACH basket IN baskets %]
151                             <li class="ungrouped" id="b-[% basket.basketno %]" >
152                                 <a href="basket.pl?basketno=[% basket.basketno %]">
153                                 [% IF ( basket.basketname ) %]
154                                     [% basket.basketname %]
155                                 [% ELSE %]
156                                     No name, basketnumber: [% basket.basketno %]
157                                 [% END %]
158                                 </a>, <br />
159                                 Total: [% basket.total %]
160                                 <input type="hidden" class="basket" name="basket" value="[% basket.basketno %]" />
161                             </li>
162                             [% END %]
163                         [% END %]
164                         </ul>
165                     </div>
166                     </fieldset>
167                     </div>
168                     </form>
169
170                         </div> 
171                         
172                     <div class="yui-u first"> 
173                         <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)">
174                                         <fieldset id="various" class="brief">
175                                         <ol>
176                         <li><label for="basketgroupname">Basket group name:</label>
177                                                         <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" /></li>
178                         <li><label for="billingplace">Billing place:</label>
179                                                         <select name="billingplace" id="billingplace" style="width:13em;">
180                                 <option value="">--</option>
181                                                                 [% FOREACH billingplaceloo IN billingplaceloop %]
182                                         [% IF ( billingplaceloo.selected ) %]<option value="[% billingplaceloo.value %]" selected="selected">[% billingplaceloo.branchname %]</option>
183                                         [% ELSE %]<option value="[% billingplaceloo.value %]">[% billingplaceloo.branchname %]</option>[% END%]
184                                                                 [% END %]
185                                                                                                 </select></li>
186                         <li><label for="deliveryplace">Delivery place:</label>
187                                                         <select name="deliveryplace" id="deliveryplace" style="width:13em;">
188                                                                 <option value="">--</option>
189                                                                 [% FOREACH deliveryplaceloo IN deliveryplaceloop %]
190                                         [% IF ( deliveryplaceloo.selected ) %]<option value="[% deliveryplaceloo.value %]" selected="selected">[% deliveryplaceloo.branchname %]</option>
191                                         [% ELSE %]<option value="[% deliveryplaceloo.value %]">[% deliveryplaceloo.branchname %]</option>[% END %]
192                                                                 [% END %]
193                                                                                                 </select></li>
194                         <li><p>or</p></li>
195                         <li><label for="freedeliveryplace">Delivery place:</label>
196                             <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace %]</textarea></li>
197                                                 <li><label for="deliverycomment">Delivery comment:</label>
198                                                         <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment %]</textarea>
199                                                 </li>
200                                                 <li><span class="label">Baskets in this group:</span>
201                                                         <ul class="draglist" id="bg">
202                                                                 [% FOREACH selectedbasket IN selectedbaskets %]
203                                                     <li class="grouped" id="b-[% selectedbasket.basketno %]" >
204                                                         <a href="basket.pl?basketno=[% selectedbasket.basketno %]">
205                                                         [% IF ( selectedbasket.basketname ) %]
206                                                             [% selectedbasket.basketname %]
207                                                         [% ELSE %]
208                                                             No name, basketnumber: [% selectedbasket.basketno %]
209                                                         [% END %]
210                                                         </a>, <br />
211                                                         Total: [% selectedbasket.total %]
212                                                         <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno %]" />
213                                                     </li>
214                                             [% END %]
215                                                         </ul>
216                                                 </li>
217                                                 <li><label><input type="checkbox" id="close" name="close" /> Close basket group</label></li>
218                                                 </ol>
219                                         </fieldset>
220
221                         <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid %]" />
222                                 [% IF ( basketgroupid ) %]
223                                         <input type="hidden" name="basketgroupid" value="[% basketgroupid %]" />
224                                 [% END %]
225                                 <input type="hidden" name="op" value="attachbasket" />
226                         <input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]" class="cancel">Cancel</a>
227                         </fieldset>
228                                 </form>
229                         </div> 
230                 </div>   
231 [% ELSE %]
232
233     <div id="toolbar" class="btn-toolbar">
234         <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>
235     </div>
236     <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
237
238         <div id="basket_groups" class="toptabs">
239         <ul class="ui-tabs-nav">
240         [% UNLESS ( closed ) %]<li class="ui-tabs-selected"><a href="#opened">Open</a></li>
241         [% ELSE%]<li><a href="#opened">Open</a></li>[% END %]
242         [% IF ( closed ) %]<li class="ui-tabs-selected"><a href="#closed">Closed</a></li>
243         [% ELSE %]<li><a href="#closed">Closed</a></li>[% END %]
244     </ul>
245     <div id="opened">
246         <table id="basket_group_opened">
247                         <thead>
248                                 <tr>
249                                         <th>Name</th>
250                                         <th>Number</th>
251                                         <th>Billing place</th>
252                                         <th>Delivery place</th>
253                                         <th>Number of baskets</th>
254                                         <th>Action</th>
255                                 </tr>
256                         </thead>
257                         <tbody>
258                         [% FOREACH basketgroup IN basketgroups %]
259                                 [% UNLESS ( basketgroup.closed ) %]
260                                         <tr>
261                                                 <td>[% IF ( basketgroup.name ) %]
262                                                                                                         [% basketgroup.name %]
263                                                                                                 [% ELSE %]
264                                                                                                         Basket group no. [% basketgroup.id %]
265                                                                                                 [% END %]
266                                                 </td>
267                                     <td>[% basketgroup.id %]</td>
268                                     <td>[% basketgroup.billingplace | $KohaBranchName %]</td>
269                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %]</td>
270                                     <td>[% basketgroup.basketsqty %]</td>
271                                                         <td>
272                                                                 <input type="button" onclick="closeandprint([% basketgroup.id %])" value="Close and print" />
273                                                                 <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>
274                                                                 <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>
275                                                         </td>
276                                         </tr>
277                                 [% END %]
278                         [% END %]
279                         </tbody>
280                 </table>
281     </div>
282     <div id="closed">
283         <table id="basket_group_closed">
284                         <thead>
285                                 <tr>
286                                         <th>Name</th>
287                                         <th>Number</th>
288                                         <th>Billing place</th>
289                                         <th>Delivery place</th>
290                                         <th>Number of baskets</th>
291                                         <th>Action</th>
292                                 </tr>
293                         </thead>
294                         <tbody>
295                                 [% FOREACH basketgroup IN basketgroups %]
296                                 [% IF ( basketgroup.closed ) %]
297                                 <tr>
298                                 <td>
299                                      [% IF ( basketgroup.name ) %]
300                                                                                         [% basketgroup.name %]
301                                                                                 [% ELSE %]
302                                                                                         Basket group no. [% basketgroup.id %]
303                                                                                 [% END %]
304                                         </td>
305                                     <td>[% basketgroup.id %]</td>
306                                     <td>[% basketgroup.billingplace | $KohaBranchName %]</td>
307                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %]</td>
308                                     <td>[% basketgroup.basketsqty %]</td>
309                                         <td>
310                                                         <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>
311                                                         <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>
312                                                         <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>
313                     </td>
314                                 </tr>
315                                 [% END %]
316                                 [% END %]
317                                 </tbody>
318                         </table>
319                         </div>
320         </div>
321 [% END %]
322 </div>
323 </div>
324 <div class="yui-b">
325 [% IF ( booksellerid ) %]
326 [% INCLUDE 'vendor-menu.inc' %]
327 [% END %]
328 [% INCLUDE 'acquisitions-menu.inc' %]
329 </div>
330 </div>
331 [% INCLUDE 'intranet-bottom.inc' %]