Bugzilla – Attachment 8212 Details for
Bug 7086
Suggested by not saved when creating suggestions in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #2
0001-Bug-7086-suggested-by-fixed-for-staff-members.patch (text/plain), 2.47 KB, created by
Adrien SAURAT
on 2012-03-15 14:01:58 UTC
(
hide
)
Description:
proposed patch #2
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-03-15 14:01:58 UTC
Size:
2.47 KB
patch
obsolete
>From 0539936aa9f2688a50d4159e157f92f633b69f92 Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Thu, 15 Mar 2012 14:59:24 +0100 >Subject: [PATCH] Bug 7086 : "suggested by" fixed for staff members > >Now: >- suggested by is stored when a staff member makes a suggestion >- managed by is only updated when a suggestion is edited (not when >it is created) >--- > suggestion/suggestion.pl | 24 +++++++++++++++--------- > 1 files changed, 15 insertions(+), 9 deletions(-) > >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 64f00d4..c0dc72f 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -34,20 +34,26 @@ use C4::Debug; > > sub Init{ > my $suggestion= shift @_; >- foreach my $date ( qw(suggesteddate manageddate) ){ >- $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")? >- $suggestion->{$date}=C4::Dates->today: >- format_date($suggestion->{$date}) >- ); >- } >+ # "Managed by" is used only when a suggestion is being edited (not when created) >+ if ($suggestion->{'suggesteddate'} eq "0000-00-00" ||$suggestion->{'suggesteddate'} eq "") { >+ # new suggestion >+ $suggestion->{'suggesteddate'} = C4::Dates->today; >+ $suggestion->{'suggestedby'} = C4::Context->userenv->{"number"} unless ($suggestion->{'suggestedby'}); >+ } >+ else { >+ # editing of an existing suggestion >+ $suggestion->{'manageddate'} = C4::Dates->today; >+ warn $suggestion->{'manageddate'}; >+ $suggestion->{'managedby'} = C4::Context->userenv->{"number"} unless ($suggestion->{'managedby'}); >+ # suggesteddate, when coming from the DB, needs to be formated >+ $suggestion->{'suggesteddate'} = format_date($suggestion->{'suggesteddate'}); >+ } > foreach my $date ( qw(rejecteddate accepteddate) ){ > $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")? > "": > format_date($suggestion->{$date}) > ); >- } >- $suggestion->{'managedby'}=C4::Context->userenv->{"number"} unless ($suggestion->{'managedby'}); >- $suggestion->{'createdby'}=C4::Context->userenv->{"number"} unless ($suggestion->{'createdby'}); >+ } > $suggestion->{'branchcode'}=C4::Context->userenv->{"branch"} unless ($suggestion->{'branchcode'}); > } > >-- >1.7.4.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 7086
:
6049
|
8076
|
8212
|
8251