@@ -, +, @@ entering a purchase suggestion. Sometimes librarians are creating purchase suggestions that came from patrons which didn't use the opac (but sent an email, or told the librarian verbally...) This patch allows the librarian to change the creator of the purchase suggestion when entering it. This way, the patron will be able to receive notifications during the purchase suggestion workflow. Test plan: - Create a new suggestion - Edit the input "By" from "Suggestion creation" - Check that autocomplete works. - Submit the suggestion with a user different than the logged-in librarian. - Check that the correct user is recorded for this suggestion. --- .../prog/en/modules/suggestion/suggestion.tt | 31 +++++++++++++++++--- suggestion/suggestion.pl | 12 ++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -167,8 +167,25 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o [% IF ( op_save ) %] [% END %] @@ -397,8 +414,14 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o - [% IF ( suggestedby_borrowernumber ) %][% suggestedby_surname %], [% suggestedby_firstname %] [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %] - + +
+ + + +
+ + --- a/suggestion/suggestion.pl +++ a/suggestion/suggestion.pl @@ -30,6 +30,7 @@ use C4::Budgets; use C4::Search; use C4::Members; use C4::Debug; +use C4::Log; use Koha::DateUtils qw( dt_from_string ); @@ -128,6 +129,12 @@ if ( $op =~ /save/i ) { } if ( $suggestion_only->{'suggestionid'} > 0 ) { &ModSuggestion($suggestion_only); + my $member = GetMember(borrowernumber => $$suggestion_only{'suggestedby'}); + logaction('ACQUISITIONS', 'MODIFY', undef, 'Suggestion title: ' . $$suggestion_only{'title'} . ", creator: " . + $member->{'surname'} . ', ' . + $member->{'firstname'} . ' (' . + $member->{'cardnumber'} . ')' ); + } else { ###FIXME:Search here if suggestion already exists. my $suggestions_loop = @@ -143,6 +150,11 @@ if ( $op =~ /save/i ) { else { ## Adding some informations related to suggestion &NewSuggestion($suggestion_only); + my $member = GetMember(borrowernumber => $$suggestion_only{'suggestedby'}); + logaction('ACQUISITIONS', 'ADD', undef, 'Suggestion title: ' . $$suggestion_only{'title'} . ", creator: " . + $member->{'surname'} . ', ' . + $member->{'firstname'} . ' (' . + $member->{'cardnumber'} . ')' ); } # empty fields, to avoid filter in "SearchSuggestion" } --