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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-13 / +18 lines)
Lines 289-298 Link Here
289
289
290
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
290
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
291
291
292
                            [% IF ( suggestions_loop ) %]
292
                            [% IF suggestions_loop OR title_filter %]
293
                                [% SET can_delete_suggestion = 0 %]
294
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
293
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
295
                                    <div class="form-row">
294
                                    <div class="form-row">
295
                                        <label for="title_filter">Search for:</label>
296
                                        <input type="text" name="title_filter" id="title_filter" value="[% title_filter | html %]" />
296
                                        [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
297
                                        [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
297
                                            [% IF loggedinusername %]
298
                                            [% IF loggedinusername %]
298
                                                <div class="col-auto my-1">
299
                                                <div class="col-auto my-1">
Lines 307-319 Link Here
307
                                                        [% END %]
308
                                                        [% END %]
308
                                                    </select>
309
                                                    </select>
309
                                                </div>
310
                                                </div>
310
                                                <div class="col-auto my-1">
311
                                                    <button type="submit" class="btn btn-sm btn-primary">Go</button>
312
                                                </div>
313
                                            [% END %]
311
                                            [% END %]
314
                                        [% END %]
312
                                        [% END %]
313
                                        <div class="col-auto my-1">
314
                                            <button type="submit" class="btn btn-sm btn-primary">Go</button>
315
                                        </div>
315
                                    </div>
316
                                    </div>
316
                                </form>
317
                                </form>
318
                            [% END %]
319
                            [% IF suggestions_loop %]
320
                                [% SET can_delete_suggestion = 0 %]
317
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
321
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
318
                                    <input type="hidden" name="op" value="delete_confirm" />
322
                                    <input type="hidden" name="op" value="delete_confirm" />
319
                                    [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
323
                                    [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
Lines 434-451 Link Here
434
                                </form>
438
                                </form>
435
                            [% ELSE %]
439
                            [% ELSE %]
436
                                [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
440
                                [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %]
437
                                    [% IF ( loggedinusername ) %]
441
                                    [% IF title_filter %]
438
                                        [% IF ( suggested_by_anyone ) %]
442
                                        <p>There are no pending purchase suggestions matching your search.</p>
439
                                            <p>There are no pending purchase suggestions.</p>
443
                                    [% ELSIF loggedinusername AND NOT suggested_by_anyone %]
440
                                        [% ELSE %]
444
                                        <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
441
                                            <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p>
442
                                        [% END %]
443
                                    [% ELSE %]
445
                                    [% ELSE %]
444
                                        <p>There are no pending purchase suggestions.</p>
446
                                        <p>There are no pending purchase suggestions.</p>
445
                                    [% END %]
447
                                    [% END %]
446
                                [% ELSE %]
448
                                [% ELSE %]
447
                                    [% IF ( loggedinusername ) %]
449
                                    [% IF ( loggedinusername ) %]
448
                                        <p>You have no pending purchase suggestions.</p>
450
                                        [% IF title_filter %]
451
                                            <p>There are no pending purchase suggestions matching your search.</p>
452
                                        [% ELSE %]
453
                                            <p>You have no pending purchase suggestions.</p>
454
                                        [% END %]
449
                                    [% ELSE %]
455
                                    [% ELSE %]
450
                                        <p>You are not authorized to see pending purchase suggestions.</p>
456
                                        <p>You are not authorized to see pending purchase suggestions.</p>
451
                                    [% END %]
457
                                    [% END %]
Lines 489-495 Link Here
489
    $(function() {
495
    $(function() {
490
        $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
496
        $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
491
            "order": [[ 1, "asc" ]],
497
            "order": [[ 1, "asc" ]],
492
            "dom": '<"top"<"table_entries"><"table_controls"f>>t',
493
            "autoWidth": false,
498
            "autoWidth": false,
494
            "columnDefs": [
499
            "columnDefs": [
495
              [% IF ( loggedinusername ) %]{ "targets": [ 0 ], "sortable": false, "searchable": false }[% END %]
500
              [% IF ( loggedinusername ) %]{ "targets": [ 0 ], "sortable": false, "searchable": false }[% 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 261-266 $template->param( Link Here
261
    messages              => \@messages,
267
    messages              => \@messages,
262
    suggestionsview       => 1,
268
    suggestionsview       => 1,
263
    suggested_by_anyone   => $suggested_by_anyone,
269
    suggested_by_anyone   => $suggested_by_anyone,
270
    title_filter          => $title_filter,
264
    patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
271
    patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
265
    need_confirm => $need_confirm,
272
    need_confirm => $need_confirm,
266
    patrons_total_suggestions_count => $patrons_total_suggestions_count,
273
    patrons_total_suggestions_count => $patrons_total_suggestions_count,
267
- 

Return to bug 26406