Bug 24476: Allow direct editing of autorenew_checkouts by patron
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / suggestion / suggestion.tt
1 [% PROCESS 'i18n.inc' %]
2 [% USE raw %]
3 [% USE Asset %]
4 [% USE Branches %]
5 [% USE AuthorisedValues %]
6 [% USE KohaDates %]
7 [% USE Price %]
8 [% USE ColumnsSettings %]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha &rsaquo; Acquisitions  &rsaquo;
12     [% IF ( op_save ) %]
13         [% IF ( suggestionid ) %]
14             Suggestions &rsaquo;  Edit suggestion #[% suggestionid | html %]
15         [% ELSE %]
16             Suggestions &rsaquo; Add suggestion
17         [% END %]
18     [% ELSIF ( op == 'show' ) %]
19            Suggestions &rsaquo; Show suggestion #[% suggestionid | html %]
20     [% ELSE %]
21         Suggestions management
22     [% END %]
23 </title>
24 [% INCLUDE 'doc-head-close.inc' %]
25 [% IF ( op_else ) %]
26 [% END %]
27 [% IF ( op_else ) %]
28     <style>
29         h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
30         .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; } div.note { background: transparent none; border-style: dotted; border-width: 1px 0 0 0; font-size : 90%; padding: 2px 0 0 0; } div.note i { color: #CCC; }
31     </style>
32 [% END %]
33 </head>
34
35 <body id="acq_suggestion" class="acq">
36 [% INCLUDE 'header.inc' %]
37 [% INCLUDE 'cat-search.inc' %]
38 <div id="breadcrumbs">
39     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
40     [% IF ( op_save ) %]
41         [% IF ( suggestionid ) %]
42             <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo;  Edit suggestion #[% suggestionid | html %]
43         [% ELSE %]
44             <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; Add suggestion
45         [% END %]
46     [% ELSIF ( op == 'show' ) %]
47            <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; Show suggestion #[% suggestionid | html %]
48     [% ELSE %]
49         Suggestions management
50     [% END %]
51 </div>
52
53 [% IF ( op == 'show' ) %]
54     <div class="main container-fluid">
55         <div class="row">
56             <div class="col-md-8 col-md-offset-2">
57
58     <div id="toolbar" class="btn-toolbar">
59         <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit&amp;suggestionid=[% suggestionid | html %]"><i class="fa fa-pencil"></i> Edit</a>
60         <a class="btn btn-default deletesuggestion" href="suggestion.pl?op=delete&amp;suggestionid=[% suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
61     </div>
62
63     <fieldset class="rows">
64       <legend>Bibliographic information</legend>
65       <ol>
66             [% IF ( title ) %]
67                 <li>
68                     <span class="label">Title:</span>
69                     [% IF suggestion.biblionumber %]
70                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
71                     [% ELSE %]
72                         [% title | html %]
73                     [% END %]
74                 </li>
75             [% END %]
76             [% IF ( author ) %]
77                 <li>
78                     <span class="label">Author:</span>
79                     [% author | html %]
80                 </li>
81             [% END %]
82             [% IF ( copyrightdate ) %]
83                 <li>
84                     <span class="label">Copyright date:</span>
85                     [% copyrightdate | html %]
86                 </li>
87             [% END %]
88             [% IF ( isbn ) %]
89                 <li>
90                     <span class="label">ISBN or ISSN or other standard number:</span>
91                     [% isbn | html %]
92                 </li>
93             [% END %]
94             [% IF ( publishercode ) %]
95                 <li>
96                     <span class="label">Publisher:</span>
97                     [% publishercode | html %]
98                 </li>
99             [% END %]
100             [% IF ( place ) %]
101                 <li>
102                     <span class="label">Publication place:</span>
103                     [% place | html %]
104                 </li>
105             [% END %]
106             [% IF ( collectiontitle ) %]
107                 <li>
108                     <span class="label">Collection title:</span>
109                     [% collectiontitle | html %]
110                 </li>
111             [% END %]
112             [% IF ( itemtype ) %]
113                 <li>
114                     <span class="label">Document type:</span>
115                     [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
116                 </li>
117             [% END %]
118         [% IF ( patron_reason_loop ) %]
119           <li><span class="label">Reason for suggestion: </span>
120             [% FOREACH patron_reason_loo IN patron_reason_loop %]
121               [% IF patron_reason_loo.authorised_value == patronreason %][% patron_reason_loo.lib | html %][% END %]
122             [% END %]
123           </li>
124         [% END %]
125             [% IF ( note ) %]
126                 <li>
127                     <span class="label">Notes:</span>
128                     [% note | html %]
129                 </li>
130             [% END %]
131       </ol>
132     </fieldset>
133     <fieldset class="rows"> <legend>Suggestion management</legend>
134       <ol>
135         <li>
136           <span class="label">Status:</span>
137           [% SET status_found = 0 %]
138           [% IF ( STATUS == 'ASKED' ) %]
139               Pending
140               [% SET status_found = 1 %]
141           [% ELSIF ( STATUS == 'ACCEPTED' ) %]
142               Accepted
143               [% SET status_found = 1 %]
144           [% ELSIF ( STATUS == 'CHECKED' ) %]
145               Checked
146               [% SET status_found = 1 %]
147           [% ELSIF ( STATUS == 'REJECTED' ) %]
148               Rejected
149               [% SET status_found = 1 %]
150           [% ELSIF ( STATUS == 'ORDERED' ) %]
151               Ordered
152               [% SET status_found = 1 %]
153           [% ELSIF ( STATUS == 'AVAILABLE' ) %]
154               Available
155               [% SET status_found = 1 %]
156           [% ELSE %]
157               [% FOREACH s IN SuggestionStatuses %]
158                   [% IF STATUS == s.authorised_value %]
159                       [% s.lib | html %]
160                       [% SET status_found = 1 %]
161                   [% END %]
162               [% END %]
163           [% END %]
164
165         </li>
166         <li>
167           <table>
168             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
169             <tbody>
170             <tr>
171                 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
172                 <td>[% suggesteddate | $KohaDates %]</td>
173                 <td>
174                     [% IF ( suggestedby_borrowernumber ) %]
175                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber | uri %]">[% suggestedby_surname | html %], [% suggestedby_firstname | html %] ([% suggestedby_cardnumber | html %])</a>
176                         [% Branches.GetName( suggestedby_branchcode ) | html %] ([% suggestedby_description | html %])
177                     [% END %]
178                 </td>
179             </tr>
180             <tr>
181                 <th>Managed by:</th>
182                 <td>[% manageddate | $KohaDates %]</td>
183                 <td>
184                         [% IF ( managedby_borrowernumber ) %]
185                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber | uri %]">[% managedby_surname | html %], [% managedby_firstname | html %] ([% suggestedby_cardnumber | html %])</a>
186                             [% Branches.GetName( managedby_branchcode ) | html %] ([% managedby_description | html %])
187                         [% END %]
188                 </td>
189             </tr>
190             <tr>
191                 <th>Accepted on:</th>
192                 <td>[% accepteddate | $KohaDates %]</td>
193                 <td>
194                     [% IF ( acceptedby_borrowernumber ) %]
195                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber | uri %]">[% acceptedby_surname | html %], [% acceptedby_firstname | html %] ([% suggestedby_cardnumber | html %])</a>
196                         [% Branches.GetName( acceptedby_branchcode ) | html %] ([% acceptedby_description | html %])
197                     [% END %]
198                 </td>
199             </tr>
200             </tbody>
201         </table></li></ol>
202     </fieldset>
203     <fieldset class="rows"> <legend>Acquisition information</legend>
204       <ol>
205         <li>
206           <span class="label">Library:</span> [% Branches.GetName( branchcode ) | html %]
207         </li>
208         <li>
209           <span class="label">Fund:</span> [% budgetname | html %]
210         </li>
211         <li>
212           <span class="label">Copies:</span>[% quantity | html %]
213         </li>
214         <li>
215           <span class="label">Currency:</span>[% currency | html %]
216         </li>
217         <li>
218           <span class="label">Price:</span>[% price | $Price %]
219         </li>
220         <li>
221           <span class="label">Total</span>[% total | $Price %]
222         </li>
223       </ol>
224     </fieldset>
225
226     <fieldset class="action">
227         <a href="suggestion.pl">&lt;&lt; Back to suggestions</a>
228     </fieldset>
229
230     </div>
231     </div>
232 </div>
233 [% ELSE %]
234
235 [% IF ( op_save ) %]
236     <div class="main container-fluid">
237         <div class="row">
238             <div class="col-md-8 col-md-offset-2">
239 [% ELSE %]
240     <div class="main container-fluid">
241         <div class="row">
242             <div class="col-sm-10 col-sm-push-2">
243                 <main>
244
245 [% END %]
246
247 [% IF ( op_save ) %]
248     [% FOR m IN messages %]
249         <div class="dialog [% m.type | html %]">
250             [% SWITCH m.code %]
251             [% CASE 'biblio_exists' %]
252                 A similar document already exists: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.id | uri %]">[% m.title | html %]</a>. Click on "Confirm your suggestion" to ignore this message.
253             [% CASE %]
254                 [% m.code | html %]
255             [% END %]
256         </div>
257     [% END %]
258     <form id="add_edit" action="suggestion.pl" method="post" class="validated">
259     <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
260     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
261     [% IF ( suggestionid ) %]
262         <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
263         <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
264     [% ELSE %]
265         <h1>Enter a new purchase suggestion</h1>
266     [% END %]
267     <fieldset class="rows"> <legend>Bibliographic information</legend><ol>
268         <li>
269             <label for="title" class="required">Title:</label>
270             <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
271             <span class="required">Required</span>
272         </li>
273         <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/></li>
274         <li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" /></li>
275         <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 | html %]"/></li>
276         <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/></li>
277         <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li>
278         <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li>
279         <li><label for="itemtype">Document type:</label>
280             [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
281         </li>
282         [% IF patron_reason_loop %]
283             <li>
284                 <label for="patronreason">Reason for suggestion: </label>
285                 <select name="patronreason" id="patronreason">
286                     <option value=""> -- Choose -- </option>
287                     [% FOREACH patron_reason_loo IN patron_reason_loop %]
288                         [% IF patron_reason_loo.authorised_value == patronreason %]
289                             <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
290                         [% ELSE %]
291                             <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
292                         [% END %]
293                     [% END %]
294                 </select>
295             </li>
296         [% END %]
297         <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea></li>
298         </ol>
299     </fieldset>
300     <fieldset class="rows"> <legend>Suggestion management</legend>
301        <ol>
302             [% IF ( suggestionid ) %]
303                 <li>
304                     <label for="STATUS">Status:</label>
305                     <select id="STATUS" name="STATUS">
306                         <option value="">No status</option>
307
308                         [% IF (statusselected_ASKED ) %]
309                             <option value="ASKED" selected="selected">Pending</option>
310                         [% ELSE %]
311                             <option value="ASKED">Pending</option>
312                         [% END %]
313
314                         [% IF (statusselected_ACCEPTED ) %]
315                             <option value="ACCEPTED" selected="selected">Accepted</option>
316                         [% ELSE %]
317                             <option value="ACCEPTED">Accepted</option>
318                         [% END %]
319
320                         [% IF (statusselected_CHECKED ) %]
321                             <option value="CHECKED" selected="selected">Checked</option>
322                         [% ELSE %]
323                             <option value="CHECKED">Checked</option>
324                         [% END %]
325
326                         [% IF ( statusselected_REJECTED ) %]
327                             <option value="REJECTED" selected="selected">Rejected</option>
328                         [% ELSE %]
329                             <option value="REJECTED">Rejected</option>
330                         [% END %]
331
332                         [% FOREACH s IN SuggestionStatuses %]
333                             [% IF s.authorised_value == suggestion.STATUS %]
334                                 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
335                             [% ELSE %]
336                                 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
337                             [% END %]
338                         [% END %]
339                     </select>
340                 </li>
341                 <li>
342                     <label for="reason">Reason</label>
343                     <select class="select-reason" id="reason" name="reason">
344                         <option value=""> -- Choose a reason -- </option>
345                         [% FOREACH reasonsloo IN suggestion.reasonsloop %]
346                             [% IF (reasonsloo.lib == suggestion.reason) %]
347                                 <option value="[% reasonsloo.lib | html %]" selected="selected">[% reasonsloo.lib | html %]</option>
348                             [% ELSE %]
349                                 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
350                             [% END %]
351                         [% END %]
352                         <option value="other">Others...</option>
353                     </select>
354
355                     <span id="other_reason" name="other_reason">
356                         [% IF other_reason %]
357                             <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
358                         [% ELSE %]
359                             <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
360                         [% END %]
361                         <a href="#back">Cancel</a>
362                     </span>
363                 </li>
364             [% END %]
365         <li><table>
366             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
367             <tbody>
368             <tr>
369                 <th><label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label> </th>
370                 <td><input type="text" id="suggesteddate" name="suggesteddate" class="datepicker" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/>[% INCLUDE 'date-format.inc' %]</td>
371                 <td><input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber | uri %]">[% suggestedby_surname | html %], [% suggestedby_firstname | html %] ([% suggestedby_cardnumber | html %])</a>  [% Branches.GetName( suggestedby_branchcode ) | html %] ([% suggestedby_description | html %])[% END %]
372                 </td>
373             </tr>
374             <tr>
375                 <th><label for="managedon">Managed by:</label> </th>
376                 <td><input type="text" id="managedon" name="manageddate" class="datepicker" size="10" maxlength="10" value="[% manageddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
377                 <td><input type="hidden" id="managedby" name="managedby" value="[% managedby | html %]"/>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber | uri %]">[% managedby_surname | html %], [% managedby_firstname | html %] ([% suggestedby_cardnumber | html %])</a> [% Branches.GetName( managedby_branchcode ) | html %] ([% managedby_description | html %])[% END %]</td>
378             </tr>
379             <tr>
380                 <th><label for="accepteddate">Accepted on:</label> </th>
381                 <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
382                 <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber | uri %]">[% acceptedby_surname | html %], [% acceptedby_firstname | html %] ([% suggestedby_cardnumber | html %])</a> [% Branches.GetName( acceptedby_branchcode ) | html %] ([% acceptedby_description | html %])[% END %]</td>
383             </tr>
384             </tbody>
385         </table></li></ol>
386     </fieldset>
387     <fieldset class="rows"> <legend>Acquisition information</legend><ol>
388         <li><label for="branchcode">Library:</label>
389             <select name="branchcode" id="branchcode">
390                 <option value="">Any</option>
391                 [% IF branchfilter %]
392                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %]
393                 [% ELSE %]
394                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
395                 [% END %]
396             </select>
397         </li>
398         <li><label for="budgetid">Fund:</label>
399             <select name="budgetid" id="budgetid">
400                 <option value="">Any</option>[% FOREACH budgetsloo IN budgetsloop %]
401                 [% IF ( budgetsloo.selected ) %]<option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>[% ELSE %]<option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>[% END %][% END %]
402             </select>
403                 </li><li><label for="quantity">Copies:</label>
404             <input type="text" size="10" id="quantity" name="quantity" value="[% quantity | html %]" />
405                 </li>
406                 <li>
407                     <label for="currency">Currency:</label>
408                     [% FOREACH c IN currencies %]
409                         <input type="hidden" value="[% c.rate | html %]" id="currency_rate_[% c.currency | html %]" name="currency_rate_[% c.currency | html %]" />
410                         <input type="hidden" id="[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" />
411                     [% END %]
412
413                     <select name="currency" id="currency">
414                         [% FOREACH c IN currencies %]
415                             [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
416                                 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
417                             [% ELSIF not c.archived %]
418                                 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
419                             [% END %]
420                         [% END %]
421                     </select>
422                 </li>
423                 <li><label for="price">Price:</label>
424             <input type="text" size="20" name="price" id="price" value="[% price | html %]" />
425                 </li><li><label for="total">Total: </label>
426                         <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total | html %]"/>
427                 </li></ol>
428     </fieldset><input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
429     <fieldset class="action">
430         <input type="hidden" name="op" value="[% op | html %]" />
431         [% IF ( suggestionid ) %]
432             [% IF ( need_confirm ) %]
433                 <input type="hidden" name="save_confirmed" value="1" />
434                 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" value="Confirm your suggestion" />
435             [% ELSE %]
436                 <input type="submit" value="Save" />
437             [% END %]
438             <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
439         [% ELSE %]
440             [% IF ( need_confirm ) %]
441                 <input type="hidden" name="save_confirmed" value="1" />
442                 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" value="Confirm your suggestion" />
443             [% ELSE %]
444                 <input type="submit" value="Submit your suggestion" />
445             [% END %]
446             <a class="cancel" href="suggestion.pl">Cancel</a>
447         [% END %]
448     </fieldset>
449     </form>
450 [% END %]
451
452 [% IF ( op_else ) %]
453 <div id="toolbar" class="btn-toolbar">
454     <a class="btn btn-default" id="newsuggestion" href="suggestion.pl?op=add"><i class="fa fa-plus"></i> New purchase suggestion</a>
455 </div>
456
457 <h1>Suggestions management</h1>
458
459
460 [% FOR m IN messages %]
461     <div class="dialog [% m.type | html %]">
462         [% SWITCH m.code %]
463         [% CASE 'already_exists' %]
464             The suggestion has not been added. A suggestion with this title already exists (<a href='/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% m.id | html %]&op=show'>suggestion #[% m.id | html %]</a>)
465         [% CASE 'biblio_exists' %]
466             A similar document already exists: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.id | uri %]">[% m.title | html %]</a>. Click on "Confirm your suggestion" to ignore this message.
467         [% CASE %]
468             [% m.code | html %]
469         [% END %]
470     </div>
471 [% END %]
472
473 [% UNLESS ( notabs ) %]
474     <div id="suggestiontabs" class="toptabs">
475     <ul class="ui-tabs-nav">
476         [% FOREACH suggestion IN suggestions %]
477                 <li>
478             <a href="#tab_[% loop.count | uri %]">
479             [% IF ( suggestion.suggestiontypelabel ) %]
480                 [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
481                 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
482                 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
483                 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
484                 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
485                 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
486                 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]Status unknown
487                 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
488             [% ELSE %]
489                 [% IF ( suggestion.suggestiontype ) %]
490                     [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
491                 [% ELSE %]
492                     No name
493                 [% END %]
494             [% END %]
495             ([% suggestion.suggestions_loop.size | html %])</a></li>
496
497         [% END %]
498     </ul>
499 [% END %]
500
501 [% FOREACH suggestion IN suggestions %]
502 <div id="tab_[% loop.count | html %]">
503 <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#tab_[% loop.count | html %]">
504
505 [% IF ( suggestion.suggestions_loop ) %]
506 <p><a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a></p>
507     <table id="table_[% loop.count | html %]" class="sorted">
508         <thead>
509             <tr>
510                 <th class="NoSort noExport">&nbsp;</th>
511                 <th class="anti-the">Suggestion</th>
512                 <th>Suggested by</th>
513                 <th>Suggested on</th>
514                 <th>Managed by</th>
515                 <th>Managed on</th>
516                 <th>Library</th>
517                 <th>Fund</th>
518                 <th>Status</th>
519                 <th class="NoSort noExport">&nbsp;</th>
520             </tr>
521     </thead>
522         <tbody>
523             [% FOREACH suggestions_loo IN suggestion.suggestions_loop %]
524                 <tr>
525                 <td>
526                     <input type="checkbox" name="suggestionid" value="[% suggestions_loo.suggestionid | html %]" />
527                 </td>
528                 <td>
529                     <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | uri %]&amp;op=show" title="suggestion" >
530                         [% suggestions_loo.title | html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author | html %][% END %]</a>
531                     <br />
532                     [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate | html %] [% END %]
533                         [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc | html %]</i> [% END %]
534                         [% 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 ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<div class="note"><i class="fa fa-comment"></i> [% suggestions_loo.note | html %]</div>[% END %]
535                 </td>
536                 <td>
537                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby | uri %]">[% suggestions_loo.surnamesuggestedby | html %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby | html %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby | html %])[% END %]</a>
538                 </td>
539                 <td data-order="[% suggestions_loo.suggesteddate | html %]">
540                     [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate | $KohaDates %][% END %]
541                 </td>
542                 <td>
543                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby | uri %]">[% suggestions_loo.surnamemanagedby | html %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby | html %][% END %]</a>
544                 </td>
545                 <td data-order="[% suggestions_loo.manageddate | html %]">
546                     [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
547                 </td>
548                 <td>
549                     [% Branches.GetName( suggestions_loo.branchcode ) | html %]
550                 </td>
551                 <td>
552                     [% suggestions_loo.budget_name | html %]
553                 </td>
554                 <td>
555                     [% IF ( suggestions_loo.ASKED ) %]
556                         Pending
557                     [% ELSIF ( suggestions_loo.ACCEPTED ) %]
558                         Accepted
559                     [% ELSIF ( suggestions_loo.ORDERED ) %]
560                         Ordered
561                     [% ELSIF ( suggestions_loo.REJECTED ) %]
562                         Rejected
563                     [% ELSIF ( suggestions_loo.CHECKED ) %]
564                         Checked
565                     [% ELSIF ( suggestions_loo.AVAILABLE ) %]
566                         Available
567                     [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
568                         [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) | html %]
569                     [% ELSE %]
570                         Status unknown
571                     [% END %]
572
573                     [% IF ( suggestions_loo.reason ) %]
574                         <br />([% suggestions_loo.reason | html %])
575                     [% END %]
576                 </td>
577                 <td class="actions">
578                     <a class="btn btn-xs btn-default" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a>
579                     <a class="btn btn-default btn-xs deletesuggestion" href="suggestion.pl?op=delete&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
580                 </td>
581         </tr>
582         [% END %]</tbody>
583         </table>
584
585         <div class="row">
586             <h2 style="padding-left:1em;">Change selected suggestions</h3>
587             <div class="col-sm-4">
588                 <fieldset>
589                     <div id="select-reason">
590                        <label for="STATUS">Mark selected as: </label>
591                        <select name="STATUS" id="STATUS">
592                            <option value=""> -- Choose a status --</option>
593
594                            [% IF (statusselected_ASKED ) %]
595                                <option value="ASKED" selected="selected">Pending</option>
596                            [% ELSE %]
597                                <option value="ASKED">Pending</option>
598                            [% END %]
599
600                            [% IF (statusselected_ACCEPTED ) %]
601                                <option value="ACCEPTED" selected="selected">Accepted</option>
602                            [% ELSE %]
603                                <option value="ACCEPTED">Accepted</option>
604                            [% END %]
605
606                            [% IF (statusselected_CHECKED ) %]
607                                <option value="CHECKED" selected="selected">Checked</option>
608                            [% ELSE %]
609                                <option value="CHECKED">Checked</option>
610                            [% END %]
611
612                            [% IF ( statusselected_REJECTED ) %]
613                                <option value="REJECTED" selected="selected">Rejected</option>
614                            [% ELSE %]
615                                <option value="REJECTED">Rejected</option>
616                            [% END %]
617
618                            [% FOREACH s IN SuggestionStatuses %]
619                                <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
620                            [% END %]
621                        </select>
622
623                        <label for="reason">with this reason:</label>
624                        <select name="reason">
625                            <option value=""> -- Choose a reason -- </option>
626                            [% FOREACH reasonsloo IN suggestion.reasonsloop %]
627                                <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
628                            [% END %]
629                            <option value="other">Others...</option>
630                        </select>
631
632                        <span class="other_reason">
633                            <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
634                            <a href="#" class="cancel_note">Cancel</a>
635                        </span>
636                     </div>
637
638                     <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
639                     <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_status"/>Submit</button></fieldset>
640                 </fieldset>
641             </div>
642             <div class="col-sm-4">
643                 <fieldset>
644                     <label for="itemtype">Update item types with: </label>
645                     [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20  %]
646                     <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
647                     <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_itemtype"/>Submit</button></fieldset>
648                 </fieldset>
649             </div>
650
651             <div class="col-sm-4">
652                 <fieldset>
653                     <label for="delete_[% loop.count | html %]">Delete selected</label>
654                     <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
655                     <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="delete"/>Delete</button></fieldset>
656                 </fieldset>
657             </div>
658         </div>
659
660 [% ELSE %]
661     <b>No results.</b>
662 [% END %]
663 </form>
664 </div>
665 [% END %]
666 [% END %]
667
668 [% UNLESS ( op_save ) %]
669     [% UNLESS ( op == 'show' ) %]
670
671             </main>
672         </div> <!-- /.col-sm-10.col-sm-push-2 -->
673
674         <div class="col-sm-2 col-sm-pull-10">
675             <aside>
676
677 <form name="suggestionfilter" action="suggestion.pl" method="get">
678 <fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
679                 <select name="displayby" id="displayby" style="width:auto;">
680                     [% IF ( displayby == "STATUS" ) %]
681                         <option value="STATUS" selected="selected">Status</option>
682                     [% ELSE %]
683                         <option value="STATUS">Status</option>
684                     [% END %]
685                     [% IF ( displayby == "branchcode" ) %]
686                         <option value="branchcode" selected="selected">Library</option>
687                     [% ELSE %]
688                         <option value="branchcode">Library</option>
689                     [% END %]
690                     [% IF ( displayby == "itemtype" ) %]
691                         <option value="itemtype" selected="selected">Item type</option>
692                     [% ELSE %]
693                         <option value="itemtype">Item type</option>
694                     [% END %]
695                     [% IF ( displayby == "managedby" ) %]
696                         <option value="managedby" selected="selected">Managed by</option>
697                     [% ELSE %]
698                         <option value="managedby">Managed by</option>
699                     [% END %]
700                     [% IF ( displayby == "acceptedby" ) %]
701                         <option value="acceptedby" selected="selected">Accepted by</option>
702                     [% ELSE %]
703                         <option value="acceptedby">Accepted by</option>
704                     [% END %]
705                 </select> <input type="submit" value="Go" /></li></ol></fieldset>
706 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
707                 <div style="display:block;" id="limits">
708
709                                 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
710                    <ol> <li><label for="title"> Title:</label><input type="text" id="title" name="title" value="[% title | html %]" /></li>
711                     <li><label for="author"> Author:</label><input type="text" id="author" name="author" value="[% author | html %]" /></li>
712                     <li><label for="isbn"> ISBN:</label><input type="text" id="isbn"  name="isbn" value="[% isbn | html %]" /></li>
713                     <li><label for="publishercode"> Publisher:</label><input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" /></li>
714                     <li><label for="copyrightdate_filter"> Copyright date:</label><input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" /></li>
715                     <li><label for="collectiontitle"> Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" /></li><li><input type="submit" value="Go" /></li></ol>
716                 </fieldset>
717                                  <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
718                     <ol>
719                       <li>
720                           <label for="STATUS"> Status:</label>
721                           <select name="STATUS" id="STATUS">
722                               <option value="">Any</option>
723
724                               [% IF (statusselected_ASKED ) %]
725                                   <option value="ASKED" selected="selected">Pending</option>
726                               [% ELSE %]
727                                   <option value="ASKED">Pending</option>
728                               [% END %]
729
730                               [% IF (statusselected_ACCEPTED ) %]
731                                   <option value="ACCEPTED" selected="selected">Accepted</option>
732                               [% ELSE %]
733                                   <option value="ACCEPTED">Accepted</option>
734                               [% END %]
735
736                               [% IF (statusselected_CHECKED ) %]
737                                   <option value="CHECKED" selected="selected">Checked</option>
738                               [% ELSE %]
739                                   <option value="CHECKED">Checked</option>
740                               [% END %]
741
742                               [% IF ( statusselected_REJECTED ) %]
743                                   <option value="REJECTED" selected="selected">Rejected</option>
744                               [% ELSE %]
745                                   <option value="REJECTED">Rejected</option>
746                               [% END %]
747
748                               [% FOREACH s IN SuggestionStatuses %]
749                                   [% IF s.authorised_value == selected_status %]
750                                       <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
751                                   [% ELSE %]
752                                       <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
753                                   [% END %]
754                               [% END %]
755                           </select>
756                       </li>
757
758                     <li><label for="suggestedby"> Suggested by:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
759 [% FOREACH suggestedby_loo IN suggestedby_loop %][% IF ( suggestedby_loo.selected ) %]<option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>[% ELSE %]<option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>[% END %][% END %]
760                                                                      </select></li>
761                     <li>
762                         <label for="suggesteddate_from">Suggested date from:</label>
763                         <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" />
764                     </li>
765                     <li>
766                         <label for="suggesteddate_to">To:</label>
767                         <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" />
768                     </li>
769                     <li><label for="managedby"> Managed by:</label><select id="managedby" name="managedby"><option value="">Any</option>
770 [% FOREACH managedby_loo IN managedby_loop %][% IF ( managedby_loo.selected ) %]<option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>[% ELSE %]<option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>[% END %][% END %]
771                                                                      </select></li>
772                     <li>
773                         <label for="manageddate_from">Management date from:</label>
774                         <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" />
775                     </li>
776                     <li>
777                         <label for="manageddate_to">To:</label>
778                         <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" />
779                     </li>
780                     <li><label for="acceptedby"> Accepted by:</label><select id="acceptedby" name="acceptedby"><option value="">Any</option>
781 [% FOREACH acceptedby_loo IN acceptedby_loop %][% IF ( acceptedby_loo.selected ) %] <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>[% ELSE %]<option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>[% END %][% END %]
782                                                       </select></li>
783                     <li>
784                         <label for="accepteddate_from">Accepted date from:</label>
785                         <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" />
786                     </li>
787                     <li>
788                         <label for="accepteddate_to">To:</label>
789                         <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" />
790                     </li>
791                     <li><input type="submit" value="Go" /></li></ol>
792                 </fieldset>
793
794                                 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
795                     <ol><li><label for="budgetid"> Book fund:</label>
796                     <select name="budgetid" id="budgetid">
797                       <option value="__ANY__">Any</option>
798                       [% IF budgetid == '__NONE__' %]
799                           <option value="__NONE__" selected="selected">None</option>
800                       [% ELSE %]
801                           <option value="__NONE__">None</option>
802                       [% END %]
803                     [% FOREACH budgetsloo IN budgetsloop %]
804                         [% IF ( budgetsloo.selected ) %]<option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>[% ELSE %]<option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>[% END %]
805                         [% END %]
806                     </select></li>
807                     <li><label for="branchcode">Library:</label>
808                     <select name="branchcode" id="branchcode">
809                         <option value="__ANY__">Any</option>
810                         [% IF branchfilter %]
811                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %]
812                         [% ELSE %]
813                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
814                         [% END %]
815                     </select></li><li><input type="submit" value="Go" /></li></ol>
816                 </fieldset>
817             </form>
818         [% INCLUDE 'acquisitions-menu.inc' %]
819
820             </aside>
821         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
822      </div> <!-- /.row -->
823
824     [% END %]
825     [% END %]
826 </div>
827 [% END %]
828
829 [% MACRO jsinclude BLOCK %]
830     [% INCLUDE 'calendar.inc' %]
831     [% IF ( op == 'show' || op_else ) %]
832         <script>
833             $(document).ready(function(){
834                 $(".deletesuggestion").on("click",function(){
835                     return confirm(_("Are you sure you want to delete this suggestion?"));
836                 });
837             });
838         </script>
839     [% END %]
840     [% IF ( op_else ) %]
841         [% INCLUDE 'datatables.inc' %]
842         [% INCLUDE 'columns_settings.inc' %]
843         [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
844
845         <script>
846             $(document).ready(function() {
847                 $('#suggestiontabs').tabs();
848
849                 columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
850                 [% FOREACH suggestion IN suggestions %]
851                     [% IF ( suggestion.suggestions_loop ) %]
852                         KohaTable("table_[% loop.count| html %]", {
853                             "sorting": [[ 1, "asc" ]],
854                             "autoWidth": false,
855                             "columnDefs": [
856                                 { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
857                                 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
858                             ]
859                         }, columns_settings );
860                     [% END %]
861                 [% END %]
862
863                 $(".checkall").click(function(e){
864                     e.preventDefault();
865                     $(this).parents('form').checkCheckboxes();
866                     return false;
867                 });
868                 $(".uncheckall").click(function(e){
869                     e.preventDefault();
870                     $(this).parents('form').unCheckCheckboxes();
871                     return false;
872                 });
873                 $(".other_reason").hide();
874                 $("select[name='reason']").change(function(){
875                     if($(this).val() == "other"){
876                         $(this).hide();
877                         $(this).siblings(".other_reason").show();
878                     }
879                 });
880
881                 $("a.cancel_note").click(function(e) {
882                     $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
883                     $(this).siblings("input[name='other_reason']").hide();
884                     e.preventDefault();
885                 });
886                 $("h4.local_collapse a").click(function(){
887                     $(this).parent().parent().find("ol").toggle();
888                     return false;
889                 });
890                 // http://jqueryui.com/demos/datepicker/#date-range
891                 var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
892                     changeMonth: true,
893                     numberOfMonths: 1,
894                     onSelect: function( selectedDate ) {
895                         var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
896                             instance = $( this ).data( "datepicker" );
897                             date = $.datepicker.parseDate(
898                                 instance.settings.dateFormat ||
899                                 $.datepicker._defaults.dateFormat,
900                                 selectedDate, instance.settings );
901                         dates.not( this ).datepicker( "option", option, date );
902                     }
903                 });
904                 var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
905                     changeMonth: true,
906                     numberOfMonths: 1,
907                     onSelect: function( selectedDate ) {
908                         var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
909                             instance = $( this ).data( "datepicker" );
910                             date = $.datepicker.parseDate(
911                                 instance.settings.dateFormat ||
912                                 $.datepicker._defaults.dateFormat,
913                                 selectedDate, instance.settings );
914                         datesMD.not( this ).datepicker( "option", option, date );
915                     }
916                 });
917                 var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
918                     changeMonth: true,
919                     numberOfMonths: 1,
920                     onSelect: function( selectedDate ) {
921                         var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
922                             instance = $( this ).data( "datepicker" );
923                             date = $.datepicker.parseDate(
924                                 instance.settings.dateFormat ||
925                                 $.datepicker._defaults.dateFormat,
926                                 selectedDate, instance.settings );
927                         datesAD.not( this ).datepicker( "option", option, date );
928                     }
929                 });
930
931                 $("button[type='submit']").on("click", function(e) {
932                     var form = $(this).parents("form");
933                     var action = $(this).val();
934                     var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
935                     if ( selected_suggestions.length == 0 ) {
936                         alert(_("Please select at least one suggestion"));
937                         e.preventDefault();
938                         return false;
939                     }
940                     if ( action == "delete" ) {
941                         if ( selected_suggestions.length == 1 ) {
942                             if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
943                                 e.preventDefault();
944                                 return false;
945                             }
946                         } else if ( selected_suggestions.length > 1 ) {
947                             if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
948                                 e.preventDefault();
949                                 return false;
950                             }
951                         }
952                     }
953
954                     $('<input />').attr('type', 'hidden')
955                                   .attr('name', "op")
956                                   .attr('value', action)
957                                   .appendTo(form);
958                     return true;
959                 });
960             });
961         </script>
962     [% END %]
963     [% IF ( op_save )  %]
964         <script>
965             $(document).ready(function(){
966                 calcNewsuggTotal();
967                 $("#quantity,#price,#currency").on("change",function(){
968                     calcNewsuggTotal();
969                 });
970
971                 [% IF other_reason %]
972                     $(".select-reason").hide();
973                     $(".select-reason").find("option[value='other']").attr("selected","selected");
974                     $("#other_reason").show();
975                 [% ELSE %]
976                     $("#other_reason").hide();
977                 [% END %]
978                 $(".select-reason").change(function(){
979                     if($(this).val() == "other"){
980                         $(this).hide();
981                         $("#other_reason").show();
982                     }
983                 });
984                 $("a[href*=back]").click(function(){
985                     $(".select-reason").show().find("option[value='']").attr("selected","selected");
986                     $("#other_reason").hide();
987                 });
988             });
989         </script>
990     [% END %]
991     [% Asset.js("js/acq.js") | $raw %]
992     [% Asset.js("js/acquisitions-menu.js") | $raw %]
993 [% END %]
994
995 [% INCLUDE 'intranet-bottom.inc' %]