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 301-307 Link Here
301
301
302
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
302
                            [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %]
303
303
304
                            [% IF suggestions.count OR title_filter %]
304
                            [% IF suggestions.size > 0 OR title_filter %]
305
                                [% SET can_delete_suggestion = 0 %]
305
                                [% SET can_delete_suggestion = 0 %]
306
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
306
                                <form action="/cgi-bin/koha/opac-suggestions.pl" class="form-inline" id="search_suggestions_form" method="get">
307
                                    <div class="form-row">
307
                                    <div class="form-row">
Lines 329-335 Link Here
329
                                    </div>
329
                                    </div>
330
                                </form>
330
                                </form>
331
                            [% END %]
331
                            [% END %]
332
                            [% IF suggestions.count %]
332
                            [% IF suggestions.size > 0 %]
333
                                [% SET can_delete_suggestion = 0 %]
333
                                [% SET can_delete_suggestion = 0 %]
334
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
334
                                <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
335
                                    <input type="hidden" name="op" value="delete_confirm" />
335
                                    <input type="hidden" name="op" value="delete_confirm" />
Lines 478-484 Link Here
478
                                        <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>
478
                                        <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>
479
                                    [% END %]
479
                                    [% END %]
480
                                [% END %]
480
                                [% END %]
481
                            [% END # / IF suggestions.count %]
481
                            [% END # / IF suggestions.size %]
482
482
483
                        [% END # IF op_else %]
483
                        [% END # IF op_else %]
484
                    </div> <!-- / #usersuggestions -->
484
                    </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 211-217 if ( $op eq "add_confirm" ) { Link Here
211
    $op = 'else';
211
    $op = 'else';
212
}
212
}
213
213
214
my $suggestions = Koha::Suggestions->search_limited(
214
my $suggestions = [ Koha::Suggestions->search_limited(
215
    {
215
    {
216
        $suggestion->{suggestedby}
216
        $suggestion->{suggestedby}
217
        ? ( suggestedby => $suggestion->{suggestedby} )
217
        ? ( suggestedby => $suggestion->{suggestedby} )
Lines 220-226 my $suggestions = Koha::Suggestions->search_limited( Link Here
220
        ? ( title       => $title_filter )
220
        ? ( title       => $title_filter )
221
        : (),
221
        : (),
222
    }
222
    }
223
);
223
)->as_list ];
224
224
225
if ( $op eq "delete_confirm" ) {
225
if ( $op eq "delete_confirm" ) {
226
    my @delete_field = $input->multi_param("delete_field");
226
    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