Bugzilla – Attachment 8196 Details for
Bug 7001
User Configurable Slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7167 Followup FIX conflicts with Bug 5347
0001-Bug-7167-Followup-FIX-conflicts-with-Bug-5347.patch (text/plain), 5.81 KB, created by
Jonathan Druart
on 2012-03-13 09:04:48 UTC
(
hide
)
Description:
Bug 7167 Followup FIX conflicts with Bug 5347
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-03-13 09:04:48 UTC
Size:
5.81 KB
patch
obsolete
>From 1236648c1291c05c48246052bfa986bfee0aad94 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 13 Mar 2012 09:55:00 +0100 >Subject: [PATCH 1/1] Bug 7167: Followup: FIX conflicts with Bug 5347 > >- Fix sql syntax error >- Fix Encoding >- SendAlerts must return an error if no email is defined >- Get error if no email in memberentry >--- > C4/Letters.pm | 19 ++++++++++--------- > .../prog/en/modules/members/memberentrygen.tt | 11 +++++++++++ > members/memberentry.pl | 14 ++++++++++++-- > 3 files changed, 33 insertions(+), 11 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index ce21a5d..6bbdb51 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -295,8 +295,8 @@ sub SendAlerts { > my %mail = ( > To => $email, > From => $email, >- Subject => "" . $letter->{title}, >- Message => "" . $letter->{content}, >+ Subject => Encode::encode( "utf8", "" . $letter->{title} ), >+ Message => Encode::encode( "utf8", "" . $letter->{content} ), > 'Content-Type' => 'text/plain; charset="utf8"', > ); > sendmail(%mail) or carp $Mail::Sendmail::error; >@@ -323,8 +323,8 @@ sub SendAlerts { > LEFT JOIN biblio ON serial.biblionumber=biblio.biblionumber > LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id > WHERE serial.serialid IN ( >- } >- . join( ",", @$externalid ) . ")"; >+ }; >+ $strsth .= join( ",", @$externalid ) . ")"; > my $sthorders = $dbh->prepare($strsth); > $sthorders->execute; > my $dataorders = $sthorders->fetchall_arrayref( {} ); >@@ -339,7 +339,7 @@ sub SendAlerts { > push @email, $databookseller->{contemail} if $databookseller->{contemail}; > unless (@email) { > warn "Bookseller $dataorders->[0]->{booksellerid} without emails"; >- return; >+ return { error => "no_email" }; > } > > my $userenv = C4::Context->userenv; >@@ -359,8 +359,8 @@ sub SendAlerts { > my %mail = ( > To => join( ','. @email), > From => $userenv->{emailaddress}, >- Subject => "" . $letter->{title}, >- Message => "" . $letter->{content}, >+ Subject => Encode::encode( "utf8", "" . $letter->{title} ), >+ Message => Encode::encode( "utf8", "" . $letter->{content} ), > 'Content-Type' => 'text/plain; charset="utf8"', > ); > sendmail(%mail) or carp $Mail::Sendmail::error; >@@ -392,11 +392,12 @@ sub SendAlerts { > want_librarian => 1, > ) or return; > >+ return { error => "no_email" } unless $externalid->{'emailaddr'}; > my %mail = ( > To => $externalid->{'emailaddr'}, > From => $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"), >- Subject => $letter->{'title'}, >- Message => $letter->{'content'}, >+ Subject => Encode::encode( "utf8", $letter->{'title'} ), >+ Message => Encode::encode( "utf8", $letter->{'content'} ), > 'Content-Type' => 'text/plain; charset="utf8"', > ); > sendmail(%mail) or carp $Mail::Sendmail::error; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index d2ca4af..c364f85 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -82,6 +82,17 @@ > <div id="yui-main"> > <div class="yui-b"> > >+ [% IF error_alert %] >+ [% IF ( error_alert == "no_email" ) %] >+ <div class="error">This member has no email</div> >+ [% ELSE %] >+ <div class="error">[% error_alert %]</div> >+ [% END %] >+ [% END %] >+ [% IF info_alert %] >+ <div class="dialog message">Email has been sent.</div> >+ [% END %] >+ > [% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3> > [% 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 %] > [% 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 %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index c474a66..d53f7f1 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -347,9 +347,19 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ > # if we manage to find a valid email address, send notice > if ($emailaddr) { > $newdata{emailaddr} = $emailaddr; >- SendAlerts ( 'members', \%newdata, "ACCTDETAILS" ); >+ my $err; >+ eval { >+ $err = SendAlerts ( 'members', \%newdata, "ACCTDETAILS" ); >+ }; >+ if ( $@ ) { >+ $template->param(error_alert => $@); >+ } elsif ( defined $err->{error} and $err->{error} eq "no_email" ) { >+ $template->{VARS}->{'error_alert'} = "no_email"; >+ } else { >+ $template->{VARS}->{'info_alert'} = 1; >+ } > } >- } >+ } > > if ($data{'organisations'}){ > # need to add the members organisations >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7001
:
6028
|
6047
|
6357
|
6854
|
6942
|
7042
|
7045
|
7096
|
7099
|
7111
|
7119
|
7129
|
7169
|
7283
|
7340
|
7416
|
7572
|
7673
|
7783
|
7796
|
7804
|
7936
|
8104
|
8169
| 8196