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

(-)a/acqui/newordersuggestion.pl (-2 / +2 lines)
Lines 128-134 if ( $op eq 'connectDuplicate' ) { Link Here
128
    ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber );
128
    ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber );
129
}
129
}
130
130
131
my $suggestions = Koha::Suggestions->search_limited(
131
my $suggestions = [ Koha::Suggestions->search_limited(
132
    {
132
    {
133
        ( $author        ? ( author        => $author )        : () ),
133
        ( $author        ? ( author        => $author )        : () ),
134
        ( $title         ? ( title         => $title )         : () ),
134
        ( $title         ? ( title         => $title )         : () ),
Lines 136-142 my $suggestions = Koha::Suggestions->search_limited( Link Here
136
        STATUS => 'ACCEPTED'
136
        STATUS => 'ACCEPTED'
137
    },
137
    },
138
    { prefetch => ['managedby', 'suggestedby'] },
138
    { prefetch => ['managedby', 'suggestedby'] },
139
);
139
)->as_list ];
140
140
141
my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid );
141
my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid );
142
$template->param(
142
$template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt (-1 / +1 lines)
Lines 41-47 Link Here
41
            <main>
41
            <main>
42
42
43
<h1>Suggestions</h1>
43
<h1>Suggestions</h1>
44
    [% IF suggestions.count %]
44
    [% IF suggestions.size %]
45
    <a href="#" id="show_only_mine">Show only mine</a> | <a href="#" id="show_all">Show all suggestions</a>
45
    <a href="#" id="show_only_mine">Show only mine</a> | <a href="#" id="show_all">Show all suggestions</a>
46
    <table id="suggestionst">
46
    <table id="suggestionst">
47
        <thead>
47
        <thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt (-1 / +1 lines)
Lines 42-48 Link Here
42
                    <a class="btn btn-default" id="newsuggestion" href="/cgi-bin/koha/suggestion/suggestion.pl?op=add&amp;suggestedby=[% patron.borrowernumber | html %]&amp;redirect=purchase_suggestions&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
42
                    <a class="btn btn-default" id="newsuggestion" href="/cgi-bin/koha/suggestion/suggestion.pl?op=add&amp;suggestedby=[% patron.borrowernumber | html %]&amp;redirect=purchase_suggestions&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
43
                </div>
43
                </div>
44
44
45
                [% IF suggestions.count %]
45
                [% IF suggestions.size %]
46
                  <table id="suggestions">
46
                  <table id="suggestions">
47
                    <thead>
47
                    <thead>
48
                        <tr>
48
                        <tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-3 / +3 lines)
Lines 707-713 Link Here
707
                                    No name
707
                                    No name
708
                                [% END %]
708
                                [% END %]
709
                            [% END %]
709
                            [% END %]
710
                            ([% suggestion.suggestions.count| html %])</a></li>
710
                            ([% suggestion.suggestions.size| html %])</a></li>
