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 <ul class="breadcrumb">
19 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
20 <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">›</span></li>
21 <li><a href="#">Your purchase suggestions</a></li>
24 <div class="container-fluid">
25 <div class="row-fluid">
28 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
32 <div id="usersuggestions" class="maincontent">
34 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
35 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
36 <h2 class="TooManySuggestionsText">You have reached your limit of 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>
38 <h1>Enter a new purchase suggestion</h1>
40 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p>
41 <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>
43 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
44 <fieldset class="rows">
46 <li><label for="title">Title:</label><input type="text" id="title" name="title" class="span6" maxlength="255" /></li>
47 <li><label for="author">Author:</label><input type="text" id="author" name="author" class="span6" maxlength="80" /></li>
49 <div title="Copyright or publication year, for example: 2016">
50 <label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" />
53 <li><label for="isbn">Standard number (ISBN, ISSN or other):</label><input type="text" id="isbn" name="isbn" maxlength="80" /></li>
54 <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
55 <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
56 <li><label for="place">Publication place:</label><input type="text" id="place" name="place" maxlength="80" /></li>
57 <li id="opac-suggestion-quantity"><label for="quantity">Quantity:</label><input type="text" id="quantity" name="quantity" maxlength="4" size="4" /></li>
58 <li><label for="itemtype">Item type:</label>
59 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
62 <li><label for="branch">Library:</label>
63 <select name="branchcode" id="branch">
64 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
68 [% IF ( patron_reason_loop ) %]
70 <label for="patronreason">Reason for suggestion: </label>
71 <select name="patronreason" id="patronreason">
72 <option value="">-- Choose --</option>
73 [% FOREACH patron_reason_loo IN patron_reason_loop %]
74 <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
80 <label for="note">Notes:</label>
81 <textarea name="note" id="note" rows="5" cols="40"></textarea>
84 <!-- Add a hidden 'negcap' field -->
85 <li id="negcap" style="position: absolute; left: -2000px;">
86 negcap <input type="text" name="negcap"/>
91 <fieldset class="action">
92 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" />
93 <input type="hidden" name="op" value="add_confirm" />
94 <input type="submit" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
102 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
105 [% IF ( loggedinusername ) %]
106 Your purchase suggestions
112 [% FOR m IN messages %]
113 <div class="alert alert-[% m.type | html %]">
115 [% CASE 'too_many' %]
116 The suggestion has not been added. You have reached your limit of 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.
117 [% CASE 'already_exists' %]
118 The suggestion has not been added. A suggestion with this title already exists.
119 [% CASE 'success_on_inserted' %]
120 Your suggestion has been submitted.
127 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
129 [% IF ( suggestions_loop ) %]
130 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" method="get">
132 <label for="title">Search for:</label>
133 <input type="text" name="title" id="title" value="[% title | html %]" />
134 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
135 [% IF loggedinusername %]
136 <label for="suggested_by_anyone">Suggested by:</label>
137 <div class="input-append">
138 <select name="suggested_by_anyone" id="suggested_by_anyone">
139 [% IF suggested_by_anyone %]
140 <option value="0">Me</option>
141 <option value="1" selected="selected">Anyone</option>
143 <option value="0" selected="selected">Me</option>
144 <option value="1">Anyone</option>
147 <button type="submit" class="btn">Go</button>
153 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="myform">
154 <input type="hidden" name="op" value="delete_confirm" />
155 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
156 <div id="toolbar" class="toolbar clearfix">
157 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
158 <p class="TooManySuggestionsText">You have reached your limit of 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>
160 <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>
165 [% IF ( loggedinusername ) %]
166 <div id="selections-toolbar" class="toolbar">
167 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
168 <span class="links"><span id="selections">Select suggestions to: </span>
169 <span id="removeitems"></span>
173 <table id="suggestt" class="checkboxed table table-bordered table-striped">
176 [% IF ( loggedinusername ) %]<th> </th>[% END %]
178 <th>Suggested on</th>
180 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
181 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
186 [% FOREACH suggestions_loo IN suggestions_loop %]
188 [% IF ( loggedinusername ) %]
190 [% IF ( suggestions_loo.showcheckbox ) %]
191 <input type="checkbox" class="cb" name="delete_field" value="[% suggestions_loo.suggestionid | html %]" />
196 <p><strong>[% suggestions_loo.title | html %]</strong></p>
197 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author | html %],[% END %]
198 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate | html %],[% END %]
199 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode | html %][% END %]
200 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place | html %])[% END %]
201 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle | html %][% END %]
202 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) | html %][% END %]
206 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
209 [% IF ( suggestions_loo.note ) %]
210 <span class="tdlabel">Note: </span>
211 [% suggestions_loo.note | html %]
214 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
216 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
217 <span class="tdlabel">Suggested for:</span>
218 [% suggestions_loo.branchcodesuggestedby | html %]
222 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
224 [% IF ( suggestions_loo.surnamemanagedby ) %]
225 <span class="tdlabel">Managed by:</span>
226 [% suggestions_loo.surnamemanagedby | html %]
227 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby | html %]
233 <span class="tdlabel">Status:</span>
234 [% IF ( suggestions_loo.ASKED ) %]Requested
235 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
236 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
237 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
238 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
239 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
240 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) | html %] [% END %]
241 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason | html %])[% END %]
244 [% END # / FOREACH suggestions_loo %]
248 [% IF ( loggedinusername ) %]
249 <fieldset class="action">
250 <input type="submit" class="btn btn-danger" value="Delete selected" />
255 [% UNLESS Koha.Preference( 'OPACViewOthersSuggestions' ) or loggedinusername %]
256 <p>You are not authorized to see pending purchase suggestions.</p>
258 <p>There are no pending purchase suggestions.</p>
260 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
261 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
262 <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>
264 <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>
267 [% END # / IF suggestions_loop %]
269 [% END # IF op_else %]
270 </div> <!-- / #usersuggestions -->
271 </div> <!-- / .span10 -->
272 </div> <!-- / .row-fluid -->
273 </div> <!-- / .container-fluid -->
274 </div> <!-- / .main -->
276 [% INCLUDE 'opac-bottom.inc' %]
277 [% BLOCK jsinclude %]
278 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
279 [% INCLUDE 'datatables.inc' %]
282 [% IF ( loggedinusername ) %]
283 function enableCheckboxActions(){
284 // Enable/disable controls if checkboxes are checked
285 var checkedBoxes = $(".checkboxed input:checkbox:checked");
286 if ($(checkedBoxes).size()) {
287 $("#selections").html(_("With selected suggestions: "));
288 $("#selections-toolbar .links a").removeClass("disabled");
290 $("#selections").html(_("Select suggestions to: "));
291 $("#selections-toolbar .links a").addClass("disabled");
297 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
298 "order": [[ 1, "asc" ]],
300 [% IF ( loggedinusername ) %]{ "targets": [ 0 ], "sortable": false, "searchable": false }[% END %]
303 [% IF ( loggedinusername ) %]null,[% END %]
304 { "type": "anti-the" },
307 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
308 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
312 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
313 $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
314 $("#CheckAll").click(function(){
315 $(".checkboxed").checkCheckboxes();
316 enableCheckboxActions();
319 $("#CheckNone").click(function(){
320 $(".checkboxed").unCheckCheckboxes();
321 enableCheckboxActions();
324 $(".cb").click(function(){
325 enableCheckboxActions();
327 $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Delete")+"</a>")
330 $("#myform").submit();
333 enableCheckboxActions();
334 $("#myform").on('submit', function() {
335 if ( $("input:checked").size() < 1 ) {
336 alert(MSG_NO_SUGGESTION_SELECTED);
342 [% IF ( op_add && mandatoryfields.size ) %]
344 var FldsRequired = ['[% mandatoryfields.join("','") | html %]'];
345 for (var i = 0; i < FldsRequired.length; i++) {
346 var rq_input = $('#' + FldsRequired[i]);
347 if (rq_input.length != 1) continue;
348 $(rq_input).attr("required", "required");
349 var rq_label = $("label[for=" + rq_input.attr("id") + "]");
350 if (rq_label.length != 1) continue;
351 $(rq_label).addClass('required');