Bugzilla – Attachment 1175 Details for
Bug 3242
emailLibrarianWhenHoldIsPlaced system preference is non-functional
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Send an email when a hold is placed
Reserves.diff (text/plain), 2.29 KB, created by
Chris Cormack
on 2009-06-29 09:31:00 UTC
(
hide
)
Description:
Send an email when a hold is placed
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2009-06-29 09:31:00 UTC
Size:
2.29 KB
patch
obsolete
>--- Reserves.pm 2009-06-29 10:44:50.000000000 +0200 >+++ Reserves.pm.patch 2009-06-29 10:45:13.000000000 +0200 >@@ -25,6 +25,8 @@ > > use strict; > use C4::Context; >+use C4::Output; >+use Mail::Sendmail; > use C4::Biblio; > use C4::Items; > use C4::Search; >@@ -191,6 +193,66 @@ > $i++; > } > } >+ >+ # Send E-mail to admin >+ if ( >+ C4::Context->preference("emailLibrarianWhenHoldIsPlaced") && >+ C4::Context->preference("KohaAdminEmailAddress") >+ ) { >+ >+ # Get informations >+ my $query = " >+ SELECT >+ borrowers.surname, >+ borrowers.firstname, >+ borrowers.email, >+ reserves.reservedate, >+ biblio.title, >+ biblio.author >+ >+ FROM reserves >+ INNER JOIN biblio >+ ON biblio.biblionumber = reserves.biblionumber >+ INNER JOIN borrowers >+ ON borrowers.borrowernumber = reserves.borrowernumber >+ >+ WHERE >+ reserves.borrowernumber=? >+ AND >+ reserves.biblionumber=? >+ ORDER BY reservedate >+ "; >+ >+ my $sth = $dbh->prepare($query); >+ $sth->execute($borrowernumber, $biblionumber); >+ my $emailinfo = $sth->fetchrow_hashref; >+ >+ # if user email exists >+ if ( $emailinfo->{email} ){ >+ >+ my $template = gettemplate("reserve/mail_reserve.tmpl", "opac", CGI->new()); >+ >+ $template->param( >+ surname => $emailinfo->{surname}, >+ firstname => $emailinfo->{firstname}, >+ title => $emailinfo->{title}, >+ author =>$emailinfo->{author}, >+ reservedate =>$emailinfo->{reservedate} >+ ); >+ >+ my %mail = ( >+ To => $emailinfo->{email}, >+ From => C4::Context->preference("KohaAdminEmailAddress"), >+ Subject => 'Réservation - '.$emailinfo->{title}, >+ Message => "".$template->output, >+ 'Content-Type' => 'text/plain; charset="utf-8"', >+ ); >+ sendmail(%mail); >+ >+ } >+ >+ } >+ > return; > } >
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 3242
: 1175 |
1176