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

(-)a/opac/opac-suggestions.pl (-4 / +5 lines)
Lines 33-39 use Koha::AuthorisedValues; Link Here
33
use Koha::Libraries;
33
use Koha::Libraries;
34
use Koha::Patrons;
34
use Koha::Patrons;
35
35
36
use Koha::DateUtils qw( dt_from_string );
36
use Koha::DateUtils;
37
37
38
my $input           = new CGI;
38
my $input           = new CGI;
39
my $op              = $input->param('op') || 'else';
39
my $op              = $input->param('op') || 'else';
Lines 130-139 my $patrons_total_suggestions_count = 0; Link Here
130
if ( $borrowernumber ){
130
if ( $borrowernumber ){
131
    if ( C4::Context->preference("MaxTotalSuggestions") ne '' && C4::Context->preference("NumberOfSuggestionDays") ne '' ) {
131
    if ( C4::Context->preference("MaxTotalSuggestions") ne '' && C4::Context->preference("NumberOfSuggestionDays") ne '' ) {
132
        my $suggesteddate_from = dt_from_string()->subtract(days=>C4::Context->preference("NumberOfSuggestionDays"));
132
        my $suggesteddate_from = dt_from_string()->subtract(days=>C4::Context->preference("NumberOfSuggestionDays"));
133
        $patrons_total_suggestions_count = scalar @{ SearchSuggestion( { suggestedby => $borrowernumber, suggesteddate_from => $suggesteddate_from } ) } ;
133
        $suggesteddate_from = output_pref({ dt => $suggesteddate_from, dateformat => 'iso', dateonly => 1 });
134
        $patrons_total_suggestions_count = Koha::Suggestions->search({ suggestedby => $borrowernumber, suggesteddate => { '>=' => $suggesteddate_from } })->count;
135
134
    }
136
    }
135
    if ( C4::Context->preference("MaxOpenSuggestions") ne '' ) {
137
    if ( C4::Context->preference("MaxOpenSuggestions") ne '' ) {
136
        $patrons_pending_suggestions_count = scalar @{ SearchSuggestion( { suggestedby => $borrowernumber, STATUS => 'ASKED' } ) } ;
138
        $patrons_pending_suggestions_count = Koha::Suggestions->search({ suggestedby => $borrowernumber, STATUS => 'ASKED' } )->count ;
137
    }
139
    }
138
}
140
}
139
141
140
- 

Return to bug 22774