Bugzilla – Attachment 101601 Details for
Bug 23590
Add the ability to change the manager of a suggestion and notify the new manager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23590: Update new fields with relevant values
Bug-23590-Update-new-fields-with-relevant-values.patch (text/plain), 2.26 KB, created by
Katrin Fischer
on 2020-03-24 14:56:09 UTC
(
hide
)
Description:
Bug 23590: Update new fields with relevant values
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-03-24 14:56:09 UTC
Size:
2.26 KB
patch
obsolete
>From 2e88081bd06e92cb1309430cc4c03fc6d3f1dda5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Mar 2020 18:21:56 +0100 >Subject: [PATCH] Bug 23590: Update new fields with relevant values > >We are filling lastmodificationdate and lastmodificationby depending on >the max dates between manageddate, accepteddate and rejecteddate > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > installer/data/mysql/atomicupdate/bug_23590.perl | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > >diff --git a/installer/data/mysql/atomicupdate/bug_23590.perl b/installer/data/mysql/atomicupdate/bug_23590.perl >index d71862fc13..cc80154a4a 100644 >--- a/installer/data/mysql/atomicupdate/bug_23590.perl >+++ b/installer/data/mysql/atomicupdate/bug_23590.perl >@@ -13,6 +13,28 @@ if( CheckVersion( $DBversion ) ) { > $dbh->do(q| > ALTER TABLE suggestions ADD COLUMN lastmodificationdate DATE DEFAULT NULL AFTER lastmodificationby > |); >+ >+ my $suggestions = $dbh->selectall_arrayref(q| >+ SELECT suggestionid, managedby, manageddate, acceptedby, accepteddate, rejectedby, rejecteddate >+ FROM suggestions >+ |, { Slice => {} }); >+ for my $suggestion ( @$suggestions ) { >+ my ( $max_date ) = sort ( $suggestion->{manageddate} || (), $suggestion->{accepteddate} || (), $suggestion->{rejecteddate} || () ); >+ next unless $max_date; >+ my $last_modif_by = ( defined $suggestion->{manageddate} and $max_date eq $suggestion->{manageddate} ) >+ ? $suggestion->{managedby} >+ : ( defined $suggestion->{accepteddate} and $max_date eq $suggestion->{accepteddate} ) >+ ? $suggestion->{acceptedby} >+ : ( defined $suggestion->{rejecteddate} and $max_date eq $suggestion->{rejecteddate} ) >+ ? $suggestion->{rejectedby} >+ : undef; >+ next unless $last_modif_by; >+ $dbh->do(q| >+ UPDATE suggestions >+ SET lastmodificationdate = ?, lastmodificationby = ? >+ WHERE suggestionid = ? >+ |, undef, $max_date, $last_modif_by, $suggestion->{suggestionid}); >+ } > } > > # Always end with this (adjust the bug info) >-- >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 23590
:
95162
|
95163
|
95164
|
95165
|
95166
|
95167
|
95168
|
95169
|
95317
|
95318
|
95319
|
95320
|
95321
|
95322
|
95323
|
95324
|
95398
|
95399
|
95407
|
95408
|
95420
|
95421
|
95422
|
95423
|
95424
|
95425
|
95426
|
95427
|
95428
|
95429
|
95430
|
95431
|
95487
|
95488
|
95489
|
95490
|
95491
|
95492
|
95493
|
95494
|
95495
|
95496
|
95497
|
95498
|
98119
|
98120
|
98121
|
98122
|
98123
|
98124
|
98126
|
98127
|
98128
|
98129
|
98130
|
98131
|
98240
|
98267
|
98268
|
98279
|
100788
|
100789
|
100790
|
100791
|
100792
|
100793
|
100794
|
100795
|
100796
|
100797
|
100798
|
100799
|
100800
|
100801
|
100802
|
100803
|
100804
|
100846
|
100847
|
100848
|
100849
|
100850
|
100851
|
100852
|
100853
|
101539
|
101548
|
101588
|
101589
|
101590
|
101591
|
101592
|
101593
|
101594
|
101595
|
101596
|
101597
|
101598
|
101599
|
101600
| 101601 |
101602
|
101603
|
101604
|
101605
|
101606
|
101695