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