Merge remote-tracking branch 'kc/new/bug_5449' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basketgroup.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Basket Grouping for [% booksellername %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4
5 <link rel="stylesheet" type="text/css" href="[% yuipath %]/fonts/fonts-min.css" />
6 <script type="text/javascript" src="[% yuipath %]/yahoo-dom-event/yahoo-dom-event.js"></script>
7 <script type="text/javascript" src="[% yuipath %]/animation/animation-min.js"></script>
8 <script type="text/javascript" src="[% yuipath %]/dragdrop/dragdrop-min.js"></script>
9 <script type="text/javascript" src="[% yuipath %]/element/element-min.js"></script>
10 <script type="text/javascript" src="[% yuipath %]/tabview/tabview-min.js"></script>
11 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
12 <link rel="stylesheet" type="text/css" href="[% yuipath %]/tabview/assets/skins/sam/tabview.css" /> 
13  
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
25 #ungrouped {
26         overflow: auto;
27         height: 400px;
28 }
29
30 .draglist{
31         width: 200px;
32         height: 300px;
33         overflow: auto;
34 }
35
36 div.workarea_alt { padding: 5px; float:left; width: 95%;}
37 div.closed { background-color="pink"; padding:10px; float:left; width: 45%;}
38
39 ul.closed {
40     position: relative;
41     background: grey;
42     padding-bottom:10;
43     border: 1px solid gray;
44     list-style: none;
45     margin:0;
46     padding: 5px;
47 }
48
49 ul.draglist {
50     position: relative;
51     background: #f7f7f7;
52     padding-bottom:10;
53     border: 1px solid gray;
54     list-style: none;
55     margin:0;
56     padding: 5px;
57 }
58
59 ul.draglist li {
60     margin: 1px;
61     cursor: move;
62     list-style: none;
63 }
64
65 ul.draglist_alt {
66     position: relative;
67     border: 1px solid gray;
68     list-style: none;
69     margin: 0;
70     background: #f7f7f7;
71     padding: 5px;
72     cursor: move;
73 }
74
75 ul.draglist_alt li {
76     margin: 1px;
77     list-style: none;
78 }
79
80 li.grouped {
81     background-color: #D1E6EC;
82     border:1px solid #7EA6B2;
83     list-style: none;
84 }
85
86 li.ungrouped {
87     background-color: #D8D4E2;
88     border:1px solid #6B4C86;
89 }
90
91 fieldset.various li {
92     list-style: none;
93     clear: none;
94 }
95
96 .basketgroup {
97         margin-top: 10px;
98         font-size: 1.2em;
99         font-weight: bold;
100         list-style: none;
101         background-color: #D8D4E2;
102         display: block;
103 }
104 .basketgroup li{
105         font-size: 0.5em;
106         list-style: none;
107         display: inline;
108 }
109
110 </style>
111
112 <script type="text/javascript">
113 //<![CDATA[
114         YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
115         var tabView = new YAHOO.widget.TabView('bgtabs');
116 //]]>
117
118
119 function submitForm(form) {
120     if (form.close.checked == true) {
121         var input = document.createElement("input");
122         input.setAttribute("type", "hidden");
123         input.setAttribute("name", "closed");
124         input.setAttribute("value", "1");
125         form.appendChild(input);
126     }
127 }
128
129 </script>
130 </head>
131 <body>
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; <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% booksellerid %]">[% booksellername %]</a> &rsaquo; Basket Grouping</div>
136
137 <div id="doc" class="yui-t7">
138             
139         <div class="yui-b"> 
140                 <div id="toolbar">
141                                 <script type="text/javascript">
142                                         //<![CDATA[
143                                 
144                                         // prepare DOM for YUI Toolbar
145                                 
146                                          $(document).ready(function() {
147                                           //  $("#toolbar").empty();
148                                             yuiToolbar();
149                                          });
150                                 
151                                         // YUI Toolbar Functions
152                                 
153                                         function yuiToolbar() {
154                                                 var booksellermenu = [
155                                                         { text: _("Vendor"), url: "/cgi-bin/koha/acqui/supplier.pl?supplierid=[% booksellerid %]" },
156                                                         { text: _("Edit vendor"), url: "/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid %]"},
157                                                 ]
158                                                 var ordersbutton = [
159                                                          { text: _("Manage orders"), url: "/cgi-bin/koha/acqui/booksellers.pl?supplierid=[% booksellerid %]" },
160                                                          { text: _("Edit uncertain prices"), url: "/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&owner=1" },
161                                                 ]
162                                                 new YAHOO.widget.Button("newbasketgroup");
163                                             new YAHOO.widget.Button({
164                                                 type: "menu",
165                                                 label: _("Vendor"),
166                                                 name: "booksellerbutton",
167                                                 menu: booksellermenu,
168                                                 container: "toolbar"
169                                             });
170                                             
171                                             new YAHOO.widget.Button({
172                                                 type: "menu",
173                                                 label: _("Orders"),
174                                                 name: "ordersbutton",
175                                                 menu: ordersbutton,
176                                                 container: "toolbar"
177                                             });
178                                         }
179                                         //]]>
180                                 </script>
181                                 <a href="?op=add&amp;booksellerid=[% booksellerid %]" name="newbasketgroup" id="newbasketgroup">New Basket Group</a>
182                         </div>
183                         <h1>Basket Grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% booksellerid %]">[% booksellername %]</a></h1>
184                 </div>
185 [% IF ( grouping ) %]
186         <div id="bd"> 
187             <div class="yui-g"> 
188                     <div class="yui-u grouping"> 
189
190                                 <form action="[% scriptname %]" method="post" name="basketgroups" id="basketgroups">
191                     <div id="groups">
192                     <div class="workarea_alt" >
193                     <h3>Ungrouped Baskets</h3>
194                     <ul id="ungrouped" class="draglist_alt">
195                     [% IF ( baskets ) %]
196                         [% FOREACH basket IN baskets %]
197                             <li class="ungrouped" id="b-[% basket.basketno %]" >
198                                 <a href="basket.pl?basketno=[% basket.basketno %]">
199                                 [% IF ( basket.basketname ) %]
200                                     [% basket.basketname %]
201                                 [% ELSE %]
202                                     No name, basketnumber: [% basket.basketno %]
203                                 [% END %]
204                                 </a>, <br />
205                                 Total: [% basket.total %]
206                                 <input type="hidden" class="basket" name="basket" value="[% basket.basketno %]" />
207                             </li>
208                             [% END %]
209                         [% END %]
210                         </ul>
211                     </div>
212                     </div>
213                     </form>
214
215                         </div> 
216                         
217                     <div class="yui-u first"> 
218                         <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)">
219                                         <fieldset id="various" class='various' >
220                                                 <h3><label for="basketgroupname">Basket Group Name:</label></h3>
221                                                 <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" />
222                                                 <h3><label for="billingplace">Billing Place:</label></h3>
223                                                 <select name="billingplace" id="billingplace">
224                                                         [% FOREACH billingplaceloo IN billingplaceloop %]
225                                                         <option value="[% billingplaceloo.value %]" [% IF ( billingplaceloo.selected ) %]selected[% END %]>[% billingplaceloo.branchname %]</option>
226                                                         [% END %]
227                                                 </select>
228                                                 <h3><label for="deliveryplace">Delivery Place:</label></h3>
229                                                 <select name="deliveryplace" id="deliveryplace">
230                                                         <option value="">--</option>
231                                                         [% FOREACH deliveryplaceloo IN deliveryplaceloop %]
232                                                         <option value="[% deliveryplaceloo.value %]" [% IF ( deliveryplaceloo.selected ) %]selected[% END %]>[% deliveryplaceloo.branchname %]</option>
233                                                         [% END %]
234                                                 </select>
235                         <p>or</p>
236                         <h3><label for="freedeliveryplace">Delivery Place:</label></h3>
237                         <textarea cols="26" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace %]</textarea>
238                                                 <h3><label for="deliverycomment">Delivery comment:</label></h3>
239                                                 <textarea cols="26" name="deliverycomment" id="deliverycomment">[% deliverycomment %]</textarea>
240                                         <div class="workarea">
241                                                         <h3>Grouping:</h3>
242                                                         <ul class="draglist" id="bg">
243                                                                 [% FOREACH selectedbasket IN selectedbaskets %]
244                                                     <li class="grouped" id="b-[% selectedbasket.basketno %]" >
245                                                         <a href="basket.pl?basketno=[% selectedbasket.basketno %]">
246                                                         [% IF ( selectedbasket.basketname ) %]
247                                                             [% selectedbasket.basketname %]
248                                                         [% ELSE %]
249                                                             No name, basketnumber: [% selectedbasket.basketno %]
250                                                         [% END %]
251                                                         </a>, <br />
252                                                         Total: [% selectedbasket.total %]
253                                                         <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno %]" />
254                                                     </li>
255                                             [% END %]
256
257                                                         </ul>
258                                                 </div>
259                                                 <div><input type="checkbox" name="close"> Close</input></div>
260                                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
261                                 [% IF ( basketgroupid ) %]
262                                         <input type="hidden" name="basketgroupid" value="[% basketgroupid %]" />
263                                 [% END %]
264                                 <input type="hidden" name="op" value="attachbasket" />
265                                 <input type="submit" value="Save" />
266                                         </fieldset>
267                                 </form>
268                         </div> 
269                 </div>   
270     </div> 
271 [% ELSE %]
272         <div class="yui-g"> 
273                 <div id="bgtabs" class="yui-navset">
274                     <ul class="yui-nav">
275                         <li[% UNLESS ( closed ) %] class="selected"[% END %]><a href="#opened"><em>Opened</em></a></li>
276                         <li[% IF ( closed ) %] class="selected"[% END %]><a href="#closed"><em>Closed</em></a></li>
277                     </ul>            
278                     <div class="yui-content">
279                         <div id="opened">
280                                 <ul>
281                                         [% FOREACH basketgroup IN basketgroups %]
282                                                 [% UNLESS ( basketgroup.closed ) %]
283                                         <li class="basketgroup">
284                                                 [% IF ( basketgroup.name ) %]
285                                                         [% basketgroup.name %]
286                                                 [% ELSE %]
287                                                         Basket Group n°[% basketgroup.id %]
288                                                 [% END %]
289                                                 <ul>
290                                                         <li>
291                                                                 <span class="yui-button yui-link-button">
292                                                                         <span class="first-child">
293                                                                                 <a href="javascript:closeandprint([% basketgroup.id %])" class="yui-button yui-link-button">Close & Print</a>
294                                                                         </span>
295                                                                 </span>
296                                                         </li>
297                                                         <li>
298                                                                 <span class="yui-button yui-link-button">
299                                                                         <span class="first-child">
300                                                                                 <a href="?op=add&amp;booksellerid=[% basketgroup.booksellerid %]&amp;basketgroupid=[% basketgroup.id %]" class="yui-button yui-link-button" >Edit</a>
301                                                                         </span>
302                                                                 </span>
303                                                         </li>
304                                                         <li>
305                                                                 <span class="yui-button yui-link-button">
306                                                                         <span class="first-child">
307                                                                                 <a href="?op=delete&amp;booksellerid=[% basketgroup.booksellerid %]&amp;basketgroupid=[% basketgroup.id %]" class="yui-button yui-link-button" >Delete</a>
308                                                                         </span>
309                                                                 </span>
310                                                         </li>
311                                                         
312                                                 </ul>
313                                         </li>
314                                                 [% END %]
315                                         [% END %]
316                                 </ul>
317                         </div>
318                         <div id="closed">
319                                 <ul>
320                                         [% FOREACH basketgroup IN basketgroups %]
321                                                 [% IF ( basketgroup.closed ) %]
322                                                 <li class="basketgroup">
323                                                         [% IF ( basketgroup.name ) %]
324                                                                 [% basketgroup.name %]
325                                                         [% ELSE %]
326                                                                 Basket Group n°[% basketgroup.id %]
327                                                         [% END %]
328                                                         <ul>
329                                                                 <li>
330                                                                                 <span class="yui-button yui-link-button">
331                                                                                 <span class="first-child">
332                                                                                         <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=reopen&amp;booksellerid=[% basketgroup.booksellerid %]&amp;basketgroupid=[% basketgroup.id %]" class="yui-button yui-link-button">Reopen</a>
333                                                                                 </span>
334                                                                         </span>
335                                                                 </li>
336                                                                 <li>
337                                                                                 <span class="yui-button yui-link-button">
338                                                                                 <span class="first-child">
339                                                                                         <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=print&amp;basketgroupid=[% basketgroup.id %]" class="yui-button yui-link-button">Print</a>
340                                                                                 </span>
341                                                                         </span>
342                                                                 </li>
343                                                         </ul>
344                                                 </li>
345                                                 [% END %]
346                                         [% END %]
347                                 </ul>
348                         </div>
349                     </div>
350                 </div>
351                 
352         </div> 
353 [% END %]
354
355 [% INCLUDE 'intranet-bottom.inc' %]