4 [% USE AuthorisedValues %]
7 [% USE TablesSettings %]
8 [% PROCESS 'i18n.inc' %]
9 [% PROCESS 'patron-search.inc' %]
10 [% SET footerjs = 1 %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>[% FILTER collapse %]
14 [% IF ( suggestionid ) %]
15 [% tx("Edit suggestion #{suggestion_number}", { suggestion_number = suggestionid }) | html %] ›
17 [% t("Add suggestion") | html %] ›
19 [% ELSIF ( op == 'show' ) %]
20 [% tx("Show suggestion #{suggestion_number}", { suggestion_number = suggestionid }) | html %] ›
22 [% t("Suggestions") | html %] ›
23 [% t("Acquisitions") | html %] ›
24 [% t("Koha") | html %]
26 [% INCLUDE 'doc-head-close.inc' %]
32 text-decoration: none;
34 #limits fieldset.brief,
35 #limits fieldset.action {
56 <body id="acq_suggestion" class="acq">
57 [% WRAPPER 'header.inc' %]
58 [% INCLUDE 'cat-search.inc' %]
61 [% WRAPPER 'sub-header.inc' %]
62 [% WRAPPER breadcrumbs %]
63 [% WRAPPER breadcrumb_item %]
64 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
66 [% IF ( op == 'save' || op == 'show' ) %]
67 [% WRAPPER breadcrumb_item %]
68 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
72 [% IF ( suggestionid ) %]
73 [% WRAPPER breadcrumb_item bc_active= 1 %]
74 <span>Edit suggestion #[% suggestionid | html %]</span>
77 [% WRAPPER breadcrumb_item bc_active= 1 %]
78 <span>Add suggestion</span>
81 [% ELSIF ( op == 'show' ) %]
82 [% WRAPPER breadcrumb_item bc_active= 1 %]
83 <span>Show suggestion #[% suggestionid | html %]</span>
86 [% WRAPPER breadcrumb_item bc_active= 1 %]
87 <span>Suggestions management</span>
90 [% END #/ WRAPPER breadcrumbs %]
91 [% END #/ WRAPPER sub-header.inc %]
93 [% IF ( op == 'show' ) %]
94 <div class="main container-fluid">
96 <div class="col-md-8 col-md-offset-2">
97 [% INCLUDE 'messages.inc' %]
99 <div id="toolbar" class="btn-toolbar">
100 <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit_form&suggestionid=[% suggestionid | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
101 <form class="delete_form" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl">
102 [% INCLUDE 'csrf-token.inc' %]
103 <fieldset class="action">
104 <input type="hidden" name="op" value="cud-delete" />
105 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]" />
106 <button type="submit" class="btn btn-primary">Delete</button>
111 <fieldset class="rows">
112 <legend>Bibliographic information</legend>
116 <span class="label">Title:</span>
117 [% IF suggestion.biblionumber %]
118 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
126 <span class="label">Author:</span>
130 [% IF ( copyrightdate ) %]
132 <span class="label">Copyright date:</span>
133 [% copyrightdate | html %]
138 <span class="label">ISBN or ISSN or other standard number:</span>
142 [% IF ( publishercode ) %]
144 <span class="label">Publisher:</span>
145 [% publishercode | html %]
150 <span class="label">Publication place:</span>
154 [% IF ( collectiontitle ) %]
156 <span class="label">Collection title:</span>
157 [% collectiontitle | html %]
160 [% IF ( itemtype ) %]
162 <span class="label">Document type:</span>
163 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
166 [% IF ( patron_reason_loop ) %]
168 <span class="label">Reason for suggestion: </span>
169 [% FOREACH patron_reason_loo IN patron_reason_loop %]
170 [% IF patron_reason_loo.authorised_value == patronreason %]
171 [% patron_reason_loo.lib | html %]
178 <span class="label">Notes:</span>
182 [% IF ( staff_note ) %]
184 <span class="label">Notes:</span>
185 [% staff_note | html %]
191 <fieldset class="rows">
192 <legend>Suggestion management</legend>
195 <span class="label">Status:</span>
196 [% SET status_found = 0 %]
197 [% IF ( STATUS == 'ASKED' ) %]
199 [% SET status_found = 1 %]
200 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
201 <span>Accepted</span>
202 [% SET status_found = 1 %]
203 [% ELSIF ( STATUS == 'CHECKED' ) %]
205 [% SET status_found = 1 %]
206 [% ELSIF ( STATUS == 'REJECTED' ) %]
207 <span>Rejected</span>
208 [% SET status_found = 1 %]
209 [% ELSIF ( STATUS == 'ORDERED' ) %]
211 [% SET status_found = 1 %]
212 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
213 <span>Available</span>
214 [% SET status_found = 1 %]
216 [% FOREACH s IN SuggestionStatuses %]
217 [% IF STATUS == s.authorised_value %]
219 [% SET status_found = 1 %]
225 <span class="label">Reason:</span>
227 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
242 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
243 <td>[% suggesteddate | $KohaDates %]</td>
245 [% IF ( suggestedby_patron.borrowernumber ) %]
246 <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>
247 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
253 <td>[% manageddate | $KohaDates %]</td>
255 [% IF ( managedby_patron.borrowernumber ) %]
256 <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>
257 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
262 <th>Accepted on:</th>
263 <td>[% accepteddate | $KohaDates %]</td>
265 [% IF ( acceptedby_patron.borrowernumber ) %]
266 <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>
267 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
272 <th>Last modification on:</th>
273 <td>[% lastmodificationdate | $KohaDates %]</td>
275 [% IF ( lastmodificationby_patron.borrowernumber ) %]
276 <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>
277 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
285 <fieldset class="rows">
286 <legend>Acquisition information</legend>
289 <span class="label">Library:</span>
290 [% Branches.GetName( branchcode ) | html %]
293 <span class="label">Fund:</span>
294 [% budgetname | html %]
297 <span class="label">Copies:</span>
298 [% quantity | html %]
301 <span class="label">Currency:</span>
302 [% currency | html %]
305 <span class="label">Price:</span>
309 <span class="label">Total</span>
315 <fieldset class="action">
316 <a href="suggestion.pl"><< Back to suggestions</a>
319 </div> <!-- /.col-md-8 col-md-offset-2 -->
320 </div> <!-- /.row -->
321 [% ELSE # IF op == "show" %]
323 [% IF op == 'save' %]
324 <div class="main container-fluid">
326 <div class="col-md-8 col-md-offset-2">
327 [% INCLUDE 'messages.inc' %]
329 <div class="main container-fluid">
331 <div class="col-sm-10 col-sm-push-2">
332 [% INCLUDE 'messages.inc' %]
335 [% IF op == 'save' %]
336 [% FOR m IN messages %]
337 <div class="dialog [% m.type | html %]">
339 [% CASE 'biblio_exists' %]
340 <span>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.</span>
341 [% CASE 'manager_not_enough_permissions' %]
342 <span>The manager you selected does not have sufficient permissions.</span>
344 <span>[% m.code | html %]</span>
346 </div> <!-- /.dialog -->
349 <form id="add_edit" action="suggestion.pl" method="post" class="validated">
350 [% INCLUDE 'csrf-token.inc' %]
351 <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
352 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
353 [% IF ( suggestionid ) %]
354 <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
355 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
357 <h1>Enter a new purchase suggestion</h1>
360 <fieldset class="rows">
361 <legend>Bibliographic information</legend>
364 <label for="title" class="required">Title:</label>
365 <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
366 <span class="required">Required</span>
369 <label for="author">Author:</label>
370 <input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/>
373 <label for="copyrightdate">Copyright date:</label>
374 <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" />
377 <label for="isbn">ISBN or ISSN or other standard number:</label>
378 <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn | html %]"/>
381 <label for="publishercode">Publisher:</label>
382 <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/>
385 <label for="place">Publication place:</label>
386 <input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/>
389 <label for="collectiontitle">Collection title:</label>
390 <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/>
393 <label for="itemtype">Document type:</label>
394 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size=20, default=itemtype, empty=1 %]
396 [% IF patron_reason_loop %]
398 <label for="patronreason">Reason for suggestion: </label>
399 <select name="patronreason" id="patronreason">
400 <option value=""> -- Choose -- </option>
401 [% FOREACH patron_reason_loo IN patron_reason_loop %]
402 [% IF patron_reason_loo.authorised_value == patronreason %]
403 <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
405 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
410 [% END # /IF patron_reason_loop %]
412 <label for="note">Notes:</label>
413 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
416 <label for="note">Non-public notes:</label>
417 <textarea name="staff_note" id="staff_note" rows="5" cols="40">[% staff_note | html %]</textarea>
422 <fieldset class="rows">
423 <legend>Suggestion management</legend>
425 [% IF ( suggestionid ) %]
427 <label for="STATUS">Status:</label>
428 <select id="STATUS" name="STATUS">
429 <option value="">No status</option>
431 [% IF (statusselected_ASKED ) %]
432 <option value="ASKED" selected="selected">Pending</option>
434 <option value="ASKED">Pending</option>
437 [% IF (statusselected_ACCEPTED ) %]
438 <option value="ACCEPTED" selected="selected">Accepted</option>
440 <option value="ACCEPTED">Accepted</option>
443 [% IF (statusselected_CHECKED ) %]
444 <option value="CHECKED" selected="selected">Checked</option>
446 <option value="CHECKED">Checked</option>
449 [% IF ( statusselected_REJECTED ) %]
450 <option value="REJECTED" selected="selected">Rejected</option>
452 <option value="REJECTED">Rejected</option>
455 [% IF ( statusselected_ORDERED ) %]
456 <option value="ORDERED" selected="selected">Ordered</option>
458 <option value="ORDERED">Ordered</option>
461 [% FOREACH s IN SuggestionStatuses %]
462 [% IF s.authorised_value == suggestion.STATUS %]
463 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
465 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
471 <label for="reason">Reason:</label>
472 <select class="select-reason" id="reason" name="reason">
473 <option value=""> -- Choose a reason -- </option>
474 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
475 [% IF (reasonsloo.lib == suggestion.reason) %]
476 <option value="[% reasonsloo.lib | html %]" selected="selected">[% reasonsloo.lib | html %]</option>
478 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
481 <option value="other">Others...</option>
484 <span id="other_reason" name="other_reason">
485 [% IF other_reason %]
486 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
488 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
490 <a href="#back">Cancel</a>
507 <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
510 <input type="text" id="suggesteddate" name="suggesteddate" class="flatpickr" size="10" maxlength="10" value="[% suggesteddate | html %]"/> [% INCLUDE 'date-format.inc' %]
512 <td id="tdsuggestedby">
513 <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
514 [% IF ( suggestedby_patron.borrowernumber ) %]
515 <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 %])
519 <a href="#patron_search_modal_suggester" id="edit_suggester" class="btn btn-default" data-toggle="modal">Set to patron</a>
524 <label for="accepteddate">Accepted on:</label>
527 <input type="text" id="accepteddate" name="accepteddate" class="flatpickr" size="10" maxlength="10" value="[% accepteddate | html %]" />[% INCLUDE 'date-format.inc' %]
530 <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
531 [% IF ( acceptedby_patron.borrowernumber ) %]
532 <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>
533 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
540 <label for="lastmodificationdate">Last modification on:</label>
543 [% lastmodificationdate | $KohaDates %]
546 [% IF lastmodificationby_patron %]
547 [% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
556 <label for="managedon">Managed on:</label>
557 <input type="text" id="managedon" name="manageddate" class="flatpickr" size="10" maxlength="10" value="[% manageddate | html %]" />[% INCLUDE 'date-format.inc' %]
560 <label for="managedby_name">by:</label>
562 <span id="managedby_name" name="managedby_name">
563 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
565 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
566 | 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 %])
569 <a href="#patron_search_modal_manager" id="edit_manager" data-toggle="modal"><i class="fa fa-search"></i> Select manager</a>
570 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
571 <a id="restore_previous_manager" href="#"><i class="fa fa-trash-can"></i> Keep existing manager</a>
573 <input type="hidden" name="managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" />
576 <label for="notify">Notify manager:</label>
577 <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." />
583 <fieldset class="rows">
584 <legend>Acquisition information</legend>
587 <label for="branchcode">Library:</label>
588 <select name="branchcode" id="branchcode">
589 <option value="">Any</option>
590 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
594 <label for="budgetid">Fund:</label>
595 <select name="budgetid" id="budgetid">
596 <option value="">Any</option>
597 [% FOREACH budget IN sugg_budgets %]
598 [% IF ( budget.selected ) %]
599 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
600 [% ELSIF ( budget.b_active ) %]
601 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
603 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
607 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
608 <input type="checkbox" id="showallfunds" />
611 <label for="quantity">Copies:</label>
612 <input type="text" size="10" id="quantity" name="quantity" value="[% quantity | html %]" />
615 <label for="currency">Currency:</label>
616 [% FOREACH c IN currencies %]
617 <input type="hidden" value="[% c.rate | html %]" id="currency_rate_[% c.currency | html %]" name="currency_rate_[% c.currency | html %]" />
618 <input type="hidden" id="[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" />
620 <select name="currency" id="currency">
621 [% FOREACH c IN currencies %]
622 [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
623 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
624 [% ELSIF not c.archived %]
625 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
631 <label for="price">Price:</label>
632 <input class="decimal" type="text" size="20" name="price" id="price" value="[% price | $Price on_editing => 1 %]" />
635 <label for="total">Total: </label>
636 <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total | html %]"/>
639 </fieldset> <!-- /.rows -->
641 <fieldset class="action">
642 <input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
643 [% IF ( suggestionid ) %]
644 <input type="hidden" name="op" value="cud-save" />
645 [% IF ( need_confirm ) %]
646 <input type="hidden" name="save_confirmed" value="1" />
647 <input type="submit" class="btn btn-primary" value="Confirm your suggestion" />
649 <input type="submit" class="btn btn-primary" value="Save" />
651 <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
653 <input type="hidden" name="op" value="cud-save" />
654 [% IF ( need_confirm ) %]
655 <input type="hidden" name="save_confirmed" value="1" />
656 <input type="submit" class="btn btn-primary" value="Confirm your suggestion" />
658 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
660 <a class="cancel" href="suggestion.pl">Cancel</a>
662 </fieldset> <!-- /.action -->
663 </form> <!-- /#add_edit -->
666 [% IF op == 'else' %]
667 <div id="toolbar" class="btn-toolbar">
668 <a class="btn btn-default" id="newsuggestion" href="suggestion.pl?op=add_form&branchcode=[% branchcode | uri %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
671 <h1>Suggestions management</h1>
673 [% IF ( displayby != "branchcode" ) %]
674 <label for="branchcode">Viewing suggestions for library:</label>
675 <select name="branchcode" id="branchcode">
676 <option value="__ANY__">Any</option>
677 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
681 [% FOR m IN messages %]
682 <div class="dialog [% m.type | html %]">
684 [% CASE 'already_exists' %]
685 <span>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>)</span>
686 [% CASE 'biblio_exists' %]
687 <span>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.</span>
689 <span>[% m.code | html %]</span>
691 </div> <!-- /.dialog -->
694 [% WRAPPER tabs id= "suggestiontabs" %]
695 [% WRAPPER tabs_nav %]
696 [% FOREACH suggestion IN suggestions %]
697 [% WRAPPER tab_item tabname= suggestion.suggestiontype %]
698 [% IF ( suggestion.suggestiontypelabel ) %]
699 [% IF (suggestion.suggestiontypelabel == "Pending") %]<span>Pending</span>
700 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]<span>Accepted</span>
701 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]<span>Checked</span>
702 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]<span>Rejected</span>
703 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]<span>Available</span>
704 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]<span>Ordered</span>
705 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]<span>Status unknown</span>
706 [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]<span>Any</span>
707 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
709 [% IF ( suggestion.suggestiontype ) %]
710 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
715 ([% suggestion.suggestions.size| html %])
717 [% END # /FOREACH suggestion %]
718 [% END # /WRAPPER tabs_nav %]
720 [% WRAPPER tab_panels %]
721 [% FOREACH suggestion IN suggestions %]
722 [% WRAPPER tab_panel tabname= suggestion.suggestiontype %]
723 <form id="action_form" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl">
724 [% INCLUDE 'csrf-token.inc' %]
725 <input type="hidden" name="op" value="cud-" />[%# filled by click event %]
726 <input type="hidden" name="suggestionid" value="" />
728 <form class="update_suggestions" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
729 [% INCLUDE 'csrf-token.inc' %]
730 <input type="hidden" name="op" value="cud-" />[%# filled by submit %]
732 [% IF suggestion.suggestions.size %]
734 <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
737 <table id="table_[% loop.count | html %]" class="sorted">
740 <th class="NoSort noExport"> </th>
741 <th class="anti-the">Suggestion</th>
742 <th>Suggested by</th>
743 <th>Suggester category</th>
744 <th>Suggested on</th>
745 <th>Patron reason</th>
748 <th>Last modification by</th>
749 <th>Last modification on</th>
750 <th>Last updated</th>
753 <th>Non-public note</th>
755 <th class="NoSort noExport"> </th>
759 [% FOREACH s IN suggestion.suggestions %]
762 <input type="checkbox" name="suggestionid" value="[% s.suggestionid | html %]" />
765 <a href="suggestion.pl?suggestionid=[% s.suggestionid | uri %]&op=show" title="suggestion" >
766 [% s.title | html %][% IF ( s.author ) %], by [% s.author | html %][% END %]
769 [% IF ( s.copyrightdate ) %]
770 © <span class="suggestion_copyrightdate">[% s.copyrightdate | html %]</span>
772 [% IF ( s.volumedesc ) %]
773 ; <span class="suggestion_volume">Volume:<em>[% s.volumedesc | html %]</em></span>
776 ; <span class="suggestion_isbn">ISBN: <em>[% s.isbn | html %]</em></span>
778 [% IF ( s.publishercode ) %]
779 ; <span class="suggestion_publishercode">Published by [% s.publishercode | html %]</span>
781 [% IF ( s.publicationyear ) %]
782 in <span class="suggestion_publicationyear"><em>[% s.publicationyear | html %]</em></span>
785 in <span class="suggestion_place"><em>[% s.place | html %]</em></span>
787 [% IF ( s.collectiontitle ) %]
788 ; <span class="suggestion_collectiontitle">[% s.collectiontitle | html %]</span>
790 [% IF ( s.itemtype ) %]
791 ; <span class="suggestion_itype">[% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', s.itemtype, 0 ) | html %]</span>
795 <div class="suggestion_note"><i class="fa fa-comment"></i> [% s.note | html %]</div>
798 <br /><i class="fa fa-archive"></i> Archived
802 [% SET suggester = s.suggester %]
803 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggester.borrowernumber | uri %]">[% suggester.surname | html %][% IF suggester.firstname %], [% suggester.firstname | html %][% END %] [% IF suggester.cardnumber %]([% suggester.cardnumber | html %])[% END %]</a>
806 [% suggester.category.description | html %]
808 <td data-order="[% s.suggesteddate | html %]">
809 [% IF ( s.suggesteddate ) %][% s.suggesteddate | $KohaDates %][% END %]
811 <td>[% AuthorisedValues.GetByCode( 'OPAC_SUG', s.patronreason ) | html %]</td>
813 [% SET manager = s.manager %]
814 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% manager.borrowernumber | uri %]">[% manager.surname | html %][% IF manager.firstname %], [% manager.firstname | html %][% END %]</a>
816 <td data-order="[% s.manageddate | html %]">
817 [% IF ( s.manageddate ) %][% s.manageddate | $KohaDates %][% END %]
820 [% SET last_modifier = s.last_modifier %]
821 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% last_modifier.borrowernumber | uri %]">[% last_modifier.surname | html %][% IF last_modifier.firstname %], [% last_modifier.firstname | html %][% END %]</a>
823 <td data-order="[% s.lastmodificationdate | html %]">
824 [% IF ( s.lastmodificationdate ) %][% s.lastmodificationdate | $KohaDates %][% END %]
827 [% s.lastmodificationdate | $KohaDates %]
830 [% Branches.GetName( s.branchcode ) | html %]
833 [% s.fund.budget_name | html %]
836 [% s.staff_note | html %]
839 [% IF s.STATUS == 'ASKED' %]
841 [% ELSIF s.STATUS == 'ACCEPTED' %]
842 <span>Accepted</span>
843 [% ELSIF s.STATUS == 'ORDERED' %]
845 [% ELSIF s.STATUS == 'REJECTED' %]
846 <span>Rejected</span>
847 [% ELSIF s.STATUS == 'CHECKED' %]
849 [% ELSIF s.STATUS == 'AVAILABLE' %]
850 <span>Available</span>
851 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) %]
852 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) | html %]
854 <span>Status unknown</span>
857 [% IF ( s.reason ) %]
858 <br />([% s.reason | html %])
862 <div class="btn-group dropup">
863 <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% s.suggestionid | html %]&op=edit_form"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% s.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
864 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% s.suggestionid | html %]">
866 <button data-op="cud-delete" data-suggestionid="[% s.suggestionid | html %]" class="btn btn-default trigger_action">Delete</button>
868 [% UNLESS s.archived %]
870 <button class="btn btn-default trigger_action" data-op="cud-archive" data-suggestionid="[% s.suggestionid | html %]">Archive</button>
874 <button class="btn btn-default trigger_action" data-op="cud-unarchive" data-suggestionid="[% s.suggestionid | html %]">Unarchive</button>
881 [% END # /FOREACH s %]
883 </table> <!-- /#table_[% loop.count | html %] -->
886 <div class="col-sm-12">
887 <h2>Change selected suggestions</h2>
890 <div class="suggestions_batch_ops row">
891 <div class="col-sm-4">
892 <fieldset class="brief">
893 <div id="select-reason[% loop.index | html %]">
894 <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label>
895 <select name="STATUS" id="STATUSreason[% loop.index | html %]">
896 <option value=""> -- Choose a status --</option>
898 [% IF (statusselected_ASKED ) %]
899 <option value="ASKED" selected="selected">Pending</option>
901 <option value="ASKED">Pending</option>
904 [% IF (statusselected_ACCEPTED ) %]
905 <option value="ACCEPTED" selected="selected">Accepted</option>
907 <option value="ACCEPTED">Accepted</option>
910 [% IF (statusselected_CHECKED ) %]
911 <option value="CHECKED" selected="selected">Checked</option>
913 <option value="CHECKED">Checked</option>
916 [% IF ( statusselected_REJECTED ) %]
917 <option value="REJECTED" selected="selected">Rejected</option>
919 <option value="REJECTED">Rejected</option>
922 [% IF ( statusselected_ORDERED ) %]
923 <option value="ORDERED" selected="selected">Ordered</option>
925 <option value="ORDERED">Ordered</option>
928 [% FOREACH s IN SuggestionStatuses %]
929 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
933 <label for="choosereason[% loop.index | html %]">with this reason:</label>
934 <select name="reason" id="choosereason[% loop.index | html %]">
935 <option value=""> -- Choose a reason -- </option>
936 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
937 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
939 <option value="other">Others...</option>
942 <span class="other_reason">
943 <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
944 <a href="#" class="cancel_note">Cancel</a>
949 <fieldset class="action">
950 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
951 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
952 <button type="submit" data-op="cud-update_status" class="btn btn-primary">Submit</button>
954 </div> <!-- /.col-sm-4 -->
956 <div class="col-sm-2">
957 <fieldset class="brief">
958 <label id="suggestion_itemtype">
959 Update item types with:
961 [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %]
963 <fieldset class="action">
964 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
965 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
966 <button type="submit" data-op="cud-update_itemtype" class="btn btn-primary">Submit</button>
968 </div> <!-- /.col-sm-4 -->
970 <div class="col-sm-2">
971 <fieldset class="brief">
972 <span class="label">Update manager</span>
973 <a href="#patron_search_modal_manager_[% loop.count | uri %]" id="set_manager_[% loop.count | uri %]" data-tab="[% loop.count | uri %]" class="set_manager" data-toggle="modal"><i class="fa fa-search"></i> Select manager</a>
974 <span id="managedby_name[% loop.count | html %]"></span>
976 <fieldset class="action">
977 <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
978 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
979 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
980 <button type="submit" data-op="cud-update_manager" class="btn btn-primary">Submit</button>
982 </div> <!-- /.col-sm-2 -->
984 <div class="col-sm-2">
985 <fieldset class="brief">
986 <span class="label">Delete selected</span>
988 <fieldset class="action">
989 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
990 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
991 <button type="submit" data-op="cud-delete" class="btn btn-primary">Delete</button>
993 </div> <!-- /.col-sm-2 -->
994 <div class="col-sm-2">
995 <fieldset class="brief">
996 <span class="label">Archive selected</span>
997 <fieldset class="action">
998 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
999 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
1000 <button type="submit" data-op="cud-archive" class="btn btn-primary">Archive</button>
1003 </div> <!-- /.col-sm-2 -->
1004 </div> <!-- /.row -->
1007 <strong>No results.</strong>
1008 [% END # /IF ( suggestion.suggestions_loop ) %]
1009 </form> <!-- /.update_suggestions -->
1010 [% END # /tab_panel# %]
1011 [% END # /FOREACH suggestion %]
1012 [% END # /WRAPPER tab_panels %]
1013 [% END # /WRAPPER tabs %]
1014 [% END # /IF op == 'else' %]
1016 [% UNLESS op == 'save' %]
1017 [% UNLESS ( op == 'show' ) %]
1018 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1020 <div class="col-sm-2 col-sm-pull-10">
1022 <form name="suggestionfilter" action="suggestion.pl" method="get">
1023 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1024 <fieldset class="brief">
1025 <h4>Organize by:</h4>
1028 <label for="displayby" class="sr-only">Organize by: </label>
1029 <select name="displayby" id="displayby">
1030 [% IF ( displayby == "STATUS" ) %]
1031 <option value="STATUS" selected="selected">Status</option>
1033 <option value="STATUS">Status</option>
1035 [% IF ( displayby == "branchcode" ) %]
1036 <option value="branchcode" selected="selected">Library</option>
1038 <option value="branchcode">Library</option>
1040 [% IF ( displayby == "itemtype" ) %]
1041 <option value="itemtype" selected="selected">Item type</option>
1043 <option value="itemtype">Item type</option>
1045 [% IF ( displayby == "managedby" ) %]
1046 <option value="managedby" selected="selected">Managed by</option>
1048 <option value="managedby">Managed by</option>
1050 [% IF ( displayby == "acceptedby" ) %]
1051 <option value="acceptedby" selected="selected">Accepted by</option>
1053 <option value="acceptedby">Accepted by</option>
1058 </fieldset> <!-- /.brief -->
1059 <fieldset class="action">
1060 <input type="submit" class="btn btn-primary" value="Go" />
1063 <fieldset class="brief">
1064 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
1067 <h4 class="local_collapse"><a href="#" data-target="biblio_information">Bibliographic information</a></h4>
1068 <fieldset class="brief biblio_information">
1071 <label for="title"> Title:</label>
1072 <input type="text" id="title" name="title" value="[% title | html %]" />
1075 <label for="author"> Author:</label>
1076 <input type="text" id="author" name="author" value="[% author | html %]" />
1079 <label for="isbn"> ISBN:</label>
1080 <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" />
1083 <label for="publishercode"> Publisher:</label>
1084 <input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" />
1087 <label for="copyrightdate_filter"> Copyright date:</label>
1088 <input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" />
1091 <label for="collectiontitle"> Collection title:</label>
1092 <input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" />
1095 </fieldset> <!-- /.biblio_information -->
1096 <fieldset class="action biblio_information">
1097 <input type="submit" value="Go" />
1100 <h4 class="local_collapse"><a href="#" data-target="suggestion_information">Suggestion information</a></h4>
1101 <fieldset class="brief suggestion_information">
1104 <label for="STATUS[% loop.index | html %]"> Status:</label>
1105 <select name="STATUS" id="STATUS[% loop.index | html %]">
1106 <option value="">Any</option>
1107 [% IF (statusselected_ASKED ) %]
1108 <option value="ASKED" selected="selected">Pending</option>
1110 <option value="ASKED">Pending</option>
1113 [% IF (statusselected_ACCEPTED ) %]
1114 <option value="ACCEPTED" selected="selected">Accepted</option>
1116 <option value="ACCEPTED">Accepted</option>
1119 [% IF (statusselected_CHECKED ) %]
1120 <option value="CHECKED" selected="selected">Checked</option>
1122 <option value="CHECKED">Checked</option>
1125 [% IF ( statusselected_REJECTED ) %]
1126 <option value="REJECTED" selected="selected">Rejected</option>
1128 <option value="REJECTED">Rejected</option>
1131 [% IF ( statusselected_ORDERED ) %]
1132 <option value="ORDERED" selected="selected">Ordered</option>
1134 <option value="ORDERED">Ordered</option>
1137 [% FOREACH s IN SuggestionStatuses %]
1138 [% IF s.authorised_value == selected_status %]
1139 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1141 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1148 <label for="suggestedby"> Suggested by:</label>
1149 <select id="suggestedby" name="suggestedby">
1150 <option value="">Any</option>
1151 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1152 [% IF ( suggestedby_loo.selected ) %]
1153 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1155 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1161 <label for="suggesteddate_from">Suggested date from:</label>
1162 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" data-date_to="suggesteddate_to" class="flatpickr" />
1165 <label for="suggesteddate_to">To:</label>
1166 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" class="flatpickr" />
1169 <label for="managedby"> Managed by:</label>
1170 <select id="managedby" name="managedby">
1171 <option value="">Any</option>
1172 [% FOREACH managedby_loo IN managedby_loop %]
1173 [% IF ( managedby_loo.selected ) %]
1174 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1176 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1182 <label for="manageddate_from">Management date from:</label>
1183 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" data-date_to="manageddate_to" class="flatpickr" />
1186 <label for="manageddate_to">To:</label>
1187 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" class="flatpickr" />
1190 <label for="acceptedby"> Accepted by:</label>
1191 <select id="acceptedby" name="acceptedby">
1192 <option value="">Any</option>
1193 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1194 [% IF ( acceptedby_loo.selected ) %]
1195 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1197 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1203 <label for="accepteddate_from">Accepted date from:</label>
1204 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" data-date_to="accepteddate_to" class="flatpickr" />
1207 <label for="accepteddate_to">To:</label>
1208 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" class="flatpickr" />
1211 </fieldset> <!-- /#suggestion_information -->
1212 <fieldset class="action suggestion_information">
1213 <input type="submit" value="Go" />
1216 <h4 class="local_collapse">
1217 <a href="#" data-target="acquisition_information">Acquisition information</a>
1219 <fieldset class="brief acquisition_information">
1222 <label for="budgetid"> Book fund:</label>
1223 <select name="budgetid" id="budgetid">
1224 <option value="__ANY__">Any</option>
1225 [% IF budgetid == '__NONE__' %]
1226 <option value="__NONE__" selected="selected">None</option>
1228 <option value="__NONE__">None</option>
1230 [% FOREACH budgetsloo IN budgetsloop %]
1231 [% IF ( budgetsloo.selected ) %]
1232 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1234 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1240 </fieldset> <!-- /#acquisition_information -->
1241 <fieldset class="action acquisition_information">
1242 <input type="submit" value="Go" />
1245 <div id="filter_archived_information">
1248 <label for="archived" style="display: inline;">Include archived:</label>
1249 [% IF filter_archived %]
1250 <input type="checkbox" id="archived" value="1" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1252 <input type="checkbox" id="archived" value="1" name="filter_archived" title="Include archived suggestions in the search" />
1257 </div> <!-- /#limits -->
1258 </fieldset> <!-- /.brief -->
1259 </form> <!-- /suggestionsfilter -->
1261 [% INCLUDE 'acquisitions-menu.inc' %]
1264 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1265 [% END # /UNLESS ( op == 'show' ) %]
1266 [% END # /UNLESS op == 'save' %]
1267 </div> <!-- /.row -->
1269 [% END # /IF op == "show" %]
1271 [% MACRO jsinclude BLOCK %]
1272 [% INCLUDE 'calendar.inc' %]
1276 function select_manager(borrowernumber, borrower) {
1277 var managedby_name = $("#managedby_name"+tab);
1278 var managedby = $("#managedby"+tab);
1279 managedby_name.empty();
1281 var borrowername = borrower.firstname + ' ' + borrower.surname;
1282 if (borrowernumber) {
1283 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1284 + '?borrowernumber=' + borrowernumber + '">'
1285 + borrowername + '</a>';
1286 managedby_name.html(managerlink);
1287 managedby.val(borrowernumber);
1290 [% IF op == "save" %]
1291 var notify = $('#notify');
1292 if ( notify.length ) {
1293 [% IF managedby_patron %]
1294 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1296 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1298 $(notify).prop('checked', false).prop('disabled', true);
1300 $(notify).prop('disabled', false);
1306 function select_suggester(borrowernumber, borrower) {
1309 url: '/api/v1/patrons/' + borrowernumber,
1311 "x-koha-embed": "+strings"
1313 success: function (data) {
1314 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + data.borrowernumber + '" />';
1315 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + data.borrowernumber + '">';
1316 suggested += data.surname.escapeHtml() + ', ' + data.firstname.escapeHtml() + ' (' + data.cardnumber.escapeHtml() + ')';
1317 suggested += '</a> ';
1318 suggested += data._strings.library_id.str.escapeHtml() + ' (' + data._strings.category_id.str.escapeHtml() + ')';
1319 $("#tdsuggestedby").html(suggested);
1322 error: function (data) {
1323 alert(_("Cannot retrieve info for this patron."));
1330 [% IF ( op == 'show' || op == 'else' ) %]
1332 $(document).ready(function(){
1333 $(".deletesuggestion").on("click",function(){
1334 return confirm(_("Are you sure you want to delete this suggestion?"));
1339 [% IF op == 'else' %]
1340 [% INCLUDE 'datatables.inc' %]
1341 [% INCLUDE 'columns_settings.inc' %]
1343 $(document).ready(function() {
1344 if( $("#suggestiontabs .tab-pane.active").length < 1 ){
1345 $("#suggestiontabs a:first").tab("show");
1348 var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1349 var saved_table = localStorage.getItem("DataTables_suggestions_/cgi-bin/koha/suggestion/suggestion.pl");
1350 var updated_settings = get_columns_saved_state(saved_table, table_settings);
1352 [% FOREACH suggestion IN suggestions %]
1353 [% IF suggestion.suggestions.size %]
1354 KohaTable("table_[% loop.count| html %]", {
1355 "sorting": [[ 4, "asc" ]],
1358 }, updated_settings );
1362 $("#branchcode").on('change',function(){
1363 [%# Modify the hidden input in the filters block from the library %]
1364 [%# dropdown list at the top of suggestion list %]
1365 let branchcode = $(this).val();
1366 $('input[name="branchcode"]').val( branchcode );
1367 $('form[name="suggestionfilter"]').submit();
1370 $(".checkall").click(function(e){
1372 $(this).parents('form').find("input:checkbox").each(function(){
1373 $(this).prop("checked", true);
1376 $(".uncheckall").click(function(e){
1378 $(this).parents('form').find("input:checkbox").each(function(){
1379 $(this).prop("checked", false);
1382 $(".other_reason").hide();
1383 $("select[name='reason']").change(function(){
1384 if($(this).val() == "other"){
1386 $(this).siblings(".other_reason").show();
1390 $("a.cancel_note").click(function(e) {
1391 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1392 $(this).siblings("input[name='other_reason']").hide();
1396 $("h4.local_collapse a").on("click", function(e){
1398 const target = $(this).data("target");
1399 $("." + target).toggle();
1402 $("button.trigger_action").on("click", function(e) {
1403 var id = $(this).data('suggestionid');
1404 var op = $(this).data('op');
1405 if ( op == 'cud-delete' && !confirm(_("Are you sure you want to delete this suggestion?")) ) {
1409 $('#action_form input[name="op"]').val(op);
1410 $('#action_form input[name="suggestionid"]').val(id);
1411 $('#action_form').submit();
1415 $("form.update_suggestions button[type='submit']").on("click", function(e) {
1416 var submit_button = this;
1417 var op = $(submit_button).data('op');
1418 var selected_suggestions = $('form.update_suggestions').find("input[type='checkbox'][name='suggestionid']:checked");
1420 if ( selected_suggestions.length == 0 ) {
1421 alert(_("Please select at least one suggestion"));
1426 if ( op === "cud-delete" ) {
1427 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1431 } else if ( op === "cud-update_manager" ) {
1432 var managedby = $(submit_button).siblings("suggestion_managedby");
1433 if ( managedby.val() == "" ) {
1434 alert(_("Please select a manager to assign to the selected suggestions"));
1439 $("form.update_suggestions input[name='op']").val(op);
1445 [% IF op == 'save' %]
1448 $(document).ready(function(){
1450 $("#quantity,#price,#currency").on("change",function(){
1454 [% IF other_reason %]
1455 $(".select-reason").hide();
1456 $(".select-reason").find("option[value='other']").attr("selected","selected");
1457 $("#other_reason").show();
1459 $("#other_reason").hide();
1461 $(".select-reason").change(function(){
1462 if($(this).val() == "other"){
1464 $("#other_reason").show();
1467 $("a[href*=back]").click(function(){
1468 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1469 $("#other_reason").hide();
1472 $("#restore_previous_manager").on("click",function(e){
1475 $("#managedby_name").empty();
1476 $("#managedby").val('');
1477 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1478 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1479 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1480 + borrowername + '</a>';
1481 $('#managedby_name').html(managerlink);
1482 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1483 $('#notify').prop('checked', false).prop('disabled', true);
1486 //keep a copy of all budgets before removing the inactives
1487 var budgetId = $("form#add_edit #budgetid");
1488 var disabledBudgetsCopy = budgetId.html();
1489 $('.b_inactive').remove();
1491 $('#showallfunds').click(function() {
1492 if ($(this).is(":checked")) {
1493 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1496 $('.b_inactive').remove();
1503 [% Asset.js("js/acq.js") | $raw %]
1504 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1506 [% INCLUDE 'select2.inc' %]
1507 [% SET columns = ['cardnumber','name','category','branch','action'] %]
1508 [% IF op == 'save' %]
1509 [% PROCESS patron_search_modal columns => columns, modal_title => t("Select suggester"), patron_search_modal_id => 'patron_search_modal_suggester', table_id => 'patron_search_modal_suggester_table' %]
1510 [% PROCESS patron_search_js columns => columns, actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_suggester_table', callback => 'select_suggester' %]
1511 [% PROCESS patron_search_modal columns => columns, modal_title => t("Select manager"), patron_search_modal_id => 'patron_search_modal_manager', table_id => 'patron_search_modal_manager_table' %]
1512 [% PROCESS patron_search_js columns => columns, filter => 'suggestions_managers', actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_manager_table', callback => 'select_manager' %]
1513 [% ELSIF op == 'else' %]
1514 [% FOREACH suggestion IN suggestions %]
1515 <script>tab = [% loop.count | html %];</script>
1516 [% PROCESS patron_search_modal columns => columns, modal_title => t("Select manager"), patron_search_modal_id => 'patron_search_modal_manager_' _ loop.count, table_id => 'patron_search_modal_manager_table_' _ loop.count %]
1517 [% PROCESS patron_search_js columns => columns, filter => 'suggestions_managers', actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_manager_table_' _ loop.count, callback => 'select_manager' %]
1523 [% INCLUDE 'intranet-bottom.inc' %]