Bugzilla – Attachment 40305 Details for
Bug 13392
New statistics wizard for suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13392: Add suggestions.ordereddate and suggestions.orderedby
Bug-13392-Add-suggestionsordereddate-and-suggestio.patch (text/plain), 5.58 KB, created by
Alex Arnaud
on 2015-06-18 14:28:31 UTC
(
hide
)
Description:
Bug 13392: Add suggestions.ordereddate and suggestions.orderedby
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2015-06-18 14:28:31 UTC
Size:
5.58 KB
patch
obsolete
>From 82e26fd9185af55ce9fd6ad0fb625d4b004d5db9 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 4 Dec 2014 11:15:36 +0100 >Subject: [PATCH] Bug 13392: Add suggestions.ordereddate and > suggestions.orderedby > >Those fields are updated when suggestion status is changed to 'ORDERED' >and are displayed on suggestion/suggestion.pl page > >Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> > >Patch updated: Use atomic update >--- > C4/Suggestions.pm | 7 +++++++ > ...92-add-suggestions-ordereddate-and-suggestions-orderedby.sql | 4 ++++ > installer/data/mysql/kohastructure.sql | 3 +++ > .../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 5 +++++ > suggestion/suggestion.pl | 2 +- > 5 files changed, 20 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug-13392-add-suggestions-ordereddate-and-suggestions-orderedby.sql > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 8fa5a85..7cd0fce 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -486,6 +486,13 @@ sub ModSuggestion { > or $suggestion->{$field} eq '' ); > } > >+ if ($suggestion->{STATUS} and $suggestion->{STATUS} eq 'ORDERED') { >+ $suggestion->{ordereddate} = dt_from_string; >+ if (C4::Context->userenv) { >+ $suggestion->{orderedby} = C4::Context->userenv->{number}; >+ } >+ } >+ > my $rs = Koha::Database->new->schema->resultset('Suggestion')->find($suggestion->{suggestionid}); > my $status_update_table = 1; > eval { >diff --git a/installer/data/mysql/atomicupdate/Bug-13392-add-suggestions-ordereddate-and-suggestions-orderedby.sql b/installer/data/mysql/atomicupdate/Bug-13392-add-suggestions-ordereddate-and-suggestions-orderedby.sql >new file mode 100644 >index 0000000..3f3fd90 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug-13392-add-suggestions-ordereddate-and-suggestions-orderedby.sql >@@ -0,0 +1,4 @@ >+ALTER TABLE suggestions >+ADD COLUMN orderedby INT(11) NULL DEFAULT NULL AFTER rejecteddate, >+ADD COLUMN ordereddate DATE NULL DEFAULT NULL AFTER orderedby, >+ADD CONSTRAINT suggestions_orderedby_fk FOREIGN KEY (orderedby) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 9d6e2ce..b49ab9a 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2180,6 +2180,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 >+ orderedby INT(11) NULL DEFAULT NULL, -- borrowernumber for the librarian who ordered the suggestion >+ ordereddate DATE NULL DEFAULT NULL, -- date the suggestion was marked as ordered > `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED) > `note` mediumtext, -- note entered on the suggestion > `author` varchar(80) default NULL, -- author of the suggested item >@@ -2209,6 +2211,7 @@ CREATE TABLE `suggestions` ( -- purchase suggestions > KEY `biblionumber` (`biblionumber`), > KEY `branchcode` (`branchcode`), > CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE >+ CONSTRAINT suggestions_orderedby_fk FOREIGN KEY (orderedby) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >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 4bd3908..d0b9980 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -274,6 +274,11 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <td>[% accepteddate | $KohaDates %]</td> > <td>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %]</td> > </tr> >+ <tr> >+ <th><span class="label">Suggestion ordered</span></th> >+ <td>[% ordereddate | $KohaDates %]</td> >+ <td>[% IF ( orderedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% orderedby_borrowernumber %]">[% orderedby_surname %], [% orderedby_firstname %]</a> [% Branches.GetName( orderedby_branchcode ) %] ([% orderedby_description %])[% END %]</td> >+ </tr> > </tbody> > </table></li></ol> > </fieldset> >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 43834f6..4d9df7d 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -273,7 +273,7 @@ if ($op=~/else/) { > ); > } > >-foreach my $element ( qw(managedby suggestedby acceptedby) ) { >+foreach my $element ( qw(managedby suggestedby acceptedby orderedby) ) { > # $debug || warn $$suggestion_ref{$element}; > if ($$suggestion_ref{$element}){ > my $member=GetMember(borrowernumber=>$$suggestion_ref{$element}); >-- >1.7.10.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 13392
:
34124
|
34125
|
34135
|
34136
|
34328
|
34329
|
35835
|
35836
|
35837
|
36188
|
36189
|
36190
|
36343
|
36344
|
36345
|
40305
|
40306
|
40307
|
40308
|
48291
|
48292
|
48293
|
48294
|
49088
|
51995
|
51996
|
51997
|
51998
|
51999
|
56110
|
56889
|
60956
|
60957
|
60958
|
60959
|
60960
|
60961
|
60962
|
64459
|
64460
|
64461
|
64462
|
64463
|
64464
|
64465
|
78622
|
78623
|
78624
|
78625
|
78626
|
78627
|
78628
|
78629