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 [% IF ( op == 'show' ) %]
93 <div class="main container-fluid">
95 <div class="col-md-8 col-md-offset-2">
96 [% INCLUDE 'messages.inc' %]
98 <div id="toolbar" class="btn-toolbar">
99 <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>
100 <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>
103 <fieldset class="rows">
104 <legend>Bibliographic information</legend>
108 <span class="label">Title:</span>
109 [% IF suggestion.biblionumber %]
110 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
118 <span class="label">Author:</span>
122 [% IF ( copyrightdate ) %]
124 <span class="label">Copyright date:</span>
125 [% copyrightdate | html %]
130 <span class="label">ISBN or ISSN or other standard number:</span>
134 [% IF ( publishercode ) %]
136 <span class="label">Publisher:</span>
137 [% publishercode | html %]
142 <span class="label">Publication place:</span>
146 [% IF ( collectiontitle ) %]
148 <span class="label">Collection title:</span>
149 [% collectiontitle | html %]
152 [% IF ( itemtype ) %]
154 <span class="label">Document type:</span>
155 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
158 [% IF ( patron_reason_loop ) %]
160 <span class="label">Reason for suggestion: </span>
161 [% FOREACH patron_reason_loo IN patron_reason_loop %]
162 [% IF patron_reason_loo.authorised_value == patronreason %]
163 [% patron_reason_loo.lib | html %]
170 <span class="label">Notes:</span>
174 [% IF ( staff_note ) %]
176 <span class="label">Notes:</span>
177 [% staff_note | html %]
183 <fieldset class="rows">
184 <legend>Suggestion management</legend>
187 <span class="label">Status:</span>
188 [% SET status_found = 0 %]
189 [% IF ( STATUS == 'ASKED' ) %]
191 [% SET status_found = 1 %]
192 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
193 <span>Accepted</span>
194 [% SET status_found = 1 %]
195 [% ELSIF ( STATUS == 'CHECKED' ) %]
197 [% SET status_found = 1 %]
198 [% ELSIF ( STATUS == 'REJECTED' ) %]
199 <span>Rejected</span>
200 [% SET status_found = 1 %]
201 [% ELSIF ( STATUS == 'ORDERED' ) %]
203 [% SET status_found = 1 %]
204 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
205 <span>Available</span>
206 [% SET status_found = 1 %]
208 [% FOREACH s IN SuggestionStatuses %]
209 [% IF STATUS == s.authorised_value %]
211 [% SET status_found = 1 %]
217 <span class="label">Reason:</span>
219 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
234 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
235 <td>[% suggesteddate | $KohaDates %]</td>
237 [% IF ( suggestedby_patron.borrowernumber ) %]
238 <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>
239 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
245 <td>[% manageddate | $KohaDates %]</td>
247 [% IF ( managedby_patron.borrowernumber ) %]
248 <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>
249 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
254 <th>Accepted on:</th>
255 <td>[% accepteddate | $KohaDates %]</td>
257 [% IF ( acceptedby_patron.borrowernumber ) %]
258 <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>
259 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
264 <th>Last modification on:</th>
265 <td>[% lastmodificationdate | $KohaDates %]</td>
267 [% IF ( lastmodificationby_patron.borrowernumber ) %]
268 <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>
269 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
277 <fieldset class="rows">
278 <legend>Acquisition information</legend>
281 <span class="label">Library:</span>
282 [% Branches.GetName( branchcode ) | html %]
285 <span class="label">Fund:</span>
286 [% budgetname | html %]
289 <span class="label">Copies:</span>
290 [% quantity | html %]
293 <span class="label">Currency:</span>
294 [% currency | html %]
297 <span class="label">Price:</span>
301 <span class="label">Total</span>
307 <fieldset class="action">
308 <a href="suggestion.pl"><< Back to suggestions</a>
311 </div> <!-- /.col-md-8 col-md-offset-2 -->
312 </div> <!-- /.row -->
313 [% ELSE # IF op == "show" %]
315 [% IF op == 'save' %]
316 <div class="main container-fluid">
318 <div class="col-md-8 col-md-offset-2">
319 [% INCLUDE 'messages.inc' %]
321 <div class="main container-fluid">
323 <div class="col-sm-10 col-sm-push-2">
324 [% INCLUDE 'messages.inc' %]
327 [% IF op == 'save' %]
328 [% FOR m IN messages %]
329 <div class="dialog [% m.type | html %]">
331 [% CASE 'biblio_exists' %]
332 <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>
333 [% CASE 'manager_not_enough_permissions' %]
334 <span>The manager you selected does not have sufficient permissions.</span>
336 <span>[% m.code | html %]</span>
338 </div> <!-- /.dialog -->
341 <form id="add_edit" action="suggestion.pl" method="post" class="validated">
342 [% INCLUDE 'csrf-token.inc' %]
343 <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
344 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
345 [% IF ( suggestionid ) %]
346 <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
347 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
349 <h1>Enter a new purchase suggestion</h1>
352 <fieldset class="rows">
353 <legend>Bibliographic information</legend>
356 <label for="title" class="required">Title:</label>
357 <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
358 <span class="required">Required</span>
361 <label for="author">Author:</label>
362 <input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/>
365 <label for="copyrightdate">Copyright date:</label>
366 <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" />
369 <label for="isbn">ISBN or ISSN or other standard number:</label>
370 <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn | html %]"/>
373 <label for="publishercode">Publisher:</label>
374 <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/>
377 <label for="place">Publication place:</label>
378 <input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/>
381 <label for="collectiontitle">Collection title:</label>
382 <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/>
385 <label for="itemtype">Document type:</label>
386 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size=20, default=itemtype, empty=1 %]
388 [% IF patron_reason_loop %]
390 <label for="patronreason">Reason for suggestion: </label>
391 <select name="patronreason" id="patronreason">
392 <option value=""> -- Choose -- </option>
393 [% FOREACH patron_reason_loo IN patron_reason_loop %]
394 [% IF patron_reason_loo.authorised_value == patronreason %]
395 <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
397 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
402 [% END # /IF patron_reason_loop %]
404 <label for="note">Notes:</label>
405 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
408 <label for="note">Non-public notes:</label>
409 <textarea name="staff_note" id="staff_note" rows="5" cols="40">[% staff_note | html %]</textarea>
414 <fieldset class="rows">
415 <legend>Suggestion management</legend>
417 [% IF ( suggestionid ) %]
419 <label for="STATUS">Status:</label>
420 <select id="STATUS" name="STATUS">
421 <option value="">No status</option>
423 [% IF (statusselected_ASKED ) %]
424 <option value="ASKED" selected="selected">Pending</option>
426 <option value="ASKED">Pending</option>
429 [% IF (statusselected_ACCEPTED ) %]
430 <option value="ACCEPTED" selected="selected">Accepted</option>
432 <option value="ACCEPTED">Accepted</option>
435 [% IF (statusselected_CHECKED ) %]
436 <option value="CHECKED" selected="selected">Checked</option>
438 <option value="CHECKED">Checked</option>
441 [% IF ( statusselected_REJECTED ) %]
442 <option value="REJECTED" selected="selected">Rejected</option>
444 <option value="REJECTED">Rejected</option>
447 [% IF ( statusselected_ORDERED ) %]
448 <option value="ORDERED" selected="selected">Ordered</option>
450 <option value="ORDERED">Ordered</option>
453 [% FOREACH s IN SuggestionStatuses %]
454 [% IF s.authorised_value == suggestion.STATUS %]
455 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
457 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
463 <label for="reason">Reason:</label>
464 <select class="select-reason" id="reason" name="reason">
465 <option value=""> -- Choose a reason -- </option>
466 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
467 [% IF (reasonsloo.lib == suggestion.reason) %]
468 <option value="[% reasonsloo.lib | html %]" selected="selected">[% reasonsloo.lib | html %]</option>
470 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
473 <option value="other">Others...</option>
476 <span id="other_reason" name="other_reason">
477 [% IF other_reason %]
478 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
480 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
482 <a href="#back">Cancel</a>
499 <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
502 <input type="text" id="suggesteddate" name="suggesteddate" class="flatpickr" size="10" maxlength="10" value="[% suggesteddate | html %]"/> [% INCLUDE 'date-format.inc' %]
504 <td id="tdsuggestedby">
505 <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
506 [% IF ( suggestedby_patron.borrowernumber ) %]
507 <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 %])
511 <a href="#" id="edit_suggester" class="btn btn-default">Set to patron</a>
516 <label for="accepteddate">Accepted on:</label>
519 <input type="text" id="accepteddate" name="accepteddate" class="flatpickr" size="10" maxlength="10" value="[% accepteddate | html %]" />[% INCLUDE 'date-format.inc' %]
522 <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
523 [% IF ( acceptedby_patron.borrowernumber ) %]
524 <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>
525 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
532 <label for="lastmodificationdate">Last modification on:</label>
535 [% lastmodificationdate | $KohaDates %]
538 [% IF lastmodificationby_patron %]
539 [% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
548 <label for="managedon">Managed on:</label>
549 <input type="text" id="managedon" name="manageddate" class="flatpickr" size="10" maxlength="10" value="[% manageddate | html %]" />[% INCLUDE 'date-format.inc' %]
552 <label for="managedby_name">by:</label>
554 <span id="managedby_name" name="managedby_name">
555 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
557 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
558 | 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 %])
561 <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a>
562 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
563 <a id="restore_previous_manager" href="#"><i class="fa fa-trash-can"></i> Keep existing manager</a>
565 <input type="hidden" name="managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" />
568 <label for="notify">Notify manager:</label>
569 <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." />
575 <fieldset class="rows">
576 <legend>Acquisition information</legend>
579 <label for="branchcode">Library:</label>
580 <select name="branchcode" id="branchcode">
581 <option value="">Any</option>
582 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
586 <label for="budgetid">Fund:</label>
587 <select name="budgetid" id="budgetid">
588 <option value="">Any</option>
589 [% FOREACH budget IN sugg_budgets %]
590 [% IF ( budget.selected ) %]
591 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
592 [% ELSIF ( budget.b_active ) %]
593 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
595 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
599 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
600 <input type="checkbox" id="showallfunds" />
603 <label for="quantity">Copies:</label>
604 <input type="text" size="10" id="quantity" name="quantity" value="[% quantity | html %]" />
607 <label for="currency">Currency:</label>
608 [% FOREACH c IN currencies %]
609 <input type="hidden" value="[% c.rate | html %]" id="currency_rate_[% c.currency | html %]" name="currency_rate_[% c.currency | html %]" />
610 <input type="hidden" id="[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" />
612 <select name="currency" id="currency">
613 [% FOREACH c IN currencies %]
614 [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
615 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
616 [% ELSIF not c.archived %]
617 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
623 <label for="price">Price:</label>
624 <input class="decimal" type="text" size="20" name="price" id="price" value="[% price | $Price on_editing => 1 %]" />
627 <label for="total">Total: </label>
628 <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total | html %]"/>
631 </fieldset> <!-- /.rows -->
633 <fieldset class="action">
634 <input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
635 <input type="hidden" name="op" value="[% op | html %]" />
636 [% IF ( suggestionid ) %]
637 [% IF ( need_confirm ) %]
638 <input type="hidden" name="save_confirmed" value="1" />
639 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" class="btn btn-primary" value="Confirm your suggestion" />
641 <input type="submit" class="btn btn-primary" value="Save" />
643 <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
645 [% IF ( need_confirm ) %]
646 <input type="hidden" name="save_confirmed" value="1" />
647 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" class="btn btn-primary" value="Confirm your suggestion" />
649 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
651 <a class="cancel" href="suggestion.pl">Cancel</a>
653 </fieldset> <!-- /.action -->
654 </form> <!-- /#add_edit -->
655 [% END # /IF op == 'save' %]
657 [% IF op == 'else' %]
658 <div id="toolbar" class="btn-toolbar">
659 <a class="btn btn-default" id="newsuggestion" href="suggestion.pl?op=add&branchcode=[% branchcode | uri %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
662 <h1>Suggestions management</h1>
664 [% IF ( displayby != "branchcode" ) %]
665 <label for="branchcode">Viewing suggestions for library:</label>
666 <select name="branchcode" id="branchcode">
667 <option value="__ANY__">Any</option>
668 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
672 [% FOR m IN messages %]
673 <div class="dialog [% m.type | html %]">
675 [% CASE 'already_exists' %]
676 <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>
677 [% CASE 'biblio_exists' %]
678 <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>
680 <span>[% m.code | html %]</span>
682 </div> <!-- /.dialog -->
685 [% WRAPPER tabs id= "suggestiontabs" %]
686 [% WRAPPER tabs_nav %]
687 [% FOREACH suggestion IN suggestions %]
688 [% WRAPPER tab_item tabname= suggestion.suggestiontype %]
689 [% IF ( suggestion.suggestiontypelabel ) %]
690 [% IF (suggestion.suggestiontypelabel == "Pending") %]<span>Pending</span>
691 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]<span>Accepted</span>
692 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]<span>Checked</span>
693 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]<span>Rejected</span>
694 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]<span>Available</span>
695 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]<span>Ordered</span>
696 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]<span>Status unknown</span>
697 [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]<span>Any</span>
698 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
700 [% IF ( suggestion.suggestiontype ) %]
701 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
706 ([% suggestion.suggestions.size| html %])
708 [% END # /FOREACH suggestion %]
709 [% END # /WRAPPER tabs_nav %]
711 [% WRAPPER tab_panels %]
712 [% FOREACH suggestion IN suggestions %]
713 [% WRAPPER tab_panel tabname= suggestion.suggestiontype %]
714 <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
715 [% INCLUDE 'csrf-token.inc' %]
717 [% IF suggestion.suggestions.size %]
719 <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
722 <table id="table_[% loop.count | html %]" class="sorted">
725 <th class="NoSort noExport"> </th>
726 <th class="anti-the">Suggestion</th>
727 <th>Suggested by</th>
728 <th>Suggester category</th>
729 <th>Suggested on</th>
730 <th>Patron reason</th>
733 <th>Last modification by</th>
734 <th>Last modification on</th>
735 <th>Last updated</th>
738 <th>Non-public note</th>
740 <th class="NoSort noExport"> </th>
744 [% FOREACH s IN suggestion.suggestions %]
747 <input type="checkbox" name="suggestionid" value="[% s.suggestionid | html %]" />
750 <a href="suggestion.pl?suggestionid=[% s.suggestionid | uri %]&op=show" title="suggestion" >
751 [% s.title | html %][% IF ( s.author ) %], by [% s.author | html %][% END %]
754 [% IF ( s.copyrightdate ) %]
755 © <span class="suggestion_copyrightdate">[% s.copyrightdate | html %]</span>
757 [% IF ( s.volumedesc ) %]
758 ; <span class="suggestion_volume">Volume:<em>[% s.volumedesc | html %]</em></span>
761 ; <span class="suggestion_isbn">ISBN: <em>[% s.isbn | html %]</em></span>
763 [% IF ( s.publishercode ) %]
764 ; <span class="suggestion_publishercode">Published by [% s.publishercode | html %]</span>
766 [% IF ( s.publicationyear ) %]
767 in <span class="suggestion_publicationyear"><em>[% s.publicationyear | html %]</em></span>
770 in <span class="suggestion_place"><em>[% s.place | html %]</em></span>
772 [% IF ( s.collectiontitle ) %]
773 ; <span class="suggestion_collectiontitle">[% s.collectiontitle | html %]</span>
775 [% IF ( s.itemtype ) %]
776 ; <span class="suggestion_itype">[% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', s.itemtype, 0 ) | html %]</span>
780 <div class="suggestion_note"><i class="fa fa-comment"></i> [% s.note | html %]</div>
783 <br /><i class="fa fa-archive"></i> Archived
787 [% SET suggester = s.suggester %]
788 <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>
791 [% suggester.category.description | html %]
793 <td data-order="[% s.suggesteddate | html %]">
794 [% IF ( s.suggesteddate ) %][% s.suggesteddate | $KohaDates %][% END %]
796 <td>[% AuthorisedValues.GetByCode( 'OPAC_SUG', s.patronreason ) | html %]</td>
798 [% SET manager = s.manager %]
799 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% manager.borrowernumber | uri %]">[% manager.surname | html %][% IF manager.firstname %], [% manager.firstname | html %][% END %]</a>
801 <td data-order="[% s.manageddate | html %]">
802 [% IF ( s.manageddate ) %][% s.manageddate | $KohaDates %][% END %]
805 [% SET last_modifier = s.last_modifier %]
806 <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>
808 <td data-order="[% s.lastmodificationdate | html %]">
809 [% IF ( s.lastmodificationdate ) %][% s.lastmodificationdate | $KohaDates %][% END %]
812 [% s.lastmodificationdate | $KohaDates %]
815 [% Branches.GetName( s.branchcode ) | html %]
818 [% s.fund.budget_name | html %]
821 [% s.staff_note | html %]
824 [% IF s.STATUS == 'ASKED' %]
826 [% ELSIF s.STATUS == 'ACCEPTED' %]
827 <span>Accepted</span>
828 [% ELSIF s.STATUS == 'ORDERED' %]
830 [% ELSIF s.STATUS == 'REJECTED' %]
831 <span>Rejected</span>
832 [% ELSIF s.STATUS == 'CHECKED' %]
834 [% ELSIF s.STATUS == 'AVAILABLE' %]
835 <span>Available</span>
836 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) %]
837 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) | html %]
839 <span>Status unknown</span>
842 [% IF ( s.reason ) %]
843 <br />([% s.reason | html %])
847 <div class="btn-group dropup">
848 <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>
849 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% s.suggestionid | html %]">
850 <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>
851 [% UNLESS s.archived %]
852 <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
854 <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li>
860 [% END # /FOREACH s %]
862 </table> <!-- /#table_[% loop.count | html %] -->
865 <div class="col-sm-12">
866 <h2>Change selected suggestions</h2>
869 <div class="suggestions_batch_ops row">
870 <div class="col-sm-4">
871 <fieldset class="brief">
872 <div id="select-reason[% loop.index | html %]">
873 <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label>
874 <select name="STATUS" id="STATUSreason[% loop.index | html %]">
875 <option value=""> -- Choose a status --</option>
877 [% IF (statusselected_ASKED ) %]
878 <option value="ASKED" selected="selected">Pending</option>
880 <option value="ASKED">Pending</option>
883 [% IF (statusselected_ACCEPTED ) %]
884 <option value="ACCEPTED" selected="selected">Accepted</option>
886 <option value="ACCEPTED">Accepted</option>
889 [% IF (statusselected_CHECKED ) %]
890 <option value="CHECKED" selected="selected">Checked</option>
892 <option value="CHECKED">Checked</option>
895 [% IF ( statusselected_REJECTED ) %]
896 <option value="REJECTED" selected="selected">Rejected</option>
898 <option value="REJECTED">Rejected</option>
901 [% IF ( statusselected_ORDERED ) %]
902 <option value="ORDERED" selected="selected">Ordered</option>
904 <option value="ORDERED">Ordered</option>
907 [% FOREACH s IN SuggestionStatuses %]
908 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
912 <label for="choosereason[% loop.index | html %]">with this reason:</label>
913 <select name="reason" id="choosereason[% loop.index | html %]">
914 <option value=""> -- Choose a reason -- </option>
915 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
916 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
918 <option value="other">Others...</option>
921 <span class="other_reason">
922 <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
923 <a href="#" class="cancel_note">Cancel</a>
927 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
928 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
930 <fieldset class="action">
931 <button type="submit" class="btn btn-primary" value="update_status">Submit</button>
933 </div> <!-- /.col-sm-4 -->
935 <div class="col-sm-2">
936 <fieldset class="brief">
937 <label id="suggestion_itemtype">
938 Update item types with:
940 [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %]
941 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
942 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
944 <fieldset class="action">
945 <button type="submit" class="btn btn-primary" value="update_itemtype">Submit</button>
947 </div> <!-- /.col-sm-4 -->
949 <div class="col-sm-2">
950 <fieldset class="brief">
951 <span class="label">Update manager</span>
952 <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>
953 <span id="managedby_name[% loop.count | html %]"></span>
954 <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
955 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
956 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
958 <fieldset class="action">
959 <button type="submit" class="btn btn-primary" value="update_manager">Submit</button>
961 </div> <!-- /.col-sm-2 -->
963 <div class="col-sm-2">
964 <fieldset class="brief">
965 <span class="label">Delete selected</span>
966 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
967 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
969 <fieldset class="action">
970 <button type="submit" class="btn btn-primary" value="delete">Delete</button>
972 </div> <!-- /.col-sm-2 -->
973 <div class="col-sm-2">
974 <fieldset class="brief">
975 <span class="label">Archive selected</span>
976 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
977 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
978 <fieldset class="action">
979 <button type="submit" class="btn btn-primary" value="archive">Archive</button>
982 </div> <!-- /.col-sm-2 -->
983 </div> <!-- /.row -->
986 <strong>No results.</strong>
987 [% END # /IF ( suggestion.suggestions_loop ) %]
988 </form> <!-- /.update_suggestions -->
989 [% END # /tab_panel# %]
990 [% END # /FOREACH suggestion %]
991 [% END # /WRAPPER tab_panels %]
992 [% END # /WRAPPER tabs %]
993 [% END # /IF op == 'else' %]
995 [% UNLESS op == 'save' %]
996 [% UNLESS ( op == 'show' ) %]
997 </div> <!-- /.col-sm-10.col-sm-push-2 -->
999 <div class="col-sm-2 col-sm-pull-10">
1001 <form name="suggestionfilter" action="suggestion.pl" method="get">
1002 [% INCLUDE 'csrf-token.inc' %]
1003 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1004 <fieldset class="brief">
1005 <h4>Organize by:</h4>
1008 <label for="displayby" class="sr-only">Organize by: </label>
1009 <select name="displayby" id="displayby">
1010 [% IF ( displayby == "STATUS" ) %]
1011 <option value="STATUS" selected="selected">Status</option>
1013 <option value="STATUS">Status</option>
1015 [% IF ( displayby == "branchcode" ) %]
1016 <option value="branchcode" selected="selected">Library</option>
1018 <option value="branchcode">Library</option>
1020 [% IF ( displayby == "itemtype" ) %]
1021 <option value="itemtype" selected="selected">Item type</option>
1023 <option value="itemtype">Item type</option>
1025 [% IF ( displayby == "managedby" ) %]
1026 <option value="managedby" selected="selected">Managed by</option>
1028 <option value="managedby">Managed by</option>
1030 [% IF ( displayby == "acceptedby" ) %]
1031 <option value="acceptedby" selected="selected">Accepted by</option>
1033 <option value="acceptedby">Accepted by</option>
1038 </fieldset> <!-- /.brief -->
1039 <fieldset class="action">
1040 <input type="submit" class="btn btn-primary" value="Go" />
1043 <fieldset class="brief">
1044 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
1047 <h4 class="local_collapse"><a href="#" data-target="biblio_information">Bibliographic information</a></h4>
1048 <fieldset class="brief biblio_information">
1051 <label for="title"> Title:</label>
1052 <input type="text" id="title" name="title" value="[% title | html %]" />
1055 <label for="author"> Author:</label>
1056 <input type="text" id="author" name="author" value="[% author | html %]" />
1059 <label for="isbn"> ISBN:</label>
1060 <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" />
1063 <label for="publishercode"> Publisher:</label>
1064 <input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" />
1067 <label for="copyrightdate_filter"> Copyright date:</label>
1068 <input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" />
1071 <label for="collectiontitle"> Collection title:</label>
1072 <input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" />
1075 </fieldset> <!-- /.biblio_information -->
1076 <fieldset class="action biblio_information">
1077 <input type="submit" value="Go" />
1080 <h4 class="local_collapse"><a href="#" data-target="suggestion_information">Suggestion information</a></h4>
1081 <fieldset class="brief suggestion_information">
1084 <label for="STATUS[% loop.index | html %]"> Status:</label>
1085 <select name="STATUS" id="STATUS[% loop.index | html %]">
1086 <option value="">Any</option>
1087 [% IF (statusselected_ASKED ) %]
1088 <option value="ASKED" selected="selected">Pending</option>
1090 <option value="ASKED">Pending</option>
1093 [% IF (statusselected_ACCEPTED ) %]
1094 <option value="ACCEPTED" selected="selected">Accepted</option>
1096 <option value="ACCEPTED">Accepted</option>
1099 [% IF (statusselected_CHECKED ) %]
1100 <option value="CHECKED" selected="selected">Checked</option>
1102 <option value="CHECKED">Checked</option>
1105 [% IF ( statusselected_REJECTED ) %]
1106 <option value="REJECTED" selected="selected">Rejected</option>
1108 <option value="REJECTED">Rejected</option>
1111 [% IF ( statusselected_ORDERED ) %]
1112 <option value="ORDERED" selected="selected">Ordered</option>
1114 <option value="ORDERED">Ordered</option>
1117 [% FOREACH s IN SuggestionStatuses %]
1118 [% IF s.authorised_value == selected_status %]
1119 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1121 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1128 <label for="suggestedby"> Suggested by:</label>
1129 <select id="suggestedby" name="suggestedby">
1130 <option value="">Any</option>
1131 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1132 [% IF ( suggestedby_loo.selected ) %]
1133 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1135 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1141 <label for="suggesteddate_from">Suggested date from:</label>
1142 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" data-date_to="suggesteddate_to" class="flatpickr" />
1145 <label for="suggesteddate_to">To:</label>
1146 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" class="flatpickr" />
1149 <label for="managedby"> Managed by:</label>
1150 <select id="managedby" name="managedby">
1151 <option value="">Any</option>
1152 [% FOREACH managedby_loo IN managedby_loop %]
1153 [% IF ( managedby_loo.selected ) %]
1154 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1156 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1162 <label for="manageddate_from">Management date from:</label>
1163 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" data-date_to="manageddate_to" class="flatpickr" />
1166 <label for="manageddate_to">To:</label>
1167 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" class="flatpickr" />
1170 <label for="acceptedby"> Accepted by:</label>
1171 <select id="acceptedby" name="acceptedby">
1172 <option value="">Any</option>
1173 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1174 [% IF ( acceptedby_loo.selected ) %]
1175 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1177 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1183 <label for="accepteddate_from">Accepted date from:</label>
1184 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" data-date_to="accepteddate_to" class="flatpickr" />
1187 <label for="accepteddate_to">To:</label>
1188 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" class="flatpickr" />
1191 </fieldset> <!-- /#suggestion_information -->
1192 <fieldset class="action suggestion_information">
1193 <input type="submit" value="Go" />
1196 <h4 class="local_collapse">
1197 <a href="#" data-target="acquisition_information">Acquisition information</a>
1199 <fieldset class="brief acquisition_information">
1202 <label for="budgetid"> Book fund:</label>
1203 <select name="budgetid" id="budgetid">
1204 <option value="__ANY__">Any</option>
1205 [% IF budgetid == '__NONE__' %]
1206 <option value="__NONE__" selected="selected">None</option>
1208 <option value="__NONE__">None</option>
1210 [% FOREACH budgetsloo IN budgetsloop %]
1211 [% IF ( budgetsloo.selected ) %]
1212 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1214 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1220 </fieldset> <!-- /#acquisition_information -->
1221 <fieldset class="action acquisition_information">
1222 <input type="submit" value="Go" />
1225 <div id="filter_archived_information">
1228 <label for="archived" style="display: inline;">Include archived:</label>
1229 [% IF filter_archived %]
1230 <input type="checkbox" id="archived" value="1" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1232 <input type="checkbox" id="archived" value="1" name="filter_archived" title="Include archived suggestions in the search" />
1237 </div> <!-- /#limits -->
1238 </fieldset> <!-- /.brief -->
1239 </form> <!-- /suggestionsfilter -->
1241 [% INCLUDE 'acquisitions-menu.inc' %]
1244 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1245 [% END # /UNLESS ( op == 'show' ) %]
1246 [% END # /UNLESS op == 'save' %]
1247 </div> <!-- /.row -->
1249 [% END # /IF op == "show" %]
1251 [% MACRO jsinclude BLOCK %]
1252 [% INCLUDE 'calendar.inc' %]
1256 function editManagerPopup(selected_tab) {
1258 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_manager&filter=suggestions_managers",
1260 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1261 + 'scrollbars=yes,resize=yes'
1264 function select_manager(borrowernumber, borrower) {
1265 var managedby_name = $("#managedby_name"+tab);
1266 var managedby = $("#managedby"+tab);
1267 managedby_name.empty();
1269 var borrowername = borrower.firstname + ' ' + borrower.surname;
1270 if (borrowernumber) {
1271 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1272 + '?borrowernumber=' + borrowernumber + '">'
1273 + borrowername + '</a>';
1274 managedby_name.html(managerlink);
1275 managedby.val(borrowernumber);
1278 [% IF op == "save" %]
1279 var notify = $('#notify');
1280 if ( notify.length ) {
1281 [% IF managedby_patron %]
1282 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1284 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1286 $(notify).prop('checked', false).prop('disabled', true);
1288 $(notify).prop('disabled', false);
1294 function editSuggesterPopup() {
1295 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_suggester",
1297 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1298 + 'scrollbars=yes,resize=yes'
1302 function select_suggester(borrowernumber, borrower) {
1305 url: '/api/v1/patrons/' + borrowernumber,
1307 "x-koha-embed": "+strings"
1309 success: function (data) {
1310 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + data.borrowernumber + '" />';
1311 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + data.borrowernumber + '">';
1312 suggested += data.surname + ', ' + data.firstname + ' (' + data.cardnumber + ')';
1313 suggested += '</a> ';
1314 suggested += data._strings.library_id.str + ' (' + data._strings.category_id.str + ')';
1315 $("#tdsuggestedby").html(suggested);
1318 error: function (data) {
1319 alert(_("Cannot retrieve info for this patron."));
1324 $(document).ready(function(){
1325 $("#edit_manager").on("click",function(e){
1327 editManagerPopup('');
1329 $(".set_manager").on("click",function(e){
1331 var selected_tab = $(this).data('tab');
1332 editManagerPopup(selected_tab);
1335 $("#edit_suggester").on("click", function(e){
1337 editSuggesterPopup();
1342 [% IF ( op == 'show' || op == 'else' ) %]
1344 $(document).ready(function(){
1345 $(".deletesuggestion").on("click",function(){
1346 return confirm(_("Are you sure you want to delete this suggestion?"));
1351 [% IF op == 'else' %]
1352 [% INCLUDE 'datatables.inc' %]
1353 [% INCLUDE 'columns_settings.inc' %]
1355 $(document).ready(function() {
1356 if( $("#suggestiontabs .tab-pane.active").length < 1 ){
1357 $("#suggestiontabs a:first").tab("show");
1360 table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1361 var saved_table = localStorage.getItem("DataTables_suggestions_/cgi-bin/koha/suggestion/suggestion.pl");
1362 var updated_settings = get_columns_saved_state(saved_table, table_settings);
1364 [% FOREACH suggestion IN suggestions %]
1365 [% IF suggestion.suggestions.size %]
1366 KohaTable("table_[% loop.count| html %]", {
1367 "sorting": [[ 4, "asc" ]],
1370 }, updated_settings );
1374 $("#branchcode").on('change',function(){
1375 [%# Modify the hidden input in the filters block from the library %]
1376 [%# dropdown list at the top of suggestion list %]
1377 let branchcode = $(this).val();
1378 $('input[name="branchcode"]').val( branchcode );
1379 $('form[name="suggestionfilter"]').submit();
1382 $(".checkall").click(function(e){
1384 $(this).parents('form').find("input:checkbox").each(function(){
1385 $(this).prop("checked", true);
1388 $(".uncheckall").click(function(e){
1390 $(this).parents('form').find("input:checkbox").each(function(){
1391 $(this).prop("checked", false);
1394 $(".other_reason").hide();
1395 $("select[name='reason']").change(function(){
1396 if($(this).val() == "other"){
1398 $(this).siblings(".other_reason").show();
1402 $("a.cancel_note").click(function(e) {
1403 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1404 $(this).siblings("input[name='other_reason']").hide();
1408 $("h4.local_collapse a").on("click", function(e){
1410 const target = $(this).data("target");
1411 $("." + target).toggle();
1414 // Note: the selector below passes a second 'context' param - it is not a multiple selector
1415 $("button[type='submit']", ".suggestions_batch_ops").on("click", function(e) {
1416 var submit_button = this;
1417 var form = $(submit_button).parents("form");
1418 var action = $(submit_button).val();
1419 var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1420 if ( selected_suggestions.length == 0 ) {
1421 alert(_("Please select at least one suggestion"));
1425 if ( action == "delete" ) {
1426 if ( selected_suggestions.length == 1 ) {
1427 if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
1431 } else if ( selected_suggestions.length > 1 ) {
1432 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1437 } else if ( action == "update_manager" ) {
1438 var managedby = $(submit_button).siblings("suggestion_managedby");
1439 if ( managedby.val() == "" ) {
1440 alert(_("Please select a manager to assign to the selected suggestions"));
1446 $('<input />').attr('type', 'hidden')
1448 .attr('value', action)
1455 [% IF op == 'save' %]
1458 $(document).ready(function(){
1460 $("#quantity,#price,#currency").on("change",function(){
1464 [% IF other_reason %]
1465 $(".select-reason").hide();
1466 $(".select-reason").find("option[value='other']").attr("selected","selected");
1467 $("#other_reason").show();
1469 $("#other_reason").hide();
1471 $(".select-reason").change(function(){
1472 if($(this).val() == "other"){
1474 $("#other_reason").show();
1477 $("a[href*=back]").click(function(){
1478 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1479 $("#other_reason").hide();
1482 $("#restore_previous_manager").on("click",function(e){
1485 $("#managedby_name").empty();
1486 $("#managedby").val('');
1487 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1488 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1489 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1490 + borrowername + '</a>';
1491 $('#managedby_name').html(managerlink);
1492 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1493 $('#notify').prop('checked', false).prop('disabled', true);
1496 //keep a copy of all budgets before removing the inactives
1497 var budgetId = $("form#add_edit #budgetid");
1498 var disabledBudgetsCopy = budgetId.html();
1499 $('.b_inactive').remove();
1501 $('#showallfunds').click(function() {
1502 if ($(this).is(":checked")) {
1503 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1506 $('.b_inactive').remove();
1513 [% Asset.js("js/acq.js") | $raw %]
1514 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1516 [% INCLUDE 'intranet-bottom.inc' %]