1 [% PROCESS 'i18n.inc' %]
5 [% USE AuthorisedValues %]
8 [% USE TablesSettings %]
10 [% INCLUDE 'doc-head-open.inc' %]
13 [% IF ( suggestionid ) %]
14 Edit suggestion #[% suggestionid | html %] › Suggestions
16 Add suggestion › Suggestions
19 [% ELSIF ( op == 'show' ) %]
20 Show suggestion #[% suggestionid | html %] › Suggestions
23 Suggestions management
24 [% END %] › Acquisitions › Koha
26 [% INCLUDE 'doc-head-close.inc' %]
32 text-decoration: none;
34 #limits fieldset.brief,
35 #limits fieldset.action {
56 <body id="acq_suggestion" class="acq">
57 [% WRAPPER 'header.inc' %]
58 [% INCLUDE 'cat-search.inc' %]
61 [% WRAPPER 'sub-header.inc' %]
62 [% WRAPPER breadcrumbs %]
63 [% WRAPPER breadcrumb_item %]
64 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
66 [% IF ( op == 'save' || op == 'show' ) %]
67 [% WRAPPER breadcrumb_item %]
68 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
72 [% IF ( suggestionid ) %]
73 [% WRAPPER breadcrumb_item bc_active= 1 %]
74 <span>Edit suggestion #[% suggestionid | html %]</span>
77 [% WRAPPER breadcrumb_item bc_active= 1 %]
78 <span>Add suggestion</span>
81 [% ELSIF ( op == 'show' ) %]
82 [% WRAPPER breadcrumb_item bc_active= 1 %]
83 <span>Show suggestion #[% suggestionid | html %]</span>
86 [% WRAPPER breadcrumb_item bc_active= 1 %]
87 <span>Suggestions management</span>
90 [% END #/ WRAPPER breadcrumbs %]
91 [% END #/ WRAPPER sub-header.inc %]
93 [% INCLUDE 'blocking_errors.inc' %]
95 [% IF ( op == 'show' ) %]
96 <div class="main container-fluid">
98 <div class="col-md-8 col-md-offset-2">
100 <div id="toolbar" class="btn-toolbar">
101 <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit&suggestionid=[% suggestionid | html %]"><i class="fa fa-pencil"></i> Edit</a>
102 <a class="btn btn-default deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
105 <fieldset class="rows">
106 <legend>Bibliographic information</legend>
110 <span class="label">Title:</span>
111 [% IF suggestion.biblionumber %]
112 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
120 <span class="label">Author:</span>
124 [% IF ( copyrightdate ) %]
126 <span class="label">Copyright date:</span>
127 [% copyrightdate | html %]
132 <span class="label">ISBN or ISSN or other standard number:</span>
136 [% IF ( publishercode ) %]
138 <span class="label">Publisher:</span>
139 [% publishercode | html %]
144 <span class="label">Publication place:</span>
148 [% IF ( collectiontitle ) %]
150 <span class="label">Collection title:</span>
151 [% collectiontitle | html %]
154 [% IF ( itemtype ) %]
156 <span class="label">Document type:</span>
157 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
160 [% IF ( patron_reason_loop ) %]
162 <span class="label">Reason for suggestion: </span>
163 [% FOREACH patron_reason_loo IN patron_reason_loop %]
164 [% IF patron_reason_loo.authorised_value == patronreason %]
165 [% patron_reason_loo.lib | html %]
172 <span class="label">Notes:</span>
176 [% IF ( staff_note ) %]
178 <span class="label">Notes:</span>
179 [% staff_note | html %]
185 <fieldset class="rows">
186 <legend>Suggestion management</legend>
189 <span class="label">Status:</span>
190 [% SET status_found = 0 %]
191 [% IF ( STATUS == 'ASKED' ) %]
193 [% SET status_found = 1 %]
194 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
195 <span>Accepted</span>
196 [% SET status_found = 1 %]
197 [% ELSIF ( STATUS == 'CHECKED' ) %]
199 [% SET status_found = 1 %]
200 [% ELSIF ( STATUS == 'REJECTED' ) %]
201 <span>Rejected</span>
202 [% SET status_found = 1 %]
203 [% ELSIF ( STATUS == 'ORDERED' ) %]
205 [% SET status_found = 1 %]
206 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
207 <span>Available</span>
208 [% SET status_found = 1 %]
210 [% FOREACH s IN SuggestionStatuses %]
211 [% IF STATUS == s.authorised_value %]
213 [% SET status_found = 1 %]
219 <span class="label">Reason:</span>
221 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
236 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
237 <td>[% suggesteddate | $KohaDates %]</td>
239 [% IF ( suggestedby_patron.borrowernumber ) %]
240 <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>
241 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
247 <td>[% manageddate | $KohaDates %]</td>
249 [% IF ( managedby_patron.borrowernumber ) %]
250 <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>
251 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
256 <th>Accepted on:</th>
257 <td>[% accepteddate | $KohaDates %]</td>
259 [% IF ( acceptedby_patron.borrowernumber ) %]
260 <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>
261 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
266 <th>Last modification on:</th>
267 <td>[% lastmodificationdate | $KohaDates %]</td>
269 [% IF ( lastmodificationby_patron.borrowernumber ) %]
270 <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>
271 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
279 <fieldset class="rows">
280 <legend>Acquisition information</legend>
283 <span class="label">Library:</span>
284 [% Branches.GetName( branchcode ) | html %]
287 <span class="label">Fund:</span>
288 [% budgetname | html %]
291 <span class="label">Copies:</span>
292 [% quantity | html %]
295 <span class="label">Currency:</span>
296 [% currency | html %]
299 <span class="label">Price:</span>
303 <span class="label">Total</span>
309 <fieldset class="action">
310 <a href="suggestion.pl"><< Back to suggestions</a>
313 </div> <!-- /.col-md-8 col-md-offset-2 -->
314 </div> <!-- /.row -->
315 [% ELSE # IF op == "show" %]
317 [% IF op == 'save' %]
318 <div class="main container-fluid">
320 <div class="col-md-8 col-md-offset-2">
322 <div class="main container-fluid">
324 <div class="col-sm-10 col-sm-push-2">
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"></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 type="text" size="20" name="price" id="price" value="[% price | html %]" />
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 %]&op=edit"><i class="fa fa-pencil"></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 %]"><i class="fa fa-trash"></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="archived" style="display: inline;">Include archived:</label>
1085 [% IF filter_archived %]
1086 <input type="checkbox" id="archived" value="1" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1088 <input type="checkbox" id="archived" value="1" name="filter_archived" title="Include archived suggestions in the search" />
1092 <label for="STATUS[% loop.index | html %]"> Status:</label>
1093 <select name="STATUS" id="STATUS[% loop.index | html %]">
1094 <option value="">Any</option>
1095 [% IF (statusselected_ASKED ) %]
1096 <option value="ASKED" selected="selected">Pending</option>
1098 <option value="ASKED">Pending</option>
1101 [% IF (statusselected_ACCEPTED ) %]
1102 <option value="ACCEPTED" selected="selected">Accepted</option>
1104 <option value="ACCEPTED">Accepted</option>
1107 [% IF (statusselected_CHECKED ) %]
1108 <option value="CHECKED" selected="selected">Checked</option>
1110 <option value="CHECKED">Checked</option>
1113 [% IF ( statusselected_REJECTED ) %]
1114 <option value="REJECTED" selected="selected">Rejected</option>
1116 <option value="REJECTED">Rejected</option>
1119 [% IF ( statusselected_ORDERED ) %]
1120 <option value="ORDERED" selected="selected">Ordered</option>
1122 <option value="ORDERED">Ordered</option>
1125 [% FOREACH s IN SuggestionStatuses %]
1126 [% IF s.authorised_value == selected_status %]
1127 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1129 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1136 <label for="suggestedby"> Suggested by:</label>
1137 <select id="suggestedby" name="suggestedby">
1138 <option value="">Any</option>
1139 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1140 [% IF ( suggestedby_loo.selected ) %]
1141 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1143 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1149 <label for="suggesteddate_from">Suggested date from:</label>
1150 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" data-date_to="suggesteddate_to" class="flatpickr" />
1153 <label for="suggesteddate_to">To:</label>
1154 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" class="flatpickr" />
1157 <label for="managedby"> Managed by:</label>
1158 <select id="managedby" name="managedby">
1159 <option value="">Any</option>
1160 [% FOREACH managedby_loo IN managedby_loop %]
1161 [% IF ( managedby_loo.selected ) %]
1162 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1164 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1170 <label for="manageddate_from">Management date from:</label>
1171 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" data-date_to="manageddate_to" class="flatpickr" />
1174 <label for="manageddate_to">To:</label>
1175 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" class="flatpickr" />
1178 <label for="acceptedby"> Accepted by:</label>
1179 <select id="acceptedby" name="acceptedby">
1180 <option value="">Any</option>
1181 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1182 [% IF ( acceptedby_loo.selected ) %]
1183 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1185 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1191 <label for="accepteddate_from">Accepted date from:</label>
1192 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" data-date_to="accepteddate_to" class="flatpickr" />
1195 <label for="accepteddate_to">To:</label>
1196 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" class="flatpickr" />
1199 </fieldset> <!-- /#suggestion_information -->
1200 <fieldset class="action suggestion_information">
1201 <input type="submit" value="Go" />
1204 <h4 class="local_collapse">
1205 <a href="#" data-target="acquisition_information">Acquisition information</a>
1207 <fieldset class="brief acquisition_information">
1210 <label for="budgetid"> Book fund:</label>
1211 <select name="budgetid" id="budgetid">
1212 <option value="__ANY__">Any</option>
1213 [% IF budgetid == '__NONE__' %]
1214 <option value="__NONE__" selected="selected">None</option>
1216 <option value="__NONE__">None</option>
1218 [% FOREACH budgetsloo IN budgetsloop %]
1219 [% IF ( budgetsloo.selected ) %]
1220 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1222 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1228 </fieldset> <!-- /#acquisition_information -->
1229 <fieldset class="action acquisition_information">
1230 <input type="submit" value="Go" />
1233 <div id="filter_archived_information">
1236 <label for="archived" style="display: inline;">Include archived:</label>
1237 [% IF filter_archived %]
1238 <input type="checkbox" id="archived" value="1" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1240 <input type="checkbox" id="archived" value="1" name="filter_archived" title="Include archived suggestions in the search" />
1245 </div> <!-- /#limits -->
1246 </fieldset> <!-- /.brief -->
1247 </form> <!-- /suggestionsfilter -->
1249 [% INCLUDE 'acquisitions-menu.inc' %]
1252 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1253 [% END # /UNLESS ( op == 'show' ) %]
1254 [% END # /UNLESS op == 'save' %]
1255 </div> <!-- /.row -->
1257 [% END # /IF op == "show" %]
1259 [% MACRO jsinclude BLOCK %]
1260 [% INCLUDE 'calendar.inc' %]
1264 function editManagerPopup(selected_tab) {
1266 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_manager&filter=suggestions_managers",
1268 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1269 + 'scrollbars=yes,resize=yes'
1272 function select_manager(borrowernumber, borrower) {
1273 var managedby_name = $("#managedby_name"+tab);
1274 var managedby = $("#managedby"+tab);
1275 managedby_name.empty();
1277 var borrowername = borrower.firstname + ' ' + borrower.surname;
1278 if (borrowernumber) {
1279 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1280 + '?borrowernumber=' + borrowernumber + '">'
1281 + borrowername + '</a>';
1282 managedby_name.html(managerlink);
1283 managedby.val(borrowernumber);
1286 [% IF op == "save" %]
1287 var notify = $('#notify');
1288 if ( notify.length ) {
1289 [% IF managedby_patron %]
1290 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1292 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1294 $(notify).prop('checked', false).prop('disabled', true);
1296 $(notify).prop('disabled', false);
1302 function editSuggesterPopup() {
1303 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_suggester",
1305 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1306 + 'scrollbars=yes,resize=yes'
1310 function select_suggester(borrowernumber, borrower) {
1311 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />';
1312 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">';
1313 suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')';
1314 suggested += '</a> ';
1315 suggested += borrower.branchname + ' (' + borrower.category_description + ')';
1316 $("#tdsuggestedby").html(suggested);
1319 $(document).ready(function(){
1320 $("#edit_manager").on("click",function(e){
1322 editManagerPopup('');
1324 $(".set_manager").on("click",function(e){
1326 var selected_tab = $(this).data('tab');
1327 editManagerPopup(selected_tab);
1330 $("#edit_suggester").on("click", function(e){
1332 editSuggesterPopup();
1337 [% IF ( op == 'show' || op == 'else' ) %]
1339 $(document).ready(function(){
1340 $(".deletesuggestion").on("click",function(){
1341 return confirm(_("Are you sure you want to delete this suggestion?"));
1346 [% IF op == 'else' %]
1347 [% INCLUDE 'datatables.inc' %]
1348 [% INCLUDE 'columns_settings.inc' %]
1350 $(document).ready(function() {
1351 if( $("#suggestiontabs .tab-pane.active").length < 1 ){
1352 $("#suggestiontabs a:first").tab("show");
1355 table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1356 [% FOREACH suggestion IN suggestions %]
1357 [% IF suggestion.suggestions.size %]
1358 KohaTable("table_[% loop.count| html %]", {
1359 "sorting": [[ 3, "asc" ]],
1361 }, table_settings );
1365 $("#branchcode").on('change',function(){
1366 [%# Modify the hidden input in the filters block from the library %]
1367 [%# dropdown list at the top of suggestion list %]
1368 let branchcode = $(this).val();
1369 $('input[name="branchcode"]').val( branchcode );
1370 $('form[name="suggestionfilter"]').submit();
1373 $(".checkall").click(function(e){
1375 $(this).parents('form').find("input:checkbox").each(function(){
1376 $(this).prop("checked", true);
1379 $(".uncheckall").click(function(e){
1381 $(this).parents('form').find("input:checkbox").each(function(){
1382 $(this).prop("checked", false);
1385 $(".other_reason").hide();
1386 $("select[name='reason']").change(function(){
1387 if($(this).val() == "other"){
1389 $(this).siblings(".other_reason").show();
1393 $("a.cancel_note").click(function(e) {
1394 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1395 $(this).siblings("input[name='other_reason']").hide();
1399 $("h4.local_collapse a").on("click", function(e){
1401 const target = $(this).data("target");
1402 $("." + target).toggle();
1405 // Note: the selector below passes a second 'context' param - it is not a multiple selector
1406 $("button[type='submit']", ".suggestions_batch_ops").on("click", function(e) {
1407 var submit_button = this;
1408 var form = $(submit_button).parents("form");
1409 var action = $(submit_button).val();
1410 var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1411 if ( selected_suggestions.length == 0 ) {
1412 alert(_("Please select at least one suggestion"));
1416 if ( action == "delete" ) {
1417 if ( selected_suggestions.length == 1 ) {
1418 if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
1422 } else if ( selected_suggestions.length > 1 ) {
1423 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1428 } else if ( action == "update_manager" ) {
1429 var managedby = $(submit_button).siblings("suggestion_managedby");
1430 if ( managedby.val() == "" ) {
1431 alert(_("Please select a manager to assign to the selected suggestions"));
1437 $('<input />').attr('type', 'hidden')
1439 .attr('value', action)
1446 [% IF op == 'save' %]
1449 $(document).ready(function(){
1451 $("#quantity,#price,#currency").on("change",function(){
1455 [% IF other_reason %]
1456 $(".select-reason").hide();
1457 $(".select-reason").find("option[value='other']").attr("selected","selected");
1458 $("#other_reason").show();
1460 $("#other_reason").hide();
1462 $(".select-reason").change(function(){
1463 if($(this).val() == "other"){
1465 $("#other_reason").show();
1468 $("a[href*=back]").click(function(){
1469 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1470 $("#other_reason").hide();
1473 $("#restore_previous_manager").on("click",function(e){
1476 $("#managedby_name").empty();
1477 $("#managedby").val('');
1478 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1479 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1480 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1481 + borrowername + '</a>';
1482 $('#managedby_name').html(managerlink);
1483 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1484 $('#notify').prop('checked', false).prop('disabled', true);
1487 //keep a copy of all budgets before removing the inactives
1488 var budgetId = $("form#add_edit #budgetid");
1489 var disabledBudgetsCopy = budgetId.html();
1490 $('.b_inactive').remove();
1492 $('#showallfunds').click(function() {
1493 if ($(this).is(":checked")) {
1494 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1497 $('.b_inactive').remove();
1504 [% Asset.js("js/acq.js") | $raw %]
1505 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1507 [% INCLUDE 'intranet-bottom.inc' %]