1 [% PROCESS 'i18n.inc' %]
5 [% USE AuthorisedValues %]
8 [% USE TablesSettings %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha › Acquisitions ›
13 [% IF ( suggestionid ) %]
14 Suggestions › Edit suggestion #[% suggestionid | html %]
16 Suggestions › Add suggestion
18 [% ELSIF ( op == 'show' ) %]
19 Suggestions › Show suggestion #[% suggestionid | html %]
21 Suggestions management
24 [% INCLUDE 'doc-head-close.inc' %]
30 text-decoration: none;
53 <body id="acq_suggestion" class="acq">
54 [% INCLUDE 'header.inc' %]
55 [% INCLUDE 'cat-search.inc' %]
57 <nav aria-label="Breadcrumb" class="breadcrumb">
60 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
63 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
67 [% IF ( suggestionid ) %]
69 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
72 <a href="#" aria-current="page">
73 Edit suggestion #[% suggestionid | html %]
78 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
81 <a href="#" aria-current="page">
86 [% ELSIF ( op == 'show' ) %]
88 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
91 <a href="#" aria-current="page">
92 Show suggestion #[% suggestionid | html %]
97 <a href="#" aria-current="page">
98 Suggestions management
103 </nav> <!-- /.breadcrumbs -->
105 [% IF ( op == 'show' ) %]
106 <div class="main container-fluid">
108 <div class="col-md-8 col-md-offset-2">
110 <div id="toolbar" class="btn-toolbar">
111 <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit&suggestionid=[% suggestionid | html %]"><i class="fa fa-pencil"></i> Edit</a>
112 <a class="btn btn-default deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
115 <fieldset class="rows">
116 <legend>Bibliographic information</legend>
120 <span class="label">Title:</span>
121 [% IF suggestion.biblionumber %]
122 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
130 <span class="label">Author:</span>
134 [% IF ( copyrightdate ) %]
136 <span class="label">Copyright date:</span>
137 [% copyrightdate | html %]
142 <span class="label">ISBN or ISSN or other standard number:</span>
146 [% IF ( publishercode ) %]
148 <span class="label">Publisher:</span>
149 [% publishercode | html %]
154 <span class="label">Publication place:</span>
158 [% IF ( collectiontitle ) %]
160 <span class="label">Collection title:</span>
161 [% collectiontitle | html %]
164 [% IF ( itemtype ) %]
166 <span class="label">Document type:</span>
167 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
170 [% IF ( patron_reason_loop ) %]
172 <span class="label">Reason for suggestion: </span>
173 [% FOREACH patron_reason_loo IN patron_reason_loop %]
174 [% IF patron_reason_loo.authorised_value == patronreason %]
175 [% patron_reason_loo.lib | html %]
182 <span class="label">Notes:</span>
189 <fieldset class="rows">
190 <legend>Suggestion management</legend>
193 <span class="label">Status:</span>
194 [% SET status_found = 0 %]
195 [% IF ( STATUS == 'ASKED' ) %]
197 [% SET status_found = 1 %]
198 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
200 [% SET status_found = 1 %]
201 [% ELSIF ( STATUS == 'CHECKED' ) %]
203 [% SET status_found = 1 %]
204 [% ELSIF ( STATUS == 'REJECTED' ) %]
206 [% SET status_found = 1 %]
207 [% ELSIF ( STATUS == 'ORDERED' ) %]
209 [% SET status_found = 1 %]
210 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
212 [% SET status_found = 1 %]
214 [% FOREACH s IN SuggestionStatuses %]
215 [% IF STATUS == s.authorised_value %]
217 [% SET status_found = 1 %]
223 <span class="label">Reason:</span>
225 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
240 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
241 <td>[% suggesteddate | $KohaDates %]</td>
243 [% IF ( suggestedby_patron.borrowernumber ) %]
244 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_patron.borrowernumber | uri %]">[% suggestedby_patron.surname | html %], [% suggestedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %])</a>
245 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
251 <td>[% manageddate | $KohaDates %]</td>
253 [% IF ( managedby_patron.borrowernumber ) %]
254 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_patron.borrowernumber | uri %]">[% managedby_patron.surname | html %], [% managedby_patron.firstname | html %] ([% managedby_patron.cardnumber | html %])</a>
255 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
260 <th>Accepted on:</th>
261 <td>[% accepteddate | $KohaDates %]</td>
263 [% IF ( acceptedby_patron.borrowernumber ) %]
264 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_patron.borrowernumber | uri %]">[% acceptedby_patron.surname | html %], [% acceptedby_patron.firstname | html %] ([% acceptedby_patron.cardnumber | html %])</a>
265 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
270 <th>Last modification on:</th>
271 <td>[% lastmodificationdate | $KohaDates %]</td>
273 [% IF ( lastmodificationby_patron.borrowernumber ) %]
274 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% lastmodificationby_patron.borrowernumber | uri %]">[% lastmodificationby_patron.surname | html %], [% lastmodificationby_patron.firstname | html %] ([% lastmodificationby_patron.cardnumber | html %])</a>
275 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
283 <fieldset class="rows">
284 <legend>Acquisition information</legend>
287 <span class="label">Library:</span>
288 [% Branches.GetName( branchcode ) | html %]
291 <span class="label">Fund:</span>
292 [% budgetname | html %]
295 <span class="label">Copies:</span>
296 [% quantity | html %]
299 <span class="label">Currency:</span>
300 [% currency | html %]
303 <span class="label">Price:</span>
307 <span class="label">Total</span>
313 <fieldset class="action">
314 <a href="suggestion.pl"><< Back to suggestions</a>
317 </div> <!-- /.col-md-8 col-md-offset-2 -->
318 </div> <!-- /.row -->
319 [% ELSE # IF op == "show" %]
321 [% IF op == 'save' %]
322 <div class="main container-fluid">
324 <div class="col-md-8 col-md-offset-2">
326 <div class="main container-fluid">
328 <div class="col-sm-10 col-sm-push-2">
331 [% IF op == 'save' %]
332 [% FOR m IN messages %]
333 <div class="dialog [% m.type | html %]">
335 [% CASE 'biblio_exists' %]
336 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.
337 [% CASE 'manager_not_enough_permissions' %]
338 The manager you selected does not have sufficient permissions.
342 </div> <!-- /.dialog -->
345 <form id="add_edit" action="suggestion.pl" method="post" class="validated">
346 <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
347 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
348 [% IF ( suggestionid ) %]
349 <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
350 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
352 <h1>Enter a new purchase suggestion</h1>
355 <fieldset class="rows">
356 <legend>Bibliographic information</legend>
359 <label for="title" class="required">Title:</label>
360 <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
361 <span class="required">Required</span>
364 <label for="author">Author:</label>
365 <input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/>
368 <label for="copyrightdate">Copyright date:</label>
369 <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" />
372 <label for="isbn">ISBN or ISSN or other standard number:</label>
373 <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn | html %]"/>
376 <label for="publishercode">Publisher:</label>
377 <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/>
380 <label for="place">Publication place:</label>
381 <input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/>
384 <label for="collectiontitle">Collection title:</label>
385 <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/>
388 <label for="itemtype">Document type:</label>
389 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
391 [% IF patron_reason_loop %]
393 <label for="patronreason">Reason for suggestion: </label>
394 <select name="patronreason" id="patronreason">
395 <option value=""> -- Choose -- </option>
396 [% FOREACH patron_reason_loo IN patron_reason_loop %]
397 [% IF patron_reason_loo.authorised_value == patronreason %]
398 <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
400 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
405 [% END # /IF patron_reason_loop %]
407 <label for="note">Notes:</label>
408 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
413 <fieldset class="rows">
414 <legend>Suggestion management</legend>
416 [% IF ( suggestionid ) %]
418 <label for="STATUS">Status:</label>
419 <select id="STATUS" name="STATUS">
420 <option value="">No status</option>
422 [% IF (statusselected_ASKED ) %]
423 <option value="ASKED" selected="selected">Pending</option>
425 <option value="ASKED">Pending</option>
428 [% IF (statusselected_ACCEPTED ) %]
429 <option value="ACCEPTED" selected="selected">Accepted</option>
431 <option value="ACCEPTED">Accepted</option>
434 [% IF (statusselected_CHECKED ) %]
435 <option value="CHECKED" selected="selected">Checked</option>
437 <option value="CHECKED">Checked</option>
440 [% IF ( statusselected_REJECTED ) %]
441 <option value="REJECTED" selected="selected">Rejected</option>
443 <option value="REJECTED">Rejected</option>
446 [% IF ( statusselected_ORDERED ) %]
447 <option value="ORDERED" selected="selected">Ordered</option>
449 <option value="ORDERED">Ordered</option>
452 [% FOREACH s IN SuggestionStatuses %]
453 [% IF s.authorised_value == suggestion.STATUS %]
454 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
456 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
462 <label for="reason">Reason</label>
463 <select class="select-reason" id="reason" name="reason">
464 <option value=""> -- Choose a reason -- </option>
465 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
466 [% IF (reasonsloo.lib == suggestion.reason) %]
467 <option value="[% reasonsloo.lib | html %]" selected="selected">[% reasonsloo.lib | html %]</option>
469 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
472 <option value="other">Others...</option>
475 <span id="other_reason" name="other_reason">
476 [% IF other_reason %]
477 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
479 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
481 <a href="#back">Cancel</a>
498 <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
501 <input type="text" id="suggesteddate" name="suggesteddate" class="datepicker" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/>[% INCLUDE 'date-format.inc' %]
503 <td id="tdsuggestedby">
504 <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
505 [% IF ( suggestedby_patron.borrowernumber ) %]
506 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_patron.borrowernumber | uri %]">[% suggestedby_patron.surname | html %], [% suggestedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %])</a> [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
510 <a href="#" id="edit_suggester" class="btn btn-default">Set to patron</a>
515 <label for="accepteddate">Accepted on:</label>
518 <input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]
521 <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
522 [% IF ( acceptedby_patron.borrowernumber ) %]
523 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_patron.borrowernumber | uri %]">[% acceptedby_patron.surname | html %], [% acceptedby_patron.firstname | html %] ([% acceptedby_patron.cardnumber | html %])</a>
524 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
531 <label for="lastmodificationdate">Last modification on:</label>
534 [% lastmodificationdate | $KohaDates %]
537 [% IF lastmodificationby_patron %]
538 [% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
547 <label for="managedon">Managed on:</label>
548 <input type="text" id="managedon" name="manageddate" class="datepicker" size="10" maxlength="10" value="[% manageddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]
551 <label for="managedby_name">by:</label>
553 <span id="managedby_name" name="managedby_name">
554 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
556 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
557 | Previously was [% INCLUDE 'patron-title.inc' patron=managedby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
560 <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a>
561 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
562 <a id="restore_previous_manager" href="#"><i class="fa fa-trash"></i> Keep existing manager</a>
564 <input type="hidden" name="managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" />
567 <label for="notify">Notify manager:</label>
568 <input type="checkbox" id="notify" name="notify" value="notify" disabled="disabled" title="A NOTIFY_MANAGER notice will be generated and send to the manager if a valid email address is defined. This can be checked if a new manager has been selected." />
574 <fieldset class="rows">
575 <legend>Acquisition information</legend>
578 <label for="branchcode">Library:</label>
579 <select name="branchcode" id="branchcode">
580 <option value="">Any</option>
581 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
585 <label for="budgetid">Fund:</label>
586 <select name="budgetid" id="budgetid">
587 <option value="">Any</option>
588 [% FOREACH budget IN sugg_budgets %]
589 [% IF ( budget.selected ) %]
590 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
591 [% ELSIF ( budget.b_active ) %]
592 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
594 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
598 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
599 <input type="checkbox" id="showallfunds" />
602 <label for="quantity">Copies:</label>
603 <input type="text" size="10" id="quantity" name="quantity" value="[% quantity | html %]" />
606 <label for="currency">Currency:</label>
607 [% FOREACH c IN currencies %]
608 <input type="hidden" value="[% c.rate | html %]" id="currency_rate_[% c.currency | html %]" name="currency_rate_[% c.currency | html %]" />
609 <input type="hidden" id="[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" />
611 <select name="currency" id="currency">
612 [% FOREACH c IN currencies %]
613 [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
614 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
615 [% ELSIF not c.archived %]
616 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
622 <label for="price">Price:</label>
623 <input type="text" size="20" name="price" id="price" value="[% price | html %]" />
626 <label for="total">Total: </label>
627 <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total | html %]"/>
630 </fieldset> <!-- /.rows -->
632 <input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
634 <fieldset class="action">
635 <input type="hidden" name="op" value="[% op | html %]" />
636 [% IF ( suggestionid ) %]
637 [% IF ( need_confirm ) %]
638 <input type="hidden" name="save_confirmed" value="1" />
639 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" value="Confirm your suggestion" />
641 <input type="submit" value="Save" />
643 <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
645 [% IF ( need_confirm ) %]
646 <input type="hidden" name="save_confirmed" value="1" />
647 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" value="Confirm your suggestion" />
649 <input type="submit" value="Submit your suggestion" />
651 <a class="cancel" href="suggestion.pl">Cancel</a>
653 </fieldset> <!-- /.action -->
654 </form> <!-- /#add_edit -->
655 [% END # /IF op == 'save' %]
657 [% IF op == 'else' %]
658 <div id="toolbar" class="btn-toolbar">
659 <a class="btn btn-default" id="newsuggestion" href="suggestion.pl?op=add"><i class="fa fa-plus"></i> New purchase suggestion</a>
662 <h1>Suggestions management</h1>
664 [% IF ( displayby != "branchcode" ) %]
665 <label for="branchcode">Viewing suggestions for library:</label>
666 <select name="branchcode" id="branchcode">
667 <option value="__ANY__">Any</option>
668 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
672 [% FOR m IN messages %]
673 <div class="dialog [% m.type | html %]">
675 [% CASE 'already_exists' %]
676 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>)
677 [% CASE 'biblio_exists' %]
678 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.
682 </div> <!-- /.dialog -->
685 [% UNLESS ( notabs ) %]
686 <div id="suggestiontabs" class="toptabs">
687 <ul class="ui-tabs-nav">
688 [% FOREACH suggestion IN suggestions %]
690 <a href="#[% suggestion.suggestiontype | uri %]">
691 [% IF ( suggestion.suggestiontypelabel ) %]
692 [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
693 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
694 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
695 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
696 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
697 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
698 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]Status unknown
699 [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]Any
700 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
702 [% IF ( suggestion.suggestiontype ) %]
703 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
708 ([% suggestion.suggestions_loop.size | html %])</a></li>
710 [% END # /FOREACH suggestion %]
711 </ul> <!-- /.ui-tabs-nav -->
712 [% END # /UNLESS notabs %]
714 [% FOREACH suggestion IN suggestions %]
715 <div id="[% suggestion.suggestiontype | html %]">
716 <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
718 [% IF ( suggestion.suggestions_loop ) %]
720 <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
723 <table id="table_[% loop.count | html %]" class="sorted">
726 <th class="NoSort noExport"> </th>
727 <th class="anti-the">Suggestion</th>
728 <th>Suggested by</th>
729 <th>Suggested on</th>
732 <th>Last modification by</th>
733 <th>Last modification on</th>
737 <th class="NoSort noExport"> </th>
741 [% FOREACH suggestions_loo IN suggestion.suggestions_loop %]
744 <input type="checkbox" name="suggestionid" value="[% suggestions_loo.suggestionid | html %]" />
747 <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | uri %]&op=show" title="suggestion" >
748 [% suggestions_loo.title | html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author | html %][% END %]
751 [% IF ( suggestions_loo.copyrightdate ) %]
752 © <span class="suggestion_copyrightdate">[% suggestions_loo.copyrightdate | html %]</span>
754 [% IF ( suggestions_loo.volumedesc ) %]
755 ; <span class="suggestion_volume">Volume:<em>[% suggestions_loo.volumedesc | html %]</em></span>
757 [% IF ( suggestions_loo.isbn ) %]
758 ; <span class="suggestion_isbn">ISBN: <em>[% suggestions_loo.isbn | html %]</em></span>
760 [% IF ( suggestions_loo.publishercode ) %]
761 ; <span class="suggestion_publishercode">Published by [% suggestions_loo.publishercode | html %]</span>
763 [% IF ( suggestions_loo.publicationyear ) %]
764 in <span class="suggestion_publicationyear"><em>[% suggestions_loo.publicationyear | html %]</em></span>
766 [% IF ( suggestions_loo.place ) %]
767 in <span class="suggestion_place"><em>[% suggestions_loo.place | html %]</em></span>
769 [% IF ( suggestions_loo.collectiontitle ) %]
770 ; <span class="suggestion_collectiontitle">[% suggestions_loo.collectiontitle | html %]</span>
772 [% IF ( suggestions_loo.itemtype ) %]
773 ; <span class="suggestion_itype">[% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %]</span>
776 [% IF ( suggestions_loo.note ) %]
777 <div class="suggestion_note"><i class="fa fa-comment"></i> [% suggestions_loo.note | html %]</div>
779 [% IF suggestions_loo.archived %]
780 <br /><i class="fa fa-archive"></i> Archived
784 <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>
786 <td data-order="[% suggestions_loo.suggesteddate | html %]">
787 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate | $KohaDates %][% END %]
790 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.managedby | uri %]">[% suggestions_loo.surnamemanagedby | html %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby | html %][% END %]</a>
792 <td data-order="[% suggestions_loo.manageddate | html %]">
793 [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
796 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.lastmodificationby | uri %]">[% suggestions_loo.surnamelastmodificationby | html %][% IF ( suggestions_loo.firstnamelastmodificationby ) %], [% suggestions_loo.firstnamelastmodificationby | html %][% END %]</a>
798 <td data-order="[% suggestions_loo.lastmodificationdate | html %]">
799 [% IF ( suggestions_loo.lastmodificationdate ) %][% suggestions_loo.lastmodificationdate | $KohaDates %][% END %]
802 [% Branches.GetName( suggestions_loo.branchcode ) | html %]
805 [% suggestions_loo.budget_name | html %]
808 [% IF ( suggestions_loo.ASKED ) %]
810 [% ELSIF ( suggestions_loo.ACCEPTED ) %]
812 [% ELSIF ( suggestions_loo.ORDERED ) %]
814 [% ELSIF ( suggestions_loo.REJECTED ) %]
816 [% ELSIF ( suggestions_loo.CHECKED ) %]
818 [% ELSIF ( suggestions_loo.AVAILABLE ) %]
820 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
821 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) | html %]
826 [% IF ( suggestions_loo.reason ) %]
827 <br />([% suggestions_loo.reason | html %])
831 <div class="btn-group dropup">
832 <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&op=edit"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% suggestions_loo.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
833 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% suggestions_loo.suggestionid | html %]">
834 <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a></li>
835 [% UNLESS suggestions_loo.archived %]
836 <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
838 <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li>
844 [% END # /FOREACH suggestions_loo %]
846 </table> <!-- /#table_[% loop.count | html %] -->
849 <h2 style="padding-left:1em;">Change selected suggestions</h2>
850 <div class="col-sm-4">
852 <div id="select-reason[% loop.index | html %]">
853 <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label>
854 <select name="STATUS" id="STATUSreason[% loop.index | html %]">
855 <option value=""> -- Choose a status --</option>
857 [% IF (statusselected_ASKED ) %]
858 <option value="ASKED" selected="selected">Pending</option>
860 <option value="ASKED">Pending</option>
863 [% IF (statusselected_ACCEPTED ) %]
864 <option value="ACCEPTED" selected="selected">Accepted</option>
866 <option value="ACCEPTED">Accepted</option>
869 [% IF (statusselected_CHECKED ) %]
870 <option value="CHECKED" selected="selected">Checked</option>
872 <option value="CHECKED">Checked</option>
875 [% IF ( statusselected_REJECTED ) %]
876 <option value="REJECTED" selected="selected">Rejected</option>
878 <option value="REJECTED">Rejected</option>
881 [% IF ( statusselected_ORDERED ) %]
882 <option value="ORDERED" selected="selected">Ordered</option>
884 <option value="ORDERED">Ordered</option>
887 [% FOREACH s IN SuggestionStatuses %]
888 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
892 <label for="choosereason[% loop.index | html %]">with this reason:</label>
893 <select name="reason" id="choosereason[% loop.index | html %]">
894 <option value=""> -- Choose a reason -- </option>
895 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
896 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
898 <option value="other">Others...</option>
901 <span class="other_reason">
902 <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
903 <a href="#" class="cancel_note">Cancel</a>
907 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
908 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
909 <fieldset class="action">
910 <button type="submit" class="btn btn-default btn-xs" value="update_status">Submit</button>
913 </div> <!-- /.col-sm-4 -->
915 <div class="col-sm-4">
918 Update item types with:
919 [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %]
921 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
922 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
923 <fieldset class="action">
924 <button type="submit" class="btn btn-default btn-xs" value="update_itemtype">Submit</button>
927 </div> <!-- /.col-sm-4 -->
929 <div class="col-sm-2">
931 <span class="label">Update manager</span><br/>
932 <a id="set_manager_[% loop.count | html %]" data-tab="[% loop.count | html %]" class="set_manager" href="#"><i class="fa fa-search"></i> Select manager</a>
933 <span id="managedby_name[% loop.count | html %]"></span>
934 <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
935 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
936 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
937 <fieldset class="action">
938 <button type="submit" class="btn btn-default btn-xs" value="update_manager">Submit</button>
941 </div> <!-- /.col-sm-2 -->
943 <div class="col-sm-2">
945 <span class="label">Delete selected</span>
946 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
947 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
948 <fieldset class="action">
949 <button type="submit" class="btn btn-default btn-xs" value="delete">Delete</button>
952 </div> <!-- /.col-sm-2 -->
953 </div> <!-- /.row -->
956 <strong>No results.</strong>
957 [% END # /IF ( suggestion.suggestions_loop ) %]
958 </form> <!-- /.update_suggestions -->
959 </div> <!-- /#[% suggestion.suggestiontype | html %] -->
960 [% END # /FOREACH suggestion %]
961 [% UNLESS ( notabs ) %]
962 </div> <!-- /.notabs -->
963 [% END # /UNLESS notabs %]
964 [% END # /IF op == 'else' %]
966 [% UNLESS op == 'save' %]
967 [% UNLESS ( op == 'show' ) %]
968 </div> <!-- /.col-sm-10.col-sm-push-2 -->
970 <div class="col-sm-2 col-sm-pull-10">
972 <form name="suggestionfilter" action="suggestion.pl" method="get">
973 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
974 <fieldset class="brief">
975 <ol style="display:block;">
977 <label for="displayby">Organize by: </label>
978 <select name="displayby" id="displayby" style="width:auto;">
979 [% IF ( displayby == "STATUS" ) %]
980 <option value="STATUS" selected="selected">Status</option>
982 <option value="STATUS">Status</option>
984 [% IF ( displayby == "branchcode" ) %]
985 <option value="branchcode" selected="selected">Library</option>
987 <option value="branchcode">Library</option>
989 [% IF ( displayby == "itemtype" ) %]
990 <option value="itemtype" selected="selected">Item type</option>
992 <option value="itemtype">Item type</option>
994 [% IF ( displayby == "managedby" ) %]
995 <option value="managedby" selected="selected">Managed by</option>
997 <option value="managedby">Managed by</option>
999 [% IF ( displayby == "acceptedby" ) %]
1000 <option value="acceptedby" selected="selected">Accepted by</option>
1002 <option value="acceptedby">Accepted by</option>
1005 <input type="submit" value="Go" />
1008 </fieldset> <!-- /.brief -->
1010 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
1013 <fieldset class="brief">
1014 <h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
1017 <label for="title"> Title:</label>
1018 <input type="text" id="title" name="title" value="[% title | html %]" />
1021 <label for="author"> Author:</label>
1022 <input type="text" id="author" name="author" value="[% author | html %]" />
1025 <label for="isbn"> ISBN:</label>
1026 <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" />
1029 <label for="publishercode"> Publisher:</label>
1030 <input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" />
1033 <label for="copyrightdate_filter"> Copyright date:</label>
1034 <input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" />
1037 <label for="collectiontitle"> Collection title:</label>
1038 <input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" /></li><li><input type="submit" value="Go" />
1041 </fieldset> <!-- /.brief -->
1043 <fieldset class="brief">
1044 <h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
1047 <label for="archived" style="display: inline;">Include archived:</label>
1048 [% IF filter_archived %]
1049 <input type="checkbox" id="archived" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1051 <input type="checkbox" id="archived" name="filter_archived" title="Include archived suggestions in the search" />
1055 <label for="STATUS[% loop.index | html %]"> Status:</label>
1056 <select name="STATUS" id="STATUS[% loop.index | html %]">
1057 <option value="">Any</option>
1058 [% IF (statusselected_ASKED ) %]
1059 <option value="ASKED" selected="selected">Pending</option>
1061 <option value="ASKED">Pending</option>
1064 [% IF (statusselected_ACCEPTED ) %]
1065 <option value="ACCEPTED" selected="selected">Accepted</option>
1067 <option value="ACCEPTED">Accepted</option>
1070 [% IF (statusselected_CHECKED ) %]
1071 <option value="CHECKED" selected="selected">Checked</option>
1073 <option value="CHECKED">Checked</option>
1076 [% IF ( statusselected_REJECTED ) %]
1077 <option value="REJECTED" selected="selected">Rejected</option>
1079 <option value="REJECTED">Rejected</option>
1082 [% IF ( statusselected_ORDERED ) %]
1083 <option value="ORDERED" selected="selected">Ordered</option>
1085 <option value="ORDERED">Ordered</option>
1088 [% FOREACH s IN SuggestionStatuses %]
1089 [% IF s.authorised_value == selected_status %]
1090 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1092 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1099 <label for="suggestedby"> Suggested by:</label>
1100 <select id="suggestedby" name="suggestedby">
1101 <option value="">Any</option>
1102 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1103 [% IF ( suggestedby_loo.selected ) %]
1104 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1106 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1112 <label for="suggesteddate_from">Suggested date from:</label>
1113 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" />
1116 <label for="suggesteddate_to">To:</label>
1117 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" />
1120 <label for="managedby"> Managed by:</label>
1121 <select id="managedby" name="managedby">
1122 <option value="">Any</option>
1123 [% FOREACH managedby_loo IN managedby_loop %]
1124 [% IF ( managedby_loo.selected ) %]
1125 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1127 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1133 <label for="manageddate_from">Management date from:</label>
1134 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" />
1137 <label for="manageddate_to">To:</label>
1138 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" />
1141 <label for="acceptedby"> Accepted by:</label>
1142 <select id="acceptedby" name="acceptedby">
1143 <option value="">Any</option>
1144 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1145 [% IF ( acceptedby_loo.selected ) %]
1146 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1148 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1154 <label for="accepteddate_from">Accepted date from:</label>
1155 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" />
1158 <label for="accepteddate_to">To:</label>
1159 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" />
1162 <input type="submit" value="Go" />
1167 <fieldset class="brief">
1168 <h4 class="local_collapse">
1169 <a href="#">Acquisition information</a>
1173 <label for="budgetid"> Book fund:</label>
1174 <select name="budgetid" id="budgetid">
1175 <option value="__ANY__">Any</option>
1176 [% IF budgetid == '__NONE__' %]
1177 <option value="__NONE__" selected="selected">None</option>
1179 <option value="__NONE__">None</option>
1181 [% FOREACH budgetsloo IN budgetsloop %]
1182 [% IF ( budgetsloo.selected ) %]
1183 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1185 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1191 <input type="submit" value="Go" />
1195 </div> <!-- /#limits -->
1196 </form> <!-- /suggestionsfilter -->
1198 [% INCLUDE 'acquisitions-menu.inc' %]
1201 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1202 [% END # /UNLESS ( op == 'show' ) %]
1203 [% END # /UNLESS op == 'save' %]
1204 </div> <!-- /.row -->
1206 [% END # /IF op == "show" %]
1208 [% MACRO jsinclude BLOCK %]
1209 [% INCLUDE 'calendar.inc' %]
1213 function editManagerPopup(selected_tab) {
1215 window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select&callback=select_manager&permissions=suggestions.suggestions_manage",
1217 'width=740,height=450,location=yes,toolbar=no,'
1218 + 'scrollbars=yes,resize=yes'
1221 function select_manager(borrowernumber, borrower) {
1222 var managedby_name = $("#managedby_name"+tab);
1223 var managedby = $("#managedby"+tab);
1224 managedby_name.empty();
1226 var borrowername = borrower.firstname + ' ' + borrower.surname;
1227 if (borrowernumber) {
1228 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1229 + '?borrowernumber=' + borrowernumber + '">'
1230 + borrowername + '</a>';
1231 managedby_name.html(managerlink);
1232 managedby.val(borrowernumber);
1235 [% IF op == "save" %]
1236 var notify = $('#notify');
1237 if ( notify.length ) {
1238 [% IF managedby_patron %]
1239 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1241 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1243 $(notify).prop('checked', false).prop('disabled', true);
1245 $(notify).prop('disabled', false);
1251 function editSuggesterPopup() {
1252 window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select&callback=select_suggester",
1254 'width=740,height=450,location=yes,toolbar=no,'
1255 + 'scrollbars=yes,resize=yes'
1259 function select_suggester(borrowernumber, borrower) {
1260 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />';
1261 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">';
1262 suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')';
1263 suggested += '</a> ';
1264 suggested += borrower.branchname + ' (' + borrower.category_description + ')';
1265 $("#tdsuggestedby").html(suggested);
1268 $(document).ready(function(){
1269 $("#edit_manager").on("click",function(e){
1271 editManagerPopup('');
1273 $(".set_manager").on("click",function(e){
1275 var selected_tab = $(this).data('tab');
1276 editManagerPopup(selected_tab);
1279 $("#edit_suggester").on("click", function(e){
1281 editSuggesterPopup();
1286 [% IF ( op == 'show' || op == 'else' ) %]
1288 $(document).ready(function(){
1289 $(".deletesuggestion").on("click",function(){
1290 return confirm(_("Are you sure you want to delete this suggestion?"));
1295 [% IF op == 'else' %]
1296 [% INCLUDE 'datatables.inc' %]
1297 [% INCLUDE 'columns_settings.inc' %]
1299 $(document).ready(function() {
1300 $('#suggestiontabs').tabs();
1302 columns_settings = [% TablesSettings.GetColumns( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1303 [% FOREACH suggestion IN suggestions %]
1304 [% IF ( suggestion.suggestions_loop ) %]
1305 KohaTable("table_[% loop.count| html %]", {
1306 "sorting": [[ 3, "asc" ]],
1308 }, columns_settings );
1312 $("#branchcode").on('change',function(){
1313 [%# Modify the hidden input in the filters block from the library %]
1314 [%# dropdown list at the top of suggestion list %]
1315 let branchcode = $(this).val();
1316 $('input[name="branchcode"]').val( branchcode );
1317 $('form[name="suggestionfilter"]').submit();
1320 $(".checkall").click(function(e){
1322 $(this).parents('form').find("input:checkbox").each(function(){
1323 $(this).prop("checked", true);
1326 $(".uncheckall").click(function(e){
1328 $(this).parents('form').find("input:checkbox").each(function(){
1329 $(this).prop("checked", false);
1332 $(".other_reason").hide();
1333 $("select[name='reason']").change(function(){
1334 if($(this).val() == "other"){
1336 $(this).siblings(".other_reason").show();
1340 $("a.cancel_note").click(function(e) {
1341 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1342 $(this).siblings("input[name='other_reason']").hide();
1345 $("h4.local_collapse a").click(function(){
1346 $(this).parent().parent().find("ol").toggle();
1349 // http://jqueryui.com/demos/datepicker/#date-range
1350 var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
1353 onSelect: function( selectedDate ) {
1354 var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
1355 instance = $( this ).data( "datepicker" );
1356 date = $.datepicker.parseDate(
1357 instance.settings.dateFormat ||
1358 $.datepicker._defaults.dateFormat,
1359 selectedDate, instance.settings );
1360 dates.not( this ).datepicker( "option", option, date );
1363 var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
1366 onSelect: function( selectedDate ) {
1367 var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
1368 instance = $( this ).data( "datepicker" );
1369 date = $.datepicker.parseDate(
1370 instance.settings.dateFormat ||
1371 $.datepicker._defaults.dateFormat,
1372 selectedDate, instance.settings );
1373 datesMD.not( this ).datepicker( "option", option, date );
1376 var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
1379 onSelect: function( selectedDate ) {
1380 var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
1381 instance = $( this ).data( "datepicker" );
1382 date = $.datepicker.parseDate(
1383 instance.settings.dateFormat ||
1384 $.datepicker._defaults.dateFormat,
1385 selectedDate, instance.settings );
1386 datesAD.not( this ).datepicker( "option", option, date );
1390 $("button[type='submit']").on("click", function(e) {
1391 var submit_button = this;
1392 var form = $(submit_button).parents("form");
1393 var action = $(submit_button).val();
1394 var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1395 if ( selected_suggestions.length == 0 ) {
1396 alert(_("Please select at least one suggestion"));
1400 if ( action == "delete" ) {
1401 if ( selected_suggestions.length == 1 ) {
1402 if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
1406 } else if ( selected_suggestions.length > 1 ) {
1407 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1412 } else if ( action == "update_manager" ) {
1413 var managedby = $(submit_button).siblings("suggestion_managedby");
1414 if ( managedby.val() == "" ) {
1415 alert(_("Please select a manager to assign to the selected suggestions"));
1421 $('<input />').attr('type', 'hidden')
1423 .attr('value', action)
1430 [% IF op == 'save' %]
1433 $(document).ready(function(){
1435 $("#quantity,#price,#currency").on("change",function(){
1439 [% IF other_reason %]
1440 $(".select-reason").hide();
1441 $(".select-reason").find("option[value='other']").attr("selected","selected");
1442 $("#other_reason").show();
1444 $("#other_reason").hide();
1446 $(".select-reason").change(function(){
1447 if($(this).val() == "other"){
1449 $("#other_reason").show();
1452 $("a[href*=back]").click(function(){
1453 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1454 $("#other_reason").hide();
1457 $("#restore_previous_manager").on("click",function(e){
1460 $("#managedby_name").empty();
1461 $("#managedby").val('');
1462 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1463 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1464 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1465 + borrowername + '</a>';
1466 $('#managedby_name').html(managerlink);
1467 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1468 $('#notify').prop('checked', false).prop('disabled', true);
1471 //keep a copy of all budgets before removing the inactives
1472 var budgetId = $("form#add_edit #budgetid");
1473 var disabledBudgetsCopy = budgetId.html();
1474 $('.b_inactive').remove();
1476 $('#showallfunds').click(function() {
1477 if ($(this).is(":checked")) {
1478 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1481 $('.b_inactive').remove();
1488 [% Asset.js("js/acq.js") | $raw %]
1489 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1491 [% INCLUDE 'intranet-bottom.inc' %]