Bugzilla – Attachment 95428 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: Add lastmodification by and date columns
Bug-23590-Add-lastmodification-by-and-date-columns.patch (text/plain), 8.26 KB, created by
Séverine Queune
on 2019-11-14 16:16:10 UTC
(
hide
)
Description:
Bug 23590: Add lastmodification by and date columns
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2019-11-14 16:16:10 UTC
Size:
8.26 KB
patch
obsolete
>From 473942e8b12f2a63d398046c194116b09e310b30 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Nov 2019 15:32:50 +0100 >Subject: [PATCH] Bug 23590: Add lastmodification by and date columns >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >No tests are provided for the changes made to SearchSuggestion. It is >going to be remove very soon as it is super ugly... > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > C4/Suggestions.pm | 3 +++ > installer/data/mysql/kohastructure.sql | 3 +++ > .../prog/en/modules/suggestion/suggestion.tt | 20 ++++++++++++++++++++ > suggestion/suggestion.pl | 5 ++++- > 4 files changed, 30 insertions(+), 1 deletion(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index ff3bc89..47c30d4 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -113,6 +113,8 @@ sub SearchSuggestion { > U2.email AS emailmanagedby, > U2.branchcode AS branchcodemanagedby, > U2.borrowernumber AS borrnummanagedby, >+ U3.surname AS surnamelastmodificationby, >+ U3.firstname AS firstnamelastmodificationby, > BU.budget_name AS budget_name > FROM suggestions > LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber >@@ -121,6 +123,7 @@ sub SearchSuggestion { > LEFT JOIN borrowers AS U2 ON managedby=U2.borrowernumber > LEFT JOIN branches AS B2 ON B2.branchcode=U2.branchcode > LEFT JOIN categories AS C2 ON C2.categorycode=U2.categorycode >+ LEFT JOIN borrowers AS U3 ON lastmodificationby=U3.borrowernumber > LEFT JOIN aqbudgets AS BU ON budgetid=BU.budget_id > WHERE 1=1 > } >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 67495ab..c83fb33 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3026,6 +3026,8 @@ CREATE TABLE `suggestions` ( -- purchase suggestions > accepteddate date default NULL, -- date the suggestion was marked as accepted > rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table > rejecteddate date default NULL, -- date the suggestion was marked as rejected >+ lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time >+ lastmodificationdate date default NULL, -- date of the last modification > `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED) > `note` LONGTEXT, -- note entered on the suggestion > `author` varchar(80) default NULL, -- author of the suggested item >@@ -3061,6 +3063,7 @@ CREATE TABLE `suggestions` ( -- purchase suggestions > CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, >+ CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 75abc66..ca225e8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -189,6 +189,16 @@ > [% END %] > </td> > </tr> >+ <tr> >+ <th>Last modification on:</th> >+ <td>[% lastmodificationdate | $KohaDates %]</td> >+ <td> >+ [% IF ( lastmodificationby_patron.borrowernumber ) %] >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% lastmodificationby_patron.borrowernumber | uri %]">[% lastmodificationby_patron.surname | html %], [% lastmodificationby_patron.firstname | html %] ([% lastmodificationby_patron.cardnumber | html %])</a> >+ [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %]) >+ [% END %] >+ </td> >+ </tr> > </tbody> > </table></li></ol> > </fieldset> >@@ -368,6 +378,11 @@ > <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td> > <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>[% IF ( acceptedby_patron.borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_patron.borrowernumber | uri %]">[% acceptedby_patron.surname | html %], [% acceptedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %])</a> [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])[% END %]</td> > </tr> >+ <tr> >+ <th><label for="lastmodificationdate">Last modification on:</label> </th> >+ <td>[% lastmodificationdate | $KohaDates %]</td> >+ <td>[% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])</td> >+ </tr> > </tbody> > </table></li> > >@@ -525,6 +540,7 @@ > <th class="anti-the">Suggestion</th> > <th>Suggested by - on</th> > <th>Managed by - on</th> >+ <th>Last modification by - on</th> > <th>Library</th> > <th>Fund</th> > <th>Status</th> >@@ -554,6 +570,10 @@ > [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate | $KohaDates %][% END %] > </td> > <td> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.lastmodificationby | uri %]">[% suggestions_loo.surnamelastmodificationby | html %][% IF ( suggestions_loo.firstnamelastmodificationby ) %], [% suggestions_loo.firstnamelastmodificationby | html %][% END %]</a> >+ [% IF ( suggestions_loo.lastmodificationdate ) %] - [% suggestions_loo.lastmodificationdate | $KohaDates %][% END %] >+ </td> >+ <td> > [% Branches.GetName( suggestions_loo.branchcode ) | html %] > </td> > <td> >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index b67fc0d..ff39b3d 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -166,6 +166,9 @@ if ( $op =~ /save/i ) { > > if ( $suggestion_only->{'suggestionid'} > 0 ) { > >+ $suggestion_only->{lastmodificationdate} = dt_from_string; >+ $suggestion_only->{lastmodificationby} = C4::Context->userenv->{number}; >+ > &ModSuggestion($suggestion_only); > > if ( $notify ) { >@@ -372,7 +375,7 @@ if ($op=~/else/) { > > $template->param( > "${_}_patron" => scalar Koha::Patrons->find( $suggestion_ref->{$_} ) ) >- for qw(managedby suggestedby acceptedby); >+ for qw(managedby suggestedby acceptedby lastmodificationby); > > $template->param( > %$suggestion_ref, >-- >2.1.4
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