2 [% USE AuthorisedValues %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
6 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
7 [% IF ( op_else ) %]Purchase Suggestions[% END %]</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% BLOCK cssinclude %][% END %]
11 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usersuggestions' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-suggestions' bodyclass='scrollto' %][% END %]
12 [% INCLUDE 'masthead.inc' %]
15 <ul class="breadcrumb">
16 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
17 <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">›</span></li>
18 <li><a href="#">Your purchase suggestions</a></li>
21 <div class="container-fluid">
22 <div class="row-fluid">
25 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
29 <div id="usersuggestions" class="maincontent">
31 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
32 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
33 <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>
35 <h1>Enter a new purchase suggestion</h1>
37 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
38 <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>
40 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
41 <fieldset class="rows">
43 <li><label for="title">Title:</label><input type="text" id="title" name="title" class="span6" maxlength="255" /></li>
44 <li><label for="author">Author:</label><input type="text" id="author" name="author" class="span6" maxlength="80" /></li>
46 <div title="Copyright or publication year, for example: 2016">
47 <label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" />
50 <li><label for="isbn">Standard number (ISBN, ISSN or other):</label><input type="text" id="isbn" name="isbn" maxlength="80" /></li>
51 <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
52 <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
53 <li><label for="place">Publication place:</label><input type="text" id="place" name="place" maxlength="80" /></li>
54 <li><label for="itemtype">Item type:</label>
55 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
57 [% IF ( branchloop ) %]
58 <li><label for="branch">Library:</label>
59 <select name="branchcode" id="branch">
60 [% FOREACH branchloo IN branchloop %]
61 [% IF ( branchloo.selected ) %]
62 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
64 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
70 [% IF ( patron_reason_loop ) %]
72 <label for="patronreason">Reason for suggestion: </label>
73 <select name="patronreason" id="patronreason">
74 <option value="">-- Choose --</option>
75 [% FOREACH patron_reason_loo IN patron_reason_loop %]
76 <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
82 <label for="note">Notes:</label>
83 <textarea name="note" id="note" rows="5" cols="40"></textarea>
86 <!-- Add a hidden 'negcap' field -->
87 <li id="negcap" style="position: absolute; left: -2000px;">
88 negcap <input type="text" name="negcap"/>
93 <fieldset class="action">
94 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone %]" />
95 <input type="hidden" name="op" value="add_confirm" />
96 <input type="submit" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
100 [% END # IF op_add %]
104 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
107 [% IF ( loggedinusername ) %]
108 Your purchase suggestions
114 [% FOR m IN messages %]
115 <div class="alert alert-[% m.type %]">
117 [% CASE 'too_many' %]
118 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.
119 [% CASE 'already_exists' %]
120 The suggestion has not been added. A suggestion with this title already exists.
121 [% CASE 'success_on_inserted' %]
122 Your suggestion has been submitted.
129 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
131 [% IF ( suggestions_loop ) %]
132 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" method="get">
134 <label for="title">Search for:</label>
135 <input type="text" name="title" id="title" value="[% title |html %]" />
136 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
137 [% IF loggedinusername %]
138 <label for="suggested_by_anyone">Suggested by:</label>
139 <div class="input-append">
140 <select name="suggested_by_anyone" id="suggested_by_anyone">
141 [% IF suggested_by_anyone %]
142 <option value="0">Me</option>
143 <option value="1" selected="selected">Anyone</option>
145 <option value="0" selected="selected">Me</option>
146 <option value="1">Anyone</option>
149 <button type="submit" class="btn">Go</button>
155 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="myform">
156 <input type="hidden" name="op" value="delete_confirm" />
157 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
158 <div id="toolbar" class="toolbar clearfix">
159 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
160 <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>
162 <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>
167 [% IF ( loggedinusername ) %]
168 <div id="selections-toolbar" class="toolbar">
169 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
170 <span class="links"><span id="selections">Select suggestions to: </span>
171 <span id="removeitems"></span>
175 <table id="suggestt" class="checkboxed table table-bordered table-striped">
178 [% IF ( loggedinusername ) %]<th> </th>[% END %]
180 <th>Suggested on</th>
182 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
183 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
188 [% FOREACH suggestions_loo IN suggestions_loop %]
190 [% IF ( loggedinusername ) %]
192 [% IF ( suggestions_loo.showcheckbox ) %]
193 <input type="checkbox" class="cb" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
198 <p><strong>[% suggestions_loo.title |html %]</strong></p>
199 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author |html %],[% END %]
200 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate |html %],[% END %]
201 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
202 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
203 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
204 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
208 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
211 [% IF ( suggestions_loo.note ) %]
212 <span class="tdlabel">Note: </span>
213 [% suggestions_loo.note |html %]
216 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
218 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
219 <span class="tdlabel">Suggested for:</span>
220 [% suggestions_loo.branchcodesuggestedby %]
224 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
226 [% IF ( suggestions_loo.surnamemanagedby ) %]
227 <span class="tdlabel">Managed by:</span>
228 [% suggestions_loo.surnamemanagedby %]
229 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby %]
235 <span class="tdlabel">Status:</span>
236 [% IF ( suggestions_loo.ASKED ) %]Requested
237 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
238 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
239 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
240 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
241 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
242 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
243 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason |html %])[% END %]
246 [% END # / FOREACH suggestions_loo %]
250 [% IF ( loggedinusername ) %]
251 <fieldset class="action">
252 <input type="submit" class="btn btn-danger" value="Delete selected" />
257 [% UNLESS Koha.Preference( 'OPACViewOthersSuggestions' ) or loggedinusername %]
258 <p>You are not authorized to see pending purchase suggestions.</p>
260 <p>There are no pending purchase suggestions.</p>
262 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
263 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
264 <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>
266 <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>
269 [% END # / IF suggestions_loop %]
271 [% END # IF op_else %]
272 </div> <!-- / #usersuggestions -->
273 </div> <!-- / .span10 -->
274 </div> <!-- / .row-fluid -->
275 </div> <!-- / .container-fluid -->
276 </div> <!-- / .main -->
278 [% INCLUDE 'opac-bottom.inc' %]
279 [% BLOCK jsinclude %]
280 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
281 [% INCLUDE 'datatables.inc' %]
282 <script type="text/javascript">
284 [% IF ( loggedinusername ) %]
285 function enableCheckboxActions(){
286 // Enable/disable controls if checkboxes are checked
287 var checkedBoxes = $(".checkboxed input:checkbox:checked");
288 if ($(checkedBoxes).size()) {
289 $("#selections").html(_("With selected suggestions: "));
290 $("#selections-toolbar .links a").removeClass("disabled");
292 $("#selections").html(_("Select suggestions to: "));
293 $("#selections-toolbar .links a").addClass("disabled");
299 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
300 "aaSorting": [[ 1, "asc" ]],
302 [% IF ( loggedinusername ) %]{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }[% END %]
305 [% IF ( loggedinusername ) %]null,[% END %]
306 { "sType": "anti-the" },
309 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
310 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
314 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
315 $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
316 $("#CheckAll").click(function(){
317 $(".checkboxed").checkCheckboxes();
318 enableCheckboxActions();
321 $("#CheckNone").click(function(){
322 $(".checkboxed").unCheckCheckboxes();
323 enableCheckboxActions();
326 $(".cb").click(function(){
327 enableCheckboxActions();
329 $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Delete")+"</a>")
332 $("#myform").submit();
335 enableCheckboxActions();
336 $("#myform").on('submit', function() {
337 if ( $("input:checked").size() < 1 ) {
338 alert(MSG_NO_SUGGESTION_SELECTED);
344 [% IF ( op_add && mandatoryfields ) %]
346 var FldsRequired = [[% mandatoryfields %]];
347 for (var i = 0; i < FldsRequired.length; i++) {
348 var rq_input = $('#' + FldsRequired[i]);
349 if (rq_input.length != 1) continue;
350 $(rq_input).attr("required", "required");
351 var rq_label = $("label[for=" + rq_input.attr("id") + "]");
352 if (rq_label.length != 1) continue;
353 $(rq_label).addClass('required');