5 [% USE AuthorisedValues %]
8 [% SET opacsuggestion = KohaNews.get( location => "OpacSuggestioninstructions", lang => lang, library => branchcode ) %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog ›
11 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
12 [% IF ( op_else ) %]Purchase Suggestions[% END %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% BLOCK cssinclude %][% END %]
16 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usersuggestions' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-suggestions' bodyclass='scrollto' %][% END %]
17 [% INCLUDE 'masthead.inc' %]
20 <nav aria-label="breadcrumb">
21 <ul class="breadcrumb">
22 <li class="breadcrumb-item">
23 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
25 <li class="breadcrumb-item">
26 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
28 <li class="breadcrumb-item" aria-current="page">
29 <a href="#">Your purchase suggestions</a>
34 <div class="container-fluid">
36 <div class="col col-lg-2 order-2 order-lg-1">
38 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
41 <div class="col-md-12 col-lg-10 order-1">
43 <div id="usersuggestions" class="maincontent">
45 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
46 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
47 <h2 class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</h2>
48 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
49 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
50 <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>
52 [% IF ( opacsuggestion ) %]
53 [% PROCESS koha_news_block news => opacsuggestion %]
55 <h1>Enter a new purchase suggestion</h1>
57 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p>
58 <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>
60 [% FOR m IN messages %]
61 <div class="alert alert-[% m.type | html %]">
63 [% CASE 'biblio_exists' %]
64 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.
71 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
72 <fieldset class="rows">
75 [% IF ( title_required ) %]
76 <label for="title" class="required">Title:</label>
77 <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" required="required" />
78 <span class="required">Required</span>
80 <label for="title">Title:</label>
81 <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" />
84 [% UNLESS ( author_hidden ) %]
86 [% IF ( author_required ) %]
87 <label for="author" class="required">Author:</label>
88 <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" required="required" />
89 <span class="required">Required</span>
91 <label for="author">Author:</label>
92 <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" />
96 [% UNLESS ( copyrightdate_hidden )%]
98 <div title="Copyright or publication year, for example: 2016">
99 [% IF ( copyrightdate_required ) %]
100 <label for="copyrightdate" class="required">Copyright date:</label>
101 <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" required="required" />
102 <span class="required">Required</span>
104 <label for="copyrightdate">Copyright date:</label>
105 <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" />
110 [% UNLESS ( isbn_hidden )%]
112 [% IF ( isbn_required ) %]
113 <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
114 <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" required="required" />
115 <span class="required">Required</span>
117 <label for="isbn">Standard number (ISBN, ISSN or other):</label>
118 <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" />
122 [% UNLESS ( publishercode_hidden ) %]
124 [% IF ( publishercode_required ) %]
125 <label for="publishercode" class="required">Publisher:</label>
126 <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
127 <span class="required">Required</span>
129 <label for="publishercode">Publisher:</label>
130 <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" />
134 [% UNLESS ( collectiontitle_hidden ) %]
136 [% IF ( collectiontitle_required ) %]
137 <label for="collectiontitle" class="required">Collection title:</label>
138 <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
139 <span class="required">Required</span>
141 <label for="collectiontitle">Collection title:</label>
142 <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" />
146 [% UNLESS ( place_hidden ) %]
148 [% IF ( place_required ) %]
149 <label for="place" class="required">Publication place:</label>
150 <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
151 <span class="required">Required</span>
153 <label for="place">Publication place:</label>
154 <input type="text" id="place" name="place" maxlength="80" value="[% place | html %]" />
158 [% UNLESS ( quantity_hidden ) %]
159 <li id="opac-suggestion-quantity">
160 [% IF ( quantity_required ) %]
161 <label for="quantity" class="required">Quantity:</label>
162 <input type="text" id="quantity" name="quantity" required="required" maxlength="4" size="4" />
163 <span class="required">Required</span>
165 <label for="quantity">Quantity:</label>
166 <input type="text" id="quantity" name="quantity" maxlength="4" size="4" />
170 [% UNLESS ( itemtype_hidden )%]
172 [% IF ( itemtype_required ) %]
173 <label for="itemtype" class="required">Item type:</label>
174 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, required = 1, blank = 1 %]
175 <span class="required">Required</span>
177 <label for="itemtype">Item type:</label>
178 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, blank = 1 %]
182 [% UNLESS ( branch_hidden )%]
184 [% IF ( branchcode_required ) %]
185 <label for="branch" class="required">Library:</label>
186 <select name="branchcode" id="branch" required="required">
187 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
189 <span class="required">Required</span>
191 <label for="branch">Library:</label>
192 <select name="branchcode" id="branch">
193 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
198 [% IF ( patron_reason_loop ) %]
199 [% UNLESS ( patronreason_hidden )%]
201 [% IF ( patronreason_required ) %]
202 <label for="patronreason" class="required">Reason for suggestion: </label>
203 <select name="patronreason" id="patronreason" required="required">
204 <option value="">-- Choose --</option>
205 [% FOREACH patron_reason_loo IN patron_reason_loop %]
206 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
209 <span class="required">Required</span>
211 <label for="patronreason">Reason for suggestion: </label>
212 <select name="patronreason" id="patronreason">
213 <option value="">-- Choose --</option>
214 [% FOREACH patron_reason_loo IN patron_reason_loop %]
215 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
222 [% UNLESS ( note_hidden ) %]
224 [% IF ( note_required ) %]
225 <label for="note" class="required">Notes:</label>
226 <textarea name="note" id="note" rows="5" cols="40" required="required">[% note | html %]</textarea>
227 <span class="required">Required</span>
229 <label for="note">Notes:</label>
230 <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
235 <!-- Add a hidden 'negcap' field -->
236 <li id="negcap" style="position: absolute; left: -2000px;">
237 negcap <input type="text" name="negcap"/>
242 <fieldset class="action">
243 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" />
244 [% IF need_confirm # Confirm that we want a duplicate %]
245 <input type="hidden" name="op" value="add_confirm" />
246 <input type="submit" class="btn btn-primary" value="Confirm your suggestion" />
247 [% ELSIF biblionumber # Create from an existing title %]
248 <input type="hidden" name="op" value="add_confirm" />
249 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
250 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
251 [% ELSE # Not created from an existing title, search for possible duplicate %]
252 <input type="hidden" name="op" value="add_validate" />
253 <input type="submit" class="btn btn-primary" value="Submit your suggestion" />
255 <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
259 [% END # IF op_add %]
263 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
266 [% IF ( loggedinusername ) %]
267 Your purchase suggestions
273 [% FOR m IN messages %]
274 <div class="alert alert-[% m.type | html %]">
276 [% CASE 'total_suggestions' %]
277 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).
278 [% CASE 'too_many' %]
279 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.
280 [% CASE 'already_exists' %]
281 The suggestion has not been added. A suggestion with this title already exists.
282 [% CASE 'success_on_inserted' %]
283 Your suggestion has been submitted.
290 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
292 [% IF ( suggestions_loop ) %]
293 [% SET can_delete_suggestion = 0 %]
294 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
295 <div class="form-row">
296 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
297 [% IF loggedinusername %]
298 <div class="col-auto my-1">
299 <label class="sr-only" for="suggested_by_anyone">Suggested by:</label>
300 <select class="form-control form-control-sm" name="suggested_by_anyone" id="suggested_by_anyone">
301 [% IF suggested_by_anyone %]
302 <option value="0">Suggested by me</option>
303 <option value="1" selected="selected">Suggested by anyone</option>
305 <option value="0" selected="selected">Suggested by me</option>
306 <option value="1">Suggested by anyone</option>
310 <div class="col-auto my-1">
311 <button type="submit" class="btn btn-sm btn-primary">Go</button>
317 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
318 <input type="hidden" name="op" value="delete_confirm" />
319 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
320 <div id="toolbar" class="toolbar clearfix">
321 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
322 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
323 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
324 <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>
326 <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>
331 [% IF ( loggedinusername ) %]
332 <div id="selections-toolbar" class="toolbar">
333 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
335 <span id="selections">Select suggestions to: </span>
336 <span id="removeitems"></span>
341 <table id="suggestt" class="table table-bordered table-striped">
344 [% IF ( loggedinusername ) %]<th> </th>[% END %]
346 <th>Suggested on</th>
348 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
349 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
354 [% FOREACH suggestions_loo IN suggestions_loop %]
356 [% IF ( loggedinusername ) %]
358 [% IF ( suggestions_loo.showcheckbox ) %]
359 [% SET can_delete_suggestion = 1 %]
360 <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 %]" />
366 <label for="id[% suggestions_loo.suggestionid | html %]">
367 [% IF suggestions_loo.biblionumber %]
368 <strong><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% suggestions_loo.biblionumber | uri %]">[% suggestions_loo.title | html %]</a></strong>
370 <strong>[% suggestions_loo.title | html %]</strong>
374 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author | html %],[% END %]
375 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate | html %],[% END %]
376 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode | html %][% END %]
377 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place | html %])[% END %]
378 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle | html %][% END %]
379 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) | html %][% END %]
383 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
386 [% IF ( suggestions_loo.note ) %]
387 <span class="tdlabel">Note: </span>
388 [% suggestions_loo.note | html %]
391 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
393 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
394 <span class="tdlabel">Suggested for:</span>
395 [% suggestions_loo.branchcodesuggestedby | html %]
399 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
401 [% IF ( suggestions_loo.surnamemanagedby ) %]
402 <span class="tdlabel">Managed by:</span>
403 [% suggestions_loo.surnamemanagedby | html %]
404 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby | html %]
410 <span class="tdlabel">Status:</span>
411 [% IF ( suggestions_loo.ASKED ) %]Requested
412 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
413 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
414 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
415 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
416 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
417 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) | html %] [% END %]
418 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason | html %])[% END %]
421 [% END # / FOREACH suggestions_loo %]
425 [% IF ( loggedinusername && can_delete_suggestion ) %]
426 <fieldset class="action">
427 <input type="submit" class="btn btn-danger removeitems" value="Delete selected" />
432 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
433 [% IF ( loggedinusername ) %]
434 [% IF ( suggested_by_anyone ) %]
435 <p>There are no pending purchase suggestions.</p>
437 <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
440 <p>There are no pending purchase suggestions.</p>
443 [% IF ( loggedinusername ) %]
444 <p>You have no pending purchase suggestions.</p>
446 <p>You are not authorized to see pending purchase suggestions.</p>
449 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
450 [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
451 <p class="TooManySuggestionsText">You may only add up to [% Koha.Preference('MaxTotalSuggestions') | html %] suggestions in [% Koha.Preference('NumberOfSuggestionDays') | html %] days.</p>
452 [% ELSIF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
453 <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>
455 <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>
458 [% END # / IF suggestions_loop %]
460 [% END # IF op_else %]
461 </div> <!-- / #usersuggestions -->
462 </div> <!-- / .col-lg-10 -->
463 </div> <!-- / .row -->
464 </div> <!-- / .container-fluid -->
465 </div> <!-- / .main -->
467 [% INCLUDE 'opac-bottom.inc' %]
468 [% BLOCK jsinclude %]
469 [% INCLUDE 'datatables.inc' %]
471 [% IF ( loggedinusername ) %]
472 function enableCheckboxActions(){
473 // Enable/disable controls if checkboxes are checked
474 var checkedBoxes = $(".cb:checked");
475 if ($(checkedBoxes).size()) {
476 $("#selections").html(_("With selected suggestions: "));
477 $("#selections-toolbar .links a").removeClass("disabled");
479 $("#selections").html(_("Select suggestions to: "));
480 $("#selections-toolbar .links a").addClass("disabled");
486 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
487 "order": [[ 1, "asc" ]],
488 "dom": '<"top"<"table_entries"><"table_controls"f>>t',
491 [% IF ( loggedinusername ) %]{ "targets": [ 0 ], "sortable": false, "searchable": false }[% END %]
494 [% IF ( loggedinusername ) %]null,[% END %]
495 { "type": "anti-the" },
498 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
499 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
503 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
504 $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
505 $("#CheckAll").on("click",function(e){
507 $(".cb").prop("checked", true);
508 enableCheckboxActions();
510 $("#CheckNone").on("click",function(e){
512 $(".cb").prop("checked", false);
513 enableCheckboxActions();
515 $(".cb").click(function(){
516 enableCheckboxActions();
518 $("#removeitems").html("<a href=\"#\" class=\"btn btn-link removeitems tag_hides btn-disabled\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i> "+_("Delete")+"</a>");
520 enableCheckboxActions();
522 $(".removeitems").on("click", function(e) {
524 var selected_titles = $("input:checked");
529 if ( selected_titles.size() < 1 ) {
530 alert(MSG_NO_SUGGESTION_SELECTED);
533 if( selected_titles.size() > 1 ){
534 message = $("<ul></ul>");
535 title = _("Are you sure you want to delete these suggestions?");
536 yes_label = _("Yes, delete suggestions");
537 no_label = _("No, do not delete suggestions");
538 selected_titles.each(function(){
539 message.append( "<li>" + $(this).data("title") + "</li>" );
542 title = _("Are you sure you want to delete this suggestion?");
543 yes_label = _("Yes, delete suggestion");
544 no_label = _("No, do not delete suggestion");
545 selected_titles.each(function(){
546 message += $(this).data("title");
549 confirmModal( message, title, yes_label, no_label, function( result ){
551 $("#delete_suggestions").submit();