4 [% USE AuthorisedValues %]
7 [% USE TablesSettings %]
8 [% PROCESS 'i18n.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>[% FILTER collapse %]
13 [% IF ( suggestionid ) %]
14 [% tx("Edit suggestion #{suggestion_number}", { suggestion_number = suggestionid }) | html %] ›
16 Add suggestion ›
18 [% ELSIF ( op == 'show' ) %]
19 [% tx("Show suggestion #{suggestion_number}", { suggestion_number = suggestionid }) | html %] ›
21 [% t("Suggestions") | html %] ›
22 [% t("Acquisitions") | html %] ›
23 [% t("Koha") | html %]
25 [% INCLUDE 'doc-head-close.inc' %]
31 text-decoration: none;
33 #limits fieldset.brief,
34 #limits fieldset.action {
55 <body id="acq_suggestion" class="acq">
56 [% WRAPPER 'header.inc' %]
57 [% INCLUDE 'cat-search.inc' %]
60 [% WRAPPER 'sub-header.inc' %]
61 [% WRAPPER breadcrumbs %]
62 [% WRAPPER breadcrumb_item %]
63 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
65 [% IF ( op == 'save' || op == 'show' ) %]
66 [% WRAPPER breadcrumb_item %]
67 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
71 [% IF ( suggestionid ) %]
72 [% WRAPPER breadcrumb_item bc_active= 1 %]
73 <span>Edit suggestion #[% suggestionid | html %]</span>
76 [% WRAPPER breadcrumb_item bc_active= 1 %]
77 <span>Add suggestion</span>
80 [% ELSIF ( op == 'show' ) %]
81 [% WRAPPER breadcrumb_item bc_active= 1 %]
82 <span>Show suggestion #[% suggestionid | html %]</span>
85 [% WRAPPER breadcrumb_item bc_active= 1 %]
86 <span>Suggestions management</span>
89 [% END #/ WRAPPER breadcrumbs %]
90 [% END #/ WRAPPER sub-header.inc %]
92 [% INCLUDE 'blocking_errors.inc' %]
94 [% IF ( op == 'show' ) %]
95 <div class="main container-fluid">
97 <div class="col-md-8 col-md-offset-2">
99 <div id="toolbar" class="btn-toolbar">
100 <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit&csrf_token=[% csrf_token | html %]&suggestionid=[% suggestionid | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
101 <a class="btn btn-default deletesuggestion" href="suggestion.pl?op=delete&csrf_token=[% csrf_token | html %]&suggestionid=[% suggestionid | html %]"><i class="fa fa-trash-can"></i> Delete</a>
104 <fieldset class="rows">
105 <legend>Bibliographic information</legend>
109 <span class="label">Title:</span>
110 [% IF suggestion.biblionumber %]
111 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
119 <span class="label">Author:</span>
123 [% IF ( copyrightdate ) %]
125 <span class="label">Copyright date:</span>
126 [% copyrightdate | html %]
131 <span class="label">ISBN or ISSN or other standard number:</span>
135 [% IF ( publishercode ) %]
137 <span class="label">Publisher:</span>
138 [% publishercode | html %]
143 <span class="label">Publication place:</span>
147 [% IF ( collectiontitle ) %]
149 <span class="label">Collection title:</span>
150 [% collectiontitle | html %]
153 [% IF ( itemtype ) %]
155 <span class="label">Document type:</span>
156 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
159 [% IF ( patron_reason_loop ) %]
161 <span class="label">Reason for suggestion: </span>
162 [% FOREACH patron_reason_loo IN patron_reason_loop %]
163 [% IF patron_reason_loo.authorised_value == patronreason %]
164 [% patron_reason_loo.lib | html %]
171 <span class="label">Notes:</span>
175 [% IF ( staff_note ) %]
177 <span class="label">Notes:</span>
178 [% staff_note | html %]
184 <fieldset class="rows">
185 <legend>Suggestion management</legend>
188 <span class="label">Status:</span>
189 [% SET status_found = 0 %]
190 [% IF ( STATUS == 'ASKED' ) %]
192 [% SET status_found = 1 %]
193 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
194 <span>Accepted</span>
195 [% SET status_found = 1 %]
196 [% ELSIF ( STATUS == 'CHECKED' ) %]
198 [% SET status_found = 1 %]
199 [% ELSIF ( STATUS == 'REJECTED' ) %]
200 <span>Rejected</span>
201 [% SET status_found = 1 %]
202 [% ELSIF ( STATUS == 'ORDERED' ) %]
204 [% SET status_found = 1 %]
205 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
206 <span>Available</span>
207 [% SET status_found = 1 %]
209 [% FOREACH s IN SuggestionStatuses %]
210 [% IF STATUS == s.authorised_value %]
212 [% SET status_found = 1 %]
218 <span class="label">Reason:</span>
220 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
235 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
236 <td>[% suggesteddate | $KohaDates %]</td>
238 [% IF ( suggestedby_patron.borrowernumber ) %]
239 <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>
240 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
246 <td>[% manageddate | $KohaDates %]</td>
248 [% IF ( managedby_patron.borrowernumber ) %]
249 <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>
250 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
255 <th>Accepted on:</th>
256 <td>[% accepteddate | $KohaDates %]</td>
258 [% IF ( acceptedby_patron.borrowernumber ) %]
259 <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>
260 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
265 <th>Last modification on:</th>
266 <td>[% lastmodificationdate | $KohaDates %]</td>
268 [% IF ( lastmodificationby_patron.borrowernumber ) %]
269 <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>
270 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
278 <fieldset class="rows">
279 <legend>Acquisition information</legend>
282 <span class="label">Library:</span>
283 [% Branches.GetName( branchcode ) | html %]
286 <span class="label">Fund:</span>
287 [% budgetname | html %]
290 <span class="label">Copies:</span>
291 [% quantity | html %]
294 <span class="label">Currency:</span>
295 [% currency | html %]
298 <span class="label">Price:</span>
302 <span class="label">Total</span>
308 <fieldset class="action">
309 <a href="suggestion.pl"><< Back to suggestions</a>
312 </div> <!-- /.col-md-8 col-md-offset-2 -->
313 </div> <!-- /.row -->
314 [% ELSE # IF op == "show" %]
316 [% IF op == 'save' %]
317 <div class="main container-fluid">
319 <div class="col-md-8 col-md-offset-2">
321 <div class="main container-fluid">
323 <div class="col-sm-10 col-sm-push-2">
326 [% IF op == 'save' %]
327 [% FOR m IN messages %]
328 <div class="dialog [% m.type | html %]">
330 [% CASE 'biblio_exists' %]
331 <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>
332 [% CASE 'manager_not_enough_permissions' %]
333 <span>The manager you selected does not have sufficient permissions.</span>
335 <span>[% m.code | html %]</span>
337 </div> <!-- /.dialog -->
340 <form id="add_edit" action="suggestion.pl" method="post" class="validated">
341 [% INCLUDE 'csrf-token.inc' %]
342 <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
343 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
344 [% IF ( suggestionid ) %]
345 <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
346 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
348 <h1>Enter a new purchase suggestion</h1>
351 <fieldset class="rows">
352 <legend>Bibliographic information</legend>
355 <label for="title" class="required">Title:</label>
356 <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
357 <span class="required">Required</span>
360 <label for="author">Author:</label>
361 <input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/>
364 <label for="copyrightdate">Copyright date:</label>
365 <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" />
368 <label for="isbn">ISBN or ISSN or other standard number:</label>
369 <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn | html %]"/>
372 <label for="publishercode">Publisher:</label>
373 <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/>
376 <label for="place">Publication place:</label>
377 <input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/>
380 <label for="collectiontitle">Collection title:</label>
381 <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/>
384 <label for="itemtype">Document type:</label>
385 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size=20, default=itemtype, empty=1 %]
387 [% IF patron_reason_loop %]
389 <label for="patronreason">Reason for suggestion: </label>
390 <select name="patronreason" id="patronreason">
391 <option value=""> -- Choose -- </option>
392 [% FOREACH patron_reason_loo IN patron_reason_loop %]
393 [% IF patron_reason_loo.authorised_value == patronreason %]
394 <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
396 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
401 [% END # /IF patron_reason_loop %]
403 <label for="note">Notes:</label>
404 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
407 <label for="note">Non-public notes:</label>
408 <textarea name="staff_note" id="staff_note" rows="5" cols="40">[% staff_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="flatpickr" size="10" maxlength="10" value="[% suggesteddate | html %]"/> [% 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="flatpickr" size="10" maxlength="10" value="[% accepteddate | html %]" />[% 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="flatpickr" size="10" maxlength="10" value="[% manageddate | html %]" />[% 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-can"></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 => 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 class="decimal" type="text" size="20" name="price" id="price" value="[% price | $Price on_editing => 1 %]" />
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 <fieldset class="action">
633 <input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
634 <input type="hidden" name="op" value="[% op | html %]" />
635 [% IF ( suggestionid ) %]
636 [% IF ( need_confirm ) %]
637 <input type="hidden" name="save_confirmed" value="1" />
638 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" class="btn btn-primary" value="Confirm your suggestion" />
640 <input type="submit" class="btn btn-primary" value="Save" />
642 <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
644 [% IF ( need_confirm ) %]
645 <input type="hidden" name="save_confirmed" value="1" />
646 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" class="btn btn-primary" value="Confirm your suggestion" />
648 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
650 <a class="cancel" href="suggestion.pl">Cancel</a>
652 </fieldset> <!-- /.action -->
653 </form> <!-- /#add_edit -->
654 [% END # /IF op == 'save' %]
656 [% IF op == 'else' %]
657 <div id="toolbar" class="btn-toolbar">
658 <a class="btn btn-default" id="newsuggestion" href="suggestion.pl?op=add&branchcode=[% branchcode | uri %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
661 <h1>Suggestions management</h1>
663 [% IF ( displayby != "branchcode" ) %]
664 <label for="branchcode">Viewing suggestions for library:</label>
665 <select name="branchcode" id="branchcode">
666 <option value="__ANY__">Any</option>
667 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
671 [% FOR m IN messages %]
672 <div class="dialog [% m.type | html %]">
674 [% CASE 'already_exists' %]
675 <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>
676 [% CASE 'biblio_exists' %]
677 <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>
679 <span>[% m.code | html %]</span>
681 </div> <!-- /.dialog -->
684 [% WRAPPER tabs id= "suggestiontabs" %]
685 [% WRAPPER tabs_nav %]
686 [% FOREACH suggestion IN suggestions %]
687 [% WRAPPER tab_item tabname= suggestion.suggestiontype %]
688 [% IF ( suggestion.suggestiontypelabel ) %]
689 [% IF (suggestion.suggestiontypelabel == "Pending") %]<span>Pending</span>
690 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]<span>Accepted</span>
691 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]<span>Checked</span>
692 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]<span>Rejected</span>
693 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]<span>Available</span>
694 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]<span>Ordered</span>
695 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]<span>Status unknown</span>
696 [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]<span>Any</span>
697 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
699 [% IF ( suggestion.suggestiontype ) %]
700 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
705 ([% suggestion.suggestions.size| html %])
707 [% END # /FOREACH suggestion %]
708 [% END # /WRAPPER tabs_nav %]
710 [% WRAPPER tab_panels %]
711 [% FOREACH suggestion IN suggestions %]
712 [% WRAPPER tab_panel tabname= suggestion.suggestiontype %]
713 <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
714 [% INCLUDE 'csrf-token.inc' %]
716 [% IF suggestion.suggestions.size %]
718 <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
721 <table id="table_[% loop.count | html %]" class="sorted">
724 <th class="NoSort noExport"> </th>
725 <th class="anti-the">Suggestion</th>
726 <th>Suggested by</th>
727 <th>Suggester category</th>
728 <th>Suggested on</th>
729 <th>Patron reason</th>
732 <th>Last modification by</th>
733 <th>Last modification on</th>
734 <th>Last updated</th>
737 <th>Non-public note</th>
739 <th class="NoSort noExport"> </th>
743 [% FOREACH s IN suggestion.suggestions %]
746 <input type="checkbox" name="suggestionid" value="[% s.suggestionid | html %]" />
749 <a href="suggestion.pl?suggestionid=[% s.suggestionid | uri %]&op=show" title="suggestion" >
750 [% s.title | html %][% IF ( s.author ) %], by [% s.author | html %][% END %]
753 [% IF ( s.copyrightdate ) %]
754 © <span class="suggestion_copyrightdate">[% s.copyrightdate | html %]</span>
756 [% IF ( s.volumedesc ) %]
757 ; <span class="suggestion_volume">Volume:<em>[% s.volumedesc | html %]</em></span>
760 ; <span class="suggestion_isbn">ISBN: <em>[% s.isbn | html %]</em></span>
762 [% IF ( s.publishercode ) %]
763 ; <span class="suggestion_publishercode">Published by [% s.publishercode | html %]</span>
765 [% IF ( s.publicationyear ) %]
766 in <span class="suggestion_publicationyear"><em>[% s.publicationyear | html %]</em></span>
769 in <span class="suggestion_place"><em>[% s.place | html %]</em></span>
771 [% IF ( s.collectiontitle ) %]
772 ; <span class="suggestion_collectiontitle">[% s.collectiontitle | html %]</span>
774 [% IF ( s.itemtype ) %]
775 ; <span class="suggestion_itype">[% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', s.itemtype, 0 ) | html %]</span>
779 <div class="suggestion_note"><i class="fa fa-comment"></i> [% s.note | html %]</div>
782 <br /><i class="fa fa-archive"></i> Archived
786 [% SET suggester = s.suggester %]
787 <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>
790 [% suggester.category.description | html %]
792 <td data-order="[% s.suggesteddate | html %]">
793 [% IF ( s.suggesteddate ) %][% s.suggesteddate | $KohaDates %][% END %]
795 <td>[% AuthorisedValues.GetByCode( 'OPAC_SUG', s.patronreason ) | html %]</td>
797 [% SET manager = s.manager %]
798 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% manager.borrowernumber | uri %]">[% manager.surname | html %][% IF manager.firstname %], [% manager.firstname | html %][% END %]</a>
800 <td data-order="[% s.manageddate | html %]">
801 [% IF ( s.manageddate ) %][% s.manageddate | $KohaDates %][% END %]
804 [% SET last_modifier = s.last_modifier %]
805 <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>
807 <td data-order="[% s.lastmodificationdate | html %]">
808 [% IF ( s.lastmodificationdate ) %][% s.lastmodificationdate | $KohaDates %][% END %]
811 [% s.lastmodificationdate | $KohaDates %]
814 [% Branches.GetName( s.branchcode ) | html %]
817 [% s.fund.budget_name | html %]
820 [% s.staff_note | html %]
823 [% IF s.STATUS == 'ASKED' %]
825 [% ELSIF s.STATUS == 'ACCEPTED' %]
826 <span>Accepted</span>
827 [% ELSIF s.STATUS == 'ORDERED' %]
829 [% ELSIF s.STATUS == 'REJECTED' %]
830 <span>Rejected</span>
831 [% ELSIF s.STATUS == 'CHECKED' %]
833 [% ELSIF s.STATUS == 'AVAILABLE' %]
834 <span>Available</span>
835 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) %]
836 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) | html %]
838 <span>Status unknown</span>
841 [% IF ( s.reason ) %]
842 <br />([% s.reason | html %])
846 <div class="btn-group dropup">
847 <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% s.suggestionid | html %]&csrf_token=[% csrf_token | html %]&op=edit"><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>
848 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% s.suggestionid | html %]">
849 <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% s.suggestionid | html %]&csrf_token=[% csrf_token | html %]"><i class="fa fa-trash-can"></i> Delete</a></li>
850 [% UNLESS s.archived %]
851 <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
853 <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li>
859 [% END # /FOREACH s %]
861 </table> <!-- /#table_[% loop.count | html %] -->
864 <div class="col-sm-12">
865 <h2>Change selected suggestions</h2>
868 <div class="suggestions_batch_ops row">
869 <div class="col-sm-4">
870 <fieldset class="brief">
871 <div id="select-reason[% loop.index | html %]">
872 <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label>
873 <select name="STATUS" id="STATUSreason[% loop.index | html %]">
874 <option value=""> -- Choose a status --</option>
876 [% IF (statusselected_ASKED ) %]
877 <option value="ASKED" selected="selected">Pending</option>
879 <option value="ASKED">Pending</option>
882 [% IF (statusselected_ACCEPTED ) %]
883 <option value="ACCEPTED" selected="selected">Accepted</option>
885 <option value="ACCEPTED">Accepted</option>
888 [% IF (statusselected_CHECKED ) %]
889 <option value="CHECKED" selected="selected">Checked</option>
891 <option value="CHECKED">Checked</option>
894 [% IF ( statusselected_REJECTED ) %]
895 <option value="REJECTED" selected="selected">Rejected</option>
897 <option value="REJECTED">Rejected</option>
900 [% IF ( statusselected_ORDERED ) %]
901 <option value="ORDERED" selected="selected">Ordered</option>
903 <option value="ORDERED">Ordered</option>
906 [% FOREACH s IN SuggestionStatuses %]
907 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
911 <label for="choosereason[% loop.index | html %]">with this reason:</label>
912 <select name="reason" id="choosereason[% loop.index | html %]">
913 <option value=""> -- Choose a reason -- </option>
914 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
915 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
917 <option value="other">Others...</option>
920 <span class="other_reason">
921 <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
922 <a href="#" class="cancel_note">Cancel</a>
926 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
927 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
929 <fieldset class="action">
930 <button type="submit" class="btn btn-primary" value="update_status">Submit</button>
932 </div> <!-- /.col-sm-4 -->
934 <div class="col-sm-2">
935 <fieldset class="brief">
936 <label id="suggestion_itemtype">
937 Update item types with:
939 [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %]
940 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
941 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
943 <fieldset class="action">
944 <button type="submit" class="btn btn-primary" value="update_itemtype">Submit</button>
946 </div> <!-- /.col-sm-4 -->
948 <div class="col-sm-2">
949 <fieldset class="brief">
950 <span class="label">Update manager</span>
951 <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>
952 <span id="managedby_name[% loop.count | html %]"></span>
953 <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
954 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
955 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
957 <fieldset class="action">
958 <button type="submit" class="btn btn-primary" value="update_manager">Submit</button>
960 </div> <!-- /.col-sm-2 -->
962 <div class="col-sm-2">
963 <fieldset class="brief">
964 <span class="label">Delete selected</span>
965 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
966 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
968 <fieldset class="action">
969 <button type="submit" class="btn btn-primary" value="delete">Delete</button>
971 </div> <!-- /.col-sm-2 -->
972 <div class="col-sm-2">
973 <fieldset class="brief">
974 <span class="label">Archive selected</span>
975 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
976 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
977 <fieldset class="action">
978 <button type="submit" class="btn btn-primary" value="archive">Archive</button>
981 </div> <!-- /.col-sm-2 -->
982 </div> <!-- /.row -->
985 <strong>No results.</strong>
986 [% END # /IF ( suggestion.suggestions_loop ) %]
987 </form> <!-- /.update_suggestions -->
988 [% END # /tab_panel# %]
989 [% END # /FOREACH suggestion %]
990 [% END # /WRAPPER tab_panels %]
991 [% END # /WRAPPER tabs %]
992 [% END # /IF op == 'else' %]
994 [% UNLESS op == 'save' %]
995 [% UNLESS ( op == 'show' ) %]
996 </div> <!-- /.col-sm-10.col-sm-push-2 -->
998 <div class="col-sm-2 col-sm-pull-10">
1000 <form name="suggestionfilter" action="suggestion.pl" method="get">
1001 [% INCLUDE 'csrf-token.inc' %]
1002 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1003 <fieldset class="brief">
1004 <h4>Organize by:</h4>
1007 <label for="displayby" class="sr-only">Organize by: </label>
1008 <select name="displayby" id="displayby">
1009 [% IF ( displayby == "STATUS" ) %]
1010 <option value="STATUS" selected="selected">Status</option>
1012 <option value="STATUS">Status</option>
1014 [% IF ( displayby == "branchcode" ) %]
1015 <option value="branchcode" selected="selected">Library</option>
1017 <option value="branchcode">Library</option>
1019 [% IF ( displayby == "itemtype" ) %]
1020 <option value="itemtype" selected="selected">Item type</option>
1022 <option value="itemtype">Item type</option>
1024 [% IF ( displayby == "managedby" ) %]
1025 <option value="managedby" selected="selected">Managed by</option>
1027 <option value="managedby">Managed by</option>
1029 [% IF ( displayby == "acceptedby" ) %]
1030 <option value="acceptedby" selected="selected">Accepted by</option>
1032 <option value="acceptedby">Accepted by</option>
1037 </fieldset> <!-- /.brief -->
1038 <fieldset class="action">
1039 <input type="submit" class="btn btn-primary" value="Go" />
1042 <fieldset class="brief">
1043 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
1046 <h4 class="local_collapse"><a href="#" data-target="biblio_information">Bibliographic information</a></h4>
1047 <fieldset class="brief biblio_information">
1050 <label for="title"> Title:</label>
1051 <input type="text" id="title" name="title" value="[% title | html %]" />
1054 <label for="author"> Author:</label>
1055 <input type="text" id="author" name="author" value="[% author | html %]" />
1058 <label for="isbn"> ISBN:</label>
1059 <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" />
1062 <label for="publishercode"> Publisher:</label>
1063 <input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" />
1066 <label for="copyrightdate_filter"> Copyright date:</label>
1067 <input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" />
1070 <label for="collectiontitle"> Collection title:</label>
1071 <input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" />
1074 </fieldset> <!-- /.biblio_information -->
1075 <fieldset class="action biblio_information">
1076 <input type="submit" value="Go" />
1079 <h4 class="local_collapse"><a href="#" data-target="suggestion_information">Suggestion information</a></h4>
1080 <fieldset class="brief suggestion_information">
1083 <label for="STATUS[% loop.index | html %]"> Status:</label>
1084 <select name="STATUS" id="STATUS[% loop.index | html %]">
1085 <option value="">Any</option>
1086 [% IF (statusselected_ASKED ) %]
1087 <option value="ASKED" selected="selected">Pending</option>
1089 <option value="ASKED">Pending</option>
1092 [% IF (statusselected_ACCEPTED ) %]
1093 <option value="ACCEPTED" selected="selected">Accepted</option>
1095 <option value="ACCEPTED">Accepted</option>
1098 [% IF (statusselected_CHECKED ) %]
1099 <option value="CHECKED" selected="selected">Checked</option>
1101 <option value="CHECKED">Checked</option>
1104 [% IF ( statusselected_REJECTED ) %]
1105 <option value="REJECTED" selected="selected">Rejected</option>
1107 <option value="REJECTED">Rejected</option>
1110 [% IF ( statusselected_ORDERED ) %]
1111 <option value="ORDERED" selected="selected">Ordered</option>
1113 <option value="ORDERED">Ordered</option>
1116 [% FOREACH s IN SuggestionStatuses %]
1117 [% IF s.authorised_value == selected_status %]
1118 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1120 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1127 <label for="suggestedby"> Suggested by:</label>
1128 <select id="suggestedby" name="suggestedby">
1129 <option value="">Any</option>
1130 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1131 [% IF ( suggestedby_loo.selected ) %]
1132 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1134 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1140 <label for="suggesteddate_from">Suggested date from:</label>
1141 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" data-date_to="suggesteddate_to" class="flatpickr" />
1144 <label for="suggesteddate_to">To:</label>
1145 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" class="flatpickr" />
1148 <label for="managedby"> Managed by:</label>
1149 <select id="managedby" name="managedby">
1150 <option value="">Any</option>
1151 [% FOREACH managedby_loo IN managedby_loop %]
1152 [% IF ( managedby_loo.selected ) %]
1153 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1155 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1161 <label for="manageddate_from">Management date from:</label>
1162 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" data-date_to="manageddate_to" class="flatpickr" />
1165 <label for="manageddate_to">To:</label>
1166 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" class="flatpickr" />
1169 <label for="acceptedby"> Accepted by:</label>
1170 <select id="acceptedby" name="acceptedby">
1171 <option value="">Any</option>
1172 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1173 [% IF ( acceptedby_loo.selected ) %]
1174 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1176 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1182 <label for="accepteddate_from">Accepted date from:</label>
1183 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" data-date_to="accepteddate_to" class="flatpickr" />
1186 <label for="accepteddate_to">To:</label>
1187 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" class="flatpickr" />
1190 </fieldset> <!-- /#suggestion_information -->
1191 <fieldset class="action suggestion_information">
1192 <input type="submit" value="Go" />
1195 <h4 class="local_collapse">
1196 <a href="#" data-target="acquisition_information">Acquisition information</a>
1198 <fieldset class="brief acquisition_information">
1201 <label for="budgetid"> Book fund:</label>
1202 <select name="budgetid" id="budgetid">
1203 <option value="__ANY__">Any</option>
1204 [% IF budgetid == '__NONE__' %]
1205 <option value="__NONE__" selected="selected">None</option>
1207 <option value="__NONE__">None</option>
1209 [% FOREACH budgetsloo IN budgetsloop %]
1210 [% IF ( budgetsloo.selected ) %]
1211 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1213 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1219 </fieldset> <!-- /#acquisition_information -->
1220 <fieldset class="action acquisition_information">
1221 <input type="submit" value="Go" />
1224 <div id="filter_archived_information">
1227 <label for="archived" style="display: inline;">Include archived:</label>
1228 [% IF filter_archived %]
1229 <input type="checkbox" id="archived" value="1" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1231 <input type="checkbox" id="archived" value="1" name="filter_archived" title="Include archived suggestions in the search" />
1236 </div> <!-- /#limits -->
1237 </fieldset> <!-- /.brief -->
1238 </form> <!-- /suggestionsfilter -->
1240 [% INCLUDE 'acquisitions-menu.inc' %]
1243 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1244 [% END # /UNLESS ( op == 'show' ) %]
1245 [% END # /UNLESS op == 'save' %]
1246 </div> <!-- /.row -->
1248 [% END # /IF op == "show" %]
1250 [% MACRO jsinclude BLOCK %]
1251 [% INCLUDE 'calendar.inc' %]
1255 function editManagerPopup(selected_tab) {
1257 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_manager&filter=suggestions_managers",
1259 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1260 + 'scrollbars=yes,resize=yes'
1263 function select_manager(borrowernumber, borrower) {
1264 var managedby_name = $("#managedby_name"+tab);
1265 var managedby = $("#managedby"+tab);
1266 managedby_name.empty();
1268 var borrowername = borrower.firstname + ' ' + borrower.surname;
1269 if (borrowernumber) {
1270 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1271 + '?borrowernumber=' + borrowernumber + '">'
1272 + borrowername + '</a>';
1273 managedby_name.html(managerlink);
1274 managedby.val(borrowernumber);
1277 [% IF op == "save" %]
1278 var notify = $('#notify');
1279 if ( notify.length ) {
1280 [% IF managedby_patron %]
1281 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1283 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1285 $(notify).prop('checked', false).prop('disabled', true);
1287 $(notify).prop('disabled', false);
1293 function editSuggesterPopup() {
1294 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_suggester",
1296 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1297 + 'scrollbars=yes,resize=yes'
1301 function select_suggester(borrowernumber, borrower) {
1302 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />';
1303 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">';
1304 suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')';
1305 suggested += '</a> ';
1306 suggested += borrower.branchname + ' (' + borrower.category_description + ')';
1307 $("#tdsuggestedby").html(suggested);
1310 $(document).ready(function(){
1311 $("#edit_manager").on("click",function(e){
1313 editManagerPopup('');
1315 $(".set_manager").on("click",function(e){
1317 var selected_tab = $(this).data('tab');
1318 editManagerPopup(selected_tab);
1321 $("#edit_suggester").on("click", function(e){
1323 editSuggesterPopup();
1328 [% IF ( op == 'show' || op == 'else' ) %]
1330 $(document).ready(function(){
1331 $(".deletesuggestion").on("click",function(){
1332 return confirm(_("Are you sure you want to delete this suggestion?"));
1337 [% IF op == 'else' %]
1338 [% INCLUDE 'datatables.inc' %]
1339 [% INCLUDE 'columns_settings.inc' %]
1341 $(document).ready(function() {
1342 if( $("#suggestiontabs .tab-pane.active").length < 1 ){
1343 $("#suggestiontabs a:first").tab("show");
1346 table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1347 var saved_table = localStorage.getItem("DataTables_suggestions_/cgi-bin/koha/suggestion/suggestion.pl");
1348 var updated_settings = get_columns_saved_state(saved_table, table_settings);
1350 [% FOREACH suggestion IN suggestions %]
1351 [% IF suggestion.suggestions.size %]
1352 KohaTable("table_[% loop.count| html %]", {
1353 "sorting": [[ 4, "asc" ]],
1356 }, updated_settings );
1360 $("#branchcode").on('change',function(){
1361 [%# Modify the hidden input in the filters block from the library %]
1362 [%# dropdown list at the top of suggestion list %]
1363 let branchcode = $(this).val();
1364 $('input[name="branchcode"]').val( branchcode );
1365 $('form[name="suggestionfilter"]').submit();
1368 $(".checkall").click(function(e){
1370 $(this).parents('form').find("input:checkbox").each(function(){
1371 $(this).prop("checked", true);
1374 $(".uncheckall").click(function(e){
1376 $(this).parents('form').find("input:checkbox").each(function(){
1377 $(this).prop("checked", false);
1380 $(".other_reason").hide();
1381 $("select[name='reason']").change(function(){
1382 if($(this).val() == "other"){
1384 $(this).siblings(".other_reason").show();
1388 $("a.cancel_note").click(function(e) {
1389 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1390 $(this).siblings("input[name='other_reason']").hide();
1394 $("h4.local_collapse a").on("click", function(e){
1396 const target = $(this).data("target");
1397 $("." + target).toggle();
1400 // Note: the selector below passes a second 'context' param - it is not a multiple selector
1401 $("button[type='submit']", ".suggestions_batch_ops").on("click", function(e) {
1402 var submit_button = this;
1403 var form = $(submit_button).parents("form");
1404 var action = $(submit_button).val();
1405 var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1406 if ( selected_suggestions.length == 0 ) {
1407 alert(_("Please select at least one suggestion"));
1411 if ( action == "delete" ) {
1412 if ( selected_suggestions.length == 1 ) {
1413 if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
1417 } else if ( selected_suggestions.length > 1 ) {
1418 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1423 } else if ( action == "update_manager" ) {
1424 var managedby = $(submit_button).siblings("suggestion_managedby");
1425 if ( managedby.val() == "" ) {
1426 alert(_("Please select a manager to assign to the selected suggestions"));
1432 $('<input />').attr('type', 'hidden')
1434 .attr('value', action)
1441 [% IF op == 'save' %]
1444 $(document).ready(function(){
1446 $("#quantity,#price,#currency").on("change",function(){
1450 [% IF other_reason %]
1451 $(".select-reason").hide();
1452 $(".select-reason").find("option[value='other']").attr("selected","selected");
1453 $("#other_reason").show();
1455 $("#other_reason").hide();
1457 $(".select-reason").change(function(){
1458 if($(this).val() == "other"){
1460 $("#other_reason").show();
1463 $("a[href*=back]").click(function(){
1464 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1465 $("#other_reason").hide();
1468 $("#restore_previous_manager").on("click",function(e){
1471 $("#managedby_name").empty();
1472 $("#managedby").val('');
1473 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1474 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1475 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1476 + borrowername + '</a>';
1477 $('#managedby_name').html(managerlink);
1478 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1479 $('#notify').prop('checked', false).prop('disabled', true);
1482 //keep a copy of all budgets before removing the inactives
1483 var budgetId = $("form#add_edit #budgetid");
1484 var disabledBudgetsCopy = budgetId.html();
1485 $('.b_inactive').remove();
1487 $('#showallfunds').click(function() {
1488 if ($(this).is(":checked")) {
1489 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1492 $('.b_inactive').remove();
1499 [% Asset.js("js/acq.js") | $raw %]
1500 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1502 [% INCLUDE 'intranet-bottom.inc' %]