5 [% USE AuthorisedValues %]
7 [% USE AdditionalContents %]
8 [% SET opacsuggestion = AdditionalContents.get( location => "OpacSuggestioninstructions", lang => lang, library => logged_in_user.branchcode ) %]
9 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>[% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
12 [% IF ( op_else ) %]Purchase suggestions[% END %] ›
13 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
14 [% INCLUDE 'doc-head-close.inc' %]
15 [% BLOCK cssinclude %][% END %]
17 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usersuggestions' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-suggestions' bodyclass='scrollto' %][% END %]
18 [% INCLUDE 'masthead.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
22 <ol class="breadcrumb">
23 <li class="breadcrumb-item">
24 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
26 <li class="breadcrumb-item">
27 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
29 <li class="breadcrumb-item active">
30 <a href="#" aria-current="page">Your purchase suggestions</a>
33 </nav> <!-- /#breadcrumbs -->
35 <div class="container-fluid">
37 <div class="col col-lg-2 order-2 order-lg-1">
39 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
42 <div class="col-md-12 col-lg-10 order-1">
44 <div id="usersuggestions" class="maincontent">
46 <h1>Your purchase suggestions</h1>
47 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
48 <h2 class="TooManySuggestions">You cannot place any more suggestions</h2>
49 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
50 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
51 <h2 class="TooManySuggestions">You cannot place any more suggestions</h2>
52 <p 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.</p>
55 [% IF ( opacsuggestion ) %]
56 [% PROCESS koha_news_block news => opacsuggestion %]
58 <h2>Enter a new purchase suggestion</h2>
60 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p>
61 <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>
63 [% FOR m IN messages %]
64 <div class="alert alert-[% m.type | html %]">
66 [% CASE 'biblio_exists' %]
67 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.
74 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
75 <fieldset class="rows">
78 [% IF ( title_required ) %]
79 <label for="title" class="required">Title:</label>
80 <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" required="required" />
81 <span class="required">Required</span>
83 <label for="title">Title:</label>
84 <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" />
87 [% UNLESS ( author_hidden ) %]
89 [% IF ( author_required ) %]
90 <label for="author" class="required">Author:</label>
91 <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" required="required" />
92 <span class="required">Required</span>
94 <label for="author">Author:</label>
95 <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" />
99 [% UNLESS ( copyrightdate_hidden )%]
101 <div title="Copyright or publication year, for example: 2016">
102 [% IF ( copyrightdate_required ) %]
103 <label for="copyrightdate" class="required">Copyright date:</label>
104 <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" required="required" />
105 <span class="required">Required</span>
107 <label for="copyrightdate">Copyright date:</label>
108 <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" />
113 [% UNLESS ( isbn_hidden )%]
115 [% IF ( isbn_required ) %]
116 <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
117 <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" required="required" />
118 <span class="required">Required</span>
120 <label for="isbn">Standard number (ISBN, ISSN or other):</label>
121 <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" />
125 [% UNLESS ( publishercode_hidden ) %]
127 [% IF ( publishercode_required ) %]
128 <label for="publishercode" class="required">Publisher:</label>
129 <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
130 <span class="required">Required</span>
132 <label for="publishercode">Publisher:</label>
133 <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" />
137 [% UNLESS ( collectiontitle_hidden ) %]
139 [% IF ( collectiontitle_required ) %]
140 <label for="collectiontitle" class="required">Collection title:</label>
141 <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
142 <span class="required">Required</span>
144 <label for="collectiontitle">Collection title:</label>
145 <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" />
149 [% UNLESS ( place_hidden ) %]
151 [% IF ( place_required ) %]
152 <label for="place" class="required">Publication place:</label>
153 <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
154 <span class="required">Required</span>
156 <label for="place">Publication place:</label>
157 <input type="text" id="place" name="place" maxlength="80" value="[% place | html %]" />
161 [% UNLESS ( quantity_hidden ) %]
162 <li id="opac-suggestion-quantity">
163 [% IF ( quantity_required ) %]
164 <label for="quantity" class="required">Quantity:</label>
165 <input type="text" id="quantity" name="quantity" required="required" maxlength="4" size="4" />
166 <span class="required">Required</span>
168 <label for="quantity">Quantity:</label>
169 <input type="text" id="quantity" name="quantity" maxlength="4" size="4" />
173 [% UNLESS ( itemtype_hidden )%]
175 [% IF ( itemtype_required ) %]
176 <label for="itemtype" class="required">Item type:</label>
177 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, required = 1, blank = 1 %]
178 <span class="required">Required</span>
180 <label for="itemtype">Item type:</label>
181 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, blank = 1 %]
185 [% UNLESS ( branch_hidden )%]
187 [% IF ( branchcode_required ) %]
188 <label for="branch" class="required">Library:</label>
189 <select name="branchcode" id="branch" required="required">
190 [% PROCESS options_for_libraries libraries => Branches.all %]
192 <span class="required">Required</span>
194 <label for="branch">Library:</label>
195 <select name="branchcode" id="branch">
196 [% PROCESS options_for_libraries libraries => Branches.all %]
201 [% IF ( patron_reason_loop ) %]
202 [% UNLESS ( patronreason_hidden )%]
204 [% IF ( patronreason_required ) %]
205 <label for="patronreason" class="required">Reason for suggestion: </label>
206 <select name="patronreason" id="patronreason" required="required">
207 <option value="">-- Choose --</option>
208 [% FOREACH patron_reason_loo IN patron_reason_loop %]
209 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
212 <span class="required">Required</span>
214 <label for="patronreason">Reason for suggestion: </label>
215 <select name="patronreason" id="patronreason">
216 <option value="">-- Choose --</option>
217 [% FOREACH patron_reason_loo IN patron_reason_loop %]
218 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
225 [% UNLESS ( note_hidden ) %]
227 [% IF ( note_required ) %]
228 <label for="note" class="required">Notes:</label>
229 <textarea name="note" id="note" rows="5" cols="40" required="required">[% note | html %]</textarea>
230 <span class="required">Required</span>
232 <label for="note">Notes:</label>
233 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
238 <!-- Add a hidden 'negcap' field -->
239 <li id="negcap" style="position: absolute; left: -2000px;">
240 negcap <input type="text" name="negcap"/>
245 <fieldset class="action">
246 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" />
247 [% IF need_confirm # Confirm that we want a duplicate %]
248 <input type="hidden" name="op" value="add_confirm" />
249 <input type="submit" class="btn btn-primary" value="Confirm your suggestion" />
250 [% ELSIF biblionumber # Create from an existing title %]
251 <input type="hidden" name="op" value="add_confirm" />
252 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
253 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
254 [% ELSE # Not created from an existing title, search for possible duplicate %]
255 <input type="hidden" name="op" value="add_validate" />
256 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
258 <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
262 [% END # IF op_add %]
266 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
269 [% IF ( loggedinusername ) %]
270 Your purchase suggestions
276 [% FOR m IN messages %]
277 <div class="alert alert-[% m.type | html %]">
279 [% CASE 'total_suggestions' %]
280 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).
281 [% CASE 'too_many' %]
282 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.
283 [% CASE 'already_exists' %]
284 The suggestion has not been added. A suggestion with this title already exists.
285 [% CASE 'success_on_inserted' %]
286 Your suggestion has been submitted.
293 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
295 [% IF suggestions_loop OR title_filter %]
296 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
297 <div class="form-row">
298 <label for="title_filter">Search for:</label>
299 <input type="text" name="title_filter" id="title_filter" value="[% title_filter | html %]" />
300 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
301 [% IF loggedinusername %]
302 <div class="col-auto my-1">
303 <label class="sr-only" for="suggested_by_anyone">Suggested by:</label>
304 <select class="form-control form-control-sm" name="suggested_by_anyone" id="suggested_by_anyone">
305 [% IF suggested_by_anyone %]
306 <option value="0">Suggested by me</option>
307 <option value="1" selected="selected">Suggested by anyone</option>
309 <option value="0" selected="selected">Suggested by me</option>
310 <option value="1">Suggested by anyone</option>
316 <div class="col-auto my-1">
317 <button type="submit" class="btn btn-sm btn-primary">Go</button>
322 [% IF suggestions_loop %]
323 [% SET can_delete_suggestion = 0 %]
324 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
325 <input type="hidden" name="op" value="delete_confirm" />
326 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
327 <div id="toolbar" class="toolbar clearfix">
328 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
329 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
330 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
331 <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>
333 <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>
338 [% IF ( loggedinusername ) %]
339 <div class="selections-toolbar toolbar">
340 <div class="check_control">
341 <span class="checkall"></span> <span class="clearall"></span>
344 <span class="selections">Select suggestions to: </span>
345 <span id="removeitems">
346 <a href="#" class="btn btn-link removeitems tag_hides disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
352 <table id="suggestt" class="table table-bordered table-striped">
353 <caption class="sr-only">Your purchase suggestions<caption>
356 [% IF ( loggedinusername ) %]<th> </th>[% END %]
358 <th>Suggested on</th>
360 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
361 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
366 [% FOREACH suggestions_loo IN suggestions_loop %]
368 [% IF ( loggedinusername ) %]
369 <td class="selectcol">
370 [% IF ( suggestions_loo.showcheckbox ) %]
371 [% SET can_delete_suggestion = 1 %]
372 <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 %]" />
378 <label for="id[% suggestions_loo.suggestionid | html %]">
379 [% IF suggestions_loo.biblionumber %]
380 <strong><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% suggestions_loo.biblionumber | uri %]">[% suggestions_loo.title | html %]</a></strong>
382 <strong>[% suggestions_loo.title | html %]</strong>
386 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author | html %],[% END %]
387 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate | html %],[% END %]
388 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode | html %][% END %]
389 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place | html %])[% END %]
390 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle | html %][% END %]
391 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) | html %][% END %]
395 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
398 [% IF ( suggestions_loo.note ) %]
399 <span class="tdlabel">Note: </span>
400 [% suggestions_loo.note | html %]
403 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
405 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
406 <span class="tdlabel">Suggested for:</span>
407 [% suggestions_loo.branchcodesuggestedby | html %]
411 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
413 [% IF ( suggestions_loo.surnamemanagedby ) %]
414 <span class="tdlabel">Managed by:</span>
415 [% suggestions_loo.surnamemanagedby | html %]
416 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby | html %]
422 <span class="tdlabel">Status:</span>
423 [% IF ( suggestions_loo.ASKED ) %]Requested
424 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
425 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
426 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
427 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
428 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
429 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) | html %] [% END %]
430 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason | html %])[% END %]
433 [% END # / FOREACH suggestions_loo %]
437 [% IF ( loggedinusername && can_delete_suggestion ) %]
438 <fieldset class="action">
439 <input type="submit" class="btn btn-danger removeitems" value="Delete selected" />
444 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
445 [% IF title_filter %]
446 <p>There are no pending purchase suggestions matching your search.</p>
447 [% ELSIF loggedinusername AND NOT suggested_by_anyone %]
448 <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
450 <p>There are no pending purchase suggestions.</p>
453 [% IF ( loggedinusername ) %]
454 [% IF title_filter %]
455 <p>There are no pending purchase suggestions matching your search.</p>
457 <p>You have no pending purchase suggestions.</p>
460 <p>You are not authorized to see pending purchase suggestions.</p>
463 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
464 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
465 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
466 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
467 <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>
469 <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>
472 [% END # / IF suggestions_loop %]
474 [% END # IF op_else %]
475 </div> <!-- / #usersuggestions -->
476 </div> <!-- / .col-lg-10 -->
477 </div> <!-- / .row -->
478 </div> <!-- / .container-fluid -->
479 </div> <!-- / .main -->
481 [% INCLUDE 'opac-bottom.inc' %]
482 [% BLOCK jsinclude %]
483 [% INCLUDE 'datatables.inc' %]
485 [% IF ( loggedinusername ) %]
486 function enableCheckboxActions(){
487 // Enable/disable controls if checkboxes are checked
488 var checkedBoxes = $(".cb:checked");
489 if ($(checkedBoxes).size()) {
490 $(".selections").html(_("With selected suggestions: "));
491 $(".selections-toolbar .links a").removeClass("disabled");
493 $(".selections").html(_("Select suggestions to: "));
494 $(".selections-toolbar .links a").addClass("disabled");
500 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
501 "order": [[ 1, "asc" ]],
504 [% IF ( loggedinusername ) %]{ "targets": [ 0 ], "sortable": false, "searchable": false }[% END %]
507 [% IF ( loggedinusername ) %]null,[% END %]
508 { "type": "anti-the" },
511 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
512 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
516 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
517 $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
518 $("#CheckAll").on("click",function(e){
520 $(".cb").prop("checked", true);
521 enableCheckboxActions();
523 $("#CheckNone").on("click",function(e){
525 $(".cb").prop("checked", false);
526 enableCheckboxActions();
528 $(".cb").click(function(){
529 enableCheckboxActions();
532 enableCheckboxActions();
534 $(".removeitems").on("click", function(e) {
536 var selected_titles = $("input:checked");
541 if ( selected_titles.size() < 1 ) {
542 alert(MSG_NO_SUGGESTION_SELECTED);
545 if( selected_titles.size() > 1 ){
546 message = $("<ul></ul>");
547 title = _("Are you sure you want to delete these suggestions?");
548 yes_label = _("Yes, delete suggestions");
549 no_label = _("No, do not delete suggestions");
550 selected_titles.each(function(){
551 message.append( "<li>" + $(this).data("title") + "</li>" );
554 title = _("Are you sure you want to delete this suggestion?");
555 yes_label = _("Yes, delete suggestion");
556 no_label = _("No, do not delete suggestion");
557 selected_titles.each(function(){
558 message += $(this).data("title");
561 confirmModal( message, title, yes_label, no_label, function( result ){
563 $("#delete_suggestions").submit();