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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
65 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
68 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
72 [% IF ( suggestionid ) %]
74 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
77 <a href="#" aria-current="page">
78 Edit suggestion #[% suggestionid | html %]
83 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
86 <a href="#" aria-current="page">
91 [% ELSIF ( op == 'show' ) %]
93 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
96 <a href="#" aria-current="page">
97 Show suggestion #[% suggestionid | html %]
102 <a href="#" aria-current="page">
103 Suggestions management
108 </nav> <!-- /.breadcrumbs -->
111 [% IF ( op == 'show' ) %]
112 <div class="main container-fluid">
114 <div class="col-md-8 col-md-offset-2">
116 <div id="toolbar" class="btn-toolbar">
117 <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit&suggestionid=[% suggestionid | html %]"><i class="fa fa-pencil"></i> Edit</a>
118 <a class="btn btn-default deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
121 <fieldset class="rows">
122 <legend>Bibliographic information</legend>
126 <span class="label">Title:</span>
127 [% IF suggestion.biblionumber %]
128 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
136 <span class="label">Author:</span>
140 [% IF ( copyrightdate ) %]
142 <span class="label">Copyright date:</span>
143 [% copyrightdate | html %]
148 <span class="label">ISBN or ISSN or other standard number:</span>
152 [% IF ( publishercode ) %]
154 <span class="label">Publisher:</span>
155 [% publishercode | html %]
160 <span class="label">Publication place:</span>
164 [% IF ( collectiontitle ) %]
166 <span class="label">Collection title:</span>
167 [% collectiontitle | html %]
170 [% IF ( itemtype ) %]
172 <span class="label">Document type:</span>
173 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
176 [% IF ( patron_reason_loop ) %]
178 <span class="label">Reason for suggestion: </span>
179 [% FOREACH patron_reason_loo IN patron_reason_loop %]
180 [% IF patron_reason_loo.authorised_value == patronreason %]
181 [% patron_reason_loo.lib | html %]
188 <span class="label">Notes:</span>
192 [% IF ( staff_note ) %]
194 <span class="label">Notes:</span>
195 [% staff_note | html %]
201 <fieldset class="rows">
202 <legend>Suggestion management</legend>
205 <span class="label">Status:</span>
206 [% SET status_found = 0 %]
207 [% IF ( STATUS == 'ASKED' ) %]
209 [% SET status_found = 1 %]
210 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
211 <span>Accepted</span>
212 [% SET status_found = 1 %]
213 [% ELSIF ( STATUS == 'CHECKED' ) %]
215 [% SET status_found = 1 %]
216 [% ELSIF ( STATUS == 'REJECTED' ) %]
217 <span>Rejected</span>
218 [% SET status_found = 1 %]
219 [% ELSIF ( STATUS == 'ORDERED' ) %]
221 [% SET status_found = 1 %]
222 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
223 <span>Available</span>
224 [% SET status_found = 1 %]
226 [% FOREACH s IN SuggestionStatuses %]
227 [% IF STATUS == s.authorised_value %]
229 [% SET status_found = 1 %]
235 <span class="label">Reason:</span>
237 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
252 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
253 <td>[% suggesteddate | $KohaDates %]</td>
255 [% IF ( suggestedby_patron.borrowernumber ) %]
256 <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>
257 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
263 <td>[% manageddate | $KohaDates %]</td>
265 [% IF ( managedby_patron.borrowernumber ) %]
266 <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>
267 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
272 <th>Accepted on:</th>
273 <td>[% accepteddate | $KohaDates %]</td>
275 [% IF ( acceptedby_patron.borrowernumber ) %]
276 <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>
277 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
282 <th>Last modification on:</th>
283 <td>[% lastmodificationdate | $KohaDates %]</td>
285 [% IF ( lastmodificationby_patron.borrowernumber ) %]
286 <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>
287 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
295 <fieldset class="rows">
296 <legend>Acquisition information</legend>
299 <span class="label">Library:</span>
300 [% Branches.GetName( branchcode ) | html %]
303 <span class="label">Fund:</span>
304 [% budgetname | html %]
307 <span class="label">Copies:</span>
308 [% quantity | html %]
311 <span class="label">Currency:</span>
312 [% currency | html %]
315 <span class="label">Price:</span>
319 <span class="label">Total</span>
325 <fieldset class="action">
326 <a href="suggestion.pl"><< Back to suggestions</a>
329 </div> <!-- /.col-md-8 col-md-offset-2 -->
330 </div> <!-- /.row -->
331 [% ELSE # IF op == "show" %]
333 [% IF op == 'save' %]
334 <div class="main container-fluid">
336 <div class="col-md-8 col-md-offset-2">
338 <div class="main container-fluid">
340 <div class="col-sm-10 col-sm-push-2">
343 [% IF op == 'save' %]
344 [% FOR m IN messages %]
345 <div class="dialog [% m.type | html %]">
347 [% CASE 'biblio_exists' %]
348 <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>
349 [% CASE 'manager_not_enough_permissions' %]
350 <span>The manager you selected does not have sufficient permissions.</span>
352 <span>[% m.code | html %]</span>
354 </div> <!-- /.dialog -->
357 <form id="add_edit" action="suggestion.pl" method="post" class="validated">
358 <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
359 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
360 [% IF ( suggestionid ) %]
361 <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
362 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
364 <h1>Enter a new purchase suggestion</h1>
367 <fieldset class="rows">
368 <legend>Bibliographic information</legend>
371 <label for="title" class="required">Title:</label>
372 <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
373 <span class="required">Required</span>
376 <label for="author">Author:</label>
377 <input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/>
380 <label for="copyrightdate">Copyright date:</label>
381 <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" />
384 <label for="isbn">ISBN or ISSN or other standard number:</label>
385 <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn | html %]"/>
388 <label for="publishercode">Publisher:</label>
389 <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/>
392 <label for="place">Publication place:</label>
393 <input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/>
396 <label for="collectiontitle">Collection title:</label>
397 <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/>
400 <label for="itemtype">Document type:</label>
401 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
403 [% IF patron_reason_loop %]
405 <label for="patronreason">Reason for suggestion: </label>
406 <select name="patronreason" id="patronreason">
407 <option value=""> -- Choose -- </option>
408 [% FOREACH patron_reason_loo IN patron_reason_loop %]
409 [% IF patron_reason_loo.authorised_value == patronreason %]
410 <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
412 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
417 [% END # /IF patron_reason_loop %]
419 <label for="note">Notes:</label>
420 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
423 <label for="note">Non-public notes:</label>
424 <textarea name="staff_note" id="staff_note" rows="5" cols="40">[% staff_note | html %]</textarea>
429 <fieldset class="rows">
430 <legend>Suggestion management</legend>
432 [% IF ( suggestionid ) %]
434 <label for="STATUS">Status:</label>
435 <select id="STATUS" name="STATUS">
436 <option value="">No status</option>
438 [% IF (statusselected_ASKED ) %]
439 <option value="ASKED" selected="selected">Pending</option>
441 <option value="ASKED">Pending</option>
444 [% IF (statusselected_ACCEPTED ) %]
445 <option value="ACCEPTED" selected="selected">Accepted</option>
447 <option value="ACCEPTED">Accepted</option>
450 [% IF (statusselected_CHECKED ) %]
451 <option value="CHECKED" selected="selected">Checked</option>
453 <option value="CHECKED">Checked</option>
456 [% IF ( statusselected_REJECTED ) %]
457 <option value="REJECTED" selected="selected">Rejected</option>
459 <option value="REJECTED">Rejected</option>
462 [% IF ( statusselected_ORDERED ) %]
463 <option value="ORDERED" selected="selected">Ordered</option>
465 <option value="ORDERED">Ordered</option>
468 [% FOREACH s IN SuggestionStatuses %]
469 [% IF s.authorised_value == suggestion.STATUS %]
470 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
472 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
478 <label for="reason">Reason:</label>
479 <select class="select-reason" id="reason" name="reason">
480 <option value=""> -- Choose a reason -- </option>
481 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
482 [% IF (reasonsloo.lib == suggestion.reason) %]
483 <option value="[% reasonsloo.lib | html %]" selected="selected">[% reasonsloo.lib | html %]</option>
485 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
488 <option value="other">Others...</option>
491 <span id="other_reason" name="other_reason">
492 [% IF other_reason %]
493 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
495 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
497 <a href="#back">Cancel</a>
514 <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
517 <input type="text" id="suggesteddate" name="suggesteddate" class="flatpickr" size="10" maxlength="10" value="[% suggesteddate | html %]"/> [% INCLUDE 'date-format.inc' %]
519 <td id="tdsuggestedby">
520 <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
521 [% IF ( suggestedby_patron.borrowernumber ) %]
522 <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 %])
526 <a href="#" id="edit_suggester" class="btn btn-default">Set to patron</a>
531 <label for="accepteddate">Accepted on:</label>
534 <input type="text" id="accepteddate" name="accepteddate" class="flatpickr" size="10" maxlength="10" value="[% accepteddate | html %]" />[% INCLUDE 'date-format.inc' %]
537 <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
538 [% IF ( acceptedby_patron.borrowernumber ) %]
539 <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>
540 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
547 <label for="lastmodificationdate">Last modification on:</label>
550 [% lastmodificationdate | $KohaDates %]
553 [% IF lastmodificationby_patron %]
554 [% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
563 <label for="managedon">Managed on:</label>
564 <input type="text" id="managedon" name="manageddate" class="flatpickr" size="10" maxlength="10" value="[% manageddate | html %]" />[% INCLUDE 'date-format.inc' %]
567 <label for="managedby_name">by:</label>
569 <span id="managedby_name" name="managedby_name">
570 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
572 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
573 | 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 %])
576 <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a>
577 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
578 <a id="restore_previous_manager" href="#"><i class="fa fa-trash"></i> Keep existing manager</a>
580 <input type="hidden" name="managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" />
583 <label for="notify">Notify manager:</label>
584 <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." />
590 <fieldset class="rows">
591 <legend>Acquisition information</legend>
594 <label for="branchcode">Library:</label>
595 <select name="branchcode" id="branchcode">
596 <option value="">Any</option>
597 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
601 <label for="budgetid">Fund:</label>
602 <select name="budgetid" id="budgetid">
603 <option value="">Any</option>
604 [% FOREACH budget IN sugg_budgets %]
605 [% IF ( budget.selected ) %]
606 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
607 [% ELSIF ( budget.b_active ) %]
608 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
610 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
614 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
615 <input type="checkbox" id="showallfunds" />
618 <label for="quantity">Copies:</label>
619 <input type="text" size="10" id="quantity" name="quantity" value="[% quantity | html %]" />
622 <label for="currency">Currency:</label>
623 [% FOREACH c IN currencies %]
624 <input type="hidden" value="[% c.rate | html %]" id="currency_rate_[% c.currency | html %]" name="currency_rate_[% c.currency | html %]" />
625 <input type="hidden" id="[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" />
627 <select name="currency" id="currency">
628 [% FOREACH c IN currencies %]
629 [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
630 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
631 [% ELSIF not c.archived %]
632 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
638 <label for="price">Price:</label>
639 <input type="text" size="20" name="price" id="price" value="[% price | html %]" />
642 <label for="total">Total: </label>
643 <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total | html %]"/>
646 </fieldset> <!-- /.rows -->
648 <fieldset class="action">
649 <input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
650 <input type="hidden" name="op" value="[% op | html %]" />
651 [% IF ( suggestionid ) %]
652 [% IF ( need_confirm ) %]
653 <input type="hidden" name="save_confirmed" value="1" />
654 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" class="btn btn-primary" value="Confirm your suggestion" />
656 <input type="submit" class="btn btn-primary" value="Save" />
658 <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
660 [% IF ( need_confirm ) %]
661 <input type="hidden" name="save_confirmed" value="1" />
662 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" class="btn btn-primary" value="Confirm your suggestion" />
664 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
666 <a class="cancel" href="suggestion.pl">Cancel</a>
668 </fieldset> <!-- /.action -->
669 </form> <!-- /#add_edit -->
670 [% END # /IF op == 'save' %]
672 [% IF op == 'else' %]
673 <div id="toolbar" class="btn-toolbar">
674 <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>
677 <h1>Suggestions management</h1>
679 [% IF ( displayby != "branchcode" ) %]
680 <label for="branchcode">Viewing suggestions for library:</label>
681 <select name="branchcode" id="branchcode">
682 <option value="__ANY__">Any</option>
683 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
687 [% FOR m IN messages %]
688 <div class="dialog [% m.type | html %]">
690 [% CASE 'already_exists' %]
691 <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>
692 [% CASE 'biblio_exists' %]
693 <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>
695 <span>[% m.code | html %]</span>
697 </div> <!-- /.dialog -->
700 [% IF suggestions.size && !notabs %]
701 <div id="suggestiontabs" class="toptabs">
702 <ul class="nav nav-tabs" role="tablist">
703 [% FOREACH suggestion IN suggestions %]
704 <li role="presentation">
705 <a href="#[% suggestion.suggestiontype | uri %]" aria-controls="[% suggestion.suggestiontype | uri %]" role="tab" data-toggle="tab">
706 [% IF ( suggestion.suggestiontypelabel ) %]
707 [% IF (suggestion.suggestiontypelabel == "Pending") %]<span>Pending</span>
708 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]<span>Accepted</span>
709 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]<span>Checked</span>
710 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]<span>Rejected</span>
711 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]<span>Available</span>
712 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]<span>Ordered</span>
713 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]<span>Status unknown</span>
714 [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]<span>Any</span>
715 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
717 [% IF ( suggestion.suggestiontype ) %]
718 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
723 ([% suggestion.suggestions.size| html %])
726 [% END # /FOREACH suggestion %]
727 </ul> <!-- /.ui-tabs-nav -->
728 <div class="tab-content">
729 [% END # IF suggestions.size && !notabs %]
731 [% FOREACH suggestion IN suggestions %]
732 [% UNLESS ( notabs ) %]
733 <div id="[% suggestion.suggestiontype | html %]" role="tabpanel" class="tab-pane">
735 <div id="[% suggestion.suggestiontype | html %]">
737 <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
739 [% IF suggestion.suggestions.size %]
741 <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
744 <table id="table_[% loop.count | html %]" class="sorted">
747 <th class="NoSort noExport"> </th>
748 <th class="anti-the">Suggestion</th>
749 <th>Suggested by</th>
750 <th>Suggester category</th>
751 <th>Suggested on</th>
752 <th>Patron reason</th>
755 <th>Last modification by</th>
756 <th>Last modification on</th>
757 <th>Last updated</th>
760 <th>Non-public note</th>
762 <th class="NoSort noExport"> </th>
766 [% FOREACH s IN suggestion.suggestions %]
769 <input type="checkbox" name="suggestionid" value="[% s.suggestionid | html %]" />
772 <a href="suggestion.pl?suggestionid=[% s.suggestionid | uri %]&op=show" title="suggestion" >
773 [% s.title | html %][% IF ( s.author ) %], by [% s.author | html %][% END %]
776 [% IF ( s.copyrightdate ) %]
777 © <span class="suggestion_copyrightdate">[% s.copyrightdate | html %]</span>
779 [% IF ( s.volumedesc ) %]
780 ; <span class="suggestion_volume">Volume:<em>[% s.volumedesc | html %]</em></span>
783 ; <span class="suggestion_isbn">ISBN: <em>[% s.isbn | html %]</em></span>
785 [% IF ( s.publishercode ) %]
786 ; <span class="suggestion_publishercode">Published by [% s.publishercode | html %]</span>
788 [% IF ( s.publicationyear ) %]
789 in <span class="suggestion_publicationyear"><em>[% s.publicationyear | html %]</em></span>
792 in <span class="suggestion_place"><em>[% s.place | html %]</em></span>
794 [% IF ( s.collectiontitle ) %]
795 ; <span class="suggestion_collectiontitle">[% s.collectiontitle | html %]</span>
797 [% IF ( s.itemtype ) %]
798 ; <span class="suggestion_itype">[% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', s.itemtype, 0 ) | html %]</span>
802 <div class="suggestion_note"><i class="fa fa-comment"></i> [% s.note | html %]</div>
805 <br /><i class="fa fa-archive"></i> Archived
809 [% SET suggester = s.suggester %]
810 <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>
813 [% suggester.category.description | html %]
815 <td data-order="[% s.suggesteddate | html %]">
816 [% IF ( s.suggesteddate ) %][% s.suggesteddate | $KohaDates %][% END %]
818 <td>[% AuthorisedValues.GetByCode( 'OPAC_SUG', s.patronreason ) | html %]</td>
820 [% SET manager = s.manager %]
821 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% manager.borrowernumber | uri %]">[% manager.surname | html %][% IF manager.firstname %], [% manager.firstname | html %][% END %]</a>
823 <td data-order="[% s.manageddate | html %]">
824 [% IF ( s.manageddate ) %][% s.manageddate | $KohaDates %][% END %]
827 [% SET last_modifier = s.last_modifier %]
828 <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>
830 <td data-order="[% s.lastmodificationdate | html %]">
831 [% IF ( s.lastmodificationdate ) %][% s.lastmodificationdate | $KohaDates %][% END %]
834 [% s.lastmodificationdate | $KohaDates %]
837 [% Branches.GetName( s.branchcode ) | html %]
840 [% s.fund.budget_name | html %]
843 [% s.staff_note | html %]
846 [% IF s.STATUS == 'ASKED' %]
848 [% ELSIF s.STATUS == 'ACCEPTED' %]
849 <span>Accepted</span>
850 [% ELSIF s.STATUS == 'ORDERED' %]
852 [% ELSIF s.STATUS == 'REJECTED' %]
853 <span>Rejected</span>
854 [% ELSIF s.STATUS == 'CHECKED' %]
856 [% ELSIF s.STATUS == 'AVAILABLE' %]
857 <span>Available</span>
858 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) %]
859 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) | html %]
861 <span>Status unknown</span>
864 [% IF ( s.reason ) %]
865 <br />([% s.reason | html %])
869 <div class="btn-group dropup">
870 <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>
871 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% s.suggestionid | html %]">
872 <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a></li>
873 [% UNLESS s.archived %]
874 <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
876 <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li>
882 [% END # /FOREACH s %]
884 </table> <!-- /#table_[% loop.count | html %] -->
887 <div class="col-sm-12">
888 <h2>Change selected suggestions</h2>
892 <div class="col-sm-4">
893 <fieldset class="brief">
894 <div id="select-reason[% loop.index | html %]">
895 <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label>
896 <select name="STATUS" id="STATUSreason[% loop.index | html %]">
897 <option value=""> -- Choose a status --</option>
899 [% IF (statusselected_ASKED ) %]
900 <option value="ASKED" selected="selected">Pending</option>
902 <option value="ASKED">Pending</option>
905 [% IF (statusselected_ACCEPTED ) %]
906 <option value="ACCEPTED" selected="selected">Accepted</option>
908 <option value="ACCEPTED">Accepted</option>
911 [% IF (statusselected_CHECKED ) %]
912 <option value="CHECKED" selected="selected">Checked</option>
914 <option value="CHECKED">Checked</option>
917 [% IF ( statusselected_REJECTED ) %]
918 <option value="REJECTED" selected="selected">Rejected</option>
920 <option value="REJECTED">Rejected</option>
923 [% IF ( statusselected_ORDERED ) %]
924 <option value="ORDERED" selected="selected">Ordered</option>
926 <option value="ORDERED">Ordered</option>
929 [% FOREACH s IN SuggestionStatuses %]
930 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
934 <label for="choosereason[% loop.index | html %]">with this reason:</label>
935 <select name="reason" id="choosereason[% loop.index | html %]">
936 <option value=""> -- Choose a reason -- </option>
937 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
938 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
940 <option value="other">Others...</option>
943 <span class="other_reason">
944 <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
945 <a href="#" class="cancel_note">Cancel</a>
949 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
950 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
952 <fieldset class="action">
953 <button type="submit" class="btn btn-primary" value="update_status">Submit</button>
955 </div> <!-- /.col-sm-4 -->
957 <div class="col-sm-2">
958 <fieldset class="brief">
959 <label id="suggestion_itemtype">
960 Update item types with:
962 [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %]
963 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
964 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
966 <fieldset class="action">
967 <button type="submit" class="btn btn-primary" value="update_itemtype">Submit</button>
969 </div> <!-- /.col-sm-4 -->
971 <div class="col-sm-2">
972 <fieldset class="brief">
973 <span class="label">Update manager</span>
974 <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>
975 <span id="managedby_name[% loop.count | html %]"></span>
976 <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
977 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
978 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
980 <fieldset class="action">
981 <button type="submit" class="btn btn-primary" value="update_manager">Submit</button>
983 </div> <!-- /.col-sm-2 -->
985 <div class="col-sm-2">
986 <fieldset class="brief">
987 <span class="label">Delete selected</span>
988 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
989 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
991 <fieldset class="action">
992 <button type="submit" class="btn btn-primary" value="delete">Delete</button>
994 </div> <!-- /.col-sm-2 -->
995 <div class="col-sm-2">
996 <fieldset class="brief">
997 <span class="label">Archive selected</span>
998 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
999 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
1000 <fieldset class="action">
1001 <button type="submit" class="btn btn-primary" value="archive">Archive</button>
1004 </div> <!-- /.col-sm-2 -->
1005 </div> <!-- /.row -->
1008 <strong>No results.</strong>
1009 [% END # /IF ( suggestion.suggestions_loop ) %]
1010 </form> <!-- /.update_suggestions -->
1011 </div> <!-- /#[% suggestion.suggestiontype | html %] -->
1012 [% END # /FOREACH suggestion %]
1013 [% IF suggestions.size && !notabs %]
1014 </div> <!-- /.tab-content -->
1015 </div> <!-- /.notabs -->
1016 [% END # /UNLESS notabs %]
1017 [% END # /IF op == 'else' %]
1019 [% UNLESS op == 'save' %]
1020 [% UNLESS ( op == 'show' ) %]
1021 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1023 <div class="col-sm-2 col-sm-pull-10">
1025 <form name="suggestionfilter" action="suggestion.pl" method="get">
1026 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1027 <fieldset class="brief">
1028 <h4>Organize by:</h4>
1031 <label for="displayby" class="sr-only">Organize by: </label>
1032 <select name="displayby" id="displayby">
1033 [% IF ( displayby == "STATUS" ) %]
1034 <option value="STATUS" selected="selected">Status</option>
1036 <option value="STATUS">Status</option>
1038 [% IF ( displayby == "branchcode" ) %]
1039 <option value="branchcode" selected="selected">Library</option>
1041 <option value="branchcode">Library</option>
1043 [% IF ( displayby == "itemtype" ) %]
1044 <option value="itemtype" selected="selected">Item type</option>
1046 <option value="itemtype">Item type</option>
1048 [% IF ( displayby == "managedby" ) %]
1049 <option value="managedby" selected="selected">Managed by</option>
1051 <option value="managedby">Managed by</option>
1053 [% IF ( displayby == "acceptedby" ) %]
1054 <option value="acceptedby" selected="selected">Accepted by</option>
1056 <option value="acceptedby">Accepted by</option>
1061 </fieldset> <!-- /.brief -->
1062 <fieldset class="action">
1063 <input type="submit" class="btn btn-primary" value="Go" />
1066 <fieldset class="brief">
1067 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
1070 <h4 class="local_collapse"><a href="#" data-target="biblio_information">Bibliographic information</a></h4>
1071 <fieldset class="brief biblio_information">
1074 <label for="title"> Title:</label>
1075 <input type="text" id="title" name="title" value="[% title | html %]" />
1078 <label for="author"> Author:</label>
1079 <input type="text" id="author" name="author" value="[% author | html %]" />
1082 <label for="isbn"> ISBN:</label>
1083 <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" />
1086 <label for="publishercode"> Publisher:</label>
1087 <input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" />
1090 <label for="copyrightdate_filter"> Copyright date:</label>
1091 <input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" />
1094 <label for="collectiontitle"> Collection title:</label>
1095 <input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" />
1098 </fieldset> <!-- /.biblio_information -->
1099 <fieldset class="action biblio_information">
1100 <input type="submit" value="Go" />
1103 <h4 class="local_collapse"><a href="#" data-target="suggestion_information">Suggestion information</a></h4>
1104 <fieldset class="brief suggestion_information">
1107 <label for="STATUS[% loop.index | html %]"> Status:</label>
1108 <select name="STATUS" id="STATUS[% loop.index | html %]">
1109 <option value="">Any</option>
1110 [% IF (statusselected_ASKED ) %]
1111 <option value="ASKED" selected="selected">Pending</option>
1113 <option value="ASKED">Pending</option>
1116 [% IF (statusselected_ACCEPTED ) %]
1117 <option value="ACCEPTED" selected="selected">Accepted</option>
1119 <option value="ACCEPTED">Accepted</option>
1122 [% IF (statusselected_CHECKED ) %]
1123 <option value="CHECKED" selected="selected">Checked</option>
1125 <option value="CHECKED">Checked</option>
1128 [% IF ( statusselected_REJECTED ) %]
1129 <option value="REJECTED" selected="selected">Rejected</option>
1131 <option value="REJECTED">Rejected</option>
1134 [% IF ( statusselected_ORDERED ) %]
1135 <option value="ORDERED" selected="selected">Ordered</option>
1137 <option value="ORDERED">Ordered</option>
1140 [% FOREACH s IN SuggestionStatuses %]
1141 [% IF s.authorised_value == selected_status %]
1142 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1144 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1151 <label for="suggestedby"> Suggested by:</label>
1152 <select id="suggestedby" name="suggestedby">
1153 <option value="">Any</option>
1154 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1155 [% IF ( suggestedby_loo.selected ) %]
1156 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1158 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1164 <label for="suggesteddate_from">Suggested date from:</label>
1165 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" data-date_to="suggesteddate_to" class="flatpickr" />
1168 <label for="suggesteddate_to">To:</label>
1169 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" class="flatpickr" />
1172 <label for="managedby"> Managed by:</label>
1173 <select id="managedby" name="managedby">
1174 <option value="">Any</option>
1175 [% FOREACH managedby_loo IN managedby_loop %]
1176 [% IF ( managedby_loo.selected ) %]
1177 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1179 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1185 <label for="manageddate_from">Management date from:</label>
1186 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" data-date_to="manageddate_to" class="flatpickr" />
1189 <label for="manageddate_to">To:</label>
1190 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" class="flatpickr" />
1193 <label for="acceptedby"> Accepted by:</label>
1194 <select id="acceptedby" name="acceptedby">
1195 <option value="">Any</option>
1196 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1197 [% IF ( acceptedby_loo.selected ) %]
1198 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1200 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1206 <label for="accepteddate_from">Accepted date from:</label>
1207 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" data-date_to="accepteddate_to" class="flatpickr" />
1210 <label for="accepteddate_to">To:</label>
1211 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" class="flatpickr" />
1214 </fieldset> <!-- /#suggestion_information -->
1215 <fieldset class="action suggestion_information">
1216 <input type="submit" value="Go" />
1219 <h4 class="local_collapse">
1220 <a href="#" data-target="acquisition_information">Acquisition information</a>
1222 <fieldset class="brief acquisition_information">
1225 <label for="budgetid"> Book fund:</label>
1226 <select name="budgetid" id="budgetid">
1227 <option value="__ANY__">Any</option>
1228 [% IF budgetid == '__NONE__' %]
1229 <option value="__NONE__" selected="selected">None</option>
1231 <option value="__NONE__">None</option>
1233 [% FOREACH budgetsloo IN budgetsloop %]
1234 [% IF ( budgetsloo.selected ) %]
1235 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1237 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1243 </fieldset> <!-- /#acquisition_information -->
1244 <fieldset class="action acquisition_information">
1245 <input type="submit" value="Go" />
1248 <div id="filter_archived_information">
1251 <label for="archived" style="display: inline;">Include archived:</label>
1252 [% IF filter_archived %]
1253 <input type="checkbox" id="archived" value="1" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1255 <input type="checkbox" id="archived" value="1" name="filter_archived" title="Include archived suggestions in the search" />
1260 </div> <!-- /#limits -->
1261 </fieldset> <!-- /.brief -->
1262 </form> <!-- /suggestionsfilter -->
1264 [% INCLUDE 'acquisitions-menu.inc' %]
1267 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1268 [% END # /UNLESS ( op == 'show' ) %]
1269 [% END # /UNLESS op == 'save' %]
1270 </div> <!-- /.row -->
1272 [% END # /IF op == "show" %]
1274 [% MACRO jsinclude BLOCK %]
1275 [% INCLUDE 'calendar.inc' %]
1279 function editManagerPopup(selected_tab) {
1281 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_manager&filter=suggestions_managers",
1283 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1284 + 'scrollbars=yes,resize=yes'
1287 function select_manager(borrowernumber, borrower) {
1288 var managedby_name = $("#managedby_name"+tab);
1289 var managedby = $("#managedby"+tab);
1290 managedby_name.empty();
1292 var borrowername = borrower.firstname + ' ' + borrower.surname;
1293 if (borrowernumber) {
1294 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1295 + '?borrowernumber=' + borrowernumber + '">'
1296 + borrowername + '</a>';
1297 managedby_name.html(managerlink);
1298 managedby.val(borrowernumber);
1301 [% IF op == "save" %]
1302 var notify = $('#notify');
1303 if ( notify.length ) {
1304 [% IF managedby_patron %]
1305 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1307 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1309 $(notify).prop('checked', false).prop('disabled', true);
1311 $(notify).prop('disabled', false);
1317 function editSuggesterPopup() {
1318 window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_suggester",
1320 'width=1024,height=768,scrollbars=yes,toolbar=no,'
1321 + 'scrollbars=yes,resize=yes'
1325 function select_suggester(borrowernumber, borrower) {
1326 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />';
1327 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">';
1328 suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')';
1329 suggested += '</a> ';
1330 suggested += borrower.branchname + ' (' + borrower.category_description + ')';
1331 $("#tdsuggestedby").html(suggested);
1334 $(document).ready(function(){
1335 $("#edit_manager").on("click",function(e){
1337 editManagerPopup('');
1339 $(".set_manager").on("click",function(e){
1341 var selected_tab = $(this).data('tab');
1342 editManagerPopup(selected_tab);
1345 $("#edit_suggester").on("click", function(e){
1347 editSuggesterPopup();
1352 [% IF ( op == 'show' || op == 'else' ) %]
1354 $(document).ready(function(){
1355 $(".deletesuggestion").on("click",function(){
1356 return confirm(_("Are you sure you want to delete this suggestion?"));
1361 [% IF op == 'else' %]
1362 [% INCLUDE 'datatables.inc' %]
1363 [% INCLUDE 'columns_settings.inc' %]
1365 $(document).ready(function() {
1366 if( $("#suggestiontabs .tab-pane.active").length < 1 ){
1367 $("#suggestiontabs a:first").tab("show");
1370 table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1371 [% FOREACH suggestion IN suggestions %]
1372 [% IF suggestion.suggestions.size %]
1373 KohaTable("table_[% loop.count| html %]", {
1374 "sorting": [[ 3, "asc" ]],
1376 }, table_settings );
1380 $("#branchcode").on('change',function(){
1381 [%# Modify the hidden input in the filters block from the library %]
1382 [%# dropdown list at the top of suggestion list %]
1383 let branchcode = $(this).val();
1384 $('input[name="branchcode"]').val( branchcode );
1385 $('form[name="suggestionfilter"]').submit();
1388 $(".checkall").click(function(e){
1390 $(this).parents('form').find("input:checkbox").each(function(){
1391 $(this).prop("checked", true);
1394 $(".uncheckall").click(function(e){
1396 $(this).parents('form').find("input:checkbox").each(function(){
1397 $(this).prop("checked", false);
1400 $(".other_reason").hide();
1401 $("select[name='reason']").change(function(){
1402 if($(this).val() == "other"){
1404 $(this).siblings(".other_reason").show();
1408 $("a.cancel_note").click(function(e) {
1409 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1410 $(this).siblings("input[name='other_reason']").hide();
1414 $("h4.local_collapse a").on("click", function(e){
1416 const target = $(this).data("target");
1417 $("." + target).toggle();
1420 $("button[type='submit']").on("click", function(e) {
1421 var submit_button = this;
1422 var form = $(submit_button).parents("form");
1423 var action = $(submit_button).val();
1424 var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1425 if ( selected_suggestions.length == 0 ) {
1426 alert(_("Please select at least one suggestion"));
1430 if ( action == "delete" ) {
1431 if ( selected_suggestions.length == 1 ) {
1432 if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
1436 } else if ( selected_suggestions.length > 1 ) {
1437 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1442 } else if ( action == "update_manager" ) {
1443 var managedby = $(submit_button).siblings("suggestion_managedby");
1444 if ( managedby.val() == "" ) {
1445 alert(_("Please select a manager to assign to the selected suggestions"));
1451 $('<input />').attr('type', 'hidden')
1453 .attr('value', action)
1460 [% IF op == 'save' %]
1463 $(document).ready(function(){
1465 $("#quantity,#price,#currency").on("change",function(){
1469 [% IF other_reason %]
1470 $(".select-reason").hide();
1471 $(".select-reason").find("option[value='other']").attr("selected","selected");
1472 $("#other_reason").show();
1474 $("#other_reason").hide();
1476 $(".select-reason").change(function(){
1477 if($(this).val() == "other"){
1479 $("#other_reason").show();
1482 $("a[href*=back]").click(function(){
1483 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1484 $("#other_reason").hide();
1487 $("#restore_previous_manager").on("click",function(e){
1490 $("#managedby_name").empty();
1491 $("#managedby").val('');
1492 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1493 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1494 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1495 + borrowername + '</a>';
1496 $('#managedby_name').html(managerlink);
1497 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1498 $('#notify').prop('checked', false).prop('disabled', true);
1501 //keep a copy of all budgets before removing the inactives
1502 var budgetId = $("form#add_edit #budgetid");
1503 var disabledBudgetsCopy = budgetId.html();
1504 $('.b_inactive').remove();
1506 $('#showallfunds').click(function() {
1507 if ($(this).is(":checked")) {
1508 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1511 $('.b_inactive').remove();
1518 [% Asset.js("js/acq.js") | $raw %]
1519 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1521 [% INCLUDE 'intranet-bottom.inc' %]