3 [% USE AuthorisedValues %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
7 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
8 [% IF ( op_else ) %]Purchase Suggestions[% END %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %][% END %]
12 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usersuggestions' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-suggestions' bodyclass='scrollto' %][% END %]
13 [% INCLUDE 'masthead.inc' %]
16 <ul class="breadcrumb">
17 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
18 <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">›</span></li>
19 <li><a href="#">Your purchase suggestions</a></li>
22 <div class="container-fluid">
23 <div class="row-fluid">
26 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
30 <div id="usersuggestions" class="maincontent">
32 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
33 <h1 class="TooManySuggestions">You cannot place any more suggestions</h1>
34 <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>
36 <h1>Enter a new purchase suggestion</h1>
38 <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
39 <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>
41 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="add_suggestion_form">
42 <fieldset class="rows">
44 <li><label for="title">Title:</label><input type="text" id="title" name="title" class="span6" maxlength="255" /></li>
45 <li><label for="author">Author:</label><input type="text" id="author" name="author" class="span6" maxlength="80" /></li>
47 <div title="Copyright or publication year, for example: 2016">
48 <label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" />
51 <li><label for="isbn">Standard number (ISBN, ISSN or other):</label><input type="text" id="isbn" name="isbn" maxlength="80" /></li>
52 <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
53 <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
54 <li><label for="place">Publication place:</label><input type="text" id="place" name="place" maxlength="80" /></li>
55 <li><label for="itemtype">Item type:</label>
56 [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
59 <li><label for="branch">Library:</label>
60 <select name="branchcode" id="branch">
61 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
65 [% IF ( patron_reason_loop ) %]
67 <label for="patronreason">Reason for suggestion: </label>
68 <select name="patronreason" id="patronreason">
69 <option value="">-- Choose --</option>
70 [% FOREACH patron_reason_loo IN patron_reason_loop %]
71 <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
77 <label for="note">Notes:</label>
78 <textarea name="note" id="note" rows="5" cols="40"></textarea>
81 <!-- Add a hidden 'negcap' field -->
82 <li id="negcap" style="position: absolute; left: -2000px;">
83 negcap <input type="text" name="negcap"/>
88 <fieldset class="action">
89 <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone %]" />
90 <input type="hidden" name="op" value="add_confirm" />
91 <input type="submit" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
99 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
102 [% IF ( loggedinusername ) %]
103 Your purchase suggestions
109 [% FOR m IN messages %]
110 <div class="alert alert-[% m.type %]">
112 [% CASE 'too_many' %]
113 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.
114 [% CASE 'already_exists' %]
115 The suggestion has not been added. A suggestion with this title already exists.
116 [% CASE 'success_on_inserted' %]
117 Your suggestion has been submitted.
124 [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
126 [% IF ( suggestions_loop ) %]
127 <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" method="get">
129 <label for="title">Search for:</label>
130 <input type="text" name="title" id="title" value="[% title |html %]" />
131 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
132 [% IF loggedinusername %]
133 <label for="suggested_by_anyone">Suggested by:</label>
134 <div class="input-append">
135 <select name="suggested_by_anyone" id="suggested_by_anyone">
136 [% IF suggested_by_anyone %]
137 <option value="0">Me</option>
138 <option value="1" selected="selected">Anyone</option>
140 <option value="0" selected="selected">Me</option>
141 <option value="1">Anyone</option>
144 <button type="submit" class="btn">Go</button>
150 <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="myform">
151 <input type="hidden" name="op" value="delete_confirm" />
152 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
153 <div id="toolbar" class="toolbar clearfix">
154 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
155 <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>
157 <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>
162 [% IF ( loggedinusername ) %]
163 <div id="selections-toolbar" class="toolbar">
164 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
165 <span class="links"><span id="selections">Select suggestions to: </span>
166 <span id="removeitems"></span>
170 <table id="suggestt" class="checkboxed table table-bordered table-striped">
173 [% IF ( loggedinusername ) %]<th> </th>[% END %]
175 <th>Suggested on</th>
177 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
178 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]<th>Managed by</th>[% END %]
183 [% FOREACH suggestions_loo IN suggestions_loop %]
185 [% IF ( loggedinusername ) %]
187 [% IF ( suggestions_loo.showcheckbox ) %]
188 <input type="checkbox" class="cb" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
193 <p><strong>[% suggestions_loo.title |html %]</strong></p>
194 <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author |html %],[% END %]
195 [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate |html %],[% END %]
196 [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
197 [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
198 [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
199 [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
203 [% IF ( suggestions_loo.suggesteddate ) %][% suggestions_loo.suggesteddate |$KohaDates %][% END %]
206 [% IF ( suggestions_loo.note ) %]
207 <span class="tdlabel">Note: </span>
208 [% suggestions_loo.note |html %]
211 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
213 [% IF ( suggestions_loo.branchcodesuggestedby ) %]
214 <span class="tdlabel">Suggested for:</span>
215 [% suggestions_loo.branchcodesuggestedby %]
219 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]
221 [% IF ( suggestions_loo.surnamemanagedby ) %]
222 <span class="tdlabel">Managed by:</span>
223 [% suggestions_loo.surnamemanagedby %]
224 [% IF ( suggestions_loo.firstnamemanagedby ) %] , [% suggestions_loo.firstnamemanagedby %]
230 <span class="tdlabel">Status:</span>
231 [% IF ( suggestions_loo.ASKED ) %]Requested
232 [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
233 [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
234 [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
235 [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
236 [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
237 [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
238 [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason |html %])[% END %]
241 [% END # / FOREACH suggestions_loo %]
245 [% IF ( loggedinusername ) %]
246 <fieldset class="action">
247 <input type="submit" class="btn btn-danger" value="Delete selected" />
252 [% UNLESS Koha.Preference( 'OPACViewOthersSuggestions' ) or loggedinusername %]
253 <p>You are not authorized to see pending purchase suggestions.</p>
255 <p>There are no pending purchase suggestions.</p>
257 [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
258 [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
259 <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>
261 <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>
264 [% END # / IF suggestions_loop %]
266 [% END # IF op_else %]
267 </div> <!-- / #usersuggestions -->
268 </div> <!-- / .span10 -->
269 </div> <!-- / .row-fluid -->
270 </div> <!-- / .container-fluid -->
271 </div> <!-- / .main -->
273 [% INCLUDE 'opac-bottom.inc' %]
274 [% BLOCK jsinclude %]
275 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
276 [% INCLUDE 'datatables.inc' %]
277 <script type="text/javascript">
279 [% IF ( loggedinusername ) %]
280 function enableCheckboxActions(){
281 // Enable/disable controls if checkboxes are checked
282 var checkedBoxes = $(".checkboxed input:checkbox:checked");
283 if ($(checkedBoxes).size()) {
284 $("#selections").html(_("With selected suggestions: "));
285 $("#selections-toolbar .links a").removeClass("disabled");
287 $("#selections").html(_("Select suggestions to: "));
288 $("#selections-toolbar .links a").addClass("disabled");
294 $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
295 "aaSorting": [[ 1, "asc" ]],
297 [% IF ( loggedinusername ) %]{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }[% END %]
300 [% IF ( loggedinusername ) %]null,[% END %]
301 { "sType": "anti-the" },
304 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
305 [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
309 [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
310 $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
311 $("#CheckAll").click(function(){
312 $(".checkboxed").checkCheckboxes();
313 enableCheckboxActions();
316 $("#CheckNone").click(function(){
317 $(".checkboxed").unCheckCheckboxes();
318 enableCheckboxActions();
321 $(".cb").click(function(){
322 enableCheckboxActions();
324 $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Delete")+"</a>")
327 $("#myform").submit();
330 enableCheckboxActions();
331 $("#myform").on('submit', function() {
332 if ( $("input:checked").size() < 1 ) {
333 alert(MSG_NO_SUGGESTION_SELECTED);
339 [% IF ( op_add && mandatoryfields ) %]
341 var FldsRequired = [[% mandatoryfields %]];
342 for (var i = 0; i < FldsRequired.length; i++) {
343 var rq_input = $('#' + FldsRequired[i]);
344 if (rq_input.length != 1) continue;
345 $(rq_input).attr("required", "required");
346 var rq_label = $("label[for=" + rq_input.attr("id") + "]");
347 if (rq_label.length != 1) continue;
348 $(rq_label).addClass('required');