Bug 11033: Make Save button and Cancel link always visible on basketgroup page
[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 #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 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");
98
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     }
107 }
108
109  $(document).ready(function() {
110     $("#basket_groups").tabs();
111
112     $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
113         "aoColumnDefs": [
114             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
115         ],
116         sDom: 't',
117         "bAutoWidth": false
118     } ));
119
120  });
121
122
123 //]]>
124 </script>
125 </head>
126 <body id="acq_basketgroup" class="acq">
127 [% INCLUDE 'header.inc' %]
128 [% INCLUDE 'acquisitions-search.inc' %]
129
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 %]">[% 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>
133 [% ELSE %]
134     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a> &rsaquo; Basket grouping</div>
135 [% END %]
136
137 <div id="doc3" class="yui-t2">
138     <div id="bd">
139     <div id="yui-main">
140     <div class="yui-b">
141
142 [% IF ( grouping ) %]
143     <h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
144         <div id="basketgroupcolumns" class="yui-g">
145                     <div class="yui-u">
146
147                                 <form action="[% scriptname %]" method="post" name="basketgroups" id="basketgroups">
148                     <div id="groups">
149                     <fieldset class="brief">
150                     <div class="workarea_alt" >
151                 <h3>Ungrouped baskets</h3>
152                     <ul id="ungrouped" class="draglist_alt">
153                     [% IF ( baskets ) %]
154                         [% FOREACH basket IN baskets %]
155                             <li class="ungrouped" id="b-[% basket.basketno %]" >
156                                 <a href="basket.pl?basketno=[% basket.basketno %]">
157                                 [% IF ( basket.basketname ) %]
158                                     [% basket.basketname %]
159                                 [% ELSE %]
160                                     No name, basketnumber: [% basket.basketno %]
161                                 [% END %]
162                                 </a>, <br />
163                                 Total: [% basket.total %]
164                                 <input type="hidden" class="basket" name="basket" value="[% basket.basketno %]" />
165                             </li>
166                             [% END %]
167                         [% END %]
168                         </ul>
169                     </div>
170                     </fieldset>
171                     </div>
172                     </form>
173
174                         </div> 
175                         
176                     <div class="yui-u first"> 
177                         <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)">
178                                         <fieldset id="various" class="brief">
179                                         <ol>
180                         <li><label for="basketgroupname">Basket group name:</label>
181                                                        <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" class="focus" /></li>
182                         <li><label for="billingplace">Billing place:</label>
183                                                         <select name="billingplace" id="billingplace" style="width:13em;">
184                                 <option value="">--</option>
185                                                                 [% FOREACH billingplaceloo IN billingplaceloop %]
186                                         [% IF ( billingplaceloo.selected ) %]<option value="[% billingplaceloo.value %]" selected="selected">[% billingplaceloo.branchname %]</option>
187                                         [% ELSE %]<option value="[% billingplaceloo.value %]">[% billingplaceloo.branchname %]</option>[% END%]
188                                                                 [% END %]
189                                                                                                 </select></li>
190                         <li><label for="deliveryplace">Delivery place:</label>
191                                                         <select name="deliveryplace" id="deliveryplace" style="width:13em;">
192                                                                 <option value="">--</option>
193                                                                 [% FOREACH deliveryplaceloo IN deliveryplaceloop %]
194                                         [% IF ( deliveryplaceloo.selected ) %]<option value="[% deliveryplaceloo.value %]" selected="selected">[% deliveryplaceloo.branchname %]</option>
195                                         [% ELSE %]<option value="[% deliveryplaceloo.value %]">[% deliveryplaceloo.branchname %]</option>[% END %]
196                                                                 [% END %]
197                                                                                                 </select></li>
198                         <li><p>or</p></li>
199                         <li><label for="freedeliveryplace">Delivery place:</label>
200                             <textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace %]</textarea></li>
201                                                 <li><label for="deliverycomment">Delivery comment:</label>
202                                                         <textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment %]</textarea>
203                                                 </li>
204                                                 <li><span class="label">Baskets in this group:</span>
205                                                         <ul class="draglist" id="bg">
206                                                                 [% FOREACH selectedbasket IN selectedbaskets %]
207                                                     <li class="grouped" id="b-[% selectedbasket.basketno %]" >
208                                                         <a href="basket.pl?basketno=[% selectedbasket.basketno %]">
209                                                         [% IF ( selectedbasket.basketname ) %]
210                                                             [% selectedbasket.basketname %]
211                                                         [% ELSE %]
212                                                             No name, basketnumber: [% selectedbasket.basketno %]
213                                                         [% END %]
214                                                         </a>, <br />
215                                                         Total: [% selectedbasket.total %]
216                                                         <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno %]" />
217                                                     </li>
218                                             [% END %]
219                                                         </ul>
220                                                 </li>
221                                                 <li><label><input type="checkbox" id="close" name="close" /> Close basket group</label></li>
222                                                 </ol>
223                                         </fieldset>
224
225                         <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid %]" />
226                                 [% IF ( basketgroupid ) %]
227                                         <input type="hidden" name="basketgroupid" value="[% basketgroupid %]" />
228                                 [% END %]
229                                 <input type="hidden" name="op" value="attachbasket" />
230                         <input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]" class="cancel">Cancel</a>
231                         </fieldset>
232                                 </form>
233                         </div> 
234                 </div>   
235 [% ELSE %]
236
237     <div id="toolbar" class="btn-toolbar">
238         <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>
239     </div>
240     <h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
241
242         <div id="basket_groups" class="toptabs">
243         <ul class="ui-tabs-nav">
244         [% UNLESS ( closed ) %]<li class="ui-tabs-selected"><a href="#opened">Open</a></li>
245         [% ELSE%]<li><a href="#opened">Open</a></li>[% END %]
246         [% IF ( closed ) %]<li class="ui-tabs-selected"><a href="#closed">Closed</a></li>
247         [% ELSE %]<li><a href="#closed">Closed</a></li>[% END %]
248     </ul>
249     <div id="opened">
250         <table id="basket_group_opened">
251                         <thead>
252                                 <tr>
253                                         <th>Name</th>
254                                         <th>Number</th>
255                                         <th>Billing place</th>
256                                         <th>Delivery place</th>
257                                         <th>Number of baskets</th>
258                                         <th>Action</th>
259                                 </tr>
260                         </thead>
261                         <tbody>
262                         [% FOREACH basketgroup IN basketgroups %]
263                                 [% UNLESS ( basketgroup.closed ) %]
264                                         <tr>
265                                                 <td>[% IF ( basketgroup.name ) %]
266                                                                                                         [% basketgroup.name %]
267                                                                                                 [% ELSE %]
268                                                                                                         Basket group no. [% basketgroup.id %]
269                                                                                                 [% END %]
270                                                 </td>
271                                     <td>[% basketgroup.id %]</td>
272                                     <td>[% basketgroup.billingplace | $KohaBranchName %]</td>
273                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %]</td>
274                                     <td>[% basketgroup.basketsqty %]</td>
275                                                         <td>
276                                                                 <input type="button" onclick="closeandprint([% basketgroup.id %])" value="Close and print" />
277                                                                 <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>
278                                                                 <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>
279                                                         </td>
280                                         </tr>
281                                 [% END %]
282                         [% END %]
283                         </tbody>
284                 </table>
285     </div>
286     <div id="closed">
287         <table id="basket_group_closed">
288                         <thead>
289                                 <tr>
290                                         <th>Name</th>
291                                         <th>Number</th>
292                                         <th>Billing place</th>
293                                         <th>Delivery place</th>
294                                         <th>Number of baskets</th>
295                                         <th>Action</th>
296                                 </tr>
297                         </thead>
298                         <tbody>
299                                 [% FOREACH basketgroup IN basketgroups %]
300                                 [% IF ( basketgroup.closed ) %]
301                                 <tr>
302                                 <td>
303                                      [% IF ( basketgroup.name ) %]
304                                                                                         [% basketgroup.name %]
305                                                                                 [% ELSE %]
306                                                                                         Basket group no. [% basketgroup.id %]
307                                                                                 [% END %]
308                                         </td>
309                                     <td>[% basketgroup.id %]</td>
310                                     <td>[% basketgroup.billingplace | $KohaBranchName %]</td>
311                                     <td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %]</td>
312                                     <td>[% basketgroup.basketsqty %]</td>
313                                         <td>
314                                                         <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>
315                                                         <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>
316                                                         <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>
317                     </td>
318                                 </tr>
319                                 [% END %]
320                                 [% END %]
321                                 </tbody>
322                         </table>
323                         </div>
324         </div>
325 [% END %]
326 </div>
327 </div>
328 <div class="yui-b">
329 [% IF ( booksellerid ) %]
330 [% INCLUDE 'vendor-menu.inc' %]
331 [% END %]
332 [% INCLUDE 'acquisitions-menu.inc' %]
333 </div>
334 </div>
335 [% INCLUDE 'intranet-bottom.inc' %]