Bug 10626: Remove doubled up TT plugins - Merge KohaAuthorisedValues and AuthorisedValues
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / suggestion / suggestion.tt
1 [% USE Branches %]
2 [% USE AuthorisedValues %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Acquisitions  &rsaquo;
5     [% IF ( op_save ) %]
6         [% IF ( suggestionid ) %]
7             Suggestions &rsaquo;  Edit suggestion #[% suggestionid %]
8         [% ELSE %]
9             Suggestions &rsaquo; Add suggestion
10         [% END %]
11     [% ELSIF ( op == 'show' ) %]
12            Suggestions &rsaquo; Show suggestion #[% suggestionid %]
13     [% ELSE %]
14         Suggestions management
15     [% END %]
16 </title>
17 [% INCLUDE 'doc-head-close.inc' %]
18 [% INCLUDE 'calendar.inc' %]
19 [% IF ( op == 'show' ) %]
20 <script type="text/javascript">
21     // <![CDATA[
22     $(document).ready(function(){
23         $("#deletesuggestion").on("click",function(){
24             return confirm(_("Are you sure you want to delete this suggestion?"));
25         });
26     });
27     // ]]>
28 </script>
29 [% END %]
30 [% IF ( op_else ) %]
31 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
32 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
33 [% INCLUDE 'datatables-strings.inc' %]
34 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
35 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
36 <script type="text/javascript">
37 // <![CDATA[
38 /**
39 *  displayOther.
40 *  This function display the select or an textaera to write a reason.
41 */
42 function displayOther(id,show,hide){
43         $("#"+hide+id).hide();
44         $("#"+show+id).show();
45 }
46 $(document).ready(function() {
47     $('#suggestiontabs').tabs({
48         // Correct table sizing for tables hidden in tabs
49         // http://www.datatables.net/examples/api/tabs_and_scrolling.html
50         "show": function(event, ui) {
51             var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
52             if ( oTable.length > 0 ) {
53                 oTable.fnAdjustColumnSizing();
54             }
55         }
56     });
57     $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
58         "aoColumnDefs": [
59             { "aTargets": [ 0, -1, -2 ], "bSortable": false, "bSearchable": false },
60         ],
61         "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
62         "iDisplayLength": 20,
63         "sPaginationType": "four_button"
64     }));
65 [% FOREACH suggestion IN suggestions %]
66 // functions for [% suggestion.suggestiontype %] interactions
67     $("#CheckAll[% suggestion.suggestiontype %]").click(function(e){
68                 $("#[% suggestion.suggestiontype %]t").checkCheckboxes();
69         e.preventDefault();
70     });
71     $("#UncheckAll[% suggestion.suggestiontype %]").click(function(e){
72                 $("#[% suggestion.suggestiontype %]t").unCheckCheckboxes();
73         e.preventDefault();
74         });
75         $("#other_reason[% suggestion.suggestiontype %]").hide();
76     $("input[name*=other_reason[% suggestion.suggestiontype %]]").focus(function(){ $(this).val(""); });
77     $("#reason[% suggestion.suggestiontype %]").change(function(){
78             if($(this).val() == "other"){
79                         $(this).hide();
80                         $("#other_reason[% suggestion.suggestiontype %]").show();
81     }
82     });
83         $("#[% suggestion.suggestiontype %]delete").change(function(){
84                 if(this.checked){
85                         $("form[name='f[% suggestion.suggestiontype %]'] input[name=op]").attr("value","delete");
86                 } else {
87                         $("form[name='f[% suggestion.suggestiontype %]'] input[name=op]").attr("value","change");
88                 }
89         });
90
91 [% END %]
92     $("a[href*=back]").click(function(){
93     var sid = $(this).attr("href").replace(/#back/,"");
94             $("#reason"+sid).show().find("option[value='']").attr("selected","selected");
95                 $("#other_reason"+sid).hide();
96     });
97     $("h4.local_collapse a").click(function(){
98         $(this).parent().parent().find("ol").toggle();
99         return false;
100     });
101     // http://jqueryui.com/demos/datepicker/#date-range
102     var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
103         changeMonth: true,
104         numberOfMonths: 1,
105         onSelect: function( selectedDate ) {
106             var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
107                 instance = $( this ).data( "datepicker" );
108                 date = $.datepicker.parseDate(
109                     instance.settings.dateFormat ||
110                     $.datepicker._defaults.dateFormat,
111                     selectedDate, instance.settings );
112             dates.not( this ).datepicker( "option", option, date );
113         }
114     });
115     var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
116         changeMonth: true,
117         numberOfMonths: 1,
118         onSelect: function( selectedDate ) {
119             var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
120                 instance = $( this ).data( "datepicker" );
121                 date = $.datepicker.parseDate(
122                     instance.settings.dateFormat ||
123                     $.datepicker._defaults.dateFormat,
124                     selectedDate, instance.settings );
125             datesMD.not( this ).datepicker( "option", option, date );
126         }
127     });
128     var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
129         changeMonth: true,
130         numberOfMonths: 1,
131         onSelect: function( selectedDate ) {
132             var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
133                 instance = $( this ).data( "datepicker" );
134                 date = $.datepicker.parseDate(
135                     instance.settings.dateFormat ||
136                     $.datepicker._defaults.dateFormat,
137                     selectedDate, instance.settings );
138             datesAD.not( this ).datepicker( "option", option, date );
139         }
140     });
141 });
142 // ]]>
143 </script>
144 <style type="text/css">
145 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
146 .overlay { top: 180px; left: 50%; position: absolute; margin-left: -100px; width: 200px; text-align: center; display: none; margin-top: -10px; background: #eeffd4; padding: .5em; color: #000; } .note { -moz-border-radius: 3px; border-radius:3px; background: transparent url("[% interface %]/[% theme %]/img/famfamfam/silk/comment.png") top left no-repeat; padding : 1px 3px 1px 18px; font-size : 90%; }
147 </style>[% END %]
148 [% IF ( op_save )  %]
149     <script type="text/javascript">
150         // <![CDATA[
151         $(document).ready(function() { calcNewsuggTotal(); });
152         // ]]>
153     </script>
154 [% END %]
155 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
156 </head>
157 <body id="acq_suggestion" class="acq">
158 [% INCLUDE 'header.inc' %]
159 [% INCLUDE 'cat-search.inc' %]
160 <div id="breadcrumbs">
161     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
162     [% IF ( op_save ) %]
163         [% IF ( suggestionid ) %]
164             <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo;  Edit suggestion #[% suggestionid %]
165         [% ELSE %]
166             <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; Add suggestion
167         [% END %]
168     [% ELSIF ( op == 'show' ) %]
169            <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; Show suggestion #[% suggestionid %]
170     [% ELSE %]
171         Suggestions management
172     [% END %]
173 </div>
174
175 [% IF ( op == 'show' ) %]
176 <div id="doc" class="yui-t7"> <!-- <div id="doc3" class="yui-t2"> -->
177 <div id="bd">
178     <div id="yui-main">
179     <div class="yui-b">
180
181     <div id="toolbar" class="btn-toolbar">
182         <a class="btn btn-small" id="editsuggestion" href="suggestion.pl?op=edit&amp;suggestionid=[% suggestionid %]"><i class="icon-pencil"></i> Edit</a>
183         <a class="btn btn-small" id="deletesuggestion" href="suggestion.pl?op=delete&amp;edit_field=[% suggestionid %]"><i class="icon-remove"></i> Delete</a>
184     </div>
185
186     <fieldset class="rows">
187       <legend>Bibliographic information</legend>
188       <ol>
189         <li><span class="label">Title:</span>[% title |html %]</li>
190         <li><span class="label">Author:</span>[% author |html %]</li>
191         <li><span class="label">Copyright date:</span>[% copyrightdate |html %]</li>
192         <li><span class="label">ISBN or ISSN or other standard number:</span>[% isbn |html %]</li>
193         <li><span class="label">Publisher:</span>[% publishercode |html %]</li>
194         <li><span class="label">Publication place:</span>[% place |html %]</li>
195         <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
196         <li><span class="label">Document type:</span>
197             [% FOREACH itemtypeloo IN itemtypeloop %]
198                 [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %]
199             [% END %]
200         </li>
201         [% IF ( patron_reason_loop ) %]
202           <li><span class="label">Reason for suggestion: </span>
203             [% FOREACH patron_reason_loo IN patron_reason_loop %]
204               [% IF ( patron_reason_loo.selected ) %][% patron_reason_loo.lib %][% END %]
205             [% END %]
206           </li>
207         [% END %]
208         <li><span class="label">Notes:</span>[% note |html %]</li>
209       </ol>
210     </fieldset>
211     <fieldset class="rows"> <legend>Suggestion management</legend>
212       <ol>
213         <li>
214           <span class="label">Status:</span>
215           [% SET status_found = 0 %]
216           [% IF ( STATUS == 'ASKED' ) %]
217               Pending
218               [% SET status_found = 1 %]
219           [% ELSIF ( STATUS == 'ACCEPTED' ) %]
220               Accepted
221               [% SET status_found = 1 %]
222           [% ELSIF ( STATUS == 'CHECKED' ) %]
223               Checked
224               [% SET status_found = 1 %]
225           [% ELSIF ( STATUS == 'REJECTED' ) %]
226               Rejected
227               [% SET status_found = 1 %]
228           [% ELSE %]
229               [% FOREACH s IN SuggestionStatuses %]
230                   [% IF STATUS == s.authorised_value %]
231                       [% s.lib %]
232                       [% SET status_found = 1 %]
233                   [% END %]
234               [% END %]
235           [% END %]
236
237         </li>
238         <li>
239           <table>
240             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
241             <tbody>
242             <tr>
243                 <th><span class="label">Suggestion creation</span> </th>
244                 <td>[% suggesteddate %]</td>
245                 <td>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a>  [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %]
246                 </td>
247             </tr>
248             <tr>
249                 <th><span class="label">Suggestion management</span> </th>
250                 <td>[% manageddate %]</td>
251                 <td>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %]</td>
252             </tr>
253             <tr>
254                 <th><span class="label">Suggestion accepted</span> </th>
255                 <td>[% accepteddate %]</td>
256                 <td>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %]</td>
257             </tr>
258             </tbody>
259         </table></li></ol>
260     </fieldset>
261     <fieldset class="rows"> <legend>Acquisition information</legend>
262       <ol>
263         <li>
264           <span class="label">Library:</span> [% branchname %]
265         </li>
266         <li>
267           <span class="label">Fund:</span> [% budgetname %]
268         </li>
269         <li>
270           <span class="label">Copies:</span>[% quantity %]
271         </li>
272         <li>
273           <span class="label">Currency:</span>[% currency %]
274         </li>
275         <li>
276           <span class="label">Price:</span>[% price %]
277         </li>
278         <li>
279           <span class="label">Total</span>[% total %]
280         </li>
281       </ol>
282     </fieldset>
283
284     <fieldset class="action">
285         <a href="suggestion.pl">&lt;&lt; Back to suggestions</a>
286     </fieldset>
287
288     </div>
289     </div>
290 </div>
291 [% ELSE %]
292
293 [% IF ( op_save ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
294 <div id="bd">
295     <div id="yui-main">
296     <div class="yui-b">
297 [% IF ( op_save ) %]
298     <form id="add_edit" action="suggestion.pl" method="post">
299     <input type="hidden" name="redirect" id="redirect" value="[% redirect %]" />
300     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
301     [% IF ( suggestionid ) %]
302         <h1>Edit purchase suggestion #[% suggestionid %]</h1>
303         <input type="hidden" name="suggestionid" value="[% suggestionid %]"/>
304     [% ELSE %]
305         <h1>Enter a new purchase suggestion</h1>
306     [% END %]
307     <fieldset class="rows"> <legend>Bibliographic information</legend><ol>
308         <li><label for="title" class="required">Title:</label><input type="text" id="title" name="title" size="80" maxlength="255" value="[% title |html %]" required="required" /></li>
309         <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" value="[% author %]"/></li>
310         <li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate %]" /></li>
311         <li><label for="isbn">ISBN or ISSN or other standard number:</label><input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn %]"/></li>
312         <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
313         <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
314         <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
315         <li><label for="itemtype">Document type:</label>
316             <select id="itemtype" name="itemtype" >
317             [% FOREACH itemtypeloo IN itemtypeloop %]
318                 [% IF ( itemtypeloo.selected ) %]<option selected="selected" value="[% itemtypeloo.itemtype %]">[% ELSE %]<option value="[% itemtypeloo.itemtype %]">[% END %]
319                 [% itemtypeloo.description %]</option>
320             [% END %]
321             </select>
322         </li>
323         [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %]
324                 [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %]
325            [% END %]</select></li>[% END %]
326         <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40">[% note %]</textarea></li>
327         </ol>
328     </fieldset>
329     <fieldset class="rows"> <legend>Suggestion management</legend>
330        <ol>
331             [% IF ( suggestionid ) %]
332                 <li>
333                     <label for="STATUS">Status:</label>
334                     <select id="STATUS" name="STATUS">
335                         <option value="">No Status</option>
336
337                         [% IF (statusselected_ASKED ) %]
338                             <option value="ASKED" selected="selected">Pending</option>
339                         [% ELSE %]
340                             <option value="ASKED">Pending</option>
341                         [% END %]
342
343                         [% IF (statusselected_ACCEPTED ) %]
344                             <option value="ACCEPTED" selected="selected">Accepted</option>
345                         [% ELSE %]
346                             <option value="ACCEPTED">Accepted</option>
347                         [% END %]
348
349                         [% IF (statusselected_CHECKED ) %]
350                             <option value="CHECKED" selected="selected">Checked</option>
351                         [% ELSE %]
352                             <option value="CHECKED">Checked</option>
353                         [% END %]
354
355                         [% IF ( statusselected_REJECTED ) %]
356                             <option value="REJECTED" selected="selected">Rejected</option>
357                         [% ELSE %]
358                             <option value="REJECTED">Rejected</option>
359                         [% END %]
360
361                         [% FOREACH s IN SuggestionStatuses %]
362                             [% IF s.authorised_value == selected_status %]
363                                 <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
364                             [% ELSE %]
365                                 <option value="[% s.authorised_value %]">[% s.lib %]</option>
366                             [% END %]
367                         [% END %]
368                     </select>
369                 </li>
370             [% END %]
371         <li><table>
372             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
373             <tbody>
374             <tr>
375                 <th><label for="suggesteddate">Suggestion creation</label> </th>
376                 <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate %]"/></td>
377                 <td><input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a>  [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %]
378                 </td>
379             </tr>
380             <tr>
381                 <th><label for="managedon">Suggestion management</label> </th>
382                 <td><input type="text" id="managedon" name="manageddate" size="10" maxlength="10" value="[% manageddate %]" /></td>
383                 <td><input type="hidden" id="managedby" name="managedby" value="[% managedby %]"/>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %]</td>
384             </tr>
385             <tr>
386                 <th><label for="accepteddate">Suggestion accepted</label> </th>
387                 <td><input type="text" id="accepteddate" name="accepteddate" size="10" maxlength="10" value="[% accepteddate %]" /></td>
388                 <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby %]"/>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %]</td>
389             </tr>
390             </tbody>
391         </table></li></ol>
392     </fieldset>
393     <fieldset class="rows"> <legend>Acquisition information</legend><ol>
394         <li><label for="branchcode">Library:</label>
395             <select name="branchcode" id="branchcode">
396                 <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %]
397                 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %][% END %]
398             </select>
399         </li>
400         <li><label for="budgetid">Fund:</label>
401             <select name="budgetid" id="budgetid">
402                 <option value="">Any</option>[% FOREACH budgetsloo IN budgetsloop %]
403                 [% IF ( budgetsloo.selected ) %]<option value="[% budgetsloo.budget_id %]" selected="selected">[% budgetsloo.budget_name %]</option>[% ELSE %]<option value="[% budgetsloo.budget_id %]">[% budgetsloo.budget_name %]</option>[% END %][% END %]
404             </select>
405                 </li><li><label for="quantity">Copies:</label>
406                         <input type="text" size="10" id="quantity" name="quantity" value="[% quantity %]" onchange="calcNewsuggTotal();" />
407                 </li><li><label for="currency">Currency:</label>
408                         [% FOREACH loop_currenc IN loop_currency %]
409                     <input type="hidden" value="[% loop_currenc.rate %]" id="currency_rate_[% loop_currenc.currcode %]" name="currency_rate_[% loop_currenc.currcode %]" />
410                             <input type="hidden" id="[% loop_currenc.currcode %]" name="[% loop_currenc.currcode %]" value="[% loop_currenc.rate %]" />
411                         [% END %]
412             <select name="currency" id="currency" onchange="calcNewsuggTotal();">
413                 [% FOREACH loop_currenc IN loop_currency %]
414                 [% IF ( loop_currenc.selected ) %]<option value="[% loop_currenc.currcode %]" selected="selected">[% loop_currenc.currcode %]</option>[% ELSE %]<option value="[% loop_currenc.currcode %]">[% loop_currenc.currcode %]</option>[% END %][% END %]
415             </select>
416                 </li><li><label for="price">Price:</label>
417                         <input type="text" size="20" name="price" id="price" value="[% price %]" onchange="calcNewsuggTotal();" />
418                 </li><li><label for="total">Total: </label>
419                         <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total %]"/>
420                 </li></ol>
421     </fieldset><input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby %][% ELSE %]noone[% END %]"/>
422     <fieldset class="action"><input type="hidden" name="op" value="[% op %]" />[% IF ( suggestionid ) %]<input type="submit" value="Save" /> <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>[% ELSE %]<input type="submit" value="Submit your suggestion" /> <a class="cancel" href="suggestion.pl">Cancel</a>[% END %]
423     </fieldset>
424     </form>
425 [% END %]
426
427 [% IF ( op_else ) %]
428 <div id="toolbar" class="btn-toolbar">
429     <a class="btn btn-small" id="newsuggestion" href="suggestion.pl?op=add"><i class="icon-plus"></i> New purchase suggestion</a>
430 </div>
431
432 <h1>Suggestions management</h1>
433
434 [% UNLESS ( notabs ) %]
435     <div id="suggestiontabs" class="toptabs">
436     <ul class="ui-tabs-nav">
437         [% FOREACH suggestion IN suggestions %]
438             [% IF ( suggestion.first ) %]
439                 <li class="ui-tabs-selected">
440             [% ELSE %]
441                 <li>
442             [% END %]
443
444             <a href="#[% suggestion.suggestiontype %]">
445             [% IF ( suggestion.suggestiontypelabel ) %]
446                 [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
447                 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
448                 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
449                 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
450                 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
451                 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
452                 [% ELSE %][% suggestion.suggestiontypelabel %][% END %]
453             [% ELSE %]
454                 [% IF ( suggestion.suggestiontype ) %]
455                     [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
456                 [% ELSE %]
457                     No name
458                 [% END %]
459             [% END %]
460             ([% suggestion.suggestions_loop.size %])</a></li>
461
462         [% END %]
463     </ul>
464 [% END %]
465
466 [% FOREACH suggestion IN suggestions %]
467 <div id="[% suggestion.suggestiontype %]">
468 <form name="f[% suggestion.suggestiontype %]" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype %]">
469
470 [% IF ( suggestion.suggestions_loop ) %]
471 <p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check all</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck all</a></p>
472     <table id="[% suggestion.suggestiontype %]t" class="sorted">
473         <thead>
474             <tr><th>&nbsp;</th>
475             <th>Suggestion</th>
476             <th>Suggested by - on</th>
477             <th>Managed by - on</th>
478             <th>Library</th>
479             <th>Fund</th>
480             <th>Status</th></tr>
481     </thead>
482         <tbody>
483             [% FOREACH suggestions_loo IN suggestion.suggestions_loop %]
484             [% IF ( suggestions_loo.even ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
485                 <td>
486                     <input type="checkbox" name="edit_field" value="[% suggestions_loo.suggestionid %]" />
487                 </td>
488                 <td>
489                     <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=show" title="suggestion" >
490                         [% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]</a>
491                     [<a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit" title="suggestion" >edit</a>]
492                     <br />
493                     [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
494                         [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
495                         [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn |html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode |html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear |html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place |html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle |html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% suggestions_loo.itemtype |html %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<span class="note">[% suggestions_loo.note |html%]</span>[% END %]
496                 </td>
497                 <td>
498                     [% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
499                     [% IF ( suggestions_loo.suggesteddate ) %] - [% suggestions_loo.suggesteddate %][% END %]
500                 </td>
501                 <td>
502                     [% IF ( suggestions_loo.emailmanagedby ) %]<a href="mailto:[% suggestions_loo.emailmanagedby %]">[% END %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby %][% END %] [% IF ( suggestions_loo.emailmanagedby ) %]</a>[% END %]
503                     [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate %][% END %]
504                 </td>
505                 <td>
506                     [% Branches.GetName( suggestions_loo.branchcode ) %]
507                 </td>
508                 <td>
509                     [% suggestions_loo.budget_name %]
510                 </td>
511                 <td>
512                     [% IF ( suggestions_loo.ASKED ) %]
513                         Pending
514                     [% ELSIF ( suggestions_loo.ACCEPTED ) %]
515                         Accepted
516                     [% ELSIF ( suggestions_loo.ORDERED ) %]
517                         Ordered
518                     [% ELSIF ( suggestions_loo.REJECTED ) %]
519                         Rejected
520                     [% ELSIF ( suggestions_loo.CHECKED ) %]
521                         Checked
522                     [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
523                         [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
524                     [% END %]
525
526                     [% IF ( suggestions_loo.reason ) %]
527                         <br />([% suggestions_loo.reason %])
528                     [% END %]
529                 </td>
530         </tr>
531         [% END %]</tbody>
532         </table>  <fieldset>
533     <div id="select-reason[% suggestion.suggestiontype %]">
534         <div id="status[% suggestion.suggestiontype %]">
535             <label for="STATUS[% suggestion.suggestiontype %]">Mark selected as: </label>
536             <select name="STATUS" id="STATUS[% suggestion.suggestiontype %]">
537                 <option value=""> -- Choose a status --</option>
538
539                 [% IF (statusselected_ASKED ) %]
540                     <option value="ASKED" selected="selected">Pending</option>
541                 [% ELSE %]
542                     <option value="ASKED">Pending</option>
543                 [% END %]
544
545                 [% IF (statusselected_ACCEPTED ) %]
546                     <option value="ACCEPTED" selected="selected">Accepted</option>
547                 [% ELSE %]
548                     <option value="ACCEPTED">Accepted</option>
549                 [% END %]
550
551                 [% IF (statusselected_CHECKED ) %]
552                     <option value="CHECKED" selected="selected">Checked</option>
553                 [% ELSE %]
554                     <option value="CHECKED">Checked</option>
555                 [% END %]
556
557                 [% IF ( statusselected_REJECTED ) %]
558                     <option value="REJECTED" selected="selected">Rejected</option>
559                 [% ELSE %]
560                     <option value="REJECTED">Rejected</option>
561                 [% END %]
562
563                 [% FOREACH s IN SuggestionStatuses %]
564                     <option value="[% s.authorised_value %]">[% s.lib %]</option>
565                 [% END %]
566             </select>
567
568             <label for="reason[% suggestion.suggestiontype %]">with this reason:</label>
569             <select id="reason[% suggestion.suggestiontype %]" name="reason[% suggestion.suggestiontype %]">
570                 <option value=""> -- Choose a reason -- </option>
571                 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
572                     <option value="[% reasonsloo.lib %]">[% reasonsloo.lib %]</option>
573                 [% END %]
574                 <option value="other">Others...</option>
575             </select>
576
577             <span id="other_reason[% suggestion.suggestiontype %]">
578                 <input type="text" size="31" id="select-other_reason[% suggestion.suggestiontype %]" name="other_reason[% suggestion.suggestiontype %]" value="please note your reason here..." />
579                 <a href="#back[% suggestion.suggestiontype %]">Cancel</a>
580             </span>
581
582             <strong style="padding: 0 1em;">OR:</strong>
583
584             <label for="[% suggestion.suggestiontype %]delete">Delete selected</label>
585             <input type="checkbox" name="op" id="[% suggestion.suggestiontype %]delete" />
586         </div>
587     </div>
588
589
590     <input type="hidden" name="tabcode" value="[% suggestion.suggestiontype %]" />
591     <input type="hidden" name="op" value="change" />
592 </fieldset>
593         <fieldset class="action">
594     <input type="submit" value="Submit" /></fieldset>
595 </form>
596 [% ELSE %]
597     <b>No results.</b>
598 [% END %]
599 </div>
600 [% END %]
601     </div>
602 [% END %]
603 </div>
604 </div>
605
606       [% UNLESS ( op_save ) %] [% UNLESS ( op == 'show' ) %]<div class="yui-b">
607 <form name="suggestionfilter" action="suggestion.pl" method="get">
608 <fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
609                 <select name="displayby" id="displayby" style="width:auto;">
610                     [% IF ( displayby == "STATUS" ) %]
611                         <option value="STATUS" selected="selected">Status</option>
612                     [% ELSE %]
613                         <option value="STATUS">Status</option>
614                     [% END %]
615                     [% IF ( displayby == "branchcode" ) %]
616                         <option value="branchcode" selected="selected">Library</option>
617                     [% ELSE %]
618                         <option value="branchcode">Library</option>
619                     [% END %]
620                     [% IF ( displayby == "itemtype" ) %]
621                         <option value="itemtype" selected="selected">Item type</option>
622                     [% ELSE %]
623                         <option value="itemtype">Item type</option>
624                     [% END %]
625                     [% IF ( displayby == "managedby" ) %]
626                         <option value="managedby" selected="selected">Managed by</option>
627                     [% ELSE %]
628                         <option value="managedby">Managed by</option>
629                     [% END %]
630                     [% IF ( displayby == "acceptedby" ) %]
631                         <option value="acceptedby" selected="selected">Accepted by</option>
632                     [% ELSE %]
633                         <option value="acceptedby">Accepted by</option>
634                     [% END %]
635                 </select> <input type="submit" value="Go" /></li></ol></fieldset>
636 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
637                 <div style="display:block;" id="limits">
638
639                                 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
640                    <ol> <li><label for="title"> Title:</label><input type="text" id="title" name="title" value="[% title |html %]" /></li>
641                     <li><label for="author"> Author:</label><input type="text" id="author" name="author" value="[% author %]" /></li>
642                     <li><label for="isbn"> ISBN:</label><input type="text" id="isbn"  name="isbn" value="[% isbn %]" /></li>
643                     <li><label for="publishercode"> Publisher:</label><input type="text" id="publishercode" name="publishercode" value="[% publishercode %]" /></li>
644                     <li><label for="copyrightdate_filter"> Copyright date:</label><input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate %]" /></li>
645                     <li><label for="collectiontitle"> Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle %]" /></li><li><input type="submit" value="Go" /></li></ol>
646                 </fieldset>
647                                  <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
648                     <ol>
649                       <li>
650                           <label for="STATUS"> Status:</label>
651                           <select name="STATUS" id="STATUS">
652                               <option value="">Any</option>
653
654                               [% IF (statusselected_ASKED ) %]
655                                   <option value="ASKED" selected="selected">Pending</option>
656                               [% ELSE %]
657                                   <option value="ASKED">Pending</option>
658                               [% END %]
659
660                               [% IF (statusselected_ACCEPTED ) %]
661                                   <option value="ACCEPTED" selected="selected">Accepted</option>
662                               [% ELSE %]
663                                   <option value="ACCEPTED">Accepted</option>
664                               [% END %]
665
666                               [% IF (statusselected_CHECKED ) %]
667                                   <option value="CHECKED" selected="selected">Checked</option>
668                               [% ELSE %]
669                                   <option value="CHECKED">Checked</option>
670                               [% END %]
671
672                               [% IF ( statusselected_REJECTED ) %]
673                                   <option value="REJECTED" selected="selected">Rejected</option>
674                               [% ELSE %]
675                                   <option value="REJECTED">Rejected</option>
676                               [% END %]
677
678                               [% FOREACH s IN SuggestionStatuses %]
679                                   [% IF s.authorised_value == selected_status %]
680                                       <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
681                                   [% ELSE %]
682                                       <option value="[% s.authorised_value %]">[% s.lib %]</option>
683                                   [% END %]
684                               [% END %]
685                           </select>
686                       </li>
687
688                     <li><label for="suggestedby"> Suggested by:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
689 [% FOREACH suggestedby_loo IN suggestedby_loop %][% IF ( suggestedby_loo.selected ) %]<option value="[% suggestedby_loo.code %]" selected="selected">[% suggestedby_loo.desc %]</option>[% ELSE %]<option value="[% suggestedby_loo.code %]">[% suggestedby_loo.desc %]</option>[% END %][% END %]
690                                                                      </select></li>
691                     <li><label for="suggesteddate_from"> Suggested on:</label>
692                         <table class="invis">
693                         <tr>
694                         <td><label for="suggesteddate_from">from:</label></td><td><input type="text" id="suggesteddate_from" name="suggesteddate_from" value="[% suggesteddate_from %]" style="width:76px;" /></td>
695                         </tr>
696                         <tr>
697                         <td><label for="suggesteddate_to">to:</label></td><td><input type="text" id="suggesteddate_to" name="suggesteddate_to" value="[% suggesteddate_to %]" style="width:76px;" /></td>
698                         </tr>
699                         </table>
700                     </li>
701                     <li><label for="managedby"> Managed by:</label><select id="managedby" name="managedby"><option value="">Any</option>
702 [% FOREACH managedby_loo IN managedby_loop %][% IF ( managedby_loo.selected ) %]<option value="[% managedby_loo.code %]" selected="selected">[% managedby_loo.desc %]</option>[% ELSE %]<option value="[% managedby_loo.code %]">[% managedby_loo.desc %]</option>[% END %][% END %]
703                                                                      </select></li>
704                     <li><label for="manageddate_from"> Management date:</label>
705                         <table class="invis">
706                         <tr>
707                         <td><label for="manageddate_from">from:</label></td><td><input type="text" id="manageddate_from" name="manageddate_from" value="[% manageddate_from %]" style="width:76px;" /></td>
708                         </tr>
709                         <tr>
710                         <td><label for="manageddate_to">to:</label></td><td><input type="text" id="manageddate_to" name="manageddate_to" value="[% manageddate_to %]" style="width:76px;" /></td>
711                         </tr>
712                         </table>
713                     </li>
714                     <li><label for="acceptedby"> Accepted by:</label><select id="acceptedby" name="acceptedby"><option value="">Any</option>
715 [% FOREACH acceptedby_loo IN acceptedby_loop %][% IF ( acceptedby_loo.selected ) %] <option value="[% acceptedby_loo.code %]" selected="selected">[% acceptedby_loo.desc %]</option>[% ELSE %]<option value="[% acceptedby_loo.code %]">[% acceptedby_loo.desc %]</option>[% END %][% END %]
716                                                       </select></li>
717                     <li><label for="accepteddate_from"> Accepted on:</label>
718                         <table class="invis">
719                         <tr>
720                         <td><label for="accepteddate_from">from:</label></td><td><input type="text" id="accepteddate_from" name="accepteddate_from" value="[% accepteddate_from %]" style="width:76px;" /></td>
721                         </tr>
722                         <tr>
723                         <td><label for="accepteddate_to">to:</label></td><td><input type="text" id="accepteddate_to" name="accepteddate_to" value="[% accepteddate_to %]" style="width:76px;" /></td>
724                         </tr>
725                         </table>
726                     </li>
727                     <li><input type="submit" value="Go" /></li></ol>
728                 </fieldset>
729
730                                 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
731                     <ol><li><label for="budgetid"> Book fund:</label>
732                     <select name="budgetid" id="budgetid"><option value="">Any</option>[% FOREACH budgetid_loo IN budgetid_loop %]
733                         [% IF ( budgetid_loo.selected ) %] <option value="[% budgetid_loo.code %]" selected="selected">[% budgetid_loo.desc %]</option>[% ELSE %]<option value="[% budgetid_loo.code %]">[% budgetid_loo.desc %]</option>[% END %]
734                         [% END %]
735                     </select></li>
736                     <li><label for="branchcode"> For:</label>
737                     <select name="branchcode" id="branchcode">
738                         <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %]
739                             [% IF ( branchloo.selected ) %] <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %] <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
740                             [% END %]
741                     </select></li><li><input type="submit" value="Go" /></li></ol>
742                 </fieldset>
743     </div>
744             </form>
745         </div>
746     [% END %]
747     [% END %]
748 </div>
749 [% END %]
750 [% INCLUDE 'intranet-bottom.inc' %]
751