use Modern::Perl;
require Exporter;
use CGI qw ( -utf8 );
-use C4::Auth; # get_template_and_user
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
use C4::Suggestions;
-use C4::Koha;
-use C4::Budgets;
-use C4::Search;
+use C4::Koha qw( GetAuthorisedValues );
+use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget );
+use C4::Search qw( FindDuplicate GetDistinctValues );
use C4::Members;
use Koha::DateUtils qw( dt_from_string );
use Koha::AuthorisedValues;
use Koha::Libraries;
use Koha::Patrons;
-use URI::Escape;
+use URI::Escape qw( uri_escape );
sub Init{
my $suggestion= shift @_;
$suggestion_only->{lastmodificationdate} = dt_from_string;
$suggestion_only->{lastmodificationby} = C4::Context->userenv->{number};
+ $suggestion_only->{branchcode} = undef
+ if exists $suggestion_only->{branchcode}
+ && $suggestion_only->{branchcode} eq "";
&ModSuggestion($suggestion_only);
my $patron = Koha::Patrons->find( $suggestion_only->{managedby} );
my $email_address = $patron->notice_email_address;
if ($patron->notice_email_address) {
- my $library = $patron->library;
- my $admin_email_address = $library->branchemail
- || C4::Context->preference('KohaAdminEmailAddress');
my $letter = C4::Letters::GetPreparedLetter(
module => 'suggestions',
{
letter => $letter,
borrowernumber => $patron->borrowernumber,
- message_transport_type => 'email',
- from_address => $admin_email_address,
+ message_transport_type => 'email'
}
);
}