View | Details | Raw Unified | Return to bug 7001
Collapse All | Expand All

(-)a/C4/Letters.pm (-9 / +10 lines)
Lines 295-302 sub SendAlerts { Link Here
295
            my %mail = (
295
            my %mail = (
296
                To      => $email,
296
                To      => $email,
297
                From    => $email,
297
                From    => $email,
298
                Subject => "" . $letter->{title},
298
                Subject => Encode::encode( "utf8", "" . $letter->{title} ),
299
                Message => "" . $letter->{content},
299
                Message => Encode::encode( "utf8", "" . $letter->{content} ),
300
                'Content-Type' => 'text/plain; charset="utf8"',
300
                'Content-Type' => 'text/plain; charset="utf8"',
301
                );
301
                );
302
            sendmail(%mail) or carp $Mail::Sendmail::error;
302
            sendmail(%mail) or carp $Mail::Sendmail::error;
Lines 323-330 sub SendAlerts { Link Here
323
            LEFT JOIN biblio ON serial.biblionumber=biblio.biblionumber
323
            LEFT JOIN biblio ON serial.biblionumber=biblio.biblionumber
324
            LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id
324
            LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id
325
            WHERE serial.serialid IN (
325
            WHERE serial.serialid IN (
326
            }
326
            };
327
          . join( ",", @$externalid ) . ")";
327
        $strsth .= join( ",", @$externalid ) . ")";
328
        my $sthorders = $dbh->prepare($strsth);
328
        my $sthorders = $dbh->prepare($strsth);
329
        $sthorders->execute;
329
        $sthorders->execute;
330
        my $dataorders = $sthorders->fetchall_arrayref( {} );
330
        my $dataorders = $sthorders->fetchall_arrayref( {} );
Lines 339-345 sub SendAlerts { Link Here
339
        push @email, $databookseller->{contemail}       if $databookseller->{contemail};
339
        push @email, $databookseller->{contemail}       if $databookseller->{contemail};
340
        unless (@email) {
340
        unless (@email) {
341
            warn "Bookseller $dataorders->[0]->{booksellerid} without emails";
341
            warn "Bookseller $dataorders->[0]->{booksellerid} without emails";
342
            return;
342
            return { error => "no_email" };
343
        }
343
        }
344
344
345
        my $userenv = C4::Context->userenv;
345
        my $userenv = C4::Context->userenv;
Lines 359-366 sub SendAlerts { Link Here
359
        my %mail = (
359
        my %mail = (
360
            To => join( ','. @email),
360
            To => join( ','. @email),
361
            From           => $userenv->{emailaddress},
361
            From           => $userenv->{emailaddress},
362
            Subject        => "" . $letter->{title},
362
            Subject        => Encode::encode( "utf8", "" . $letter->{title} ),
363
            Message        => "" . $letter->{content},
363
            Message        => Encode::encode( "utf8", "" . $letter->{content} ),
364
            'Content-Type' => 'text/plain; charset="utf8"',
364
            'Content-Type' => 'text/plain; charset="utf8"',
365
        );
365
        );
366
        sendmail(%mail) or carp $Mail::Sendmail::error;
366
        sendmail(%mail) or carp $Mail::Sendmail::error;
Lines 392-402 sub SendAlerts { Link Here
392
            want_librarian => 1,
392
            want_librarian => 1,
393
        ) or return;
393
        ) or return;
394
394
395
        return { error => "no_email" } unless $externalid->{'emailaddr'};
395
        my %mail = (
396
        my %mail = (
396
                To      =>     $externalid->{'emailaddr'},
397
                To      =>     $externalid->{'emailaddr'},
397
                From    =>  $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"),
398
                From    =>  $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"),
398
                Subject => $letter->{'title'}, 
399
                Subject => Encode::encode( "utf8", $letter->{'title'} ),
399
                Message => $letter->{'content'},
400
                Message => Encode::encode( "utf8", $letter->{'content'} ),
400
                'Content-Type' => 'text/plain; charset="utf8"',
401
                'Content-Type' => 'text/plain; charset="utf8"',
401
        );
402
        );
402
        sendmail(%mail) or carp $Mail::Sendmail::error;
403
        sendmail(%mail) or carp $Mail::Sendmail::error;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+11 lines)
Lines 82-87 Link Here
82
	<div id="yui-main">
82
	<div id="yui-main">
83
	<div class="yui-b">
83
	<div class="yui-b">
84
84
85
    [% IF error_alert %]
86
        [% IF ( error_alert == "no_email" ) %]
87
            <div class="error">This member has no email</div>
88
        [% ELSE %]
89
            <div class="error">[% error_alert %]</div>
90
        [% END %]
91
    [% END %]
92
    [% IF info_alert %]
93
        <div class="dialog message">Email has been sent.</div>
94
    [% END %]
95
85
	[% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
96
	[% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
86
		[% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
97
		[% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
87
		[% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
98
		[% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
(-)a/members/memberentry.pl (-3 / +12 lines)
Lines 347-355 if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ Link Here
347
            # if we manage to find a valid email address, send notice 
347
            # if we manage to find a valid email address, send notice 
348
            if ($emailaddr) {
348
            if ($emailaddr) {
349
                $newdata{emailaddr} = $emailaddr;
349
                $newdata{emailaddr} = $emailaddr;
350
                SendAlerts ( 'members', \%newdata, "ACCTDETAILS" );
350
                my $err;
351
                eval {
352
                    $err = SendAlerts ( 'members', \%newdata, "ACCTDETAILS" );
353
                };
354
                if ( $@ ) {
355
                    $template->param(error_alert => $@);
356
                } elsif ( defined $err->{error} and $err->{error} eq "no_email" ) {
357
                    $template->{VARS}->{'error_alert'} = "no_email";
358
                } else {
359
                    $template->{VARS}->{'info_alert'} = 1;
360
                }
351
            }
361
            }
352
        } 
362
        }
353
363
354
		if ($data{'organisations'}){            
364
		if ($data{'organisations'}){            
355
			# need to add the members organisations
365
			# need to add the members organisations
356
- 

Return to bug 7001