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