Lines 92-97
my $managedby = $input->param('managedby');
Link Here
|
92 |
my $displayby = $input->param('displayby') || ''; |
92 |
my $displayby = $input->param('displayby') || ''; |
93 |
my $tabcode = $input->param('tabcode'); |
93 |
my $tabcode = $input->param('tabcode'); |
94 |
my $save_confirmed = $input->param('save_confirmed') || 0; |
94 |
my $save_confirmed = $input->param('save_confirmed') || 0; |
|
|
95 |
my $notify = $input->param('notify'); |
95 |
|
96 |
|
96 |
my $reasonsloop = GetAuthorisedValues("SUGGEST"); |
97 |
my $reasonsloop = GetAuthorisedValues("SUGGEST"); |
97 |
|
98 |
|
Lines 104-110
my $columns = ' '.join(' ', $schema->source('Suggestion')->columns).' ';
Link Here
|
104 |
my $suggestion_only = { map { $columns =~ / $_ / ? ($_ => $suggestion_ref->{$_}) : () } keys %$suggestion_ref }; |
105 |
my $suggestion_only = { map { $columns =~ / $_ / ? ($_ => $suggestion_ref->{$_}) : () } keys %$suggestion_ref }; |
105 |
$suggestion_only->{STATUS} = $suggestion_ref->{STATUS}; |
106 |
$suggestion_only->{STATUS} = $suggestion_ref->{STATUS}; |
106 |
|
107 |
|
107 |
delete $$suggestion_ref{$_} foreach qw( suggestedbyme op displayby tabcode edit_field ); |
108 |
delete $$suggestion_ref{$_} foreach qw( suggestedbyme op displayby tabcode edit_field notify ); |
108 |
foreach (keys %$suggestion_ref){ |
109 |
foreach (keys %$suggestion_ref){ |
109 |
delete $$suggestion_ref{$_} if (!$$suggestion_ref{$_} && ($op eq 'else' )); |
110 |
delete $$suggestion_ref{$_} if (!$$suggestion_ref{$_} && ($op eq 'else' )); |
110 |
} |
111 |
} |
Lines 164-170
if ( $op =~ /save/i ) {
Link Here
|
164 |
} |
165 |
} |
165 |
|
166 |
|
166 |
if ( $suggestion_only->{'suggestionid'} > 0 ) { |
167 |
if ( $suggestion_only->{'suggestionid'} > 0 ) { |
|
|
168 |
|
167 |
&ModSuggestion($suggestion_only); |
169 |
&ModSuggestion($suggestion_only); |
|
|
170 |
|
171 |
if ( $notify ) { |
172 |
my $patron = Koha::Patrons->find( $suggestion_only->{managedby} ); |
173 |
my $email_address = $patron->notice_email_address; |
174 |
if ($patron->notice_email_address) { |
175 |
my $budget = C4::Budgets::GetBudget( $suggestion_only->{budgetid} ); |
176 |
my $library = $patron->library; |
177 |
my $admin_email_address = $library->branchemail |
178 |
|| C4::Context->preference('KohaAdminEmailAddress'); |
179 |
|
180 |
my $letter = C4::Letters::GetPreparedLetter( |
181 |
module => 'suggestions', |
182 |
letter_code => 'TO_PROCESS', |
183 |
branchcode => $patron->branchcode, |
184 |
lang => $patron->lang, |
185 |
tables => { |
186 |
suggestions => $suggestion_only->{suggestionid}, |
187 |
branches => $patron->branchcode, |
188 |
borrowers => $patron->borrowernumber, |
189 |
}, |
190 |
); |
191 |
C4::Letters::EnqueueLetter( |
192 |
{ |
193 |
letter => $letter, |
194 |
borrowernumber => $patron->borrowernumber, |
195 |
message_transport_type => 'email', |
196 |
from_address => $admin_email_address, |
197 |
} |
198 |
); |
199 |
} |
200 |
} |
168 |
} else { |
201 |
} else { |
169 |
###FIXME:Search here if suggestion already exists. |
202 |
###FIXME:Search here if suggestion already exists. |
170 |
my $suggestions_loop = |
203 |
my $suggestions_loop = |
171 |
- |
|
|