View | Details | Raw Unified | Return to bug 15128
Collapse All | Expand All

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 233-238 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
233
('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'),
233
('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'),
234
('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer'),
234
('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer'),
235
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
235
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
236
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer')
236
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
237
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
237
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
238
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
238
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
239
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +5 lines)
Lines 566-572 OPAC: Link Here
566
                yes: "Block"
566
                yes: "Block"
567
                no: "Don't block"
567
                no: "Don't block"
568
            - expired patrons from OPAC actions such as placing a hold or renewing.  Note that the setting for a patron category takes priority over this system preference.
568
            - expired patrons from OPAC actions such as placing a hold or renewing.  Note that the setting for a patron category takes priority over this system preference.
569
569
        -
570
            - Limit patrons to
571
            - pref: MaxOpenSuggestions
572
              class: integer
573
            - "open suggestions. Leave empty for no limit. **Note: this setting does not affect anonymous suggestions"
570
    Privacy:
574
    Privacy:
571
        -
575
        -
572
            - pref: StoreLastBorrower
576
            - pref: StoreLastBorrower
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-2 / +15 lines)
Lines 28-33 Link Here
28
                <div class="span10">
28
                <div class="span10">
29
                    <div id="usersuggestions" class="maincontent">
29
                    <div id="usersuggestions" class="maincontent">
30
                        [% IF ( op_add ) %]
30
                        [% IF ( op_add ) %]
31
                            [% IF ( Koha.Preference('MaxOpenSuggestions') && own_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>
34
                            [% ELSE %]
31
                            <h1>Enter a new purchase suggestion</h1>
35
                            <h1>Enter a new purchase suggestion</h1>
32
36
33
                            <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
37
                            <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
Lines 88-93 Link Here
88
                                    <input type="submit" onclick="Check(this.form); return false;" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
92
                                    <input type="submit" onclick="Check(this.form); return false;" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
89
                                </fieldset>
93
                                </fieldset>
90
                            </form>
94
                            </form>
95
                            [% END %]
91
                        [% END #  IF op_add %]
96
                        [% END #  IF op_add %]
92
97
93
                        [% IF ( op_else ) %]
98
                        [% IF ( op_else ) %]
Lines 145-151 Link Here
145
                                    <input type="hidden" name="op" value="delete_confirm" />
150
                                    <input type="hidden" name="op" value="delete_confirm" />
146
                                    [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
151
                                    [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
147
                                        <div id="toolbar" class="toolbar clearfix">
152
                                        <div id="toolbar" class="toolbar clearfix">
148
                                            <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>
153
                                        [% IF ( Koha.Preference('MaxOpenSuggestions') && own_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
154
                                                <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>
155
                                        [% ELSE %]
156
                                                <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>
157
                                        [% END %]
149
                                        </div>
158
                                        </div>
150
                                    [% END %]
159
                                    [% END %]
151
160
Lines 245-251 Link Here
245
                                    <p>There are no pending purchase suggestions.</p>
254
                                    <p>There are no pending purchase suggestions.</p>
246
                                [% END %]
255
                                [% END %]
247
                                [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
256
                                [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
248
                                    <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>
257
                                    [% IF ( Koha.Preference('MaxOpenSuggestions') && own_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %]
258
                                        <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>
259
                                    [% ELSE %]
260
                                        <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>
261
                                    [% END %]
249
                                [% END %]
262
                                [% END %]
250
                            [% END # / IF suggestions_loop %]
263
                            [% END # / IF suggestions_loop %]
251
264
(-)a/opac/opac-suggestions.pl (-1 / +5 lines)
Lines 157-165 map{ Link Here
157
    $library ? $s->{branchcodesuggestedby} = $library->branchname : ()
157
    $library ? $s->{branchcodesuggestedby} = $library->branchname : ()
158
} @$suggestions_loop;
158
} @$suggestions_loop;
159
159
160
my $own_suggestions_count = 0;
160
foreach my $suggestion(@$suggestions_loop) {
161
foreach my $suggestion(@$suggestions_loop) {
161
    if($suggestion->{'suggestedby'} == $borrowernumber) {
162
    if($suggestion->{'suggestedby'} == $borrowernumber) {
162
        $suggestion->{'showcheckbox'} = $borrowernumber;
163
        $suggestion->{'showcheckbox'} = $borrowernumber;
164
        if ( $suggestion->{'STATUS'} eq 'ASKED' ) {
165
            $own_suggestions_count++;
166
        }
163
    } else {
167
    } else {
164
        $suggestion->{'showcheckbox'} = 0;
168
        $suggestion->{'showcheckbox'} = 0;
165
    }
169
    }
Lines 195-200 $template->param( Link Here
195
    messages => \@messages,
199
    messages => \@messages,
196
    suggestionsview => 1,
200
    suggestionsview => 1,
197
    suggested_by_anyone => $suggested_by_anyone,
201
    suggested_by_anyone => $suggested_by_anyone,
202
    own_suggestions_count => $own_suggestions_count,
198
);
203
);
199
204
200
output_html_with_http_headers $input, $cookie, $template->output;
205
output_html_with_http_headers $input, $cookie, $template->output;
201
- 

Return to bug 15128