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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-12 / +16 lines)
Lines 255-266 Link Here
255
255
256
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
256
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
257
257
258
                            [% IF ( suggestions_loop ) %]
258
                            [% IF suggestions_loop OR title_filter %]
259
                                [% SET can_delete_suggestion = 0 %]
260
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" method="get">
259
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" method="get">
261
                                    <fieldset>
260
                                    <fieldset>
262
                                        <label for="title">Search for:</label>
261
                                        <label for="title_filter">Search for:</label>
263
                                        <input type="text" name="title" id="title" value="[% title | html %]" />
262
                                        <input type="text" name="title_filter" id="title_filter" value="[% title_filter | html %]" />
264
                                        [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
263
                                        [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
265
                                            [% IF loggedinusername %]
264
                                            [% IF loggedinusername %]
266
                                                <label for="suggested_by_anyone">Suggested by:</label>
265
                                                <label for="suggested_by_anyone">Suggested by:</label>
Lines 274-285 Link Here
274
                                                            <option value="1">Anyone</option>
273
                                                            <option value="1">Anyone</option>
275
                                                        [% END %]
274
                                                        [% END %]
276
                                                    </select>
275
                                                    </select>
277
                                                    <button type="submit" class="btn">Go</button>
278
                                                </div>
276
                                                </div>
279
                                            [% END %]
277
                                            [% END %]
280
                                        [% END %]
278
                                        [% END %]
279
                                        <button type="submit" class="btn">Go</button>
281
                                    </fieldset>
280
                                    </fieldset>
282
                                </form>
281
                                </form>
282
                            [% END %]
283
                            [% IF suggestions_loop %]
284
                                [% SET can_delete_suggestion = 0 %]
283
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
285
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
284
                                    <input type="hidden" name="op" value="delete_confirm" />
286
                                    <input type="hidden" name="op" value="delete_confirm" />
285
                                    [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
287
                                    [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
Lines 396-413 Link Here
396
                                </form>
398
                                </form>
397
                            [% ELSE %]
399
                            [% ELSE %]
398
                                [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
400
                                [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
399
                                    [% IF ( loggedinusername ) %]
401
                                    [% IF title_filter %]
400
                                        [% IF ( suggested_by_anyone ) %]
402
                                        <p>There are no pending purchase suggestions matching your search.</p>
401
                                            <p>There are no pending purchase suggestions.</p>
403
                                    [% ELSIF loggedinusername AND NOT suggested_by_anyone %]
402
                                        [% ELSE %]
404
                                        <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
403
                                            <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
404
                                        [% END %]
405
                                    [% ELSE %]
405
                                    [% ELSE %]
406
                                        <p>There are no pending purchase suggestions.</p>
406
                                        <p>There are no pending purchase suggestions.</p>
407
                                    [% END %]
407
                                    [% END %]
408
                                [% ELSE %]
408
                                [% ELSE %]
409
                                    [% IF ( loggedinusername ) %]
409
                                    [% IF ( loggedinusername ) %]
410
                                        <p>You have no pending purchase suggestions.</p>
410
                                        [% IF title_filter %]
411
                                            <p>There are no pending purchase suggestions matching your search.</p>
412
                                        [% ELSE %]
413
                                            <p>You have no pending purchase suggestions.</p>
414
                                        [% END %]
411
                                    [% ELSE %]
415
                                    [% ELSE %]
412
                                        <p>You are not authorized to see pending purchase suggestions.</p>
416
                                        <p>You are not authorized to see pending purchase suggestions.</p>
413
                                    [% END %]
417
                                    [% END %]
(-)a/opac/opac-suggestions.pl (-2 / +8 lines)
Lines 41-46 my $biblionumber = $input->param('biblionumber'); Link Here
41
my $suggestion      = $input->Vars;
41
my $suggestion      = $input->Vars;
42
my $negcaptcha      = $input->param('negcap');
42
my $negcaptcha      = $input->param('negcap');
43
my $suggested_by_anyone = $input->param('suggested_by_anyone') || 0;
43
my $suggested_by_anyone = $input->param('suggested_by_anyone') || 0;
44
my $title_filter    = $input->param('title_filter');
44
my $need_confirm    = 0;
45
my $need_confirm    = 0;
45
46
46
# If a spambot accidentally populates the 'negcap' field in the sugesstions form, then silently skip and return.
47
# If a spambot accidentally populates the 'negcap' field in the sugesstions form, then silently skip and return.
Lines 188-194 if ( $op eq "add_confirm" ) { Link Here
188
    $op = 'else';
189
    $op = 'else';
189
}
190
}
190
191
191
my $suggestions_loop = &SearchSuggestion({suggestedby => $suggestion->{suggestedby}});
192
my $suggestions_loop = &SearchSuggestion(
193
    {
194
        suggestedby => $suggestion->{suggestedby},
195
        title       => $title_filter,
196
    }
197
);
192
if ( $op eq "delete_confirm" ) {
198
if ( $op eq "delete_confirm" ) {
193
    my @delete_field = $input->multi_param("delete_field");
199
    my @delete_field = $input->multi_param("delete_field");
194
    foreach my $delete_field (@delete_field) {
200
    foreach my $delete_field (@delete_field) {
Lines 265-270 $template->param( Link Here
265
    messages              => \@messages,
271
    messages              => \@messages,
266
    suggestionsview       => 1,
272
    suggestionsview       => 1,
267
    suggested_by_anyone   => $suggested_by_anyone,
273
    suggested_by_anyone   => $suggested_by_anyone,
274
    title_filter          => $title_filter,
268
    patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
275
    patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
269
    need_confirm => $need_confirm,
276
    need_confirm => $need_confirm,
270
    patrons_total_suggestions_count => $patrons_total_suggestions_count,
277
    patrons_total_suggestions_count => $patrons_total_suggestions_count,
271
- 

Return to bug 26406