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