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