711
711
712
                        [% END # /FOREACH suggestion %]
712
                        [% END # /FOREACH suggestion %]
713
                    </ul> <!-- /.ui-tabs-nav -->
713
                    </ul> <!-- /.ui-tabs-nav -->
Lines 717-723 Link Here
717
                <div id="[% suggestion.suggestiontype | html %]">
717
                <div id="[% suggestion.suggestiontype | html %]">
718
                    <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
718
                    <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
719
719
720
                        [% IF suggestion.suggestions.count %]
720
                        [% IF suggestion.suggestions.size %]
721
                            <p>
721
                            <p>
722
                                <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
722
                                <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a>
723
                            </p>
723
                            </p>
Lines 1310-1316 Link Here
1310
1310
1311
                columns_settings = [% TablesSettings.GetColumns( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1311
                columns_settings = [% TablesSettings.GetColumns( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1312
                [% FOREACH suggestion IN suggestions %]
1312
                [% FOREACH suggestion IN suggestions %]
1313
                    [% IF suggestion.suggestions.count %]
1313
                    [% IF suggestion.suggestions.size %]
1314
                        KohaTable("table_[% loop.count| html %]", {
1314
                        KohaTable("table_[% loop.count| html %]", {
1315
                            "sorting": [[ 3, "asc" ]],
1315
                            "sorting": [[ 3, "asc" ]],
1316
                            "autoWidth": false,
1316
                            "autoWidth": false,
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-3 / +3 lines)
Lines 293-299 Link Here
293
293
294
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
294
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
295
295
296
                            [% IF suggestions.count OR title_filter %]
296
                            [% IF suggestions.size > 0 OR title_filter %]
297
                                [% SET can_delete_suggestion = 0 %]
297
                                [% SET can_delete_suggestion = 0 %]
298
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
298
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
299
                                    <div class="form-row">
299
                                    <div class="form-row">
Lines 321-327 Link Here
321
                                    </div>
321
                                    </div>
322
                                </form>
322
                                </form>
323
                            [% END %]
323
                            [% END %]
324
                            [% IF suggestions.count %]
324
                            [% IF suggestions.size > 0 %]
325
                                [% SET can_delete_suggestion = 0 %]
325
                                [% SET can_delete_suggestion = 0 %]
326
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
326
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
327
                                    <input type="hidden" name="op" value="delete_confirm" />
327
                                    <input type="hidden" name="op" value="delete_confirm" />
Lines 470-476 Link Here
470
                                        <p><a class="btn btn-link new" href="/cgi-bin/koha/opac-suggestions.pl?op=add"><i class="fa fa-plus" aria-hidden="true"></i> New purchase suggestion</a></p>
470
                                        <p><a class="btn btn-link new" href="/cgi-bin/koha/opac-suggestions.pl?op=add"><i class="fa fa-plus" aria-hidden="true"></i> New purchase suggestion</a></p>
471
                                    [% END %]
471
                                    [% END %]
472
                                [% END %]
472
                                [% END %]
473
                            [% END # / IF suggestions.count %]
473
                            [% END # / IF suggestions.size %]
474
474
475
                        [% END # IF op_else %]
475
                        [% END # IF op_else %]
476
                    </div> <!-- / #usersuggestions -->
476
                    </div> <!-- / #usersuggestions -->
(-)a/members/purchase-suggestions.pl (-1 / +4 lines)
Lines 48-54 $template->param( Link Here
48
    suggestionsview  => 1,
48
    suggestionsview  => 1,
49
);
49
);
50
50
51
my $suggestions = Koha::Suggestions->search_limited( { suggestedby => $borrowernumber }, { prefetch => 'managedby' } );
51
my $suggestions = [
52
    Koha::Suggestions->search_limited( { suggestedby => $borrowernumber },
53
        { prefetch => 'managedby' } )->as_list
54
];
52
55
53
$template->param( suggestions => $suggestions );
56
$template->param( suggestions => $suggestions );
54
57
(-)a/opac/opac-suggestions.pl (-2 / +2 lines)
Lines 210-216 if ( $op eq "add_confirm" ) { Link Here
210
    $op = 'else';
210
    $op = 'else';
211
}
211
}
212
212
213
my $suggestions = Koha::Suggestions->search_limited(
213
my $suggestions = [ Koha::Suggestions->search_limited(
214
    {
214
    {
215
        $suggestion->{suggestedby}
215
        $suggestion->{suggestedby}
216
        ? ( suggestedby => $suggestion->{suggestedby} )
216
        ? ( suggestedby => $suggestion->{suggestedby} )
Lines 219-225 my $suggestions = Koha::Suggestions->search_limited( Link Here
219
        ? ( title       => $title_filter )
219
        ? ( title       => $title_filter )
220
        : (),
220
        : (),
221
    }
221
    }
222
);
222
)->as_list ];
223
223
224
if ( $op eq "delete_confirm" ) {
224
if ( $op eq "delete_confirm" ) {
225
    my @delete_field = $input->multi_param("delete_field");
225
    my @delete_field = $input->multi_param("delete_field");
(-)a/suggestion/suggestion.pl (-9 / +12 lines)
Lines 397-410 if ($op=~/else/) { Link Here
397
                }
397
                }
398
            }
398
            }
399
        }
399
        }
400
        my $suggestions = Koha::Suggestions->search_limited( { %$suggestion_ref, archived => $filter_archived } );
400
        my @suggestions =
401
401
          Koha::Suggestions->search_limited(
402
        push @allsuggestions,{
402
            { %$suggestion_ref, archived => $filter_archived } )->as_list;
403
                            "suggestiontype"=>$criteriumvalue||"suggest",
403
404
                            "suggestiontypelabel"=>GetCriteriumDesc($criteriumvalue,$displayby)||"",
404
        push @allsuggestions,
405
                            'suggestions'     => $suggestions,
405
          {
406
                            'reasonsloop'     => $reasonsloop,
406
            "suggestiontype"      => $criteriumvalue || "suggest",
407
                            } if $suggestions->count;
407
            "suggestiontypelabel" => GetCriteriumDesc( $criteriumvalue, $displayby ) || "",
408
            'suggestions'         => \@suggestions,
409
            'reasonsloop'         => $reasonsloop,
410
          }
411
          if scalar @suggestions > 0;
408
412
409
        delete $$suggestion_ref{$displayby} unless $definedvalue;
413
        delete $$suggestion_ref{$displayby} unless $definedvalue;
410
    }
414
    }
411
- 

Return to bug 23991