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