@@ -, +, @@ --- .../en/modules/opac-reportproblem.tt | 100 +++++++++--------- opac/opac-reportproblem.pl | 31 +----- 2 files changed, 54 insertions(+), 77 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt @@ -25,57 +25,57 @@ [% ELSE %]
[% END %] -

Report a problem

+

Report a problem

- [% IF ( successfuladd ) %] -
Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient | html %][% END %].
- [% END %] - [% IF ( ( nolibemail and noadminemail ) or norecipients ) %] -
Unable to send problem reports.
- [% ELSE %] -
-
- -
-
    -
  1. - - [% IF !nolibemail and noadminemail %] - - [% ELSIF !noadminemail and nolibemail %] - - [% ELSE %] - - [% END %] -
  2. -
  3. - - - [% probpage | html %] -
  4. -
  5. - - - [% username | html %] -
  6. - - -
  7. -
  8. - - -
  9. -
-
-
- -
-
-
- [% END %] + [% IF ( successfuladd ) %] +
+ [% IF recipient == 'admin' %] + Your problem report has been sent to the Koha administrator. + [% ELSE %] + Your problem report has been sent to the library. + [% END %] +
+ [% END %] +
+
+ +
+
    +
  1. + + [% IF library.branchemail %] + + [% ELSE %] + Koha administrator + [% END %] +
  2. +
  3. + + + [% probpage | html %] +
  4. +
  5. + + + [% username | html %] +
  6. + + +
  7. +
  8. + + +
  9. +
+
+
+ +
+
+
--- a/opac/opac-reportproblem.pl +++ a/opac/opac-reportproblem.pl @@ -52,40 +52,20 @@ my $member = Koha::Patrons->find($borrowernumber); my $username = $member->userid; my $branchcode = $member->branchcode; my $library = Koha::Libraries->find($branchcode); -my $recipients = 2; - -if ( - ( !defined($library->branchreplyto) || $library->branchreplyto eq '' ) && - ( C4::Context->preference('ReplytoDefault') eq '' ) && - ( !defined($library->branchemail) || $library->branchemail eq '' ) - ) { - $template->param( nolibemail => 1 ); - $recipients--; -} - -my $koha_admin = C4::Context->preference('KohaAdminEmailAddress'); -if ( $koha_admin eq '' ) { - $template->param( noadminemail => 1 ); - $recipients--; -} $template->param( username => $username, probpage => $problempage, + library => $library, ); my $op = $input->param('op') || ''; if ( $op eq 'addreport' ) { - if ( $recipients == 0 ){ - print $input->redirect("/cgi-bin/koha/opac-reportproblem?norecipients=1.pl"); - exit; - } - my $subject = $input->param('subject'); my $message = $input->param('message'); my $place = $input->param('place'); - my $recipient = $input->param('recipient') || 'library'; + my $recipient = $input->param('recipient') || 'admin'; my $problem = Koha::ProblemReport->new( { title => $subject, @@ -121,18 +101,15 @@ if ( $op eq 'addreport' ) { letter => $letter, borrowernumber => $borrowernumber, message_transport_type => $transport, - to_address => $koha_admin, + to_address => C4::Context->preference('KohaAdminEmailAddress'), from_address => $from_address, }); } else { - my $to_address = $library->branchreplyto || - C4::Context->preference('ReplytoDefault') || - $library->branchemail; C4::Letters::EnqueueLetter({ letter => $letter, borrowernumber => $borrowernumber, message_transport_type => $transport, - to_address => $to_address, + to_address => $library->branchemail, from_address => $from_address, }); } --