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;
55 <body id="acq_suggestion" class="acq">
56 [% INCLUDE 'header.inc' %]
57 [% INCLUDE 'cat-search.inc' %]
59 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
62 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
65 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
69 [% IF ( suggestionid ) %]
71 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
74 <a href="#" aria-current="page">
75 Edit suggestion #[% suggestionid | html %]
80 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
83 <a href="#" aria-current="page">
88 [% ELSIF ( op == 'show' ) %]
90 <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a>
93 <a href="#" aria-current="page">
94 Show suggestion #[% suggestionid | html %]
99 <a href="#" aria-current="page">
100 Suggestions management
105 </nav> <!-- /.breadcrumbs -->
107 [% IF ( op == 'show' ) %]
108 <div class="main container-fluid">
110 <div class="col-md-8 col-md-offset-2">
112 <div id="toolbar" class="btn-toolbar">
113 <a class="btn btn-default" id="editsuggestion" href="suggestion.pl?op=edit&suggestionid=[% suggestionid | html %]"><i class="fa fa-pencil"></i> Edit</a>
114 <a class="btn btn-default deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
117 <fieldset class="rows">
118 <legend>Bibliographic information</legend>
122 <span class="label">Title:</span>
123 [% IF suggestion.biblionumber %]
124 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a>
132 <span class="label">Author:</span>
136 [% IF ( copyrightdate ) %]
138 <span class="label">Copyright date:</span>
139 [% copyrightdate | html %]
144 <span class="label">ISBN or ISSN or other standard number:</span>
148 [% IF ( publishercode ) %]
150 <span class="label">Publisher:</span>
151 [% publishercode | html %]
156 <span class="label">Publication place:</span>
160 [% IF ( collectiontitle ) %]
162 <span class="label">Collection title:</span>
163 [% collectiontitle | html %]
166 [% IF ( itemtype ) %]
168 <span class="label">Document type:</span>
169 [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) | html %]
172 [% IF ( patron_reason_loop ) %]
174 <span class="label">Reason for suggestion: </span>
175 [% FOREACH patron_reason_loo IN patron_reason_loop %]
176 [% IF patron_reason_loo.authorised_value == patronreason %]
177 [% patron_reason_loo.lib | html %]
184 <span class="label">Notes:</span>
191 <fieldset class="rows">
192 <legend>Suggestion management</legend>
195 <span class="label">Status:</span>
196 [% SET status_found = 0 %]
197 [% IF ( STATUS == 'ASKED' ) %]
199 [% SET status_found = 1 %]
200 [% ELSIF ( STATUS == 'ACCEPTED' ) %]
202 [% SET status_found = 1 %]
203 [% ELSIF ( STATUS == 'CHECKED' ) %]
205 [% SET status_found = 1 %]
206 [% ELSIF ( STATUS == 'REJECTED' ) %]
208 [% SET status_found = 1 %]
209 [% ELSIF ( STATUS == 'ORDERED' ) %]
211 [% SET status_found = 1 %]
212 [% ELSIF ( STATUS == 'AVAILABLE' ) %]
214 [% SET status_found = 1 %]
216 [% FOREACH s IN SuggestionStatuses %]
217 [% IF STATUS == s.authorised_value %]
219 [% SET status_found = 1 %]
225 <span class="label">Reason:</span>
227 [% AuthorisedValues.GetByCode( 'SUGGEST', reason, 0 ) | html %]
242 <th>[% tp('purchase suggestion created by', 'Created by:') | html %]</th>
243 <td>[% suggesteddate | $KohaDates %]</td>
245 [% IF ( suggestedby_patron.borrowernumber ) %]
246 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_patron.borrowernumber | uri %]">[% suggestedby_patron.surname | html %], [% suggestedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %])</a>
247 [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])
253 <td>[% manageddate | $KohaDates %]</td>
255 [% IF ( managedby_patron.borrowernumber ) %]
256 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_patron.borrowernumber | uri %]">[% managedby_patron.surname | html %], [% managedby_patron.firstname | html %] ([% managedby_patron.cardnumber | html %])</a>
257 [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %])
262 <th>Accepted on:</th>
263 <td>[% accepteddate | $KohaDates %]</td>
265 [% IF ( acceptedby_patron.borrowernumber ) %]
266 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_patron.borrowernumber | uri %]">[% acceptedby_patron.surname | html %], [% acceptedby_patron.firstname | html %] ([% acceptedby_patron.cardnumber | html %])</a>
267 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
272 <th>Last modification on:</th>
273 <td>[% lastmodificationdate | $KohaDates %]</td>
275 [% IF ( lastmodificationby_patron.borrowernumber ) %]
276 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% lastmodificationby_patron.borrowernumber | uri %]">[% lastmodificationby_patron.surname | html %], [% lastmodificationby_patron.firstname | html %] ([% lastmodificationby_patron.cardnumber | html %])</a>
277 [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
285 <fieldset class="rows">
286 <legend>Acquisition information</legend>
289 <span class="label">Library:</span>
290 [% Branches.GetName( branchcode ) | html %]
293 <span class="label">Fund:</span>
294 [% budgetname | html %]
297 <span class="label">Copies:</span>
298 [% quantity | html %]
301 <span class="label">Currency:</span>
302 [% currency | html %]
305 <span class="label">Price:</span>
309 <span class="label">Total</span>
315 <fieldset class="action">
316 <a href="suggestion.pl"><< Back to suggestions</a>
319 </div> <!-- /.col-md-8 col-md-offset-2 -->
320 </div> <!-- /.row -->
321 [% ELSE # IF op == "show" %]
323 [% IF op == 'save' %]
324 <div class="main container-fluid">
326 <div class="col-md-8 col-md-offset-2">
328 <div class="main container-fluid">
330 <div class="col-sm-10 col-sm-push-2">
333 [% IF op == 'save' %]
334 [% FOR m IN messages %]
335 <div class="dialog [% m.type | html %]">
337 [% CASE 'biblio_exists' %]
338 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.
339 [% CASE 'manager_not_enough_permissions' %]
340 The manager you selected does not have sufficient permissions.
344 </div> <!-- /.dialog -->
347 <form id="add_edit" action="suggestion.pl" method="post" class="validated">
348 <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
349 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
350 [% IF ( suggestionid ) %]
351 <h1>Edit purchase suggestion #[% suggestionid | html %]</h1>
352 <input type="hidden" name="suggestionid" value="[% suggestionid | html %]"/>
354 <h1>Enter a new purchase suggestion</h1>
357 <fieldset class="rows">
358 <legend>Bibliographic information</legend>
361 <label for="title" class="required">Title:</label>
362 <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title | html %]" required="required" class="required" />
363 <span class="required">Required</span>
366 <label for="author">Author:</label>
367 <input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/>
370 <label for="copyrightdate">Copyright date:</label>
371 <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" />
374 <label for="isbn">ISBN or ISSN or other standard number:</label>
375 <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="[% isbn | html %]"/>
378 <label for="publishercode">Publisher:</label>
379 <input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/>
382 <label for="place">Publication place:</label>
383 <input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/>
386 <label for="collectiontitle">Collection title:</label>
387 <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/>
390 <label for="itemtype">Document type:</label>
391 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
393 [% IF patron_reason_loop %]
395 <label for="patronreason">Reason for suggestion: </label>
396 <select name="patronreason" id="patronreason">
397 <option value=""> -- Choose -- </option>
398 [% FOREACH patron_reason_loo IN patron_reason_loop %]
399 [% IF patron_reason_loo.authorised_value == patronreason %]
400 <option value="[% patron_reason_loo.authorised_value | html %]" selected="selected">[% patron_reason_loo.lib | html %]</option>
402 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
407 [% END # /IF patron_reason_loop %]
409 <label for="note">Notes:</label>
410 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
415 <fieldset class="rows">
416 <legend>Suggestion management</legend>
418 [% IF ( suggestionid ) %]
420 <label for="STATUS">Status:</label>
421 <select id="STATUS" name="STATUS">
422 <option value="">No status</option>
424 [% IF (statusselected_ASKED ) %]
425 <option value="ASKED" selected="selected">Pending</option>
427 <option value="ASKED">Pending</option>
430 [% IF (statusselected_ACCEPTED ) %]
431 <option value="ACCEPTED" selected="selected">Accepted</option>
433 <option value="ACCEPTED">Accepted</option>
436 [% IF (statusselected_CHECKED ) %]
437 <option value="CHECKED" selected="selected">Checked</option>
439 <option value="CHECKED">Checked</option>
442 [% IF ( statusselected_REJECTED ) %]
443 <option value="REJECTED" selected="selected">Rejected</option>
445 <option value="REJECTED">Rejected</option>
448 [% IF ( statusselected_ORDERED ) %]
449 <option value="ORDERED" selected="selected">Ordered</option>
451 <option value="ORDERED">Ordered</option>
454 [% FOREACH s IN SuggestionStatuses %]
455 [% IF s.authorised_value == suggestion.STATUS %]
456 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
458 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
464 <label for="reason">Reason:</label>
465 <select class="select-reason" id="reason" name="reason">
466 <option value=""> -- Choose a reason -- </option>
467 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
468 [% IF (reasonsloo.lib == suggestion.reason) %]
469 <option value="[% reasonsloo.lib | html %]" selected="selected">[% reasonsloo.lib | html %]</option>
471 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
474 <option value="other">Others...</option>
477 <span id="other_reason" name="other_reason">
478 [% IF other_reason %]
479 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
481 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
483 <a href="#back">Cancel</a>
500 <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
503 <input type="text" id="suggesteddate" name="suggesteddate" class="datepicker" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/>[% INCLUDE 'date-format.inc' %]
505 <td id="tdsuggestedby">
506 <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
507 [% IF ( suggestedby_patron.borrowernumber ) %]
508 <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 %])
512 <a href="#" id="edit_suggester" class="btn btn-default">Set to patron</a>
517 <label for="accepteddate">Accepted on:</label>
520 <input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]
523 <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
524 [% IF ( acceptedby_patron.borrowernumber ) %]
525 <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>
526 [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])
533 <label for="lastmodificationdate">Last modification on:</label>
536 [% lastmodificationdate | $KohaDates %]
539 [% IF lastmodificationby_patron %]
540 [% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
549 <label for="managedon">Managed on:</label>
550 <input type="text" id="managedon" name="manageddate" class="datepicker" size="10" maxlength="10" value="[% manageddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]
553 <label for="managedby_name">by:</label>
555 <span id="managedby_name" name="managedby_name">
556 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
558 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
559 | 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 %])
562 <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a>
563 [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
564 <a id="restore_previous_manager" href="#"><i class="fa fa-trash"></i> Keep existing manager</a>
566 <input type="hidden" name="managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" />
569 <label for="notify">Notify manager:</label>
570 <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." />
576 <fieldset class="rows">
577 <legend>Acquisition information</legend>
580 <label for="branchcode">Library:</label>
581 <select name="branchcode" id="branchcode">
582 <option value="">Any</option>
583 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
587 <label for="budgetid">Fund:</label>
588 <select name="budgetid" id="budgetid">
589 <option value="">Any</option>
590 [% FOREACH budget IN sugg_budgets %]
591 [% IF ( budget.selected ) %]
592 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
593 [% ELSIF ( budget.b_active ) %]
594 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
596 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
600 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
601 <input type="checkbox" id="showallfunds" />
604 <label for="quantity">Copies:</label>
605 <input type="text" size="10" id="quantity" name="quantity" value="[% quantity | html %]" />
608 <label for="currency">Currency:</label>
609 [% FOREACH c IN currencies %]
610 <input type="hidden" value="[% c.rate | html %]" id="currency_rate_[% c.currency | html %]" name="currency_rate_[% c.currency | html %]" />
611 <input type="hidden" id="[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" />
613 <select name="currency" id="currency">
614 [% FOREACH c IN currencies %]
615 [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
616 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
617 [% ELSIF not c.archived %]
618 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
624 <label for="price">Price:</label>
625 <input type="text" size="20" name="price" id="price" value="[% price | html %]" />
628 <label for="total">Total: </label>
629 <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total | html %]"/>
632 </fieldset> <!-- /.rows -->
634 <input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby | html %][% ELSE %]noone[% END %]"/>
636 <fieldset class="action">
637 <input type="hidden" name="op" value="[% op | html %]" />
638 [% IF ( suggestionid ) %]
639 [% IF ( need_confirm ) %]
640 <input type="hidden" name="save_confirmed" value="1" />
641 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" value="Confirm your suggestion" />
643 <input type="submit" value="Save" />
645 <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby | uri %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>
647 [% IF ( need_confirm ) %]
648 <input type="hidden" name="save_confirmed" value="1" />
649 <input onclick="this.form.op.value = 'save'; this.form.submit();" type="submit" value="Confirm your suggestion" />
651 <input type="submit" value="Submit your suggestion" />
653 <a class="cancel" href="suggestion.pl">Cancel</a>
655 </fieldset> <!-- /.action -->
656 </form> <!-- /#add_edit -->
657 [% END # /IF op == 'save' %]
659 [% IF op == 'else' %]
660 <div id="toolbar" class="btn-toolbar">
661 <a class="btn btn-default" id="newsuggestion" href="suggestion.pl?op=add"><i class="fa fa-plus"></i> New purchase suggestion</a>
664 <h1>Suggestions management</h1>
666 [% IF ( displayby != "branchcode" ) %]
667 <label for="branchcode">Viewing suggestions for library:</label>
668 <select name="branchcode" id="branchcode">
669 <option value="__ANY__">Any</option>
670 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
674 [% FOR m IN messages %]
675 <div class="dialog [% m.type | html %]">
677 [% CASE 'already_exists' %]
678 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>)
679 [% CASE 'biblio_exists' %]
680 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.
684 </div> <!-- /.dialog -->
687 [% UNLESS ( notabs ) %]
688 <div id="suggestiontabs" class="toptabs">
689 <ul class="ui-tabs-nav">
690 [% FOREACH suggestion IN suggestions %]
692 <a href="#[% suggestion.suggestiontype | uri %]">
693 [% IF ( suggestion.suggestiontypelabel ) %]
694 [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
695 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
696 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
697 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
698 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
699 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
700 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]Status unknown
701 [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]Any
702 [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %]
704 [% IF ( suggestion.suggestiontype ) %]
705 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) | html %]
710 ([% suggestion.suggestions_loop.size | html %])</a></li>
712 [% END # /FOREACH suggestion %]
713 </ul> <!-- /.ui-tabs-nav -->
714 [% END # /UNLESS notabs %]
716 [% FOREACH suggestion IN suggestions %]
717 <div id="[% suggestion.suggestiontype | html %]">
718 <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
720 [% IF ( suggestion.suggestions_loop ) %]
722 <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
725 <table id="table_[% loop.count | html %]" class="sorted">
728 <th class="NoSort noExport"> </th>
729 <th class="anti-the">Suggestion</th>
730 <th>Suggested by</th>
731 <th>Suggested on</th>
734 <th>Last modification by</th>
735 <th>Last modification on</th>
739 <th class="NoSort noExport"> </th>
743 [% FOREACH suggestions_loo IN suggestion.suggestions_loop %]
746 <input type="checkbox" name="suggestionid" value="[% suggestions_loo.suggestionid | html %]" />
749 <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | uri %]&op=show" title="suggestion" >
750 [% suggestions_loo.title | html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author | html %][% END %]
753 [% IF ( suggestions_loo.copyrightdate ) %]
754 © <span class="suggestion_copyrightdate">[% suggestions_loo.copyrightdate | html %]</span>
756 [% IF ( suggestions_loo.volumedesc ) %]
757 ; <span class="suggestion_volume">Volume:<em>[% suggestions_loo.volumedesc | html %]</em></span>
759 [% IF ( suggestions_loo.isbn ) %]
760 ; <span class="suggestion_isbn">ISBN: <em>[% suggestions_loo.isbn | html %]</em></span>
762 [% IF ( suggestions_loo.publishercode ) %]
763 ; <span class="suggestion_publishercode">Published by [% suggestions_loo.publishercode | html %]</span>
765 [% IF ( suggestions_loo.publicationyear ) %]
766 in <span class="suggestion_publicationyear"><em>[% suggestions_loo.publicationyear | html %]</em></span>
768 [% IF ( suggestions_loo.place ) %]
769 in <span class="suggestion_place"><em>[% suggestions_loo.place | html %]</em></span>
771 [% IF ( suggestions_loo.collectiontitle ) %]
772 ; <span class="suggestion_collectiontitle">[% suggestions_loo.collectiontitle | html %]</span>
774 [% IF ( suggestions_loo.itemtype ) %]
775 ; <span class="suggestion_itype">[% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %]</span>
778 [% IF ( suggestions_loo.note ) %]
779 <div class="suggestion_note"><i class="fa fa-comment"></i> [% suggestions_loo.note | html %]</div>
781 [% IF suggestions_loo.archived %]
782 <br /><i class="fa fa-archive"></i> Archived
786 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby | uri %]">[% suggestions_loo.surnamesuggestedby | html %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby | html %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby | html %])[% END %]</a>
788 <td data-order="[% suggestions_loo.suggesteddate | html %]">
789 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate | $KohaDates %][% END %]
792 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.managedby | uri %]">[% suggestions_loo.surnamemanagedby | html %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby | html %][% END %]</a>
794 <td data-order="[% suggestions_loo.manageddate | html %]">
795 [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
798 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.lastmodificationby | uri %]">[% suggestions_loo.surnamelastmodificationby | html %][% IF ( suggestions_loo.firstnamelastmodificationby ) %], [% suggestions_loo.firstnamelastmodificationby | html %][% END %]</a>
800 <td data-order="[% suggestions_loo.lastmodificationdate | html %]">
801 [% IF ( suggestions_loo.lastmodificationdate ) %][% suggestions_loo.lastmodificationdate | $KohaDates %][% END %]
804 [% Branches.GetName( suggestions_loo.branchcode ) | html %]
807 [% suggestions_loo.budget_name | html %]
810 [% IF ( suggestions_loo.ASKED ) %]
812 [% ELSIF ( suggestions_loo.ACCEPTED ) %]
814 [% ELSIF ( suggestions_loo.ORDERED ) %]
816 [% ELSIF ( suggestions_loo.REJECTED ) %]
818 [% ELSIF ( suggestions_loo.CHECKED ) %]
820 [% ELSIF ( suggestions_loo.AVAILABLE ) %]
822 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
823 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) | html %]
828 [% IF ( suggestions_loo.reason ) %]
829 <br />([% suggestions_loo.reason | html %])
833 <div class="btn-group dropup">
834 <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&op=edit"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% suggestions_loo.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
835 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% suggestions_loo.suggestionid | html %]">
836 <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a></li>
837 [% UNLESS suggestions_loo.archived %]
838 <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
840 <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li>
846 [% END # /FOREACH suggestions_loo %]
848 </table> <!-- /#table_[% loop.count | html %] -->
851 <h2 style="padding-left:1em;">Change selected suggestions</h2>
852 <div class="col-sm-4">
854 <div id="select-reason[% loop.index | html %]">
855 <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label>
856 <select name="STATUS" id="STATUSreason[% loop.index | html %]">
857 <option value=""> -- Choose a status --</option>
859 [% IF (statusselected_ASKED ) %]
860 <option value="ASKED" selected="selected">Pending</option>
862 <option value="ASKED">Pending</option>
865 [% IF (statusselected_ACCEPTED ) %]
866 <option value="ACCEPTED" selected="selected">Accepted</option>
868 <option value="ACCEPTED">Accepted</option>
871 [% IF (statusselected_CHECKED ) %]
872 <option value="CHECKED" selected="selected">Checked</option>
874 <option value="CHECKED">Checked</option>
877 [% IF ( statusselected_REJECTED ) %]
878 <option value="REJECTED" selected="selected">Rejected</option>
880 <option value="REJECTED">Rejected</option>
883 [% IF ( statusselected_ORDERED ) %]
884 <option value="ORDERED" selected="selected">Ordered</option>
886 <option value="ORDERED">Ordered</option>
889 [% FOREACH s IN SuggestionStatuses %]
890 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
894 <label for="choosereason[% loop.index | html %]">with this reason:</label>
895 <select name="reason" id="choosereason[% loop.index | html %]">
896 <option value=""> -- Choose a reason -- </option>
897 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
898 <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option>
900 <option value="other">Others...</option>
903 <span class="other_reason">
904 <input type="text" size="31" name="other_reason" placeholder="please note your reason here..." />
905 <a href="#" class="cancel_note">Cancel</a>
909 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
910 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
911 <fieldset class="action">
912 <button type="submit" class="btn btn-default btn-xs" value="update_status">Submit</button>
915 </div> <!-- /.col-sm-4 -->
917 <div class="col-sm-4">
920 Update item types with:
921 [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %]
923 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
924 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
925 <fieldset class="action">
926 <button type="submit" class="btn btn-default btn-xs" value="update_itemtype">Submit</button>
929 </div> <!-- /.col-sm-4 -->
931 <div class="col-sm-2">
933 <span class="label">Update manager</span><br/>
934 <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>
935 <span id="managedby_name[% loop.count | html %]"></span>
936 <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
937 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
938 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
939 <fieldset class="action">
940 <button type="submit" class="btn btn-default btn-xs" value="update_manager">Submit</button>
943 </div> <!-- /.col-sm-2 -->
945 <div class="col-sm-2">
947 <span class="label">Delete selected</span>
948 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
949 <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
950 <fieldset class="action">
951 <button type="submit" class="btn btn-default btn-xs" value="delete">Delete</button>
954 </div> <!-- /.col-sm-2 -->
955 </div> <!-- /.row -->
958 <strong>No results.</strong>
959 [% END # /IF ( suggestion.suggestions_loop ) %]
960 </form> <!-- /.update_suggestions -->
961 </div> <!-- /#[% suggestion.suggestiontype | html %] -->
962 [% END # /FOREACH suggestion %]
963 [% UNLESS ( notabs ) %]
964 </div> <!-- /.notabs -->
965 [% END # /UNLESS notabs %]
966 [% END # /IF op == 'else' %]
968 [% UNLESS op == 'save' %]
969 [% UNLESS ( op == 'show' ) %]
970 </div> <!-- /.col-sm-10.col-sm-push-2 -->
972 <div class="col-sm-2 col-sm-pull-10">
974 <form name="suggestionfilter" action="suggestion.pl" method="get">
975 <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
976 <fieldset class="brief">
977 <ol style="display:block;">
979 <label for="displayby">Organize by: </label>
980 <select name="displayby" id="displayby" style="width:auto;">
981 [% IF ( displayby == "STATUS" ) %]
982 <option value="STATUS" selected="selected">Status</option>
984 <option value="STATUS">Status</option>
986 [% IF ( displayby == "branchcode" ) %]
987 <option value="branchcode" selected="selected">Library</option>
989 <option value="branchcode">Library</option>
991 [% IF ( displayby == "itemtype" ) %]
992 <option value="itemtype" selected="selected">Item type</option>
994 <option value="itemtype">Item type</option>
996 [% IF ( displayby == "managedby" ) %]
997 <option value="managedby" selected="selected">Managed by</option>
999 <option value="managedby">Managed by</option>
1001 [% IF ( displayby == "acceptedby" ) %]
1002 <option value="acceptedby" selected="selected">Accepted by</option>
1004 <option value="acceptedby">Accepted by</option>
1007 <input type="submit" value="Go" />
1010 </fieldset> <!-- /.brief -->
1012 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
1015 <fieldset class="brief">
1016 <h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
1019 <label for="title"> Title:</label>
1020 <input type="text" id="title" name="title" value="[% title | html %]" />
1023 <label for="author"> Author:</label>
1024 <input type="text" id="author" name="author" value="[% author | html %]" />
1027 <label for="isbn"> ISBN:</label>
1028 <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" />
1031 <label for="publishercode"> Publisher:</label>
1032 <input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" />
1035 <label for="copyrightdate_filter"> Copyright date:</label>
1036 <input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" />
1039 <label for="collectiontitle"> Collection title:</label>
1040 <input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" /></li><li><input type="submit" value="Go" />
1043 </fieldset> <!-- /.brief -->
1045 <fieldset class="brief">
1046 <h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
1049 <label for="archived" style="display: inline;">Include archived:</label>
1050 [% IF filter_archived %]
1051 <input type="checkbox" id="archived" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
1053 <input type="checkbox" id="archived" name="filter_archived" title="Include archived suggestions in the search" />
1057 <label for="STATUS[% loop.index | html %]"> Status:</label>
1058 <select name="STATUS" id="STATUS[% loop.index | html %]">
1059 <option value="">Any</option>
1060 [% IF (statusselected_ASKED ) %]
1061 <option value="ASKED" selected="selected">Pending</option>
1063 <option value="ASKED">Pending</option>
1066 [% IF (statusselected_ACCEPTED ) %]
1067 <option value="ACCEPTED" selected="selected">Accepted</option>
1069 <option value="ACCEPTED">Accepted</option>
1072 [% IF (statusselected_CHECKED ) %]
1073 <option value="CHECKED" selected="selected">Checked</option>
1075 <option value="CHECKED">Checked</option>
1078 [% IF ( statusselected_REJECTED ) %]
1079 <option value="REJECTED" selected="selected">Rejected</option>
1081 <option value="REJECTED">Rejected</option>
1084 [% IF ( statusselected_ORDERED ) %]
1085 <option value="ORDERED" selected="selected">Ordered</option>
1087 <option value="ORDERED">Ordered</option>
1090 [% FOREACH s IN SuggestionStatuses %]
1091 [% IF s.authorised_value == selected_status %]
1092 <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
1094 <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
1101 <label for="suggestedby"> Suggested by:</label>
1102 <select id="suggestedby" name="suggestedby">
1103 <option value="">Any</option>
1104 [% FOREACH suggestedby_loo IN suggestedby_loop %]
1105 [% IF ( suggestedby_loo.selected ) %]
1106 <option value="[% suggestedby_loo.code | html %]" selected="selected">[% suggestedby_loo.desc | html %]</option>
1108 <option value="[% suggestedby_loo.code | html %]">[% suggestedby_loo.desc | html %]</option>
1114 <label for="suggesteddate_from">Suggested date from:</label>
1115 <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from | html %]" />
1118 <label for="suggesteddate_to">To:</label>
1119 <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to | html %]" />
1122 <label for="managedby"> Managed by:</label>
1123 <select id="managedby" name="managedby">
1124 <option value="">Any</option>
1125 [% FOREACH managedby_loo IN managedby_loop %]
1126 [% IF ( managedby_loo.selected ) %]
1127 <option value="[% managedby_loo.code | html %]" selected="selected">[% managedby_loo.desc | html %]</option>
1129 <option value="[% managedby_loo.code | html %]">[% managedby_loo.desc | html %]</option>
1135 <label for="manageddate_from">Management date from:</label>
1136 <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from | html %]" />
1139 <label for="manageddate_to">To:</label>
1140 <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to | html %]" />
1143 <label for="acceptedby"> Accepted by:</label>
1144 <select id="acceptedby" name="acceptedby">
1145 <option value="">Any</option>
1146 [% FOREACH acceptedby_loo IN acceptedby_loop %]
1147 [% IF ( acceptedby_loo.selected ) %]
1148 <option value="[% acceptedby_loo.code | html %]" selected="selected">[% acceptedby_loo.desc | html %]</option>
1150 <option value="[% acceptedby_loo.code | html %]">[% acceptedby_loo.desc | html %]</option>
1156 <label for="accepteddate_from">Accepted date from:</label>
1157 <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from | html %]" />
1160 <label for="accepteddate_to">To:</label>
1161 <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" />
1164 <input type="submit" value="Go" />
1169 <fieldset class="brief">
1170 <h4 class="local_collapse">
1171 <a href="#">Acquisition information</a>
1175 <label for="budgetid"> Book fund:</label>
1176 <select name="budgetid" id="budgetid">
1177 <option value="__ANY__">Any</option>
1178 [% IF budgetid == '__NONE__' %]
1179 <option value="__NONE__" selected="selected">None</option>
1181 <option value="__NONE__">None</option>
1183 [% FOREACH budgetsloo IN budgetsloop %]
1184 [% IF ( budgetsloo.selected ) %]
1185 <option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>
1187 <option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>
1193 <input type="submit" value="Go" />
1197 </div> <!-- /#limits -->
1198 </form> <!-- /suggestionsfilter -->
1200 [% INCLUDE 'acquisitions-menu.inc' %]
1203 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1204 [% END # /UNLESS ( op == 'show' ) %]
1205 [% END # /UNLESS op == 'save' %]
1206 </div> <!-- /.row -->
1208 [% END # /IF op == "show" %]
1210 [% MACRO jsinclude BLOCK %]
1211 [% INCLUDE 'calendar.inc' %]
1215 function editManagerPopup(selected_tab) {
1217 window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select&callback=select_manager&permissions=suggestions.suggestions_manage",
1219 'width=740,height=450,location=yes,toolbar=no,'
1220 + 'scrollbars=yes,resize=yes'
1223 function select_manager(borrowernumber, borrower) {
1224 var managedby_name = $("#managedby_name"+tab);
1225 var managedby = $("#managedby"+tab);
1226 managedby_name.empty();
1228 var borrowername = borrower.firstname + ' ' + borrower.surname;
1229 if (borrowernumber) {
1230 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1231 + '?borrowernumber=' + borrowernumber + '">'
1232 + borrowername + '</a>';
1233 managedby_name.html(managerlink);
1234 managedby.val(borrowernumber);
1237 [% IF op == "save" %]
1238 var notify = $('#notify');
1239 if ( notify.length ) {
1240 [% IF managedby_patron %]
1241 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) {
1243 if ( borrowernumber == [% logged_in_user.borrowernumber | html %] ) {
1245 $(notify).prop('checked', false).prop('disabled', true);
1247 $(notify).prop('disabled', false);
1253 function editSuggesterPopup() {
1254 window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select&callback=select_suggester",
1256 'width=740,height=450,location=yes,toolbar=no,'
1257 + 'scrollbars=yes,resize=yes'
1261 function select_suggester(borrowernumber, borrower) {
1262 var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />';
1263 suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">';
1264 suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')';
1265 suggested += '</a> ';
1266 suggested += borrower.branchname + ' (' + borrower.category_description + ')';
1267 $("#tdsuggestedby").html(suggested);
1270 $(document).ready(function(){
1271 $("#edit_manager").on("click",function(e){
1273 editManagerPopup('');
1275 $(".set_manager").on("click",function(e){
1277 var selected_tab = $(this).data('tab');
1278 editManagerPopup(selected_tab);
1281 $("#edit_suggester").on("click", function(e){
1283 editSuggesterPopup();
1288 [% IF ( op == 'show' || op == 'else' ) %]
1290 $(document).ready(function(){
1291 $(".deletesuggestion").on("click",function(){
1292 return confirm(_("Are you sure you want to delete this suggestion?"));
1297 [% IF op == 'else' %]
1298 [% INCLUDE 'datatables.inc' %]
1299 [% INCLUDE 'columns_settings.inc' %]
1301 $(document).ready(function() {
1302 $('#suggestiontabs').tabs();
1304 columns_settings = [% TablesSettings.GetColumns( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1305 [% FOREACH suggestion IN suggestions %]
1306 [% IF ( suggestion.suggestions_loop ) %]
1307 KohaTable("table_[% loop.count| html %]", {
1308 "sorting": [[ 3, "asc" ]],
1310 }, columns_settings );
1314 $("#branchcode").on('change',function(){
1315 [%# Modify the hidden input in the filters block from the library %]
1316 [%# dropdown list at the top of suggestion list %]
1317 let branchcode = $(this).val();
1318 $('input[name="branchcode"]').val( branchcode );
1319 $('form[name="suggestionfilter"]').submit();
1322 $(".checkall").click(function(e){
1324 $(this).parents('form').find("input:checkbox").each(function(){
1325 $(this).prop("checked", true);
1328 $(".uncheckall").click(function(e){
1330 $(this).parents('form').find("input:checkbox").each(function(){
1331 $(this).prop("checked", false);
1334 $(".other_reason").hide();
1335 $("select[name='reason']").change(function(){
1336 if($(this).val() == "other"){
1338 $(this).siblings(".other_reason").show();
1342 $("a.cancel_note").click(function(e) {
1343 $(this).parent().siblings("select").show().find("option[value='']").attr("selected","selected");
1344 $(this).siblings("input[name='other_reason']").hide();
1347 $("h4.local_collapse a").click(function(){
1348 $(this).parent().parent().find("ol").toggle();
1351 // http://jqueryui.com/demos/datepicker/#date-range
1352 var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
1355 onSelect: function( selectedDate ) {
1356 var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
1357 instance = $( this ).data( "datepicker" );
1358 date = $.datepicker.parseDate(
1359 instance.settings.dateFormat ||
1360 $.datepicker._defaults.dateFormat,
1361 selectedDate, instance.settings );
1362 dates.not( this ).datepicker( "option", option, date );
1365 var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
1368 onSelect: function( selectedDate ) {
1369 var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
1370 instance = $( this ).data( "datepicker" );
1371 date = $.datepicker.parseDate(
1372 instance.settings.dateFormat ||
1373 $.datepicker._defaults.dateFormat,
1374 selectedDate, instance.settings );
1375 datesMD.not( this ).datepicker( "option", option, date );
1378 var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
1381 onSelect: function( selectedDate ) {
1382 var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
1383 instance = $( this ).data( "datepicker" );
1384 date = $.datepicker.parseDate(
1385 instance.settings.dateFormat ||
1386 $.datepicker._defaults.dateFormat,
1387 selectedDate, instance.settings );
1388 datesAD.not( this ).datepicker( "option", option, date );
1392 $("button[type='submit']").on("click", function(e) {
1393 var submit_button = this;
1394 var form = $(submit_button).parents("form");
1395 var action = $(submit_button).val();
1396 var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1397 if ( selected_suggestions.length == 0 ) {
1398 alert(_("Please select at least one suggestion"));
1402 if ( action == "delete" ) {
1403 if ( selected_suggestions.length == 1 ) {
1404 if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
1408 } else if ( selected_suggestions.length > 1 ) {
1409 if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
1414 } else if ( action == "update_manager" ) {
1415 var managedby = $(submit_button).siblings("suggestion_managedby");
1416 if ( managedby.val() == "" ) {
1417 alert(_("Please select a manager to assign to the selected suggestions"));
1423 $('<input />').attr('type', 'hidden')
1425 .attr('value', action)
1432 [% IF op == 'save' %]
1435 $(document).ready(function(){
1437 $("#quantity,#price,#currency").on("change",function(){
1441 [% IF other_reason %]
1442 $(".select-reason").hide();
1443 $(".select-reason").find("option[value='other']").attr("selected","selected");
1444 $("#other_reason").show();
1446 $("#other_reason").hide();
1448 $(".select-reason").change(function(){
1449 if($(this).val() == "other"){
1451 $("#other_reason").show();
1454 $("a[href*=back]").click(function(){
1455 $(".select-reason").show().find("option[value='']").attr("selected","selected");
1456 $("#other_reason").hide();
1459 $("#restore_previous_manager").on("click",function(e){
1462 $("#managedby_name").empty();
1463 $("#managedby").val('');
1464 var borrowername = "[% managedby_patron.firstname | html %] [% managedby_patron.surname | html %]";
1465 var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
1466 + '?borrowernumber=[% managedby_patron.borrowernumber | html %]">'
1467 + borrowername + '</a>';
1468 $('#managedby_name').html(managerlink);
1469 $('#managedby').val([% managedby_patron.borrowernumber | html %]);
1470 $('#notify').prop('checked', false).prop('disabled', true);
1473 //keep a copy of all budgets before removing the inactives
1474 var budgetId = $("form#add_edit #budgetid");
1475 var disabledBudgetsCopy = budgetId.html();
1476 $('.b_inactive').remove();
1478 $('#showallfunds').click(function() {
1479 if ($(this).is(":checked")) {
1480 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
1483 $('.b_inactive').remove();
1490 [% Asset.js("js/acq.js") | $raw %]
1491 [% Asset.js("js/acquisitions-menu.js") | $raw %]
1493 [% INCLUDE 'intranet-bottom.inc' %]