Bug 4461: Use inbound_email_address to know if we display the dropdown list
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 3 Apr 2020 13:06:53 +0000 (15:06 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:19:44 +0000 (11:19 +0100)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt
opac/opac-reportproblem.pl

index efae101..ae347d7 100644 (file)
@@ -51,7 +51,7 @@
                                 <ol>
                                     <li>
                                         <label for="recipient">Send problem report to: </label>
-                                        [% IF library.branchemail %]
+                                        [% IF library.inbound_email_address && library.inbound_email_address != Koha.Preference('KohaAdminEmailAddress') %]
                                             <select name="recipient" id="recipient">
                                                 <option value="library">A librarian</option>
                                                 <option value="admin">Koha administrator</option>
index 2abce15..b7e133c 100755 (executable)
@@ -52,9 +52,8 @@ my $referer = Koha::Util::Navigation::local_referer($input );
 $referer = Encode::decode_utf8 uri_unescape $referer,
 
 my $patron = Koha::Patrons->find($borrowernumber);
+my $library = $patron->library;
 my $username = $patron->userid;
-my $branchcode = $patron->branchcode;
-my $library = Koha::Libraries->find($branchcode);
 my @messages;
 
 $template->param(
@@ -81,7 +80,7 @@ if ( $op eq 'addreport' ) {
                         title          => $subject,
                         content        => $message,
                         borrowernumber => $borrowernumber,
-                        branchcode     => $branchcode,
+                        branchcode     => $patron->branchcode,
                         username       => $username,
                         problempage    => $problempage,
                         recipient      => $recipient,