4 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
8 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
9 [% IF ( op_else ) %]Purchase Suggestions[% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %][% END %]
13 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usersuggestions' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-suggestions' bodyclass='scrollto' %][% END %]
14 [% INCLUDE 'masthead.inc' %]
17 <ul class="breadcrumb">
18 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
19 <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">›</span></li>
20 <li><a href="#">Your purchase suggestions</a></li>
23 <div class="container-fluid">
24 <div class="row-fluid">
27 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
31 <div id="usersuggestions" class="maincontent">
33 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
34 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
35 <h2 class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]). Once the library has processed those suggestions you will be able to place more.</h2>
37 <h1>Enter a new purchase suggestion</h1>
39 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p>
40 <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>
42 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
43 <fieldset class="rows">
45 <li><label for="title">Title:</label><input type="text" id="title" name="title" class="span6" maxlength="255" /></li>
46 <li><label for="author">Author:</label><input type="text" id="author" name="author" class="span6" maxlength="80" /></li>
48 <div title="Copyright or publication year, for example: 2016">
49 <label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" />
52 <li><label for="isbn">Standard number (ISBN, ISSN or other):</label><input type="text" id="isbn" name="isbn" maxlength="80" /></li>
53 <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
54 <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
55 <li><label for="place">Publication place:</label><input type="text" id="place" name="place" maxlength="80" /></li>
56 <li id="opac-suggestion-quantity"><label for="quantity">Quantity:</label><input type="text" id="quantity" name="quantity" maxlength="4" size="4" /></li>
57 <li><label for="itemtype">Item type:</label>
58 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
61 <li><label for="branch">Library:</label>
62 <select name="branchcode" id="branch">
63 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
67 [% IF ( patron_reason_loop ) %]
69 <label for="patronreason">Reason for suggestion: </label>
70 <select name="patronreason" id="patronreason">
71 <option value="">-- Choose --</option>
72 [% FOREACH patron_reason_loo IN patron_reason_loop %]
73 <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
79 <label for="note">Notes:</label>
80 <textarea name="note" id="note" rows="5" cols="40"></textarea>
83 <!-- Add a hidden 'negcap' field -->
84 <li id="negcap" style="position: absolute; left: -2000px;">
85 negcap <input type="text" name="negcap"/>
90 <fieldset class="action">
91 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone %]" />
92 <input type="hidden" name="op" value="add_confirm" />
93 <input type="submit" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
101 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
104 [% IF ( loggedinusername ) %]
105 Your purchase suggestions
111 [% FOR m IN messages %]
112 <div class="alert alert-[% m.type %]">
114 [% CASE 'too_many' %]
115 The suggestion has not been added. You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]). Once the library has processed those suggestions you will be able to place more.
116 [% CASE 'already_exists' %]
117 The suggestion has not been added. A suggestion with this title already exists.
118 [% CASE 'success_on_inserted' %]
119 Your suggestion has been submitted.
126 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
128 [% IF ( suggestions_loop ) %]
129 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" method="get">
131 <label for="title">Search for:</label>
132 <input type="text" name="title" id="title" value="[% title |html %]" />
133 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
134 [% IF loggedinusername %]
135 <label for="suggested_by_anyone">Suggested by:</label>
136 <div class="input-append">
137 <select name="suggested_by_anyone" id="suggested_by_anyone">
138 [% IF suggested_by_anyone %]
139 <option value="0">Me</option>
140 <option value="1" selected="selected">Anyone</option>
142 <option value="0" selected="selected">Me</option>
143 <option value="1">Anyone</option>
146 <button type="submit" class="btn">Go</button>
152 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="myform">
153 <input type="hidden" name="op" value="delete_confirm" />
154 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
155 <div id="toolbar" class="toolbar clearfix">
156 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
157 <p class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]).</br>Once the library has processed those suggestions you will be able to place more.</p>
159 <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>
164 [% IF ( loggedinusername ) %]
165 <div id="selections-toolbar" class="toolbar">
166 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
167 <span class="links"><span id="selections">Select suggestions to: </span>
168 <span id="removeitems"></span>
172 <table id="suggestt" class="checkboxed table table-bordered table-striped">
175 [% IF ( loggedinusername ) %]<th> </th>[% END %]
177 <th>Suggested on</th>
179 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
180 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
185 [% FOREACH suggestions_loo IN suggestions_loop %]
187 [% IF ( loggedinusername ) %]
189 [% IF ( suggestions_loo.showcheckbox ) %]
190 <input type="checkbox" class="cb" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
195 <p><strong>[% suggestions_loo.title |html %]</strong></p>
196 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author |html %],[% END %]
197 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate |html %],[% END %]
198 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
199 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
200 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
201 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
205 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
208 [% IF ( suggestions_loo.note ) %]
209 <span class="tdlabel">Note: </span>
210 [% suggestions_loo.note |html %]
213 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
215 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
216 <span class="tdlabel">Suggested for:</span>
217 [% suggestions_loo.branchcodesuggestedby %]
221 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
223 [% IF ( suggestions_loo.surnamemanagedby ) %]
224 <span class="tdlabel">Managed by:</span>
225 [% suggestions_loo.surnamemanagedby %]
226 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby %]
232 <span class="tdlabel">Status:</span>
233 [% IF ( suggestions_loo.ASKED ) %]Requested
234 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
235 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
236 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
237 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
238 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
239 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
240 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason |html %])[% END %]
243 [% END # / FOREACH suggestions_loo %]
247 [% IF ( loggedinusername ) %]
248 <fieldset class="action">
249 <input type="submit" class="btn btn-danger" value="Delete selected" />
254 [% UNLESS Koha.Preference( 'OPACViewOthersSuggestions' ) or loggedinusername %]
255 <p>You are not authorized to see pending purchase suggestions.</p>
257 <p>There are no pending purchase suggestions.</p>
259 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
260 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
261 <p class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time.</br>Once the library has processed those suggestions you will be able to place more.</p>
263 <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>
266 [% END # / IF suggestions_loop %]
268 [% END # IF op_else %]
269 </div> <!-- / #usersuggestions -->
270 </div> <!-- / .span10 -->
271 </div> <!-- / .row-fluid -->
272 </div> <!-- / .container-fluid -->
273 </div> <!-- / .main -->
275 [% INCLUDE 'opac-bottom.inc' %]
276 [% BLOCK jsinclude %]
277 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
278 [% INCLUDE 'datatables.inc' %]
281 [% IF ( loggedinusername ) %]
282 function enableCheckboxActions(){
283 // Enable/disable controls if checkboxes are checked
284 var checkedBoxes = $(".checkboxed input:checkbox:checked");
285 if ($(checkedBoxes).size()) {
286 $("#selections").html(_("With selected suggestions: "));
287 $("#selections-toolbar .links a").removeClass("disabled");
289 $("#selections").html(_("Select suggestions to: "));
290 $("#selections-toolbar .links a").addClass("disabled");
296 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
297 "aaSorting": [[ 1, "asc" ]],
299 [% IF ( loggedinusername ) %]{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }[% END %]
302 [% IF ( loggedinusername ) %]null,[% END %]
303 { "sType": "anti-the" },
306 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
307 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
311 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
312 $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
313 $("#CheckAll").click(function(){
314 $(".checkboxed").checkCheckboxes();
315 enableCheckboxActions();
318 $("#CheckNone").click(function(){
319 $(".checkboxed").unCheckCheckboxes();
320 enableCheckboxActions();
323 $(".cb").click(function(){
324 enableCheckboxActions();
326 $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Delete")+"</a>")
329 $("#myform").submit();
332 enableCheckboxActions();
333 $("#myform").on('submit', function() {
334 if ( $("input:checked").size() < 1 ) {
335 alert(MSG_NO_SUGGESTION_SELECTED);
341 [% IF ( op_add && mandatoryfields ) %]
343 var FldsRequired = [[% mandatoryfields %]];
344 for (var i = 0; i < FldsRequired.length; i++) {
345 var rq_input = $('#' + FldsRequired[i]);
346 if (rq_input.length != 1) continue;
347 $(rq_input).attr("required", "required");
348 var rq_label = $("label[for=" + rq_input.attr("id") + "]");
349 if (rq_label.length != 1) continue;
350 $(rq_label).addClass('required');