Bugzilla – Attachment 101448 Details for
Bug 22774
Add ability to limit the number of purchase suggestions a patron may submit in a specified time period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22774: (follow-up) Limit Purchase Suggestion in a specified Time period
Bug-22774-follow-up-Limit-Purchase-Suggestion-in-a.patch (text/plain), 1.86 KB, created by
Devinim
on 2020-03-23 13:32:46 UTC
(
hide
)
Description:
Bug 22774: (follow-up) Limit Purchase Suggestion in a specified Time period
Filename:
MIME Type:
Creator:
Devinim
Created:
2020-03-23 13:32:46 UTC
Size:
1.86 KB
patch
obsolete
>From 01f6686467092c1ff9e9871bc6126385744cd35b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Nazl=C4=B1=20=C3=87etin?= <nazli@devinim.com.tr> >Date: Mon, 23 Mar 2020 13:30:48 +0000 >Subject: [PATCH] Bug 22774: (follow-up) Limit Purchase Suggestion in a > specified Time period > >--- > opac/opac-suggestions.pl | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index b506a1537aa..74e3079dfed 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -33,7 +33,7 @@ use Koha::AuthorisedValues; > use Koha::Libraries; > use Koha::Patrons; > >-use Koha::DateUtils qw( dt_from_string ); >+use Koha::DateUtils; > > my $input = new CGI; > my $op = $input->param('op') || 'else'; >@@ -130,10 +130,12 @@ my $patrons_total_suggestions_count = 0; > if ( $borrowernumber ){ > if ( C4::Context->preference("MaxTotalSuggestions") ne '' && C4::Context->preference("NumberOfSuggestionDays") ne '' ) { > my $suggesteddate_from = dt_from_string()->subtract(days=>C4::Context->preference("NumberOfSuggestionDays")); >- $patrons_total_suggestions_count = scalar @{ SearchSuggestion( { suggestedby => $borrowernumber, suggesteddate_from => $suggesteddate_from } ) } ; >+ $suggesteddate_from = output_pref({ dt => $suggesteddate_from, dateformat => 'iso', dateonly => 1 }); >+ $patrons_total_suggestions_count = Koha::Suggestions->search({ suggestedby => $borrowernumber, suggesteddate => { '>=' => $suggesteddate_from } })->count; >+ > } > if ( C4::Context->preference("MaxOpenSuggestions") ne '' ) { >- $patrons_pending_suggestions_count = scalar @{ SearchSuggestion( { suggestedby => $borrowernumber, STATUS => 'ASKED' } ) } ; >+ $patrons_pending_suggestions_count = Koha::Suggestions->search({ suggestedby => $borrowernumber, STATUS => 'ASKED' } )->count ; > } > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22774
:
95940
|
95941
|
97061
|
97070
|
97071
|
99045
|
99046
|
99380
|
99381
|
99382
|
100192
|
100193
|
100912
|
100913
|
101448
|
102882
|
102883
|
102884
|
102885
|
102886