5 [% USE AuthorisedValues %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog ›
9 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
10 [% IF ( op_else ) %]Purchase Suggestions[% END %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% BLOCK cssinclude %][% END %]
14 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usersuggestions' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-suggestions' bodyclass='scrollto' %][% END %]
15 [% INCLUDE 'masthead.inc' %]
18 <nav aria-label="breadcrumb">
19 <ul class="breadcrumb">
20 <li class="breadcrumb-item">
21 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
23 <li class="breadcrumb-item">
24 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
26 <li class="breadcrumb-item" aria-current="page">
27 <a href="#">Your purchase suggestions</a>
32 <div class="container-fluid">
34 <div class="col col-lg-2 order-2 order-lg-1">
36 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
39 <div class="col-md-12 col-lg-10 order-1">
41 <div id="usersuggestions" class="maincontent">
43 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
44 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
45 <h2 class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</h2>
46 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
47 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
48 <h2 class="TooManySuggestionsText">You have reached your limit for suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') | html %]). Once the library has processed those suggestions you will be able to place more.</h2>
50 <h1>Enter a new purchase suggestion</h1>
52 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p>
53 <p>Only certain fields (marked in red) are required, but the more information you enter the easier it will be for the librarians to find the title you're requesting. The "Notes" field can be used to provide any additional information.</p>
55 [% FOR m IN messages %]
56 <div class="alert alert-[% m.type | html %]">
58 [% CASE 'biblio_exists' %]
59 A similar document already exists: <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% m.id | uri %]">[% m.title | html %]</a>. Click on "Confirm your suggestion" to ignore this message.
66 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
67 <fieldset class="rows">
70 [% IF ( title_required ) %]
71 <label for="title" class="required">Title:</label>
72 <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" required="required" />
73 <span class="required">Required</span>
75 <label for="title">Title:</label>
76 <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" />
79 [% UNLESS ( author_hidden ) %]
81 [% IF ( author_required ) %]
82 <label for="author" class="required">Author:</label>
83 <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" required="required" />
84 <span class="required">Required</span>
86 <label for="author">Author:</label>
87 <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" />
91 [% UNLESS ( copyrightdate_hidden )%]
93 <div title="Copyright or publication year, for example: 2016">
94 [% IF ( copyrightdate_required ) %]
95 <label for="copyrightdate" class="required">Copyright date:</label>
96 <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" required="required" />
97 <span class="required">Required</span>
99 <label for="copyrightdate">Copyright date:</label>
100 <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" />
105 [% UNLESS ( isbn_hidden )%]
107 [% IF ( isbn_required ) %]
108 <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
109 <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" required="required" />
110 <span class="required">Required</span>
112 <label for="isbn">Standard number (ISBN, ISSN or other):</label>
113 <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" />
117 [% UNLESS ( publishercode_hidden ) %]
119 [% IF ( publishercode_required ) %]
120 <label for="publishercode" class="required">Publisher:</label>
121 <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
122 <span class="required">Required</span>
124 <label for="publishercode">Publisher:</label>
125 <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" />
129 [% UNLESS ( collectiontitle_hidden ) %]
131 [% IF ( collectiontitle_required ) %]
132 <label for="collectiontitle" class="required">Collection title:</label>
133 <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
134 <span class="required">Required</span>
136 <label for="collectiontitle">Collection title:</label>
137 <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" />
141 [% UNLESS ( place_hidden ) %]
143 [% IF ( place_required ) %]
144 <label for="place" class="required">Publication place:</label>
145 <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
146 <span class="required">Required</span>
148 <label for="place">Publication place:</label>
149 <input type="text" id="place" name="place" maxlength="80" value="[% place | html %]" />
153 [% UNLESS ( quantity_hidden ) %]
154 <li id="opac-suggestion-quantity">
155 [% IF ( quantity_required ) %]
156 <label for="quantity" class="required">Quantity:</label>
157 <input type="text" id="quantity" name="quantity" required="required" maxlength="4" size="4" />
158 <span class="required">Required</span>
160 <label for="quantity">Quantity:</label>
161 <input type="text" id="quantity" name="quantity" maxlength="4" size="4" />
165 [% UNLESS ( itemtype_hidden )%]
167 [% IF ( itemtype_required ) %]
168 <label for="itemtype" class="required">Item type:</label>
169 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
170 <span class="required">Required</span>
172 <label for="itemtype">Item type:</label>
173 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
178 [% UNLESS ( branch_hidden )%]
180 [% IF ( branchcode_required ) %]
181 <label for="branch" class="required">Library:</label>
182 <select name="branchcode" id="branch" required="required">
183 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
185 <span class="required">Required</span>
187 <label for="branch">Library:</label>
188 <select name="branchcode" id="branch">
189 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
195 [% IF ( patron_reason_loop ) %]
196 [% UNLESS ( patronreason_hidden )%]
198 [% IF ( patronreason_required ) %]
199 <label for="patronreason" class="required">Reason for suggestion: </label>
200 <select name="patronreason" id="patronreason" required="required">
201 <option value="">-- Choose --</option>
202 [% FOREACH patron_reason_loo IN patron_reason_loop %]
203 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
206 <span class="required">Required</span>
208 <label for="patronreason">Reason for suggestion: </label>
209 <select name="patronreason" id="patronreason">
210 <option value="">-- Choose --</option>
211 [% FOREACH patron_reason_loo IN patron_reason_loop %]
212 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
219 [% UNLESS ( note_hidden ) %]
221 [% IF ( note_required ) %]
222 <label for="note" class="required">Notes:</label>
223 <textarea name="note" id="note" rows="5" cols="40" required="required">[% note | html %]</textarea>
224 <span class="required">Required</span>
226 <label for="note">Notes:</label>
227 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
232 <!-- Add a hidden 'negcap' field -->
233 <li id="negcap" style="position: absolute; left: -2000px;">
234 negcap <input type="text" name="negcap"/>
239 <fieldset class="action">
240 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" />
241 [% IF need_confirm # Confirm that we want a duplicate %]
242 <input type="hidden" name="op" value="add_confirm" />
243 <input type="submit" class="btn btn-primary" value="Confirm your suggestion" />
244 [% ELSIF biblionumber # Create from an existing title %]
245 <input type="hidden" name="op" value="add_confirm" />
246 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
247 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
248 [% ELSE # Not created from an existing title, search for possible duplicate %]
249 <input type="hidden" name="op" value="add_validate" />
250 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
252 <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
256 [% END # IF op_add %]
260 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
263 [% IF ( loggedinusername ) %]
264 Your purchase suggestions
270 [% FOR m IN messages %]
271 <div class="alert alert-[% m.type | html %]">
273 [% CASE 'total_suggestions' %]
274 The suggestion has not been added. You have reached your limit for suggestions you can place at this time ([% Koha.Preference('MaxTotalSuggestions') | html %] in [% Koha.Preference('NumberOfSuggestionDays') | html %] days).
275 [% CASE 'too_many' %]
276 The suggestion has not been added. You have reached your limit for suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') | html %]). Once the library has processed those suggestions you will be able to place more.
277 [% CASE 'already_exists' %]
278 The suggestion has not been added. A suggestion with this title already exists.
279 [% CASE 'success_on_inserted' %]
280 Your suggestion has been submitted.
287 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
289 [% IF ( suggestions_loop ) %]
290 [% SET can_delete_suggestion = 0 %]
291 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
292 <div class="form-row">
293 <div class="col-auto my-1">
294 <label class="sr-only" for="title">Search for:</label>
295 <input class="form-control form-control-sm" type="text" name="title" placeholder="Search suggestions" id="title" value="[% title | html %]" />
297 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
298 [% IF loggedinusername %]
299 <div class="col-auto my-1">
300 <label class="sr-only" for="suggested_by_anyone">Suggested by:</label>
301 <select class="form-control form-control-sm" name="suggested_by_anyone" id="suggested_by_anyone">
302 [% IF suggested_by_anyone %]
303 <option value="0">Suggested by me</option>
304 <option value="1" selected="selected">Suggested by anyone</option>
306 <option value="0" selected="selected">Suggested by me</option>
307 <option value="1">Suggested by anyone</option>
311 <div class="col-auto my-1">
312 <button type="submit" class="btn btn-sm btn-primary">Go</button>
318 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
319 <input type="hidden" name="op" value="delete_confirm" />
320 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
321 <div id="toolbar" class="toolbar clearfix">
322 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
323 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
324 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
325 <p class="TooManySuggestionsText">You have reached your limit for suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') | html %]).</br>Once the library has processed those suggestions you will be able to place more.</p>
327 <a class="btn btn-link new" href="/cgi-bin/koha/opac-suggestions.pl?op=add"><i class="fa fa-plus" aria-hidden="true"></i> New purchase suggestion</a>
332 [% IF ( loggedinusername ) %]
333 <div id="selections-toolbar" class="toolbar">
334 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
336 <span id="selections">Select suggestions to: </span>
337 <span id="removeitems"></span>
342 <table id="suggestt" class="checkboxed table table-bordered table-striped">
345 [% IF ( loggedinusername ) %]<th> </th>[% END %]
347 <th>Suggested on</th>
349 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
350 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
355 [% FOREACH suggestions_loo IN suggestions_loop %]
357 [% IF ( loggedinusername ) %]
359 [% IF ( suggestions_loo.showcheckbox ) %]
360 [% SET can_delete_suggestion = 1 %]
361 <input type="checkbox" class="cb" id="id[% suggestions_loo.suggestionid | html %]" name="delete_field" data-title="[% suggestions_loo.title | html %]" value="[% suggestions_loo.suggestionid | html %]" />
367 <label for="id[% suggestions_loo.suggestionid | html %]">
368 [% IF suggestions_loo.biblionumber %]
369 <strong><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% suggestions_loo.biblionumber | uri %]">[% suggestions_loo.title | html %]</a></strong>
371 <strong>[% suggestions_loo.title | html %]</strong>
375 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author | html %],[% END %]
376 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate | html %],[% END %]
377 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode | html %][% END %]
378 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place | html %])[% END %]
379 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle | html %][% END %]
380 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) | html %][% END %]
384 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
387 [% IF ( suggestions_loo.note ) %]
388 <span class="tdlabel">Note: </span>
389 [% suggestions_loo.note | html %]
392 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
394 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
395 <span class="tdlabel">Suggested for:</span>
396 [% suggestions_loo.branchcodesuggestedby | html %]
400 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
402 [% IF ( suggestions_loo.surnamemanagedby ) %]
403 <span class="tdlabel">Managed by:</span>
404 [% suggestions_loo.surnamemanagedby | html %]
405 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby | html %]
411 <span class="tdlabel">Status:</span>
412 [% IF ( suggestions_loo.ASKED ) %]Requested
413 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
414 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
415 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
416 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
417 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
418 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) | html %] [% END %]
419 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason | html %])[% END %]
422 [% END # / FOREACH suggestions_loo %]
426 [% IF ( loggedinusername && can_delete_suggestion ) %]
427 <fieldset class="action">
428 <input type="submit" class="btn btn-danger removeitems" value="Delete selected" />
433 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
434 [% IF ( loggedinusername ) %]
435 [% IF ( suggested_by_anyone ) %]
436 <p>There are no pending purchase suggestions.</p>
438 <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
441 <p>There are no pending purchase suggestions.</p>
444 [% IF ( loggedinusername ) %]
445 <p>You have no pending purchase suggestions.</p>
447 <p>You are not authorized to see pending purchase suggestions.</p>
450 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
451 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
452 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
453 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
454 <p class="TooManySuggestionsText">You have reached your limit for suggestions you can place at this time.</br>Once the library has processed those suggestions you will be able to place more.</p>
456 <p><a class="btn btn-link new" href="/cgi-bin/koha/opac-suggestions.pl?op=add"><i class="fa fa-plus" aria-hidden="true"></i> New purchase suggestion</a></p>
459 [% END # / IF suggestions_loop %]
461 [% END # IF op_else %]
462 </div> <!-- / #usersuggestions -->
463 </div> <!-- / .col-lg-10 -->
464 </div> <!-- / .row -->
465 </div> <!-- / .container-fluid -->
466 </div> <!-- / .main -->
468 [% INCLUDE 'opac-bottom.inc' %]
469 [% BLOCK jsinclude %]
470 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
471 [% INCLUDE 'datatables.inc' %]
473 [% IF ( loggedinusername ) %]
474 function enableCheckboxActions(){
475 // Enable/disable controls if checkboxes are checked
476 var checkedBoxes = $(".checkboxed input:checkbox:checked");
477 if ($(checkedBoxes).size()) {
478 $("#selections").html(_("With selected suggestions: "));
479 $("#selections-toolbar .links a").removeClass("disabled");
481 $("#selections").html(_("Select suggestions to: "));
482 $("#selections-toolbar .links a").addClass("disabled");
488 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
489 "order": [[ 1, "asc" ]],
492 [% IF ( loggedinusername ) %]{ "targets": [ 0 ], "sortable": false, "searchable": false }[% END %]
495 [% IF ( loggedinusername ) %]null,[% END %]
496 { "type": "anti-the" },
499 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
500 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
504 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
505 $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
506 $("#CheckAll").click(function(){
507 $(".checkboxed").checkCheckboxes();
508 enableCheckboxActions();
511 $("#CheckNone").click(function(){
512 $(".checkboxed").unCheckCheckboxes();
513 enableCheckboxActions();
516 $(".cb").click(function(){
517 enableCheckboxActions();
519 $("#removeitems").html("<a href=\"#\" class=\"btn btn-link removeitems tag_hides btn-disabled\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i> "+_("Delete")+"</a>");
521 enableCheckboxActions();
523 $(".removeitems").on("click", function(e) {
525 var selected_titles = $("input:checked");
530 if ( selected_titles.size() < 1 ) {
531 alert(MSG_NO_SUGGESTION_SELECTED);
534 if( selected_titles.size() > 1 ){
535 message = $("<ul></ul>");
536 title = _("Are you sure you want to delete these suggestions?");
537 yes_label = _("Yes, delete suggestions");
538 no_label = _("No, do not delete suggestions");
539 selected_titles.each(function(){
540 message.append( "<li>" + $(this).data("title") + "</li>" );
543 title = _("Are you sure you want to delete this suggestion?");
544 yes_label = _("Yes, delete suggestion");
545 no_label = _("No, do not delete suggestion");
546 selected_titles.each(function(){
547 message += $(this).data("title");
550 confirmModal( message, title, yes_label, no_label, function( result ){
552 $("#delete_suggestions").submit();