[% ELSE %]
<div class="span12">
[% END %]
- <h1>Report a problem</h1>
+ <h1>Report a problem</h1>
- [% IF ( successfuladd ) %]
- <div class="alert alert-info">Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient | html %][% END %].</div>
- [% END %]
- [% IF ( ( nolibemail and noadminemail ) or norecipients ) %]
- <div class="alert">Unable to send problem reports.</div>
- [% ELSE %]
- <div id="reportproblem" class="maincontent toptabs">
- <form name="reportlibform" action="/cgi-bin/koha/opac-reportproblem.pl" method="post">
- <input type="hidden" name="op" value="addreport">
- <fieldset class="rows">
- <ol>
- <li>
- <label for="recipient">Send problem report to: </label>
- [% IF !nolibemail and noadminemail %]
- <option value="library">A librarian</option>
- [% ELSIF !noadminemail and nolibemail %]
- <option value="admin">Koha Administrator</option>
- [% ELSE %]
- <select name="recipient" id="recipient">
- <option value="library">A librarian</option>
- <option value="admin">Koha Administrator</option>
- </select>
- [% END %]
- </li>
- <li>
- <label for="place">Problem found on page: </label>
- <input type="hidden" name="place" id="place" value="[% probpage | html %]">
- [% probpage | html %]
- </li>
- <li>
- <label for="user">Username: </label>
- <input type="hidden" name="user" id="user" value="[% username | html %]" class="span3">
- [% username | html %]
- <li>
- <label for="subject">Subject: </label>
- <input type="text" name="subject" id="subject" value="[% subject | html %]" class="span3">
- </li>
- <li>
- <label for="message">Message: </label>
- <textarea name="message" id="message" rows="7" cols="60"></textarea>
- </li>
- </ol>
- </fieldset>
- <fieldset class="action">
- <input type="submit" value="Submit" class="btn">
- </fieldset>
- </form>
- </div>
- [% END %]
+ [% IF ( successfuladd ) %]
+ <div class="alert alert-info">
+ [% IF recipient == 'admin' %]
+ Your problem report has been sent to the Koha administrator.
+ [% ELSE %]
+ Your problem report has been sent to the library.
+ [% END %]
+ </div>
+ [% END %]
+ <div id="reportproblem" class="maincontent toptabs">
+ <form name="reportlibform" action="/cgi-bin/koha/opac-reportproblem.pl" method="post">
+ <input type="hidden" name="op" value="addreport">
+ <fieldset class="rows">
+ <ol>
+ <li>
+ <label for="recipient">Send problem report to: </label>
+ [% IF library.branchemail %]
+ <select name="recipient" id="recipient">
+ <option value="library">A librarian</option>
+ <option value="admin">Koha administrator</option>
+ </select>
+ [% ELSE %]
+ <span>Koha administrator</span>
+ [% END %]
+ </li>
+ <li>
+ <label for="place">Problem found on page: </label>
+ <input type="hidden" name="place" id="place" value="[% probpage | html %]">
+ [% probpage | html %]
+ </li>
+ <li>
+ <label for="user">Username: </label>
+ <input type="hidden" name="user" id="user" value="[% username | html %]" class="span3">
+ [% username | html %]
+ <li>
+ <label for="subject">Subject: </label>
+ <input type="text" name="subject" id="subject" value="[% subject | html %]" class="span3">
+ </li>
+ <li>
+ <label for="message">Message: </label>
+ <textarea name="message" id="message" rows="7" cols="60"></textarea>
+ </li>
+ </ol>
+ </fieldset>
+ <fieldset class="action">
+ <input type="submit" value="Submit" class="btn">
+ </fieldset>
+ </form>
+ </div> <!-- / #reportproblem -->
</div> <!-- / .span10/12 -->
</div> <!-- / .row-fluid -->
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,
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,
});
}