Bugzilla – Attachment 33279 Details for
Bug 12627
SQLHelper replacement - C4::Suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12627: Fix date management
PASSED-QA-Bug-12627-Fix-date-management.patch (text/plain), 3.58 KB, created by
Katrin Fischer
on 2014-11-05 21:39:36 UTC
(
hide
)
Description:
[PASSED QA] Bug 12627: Fix date management
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-11-05 21:39:36 UTC
Size:
3.58 KB
patch
obsolete
>From ebed532badf4870adde493c108ca1bce8ec0010f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 30 Sep 2014 11:25:27 +0200 >Subject: [PATCH] [PASSED QA] Bug 12627: Fix date management > >C4::Dates->today returns a string formatted depending on the dateformat >syspref. > >Before the original patch, SQLHelper managed both format (string >formatted and DateTime. > >Now DBIX::Class only manages DateTime, so the call to NewSuggestion and >ModSuggestion should pass a DateTime object > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > opac/opac-suggestions.pl | 4 +++- > suggestion/suggestion.pl | 13 ++++++++----- > 2 files changed, 11 insertions(+), 6 deletions(-) > >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 9c74308..d35f715 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -29,6 +29,8 @@ use C4::Koha; > use C4::Dates; > use C4::Scrubber; > >+use Koha::DateUtils qw( dt_from_string ); >+ > my $input = new CGI; > my $allsuggestions = $input->param('showall'); > my $op = $input->param('op'); >@@ -91,7 +93,7 @@ if ( $op eq "add_confirm" ) { > foreach my $suggest (keys %$suggestion){ > $suggestion->{$suggest} = $scrubber->scrub($suggestion->{$suggest}); > } >- $$suggestion{'suggesteddate'}=C4::Dates->today; >+ $suggestion->{suggesteddate} = dt_from_string; > $$suggestion{'branchcode'}= $input->param('branch') || C4::Context->userenv->{"branch"}; > > &NewSuggestion($suggestion); >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 211daa8..14c90bd 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -31,6 +31,9 @@ use C4::Search; > use C4::Dates qw(format_date); > use C4::Members; > use C4::Debug; >+ >+use Koha::DateUtils qw( dt_from_string ); >+ > use URI::Escape; > > sub Init{ >@@ -123,10 +126,10 @@ $template->param('borrowernumber' => $borrowernumber); > if ( $op =~ /save/i ) { > if ( $suggestion_only->{"STATUS"} ) { > if ( my $tmpstatus = lc( $suggestion_only->{"STATUS"} ) =~ /ACCEPTED|REJECTED/i ) { >- $suggestion_only->{ lc( $suggestion_only->{"STATUS"}) . "date" } = C4::Dates->today; >+ $suggestion_only->{ lc( $suggestion_only->{"STATUS"}) . "date" } = dt_from_string; > $suggestion_only->{ lc( $suggestion_only->{"STATUS"}) . "by" } = C4::Context->userenv->{number}; > } >- $suggestion_only->{"manageddate"} = C4::Dates->today; >+ $suggestion_only->{manageddate} = dt_from_string; > $suggestion_only->{"managedby"} = C4::Context->userenv->{number}; > } > if ( $suggestion_only->{'suggestionid'} > 0 ) { >@@ -167,14 +170,14 @@ elsif ($op eq "change" ) { > # set accepted/rejected/managed informations if applicable > # ie= if the librarian has choosen some action on the suggestions > if ($suggestion_only->{"STATUS"} eq "ACCEPTED"){ >- $suggestion_only->{"accepteddate"}=C4::Dates->today; >+ $suggestion_only->{accepteddate} = dt_from_string; > $suggestion_only->{"acceptedby"}=C4::Context->userenv->{number}; > } elsif ($suggestion_only->{"STATUS"} eq "REJECTED"){ >- $suggestion_only->{"rejecteddate"}=C4::Dates->today; >+ $suggestion_only->{rejecteddate} = dt_from_string; > $suggestion_only->{"rejectedby"}=C4::Context->userenv->{number}; > } > if ($suggestion_only->{"STATUS"}){ >- $suggestion_only->{"manageddate"}=C4::Dates->today; >+ $suggestion_only->{manageddate} = dt_from_string; > $suggestion_only->{"managedby"}=C4::Context->userenv->{number}; > } > if ( my $reason = $$suggestion_ref{"reason$tabcode"}){ >-- >1.9.1
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 12627
:
29963
|
30095
|
30237
|
30269
|
30624
|
30635
|
30892
|
31916
|
31917
|
31937
|
31939
|
31940
|
31941
|
31942
|
31944
|
31948
|
31953
|
33244
|
33276
|
33277
|
33278
| 33279 |
33280
|
33281