Bugzilla – Attachment 140248 Details for
Bug 3150
Move emails for sending cart and list contents into notices tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email
Bug-3150-follow-up-Reformat-notices-dont-send-if-n.patch (text/plain), 35.96 KB, created by
Martin Renvoize (ashimema)
on 2022-09-07 07:09:12 UTC
(
hide
)
Description:
Bug 3150: (follow-up) Reformat notices, don't send if no sender email
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-09-07 07:09:12 UTC
Size:
35.96 KB
patch
obsolete
>From b6f05ac9aa77aca8538dc0b8126465143e7c38b5 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 22 Jul 2021 14:59:10 +1200 >Subject: [PATCH] Bug 3150: (follow-up) Reformat notices, don't send if no > sender email > >This patch reformats the notices so that the is_html flag is disabled >and the notices display better > >It also throws an error if trying to send an email but the logged in >borrower has no valid email address. > >Signed-off-by: David Nind <david@davidnind.com> >--- > basket/sendbasket.pl | 7 +- > .../bug_3150_-_add_LIST_and_CART_notices.perl | 264 ++++-------------- > .../mysql/en/mandatory/sample_notices.yml | 257 +++-------------- > opac/opac-sendbasket.pl | 5 +- > opac/opac-sendshelf.pl | 7 +- > virtualshelves/sendshelf.pl | 6 +- > 6 files changed, 108 insertions(+), 438 deletions(-) > >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 7220544c35..9f6191e346 100755 >--- a/basket/sendbasket.pl >+++ b/basket/sendbasket.pl >@@ -55,7 +55,8 @@ if ( $email_add ) { > token => scalar $query->param('csrf_token'), > }); > >- my $patron = Koha:::Patrons->find( $borrowernumber ); >+ my $patron = Koha::Patrons->find( $borrowernumber ); >+ my $user_email = $patron->first_valid_email_address; > > my $comment = $query->param('comment'); > >@@ -70,6 +71,9 @@ if ( $email_add ) { > if ( !defined $iso2709 ) { > carp "Error sending mail: empty basket"; > $template->param( error => 1 ); >+ } elsif ( !defined $user_email or $user_email eq '' ) { >+ carp "Error sending mail: sender's email address is invalid"; >+ $template->param( error => 1 ); > } else { > my %loops = ( > biblio => \@bibs, >@@ -97,7 +101,6 @@ if ( $email_add ) { > content => Encode::encode("UTF-8", $iso2709), > }; > >- my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress'); > C4::Letters::EnqueueLetter({ > letter => $letter, > message_transport_type => 'email', >diff --git a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl b/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl >index 4360c8f4bf..efa111b2b7 100644 >--- a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl >+++ b/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl >@@ -1,222 +1,54 @@ > $DBversion = 'XXX'; > if( CheckVersion( $DBversion ) ) { > $dbh->do(q{ INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES >- ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"<p>Hi,</p> >-<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].</p> >-<p>Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.</p> >-<hr/> >-<p>[% comment | html %]</p> >-<hr/> >-<ol> >-[% FOREACH biblio IN biblios %] >- <li> >- <span> >- [% biblio.title | html %] >- [% IF ( biblio.subtitle ) %] >- [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] >- [% subtitle | html %] >- [% END %] >- [% END %] >- [% biblio.part_number | html %] [% biblio.part_name | html %] >- </span> >- <p> >- [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] >- <span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %] >- [% IF ( biblio.get_authors_from_MARC ) %] >- [% IF ( biblio.author ) %]; [% END %] >- [% FOREACH author IN biblio.get_authors_from_MARC %] >- [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] >- [% subfield.separator | html %][% subfield.value | html %] >- [% END %] >- [% UNLESS ( loop.last ) %];[% END %] >- [% END %] >- [% END %] >- </span><br/> >- [% END %] >- [% SET biblioitem = biblio.biblioitem %] >- [% IF ( biblioitem.isbn ) %] >- <span> >- ISBN: [% FOREACH isbn IN biblioitem.isbn %] >- [% isbn | html %] >- [% UNLESS ( loop.last ) %]; [% END %] >- [% END %] >- </span><br/> >- [% END %] >- [% IF ( biblioitem.publishercode ) %] >- <span> >- Published by: [% biblioitem.publishercode | html %] >- [% IF ( biblioitem.publicationyear ) %] >- in [% biblioitem.publicationyear | html %] >- [% END %] >- [% IF ( biblioitem.pages ) %] >- , [% biblioitem.pages | html %] >- [% END %] >- </span><br/> >- [% END %] >- [% IF ( biblio.seriestitle ) %] >- <span> >- Collection: [% biblio.seriestitle | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.copyrightdate ) %] >- <span> >- Copyright year: [% biblio.copyrightdate | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.notes ) %] >- <span> >- Notes: [% biblio.notes | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.unititle ) %] >- <span> >- Unified title: [% biblio.unititle | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.serial ) %] >- <span> >- Serial: [% biblio.serial | html %] >- </span><br/> >- [% END %] >- [% IF ( biblioitem.lccn ) %] >- <span> >- LCCN: [% biblioitem.lccn | html %] >- </span><br/> >- [% END %] >- [% IF ( biblioitem.url ) %] >- <span> >- URL: [% biblioitem.url | html %] >- </span> >- [% END %] >- </p> >- [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] >- [% IF ( OPACBaseURL ) %] >- <p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p> >- [% END %] >- [% IF ( biblio.items.count > 0 ) %] >- <p>Items: >- <ul> >- [% FOREACH item IN biblio.items %]<li> >- [% item.holding_branch.branchname | html %] >- [% item.location | html %] >- [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] >- [% item.barcode | html %] >- </li>[% END %] >- </ul> >- </p> >- [% END %] >- <hr/> >- </li> >-[% END %] >-</ol>", 'email','default' ), >- ('catalog','CART','','Send cart',1,'Your cart',"<p>Hi,</p> >-<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.</p> >-<p>Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.</p> >-<hr/> >-<p>[% comment | html %]</p> >-<hr/> >-<ol> >-[% FOREACH biblio IN biblios %] >- <li> >- <span> >- [% biblio.title | html %] >- [% IF ( biblio.subtitle ) %] >- [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] >- [% subtitle | html %] >- [% END %] >- [% END %] >- [% biblio.part_number | html %] [% biblio.part_name | html %] >- </span> >- <p> >- [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] >- <span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %] >- [% IF ( biblio.get_authors_from_MARC ) %] >- [% IF ( biblio.author ) %]; [% END %] >- [% FOREACH author IN biblio.get_authors_from_MARC %] >- [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] >- [% subfield.separator | html %][% subfield.value | html %] >- [% END %] >- [% UNLESS ( loop.last ) %];[% END %] >- [% END %] >- [% END %] >- </span><br/> >- [% END %] >- [% SET biblioitem = biblio.biblioitem %] >- [% IF ( biblioitem.isbn ) %] >- <span> >- ISBN: [% FOREACH isbn IN biblioitem.isbn %] >- [% isbn | html %] >- [% UNLESS ( loop.last ) %]; [% END %] >- [% END %] >- </span><br/> >- [% END %] >- [% IF ( biblioitem.publishercode ) %] >- <span> >- Published by: [% biblioitem.publishercode | html %] >- [% IF ( biblioitem.publicationyear ) %] >- in [% biblioitem.publicationyear | html %] >- [% END %] >- [% IF ( biblioitem.pages ) %] >- , [% biblioitem.pages | html %] >- [% END %] >- </span><br/> >- [% END %] >- [% IF ( biblio.seriestitle ) %] >- <span> >- Collection: [% biblio.seriestitle | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.copyrightdate ) %] >- <span> >- Copyright year: [% biblio.copyrightdate | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.notes ) %] >- <span> >- Notes: [% biblio.notes | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.unititle ) %] >- <span> >- Unified title: [% biblio.unititle | html %] >- </span><br/> >- [% END %] >- [% IF ( biblio.serial ) %] >- <span> >- Serial: [% biblio.serial | html %] >- </span><br/> >- [% END %] >- [% IF ( biblioitem.lccn ) %] >- <span> >- LCCN: [% biblioitem.lccn | html %] >- </span><br/> >- [% END %] >- [% IF ( biblioitem.url ) %] >- <span> >- URL: [% biblioitem.url | html %] >- </span> >- [% END %] >- </p> >- [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] >- [% IF ( OPACBaseURL ) %] >- <p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p> >- [% END %] >- [% IF ( biblio.items.count > 0 ) %] >- <p>Items: >- <ul> >- [% FOREACH item IN biblio.items %]<li> >- [% item.holding_branch.branchname | html %] >- [% item.location | html %] >- [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] >- [% item.barcode | html %] >- </li>[% END %] >- </ul> >- </p> >- [% END %] >- <hr/> >- </li> >-[% END %] >-</ol>",'email','default') }); >+('catalog','LIST','','Send list',0,'Your list: [% listname | html %]',"Hi, >+[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %]. >+Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite. >+<hr/>[% comment | html %]<hr/> >+<ol>[% FOREACH biblio IN biblios %]<li> >+ [% biblio.title | html %] >+ [% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %] >+ [% biblio.part_number | html %] [% biblio.part_name | html %] >+ [% IF ( biblio.author || biblio.get_marc_authors ) %]Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %][% IF ( biblio.get_marc_authors ) %][% IF ( biblio.author ) %]; [% END %][% FOREACH author IN biblio.get_marc_authors %][% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %][% subfield.separator | html %][% subfield.value | html %][% END %][% UNLESS ( loop.last ) %];[% END %][% END %][% END %][% END %] >+ [% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %] >+ [% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %] >+ [% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %] >+ [% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %] >+ [% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %] >+ [% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %] >+ [% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %] >+ [% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %] >+ [% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %] >+ [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %] >+ [% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% item.holding_branch.branchname | html %] >+ [% item.location | html %] >+ [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] >+ [% item.barcode | html %]</li>[% END %]</ul>[% END %] >+<hr/></li>[% END %]</ol>", 'email','default' ), >+ ('catalog','CART','','Send cart',0,'Your cart',"Hi, >+[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog. >+Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite. >+<hr/>[% comment | html %]<hr/> >+<ol>[% FOREACH biblio IN biblios %]<li> >+ [% biblio.title | html %] >+ [% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %] >+ [% biblio.part_number | html %] [% biblio.part_name | html %] >+ [% IF ( biblio.author || biblio.get_marc_authors ) %]Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %][% IF ( biblio.get_marc_authors ) %][% IF ( biblio.author ) %]; [% END %][% FOREACH author IN biblio.get_marc_authors %][% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %][% subfield.separator | html %][% subfield.value | html %][% END %][% UNLESS ( loop.last ) %];[% END %][% END %][% END %][% END %] >+ [% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %] >+ [% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %] >+ [% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %] >+ [% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %] >+ [% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %] >+ [% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %] >+ [% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %] >+ [% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %] >+ [% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %] >+ [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %] >+ [% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% item.holding_branch.branchname | html %] >+ [% item.location | html %] >+ [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] >+ [% item.barcode | html %]</li>[% END %]</ul>[% END %] >+<hr/></li>[% END %]</ol>",'email','default') }); > > NewVersion( $DBversion, 3150, 'Add LIST and CART notices' ); > } >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index 91e4432392..4ee5adc198 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -1750,234 +1750,59 @@ tables: > code: LIST > branchcode: "" > name: "Send list" >- is_html: 1 >+ is_html: 0 > title: "Your list: [% listname | html %]" > message_transport_type: email > lang: default > content: >- - "<p>Hi,</p>" >- - "<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].</p>" >- - "<p>Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.</p>" >- - "<hr/>" >- - "<p>[% comment | html %]</p>" >- - "<hr/>" >- - "<ol>" >- - "[% FOREACH biblio IN biblios %]" >- - "<li>" >- - "<span>" >+ - "Hi," >+ - "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %]." >+ - "Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite." >+ - "<hr/>[% comment | html %]<hr/>" >+ - "<ol>[% FOREACH biblio IN biblios %]<li>" > - "[% biblio.title | html %]" >- - "[% IF ( biblio.subtitle ) %]" >- - "[% FOREACH subtitle IN biblio.subtitle.split(' | ') %]" >- - "[% subtitle | html %]" >- - "[% END %]" >- - "[% END %]" >- - "[% biblio.part_number | html %] [% biblio.part_name | html %]" >- - "</span>" >- - "<p>" >- - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]" >- - "<span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %]" >- - "[% IF ( biblio.get_authors_from_MARC ) %]" >- - "[% IF ( biblio.author ) %]; [% END %]" >- - "[% FOREACH author IN biblio.get_authors_from_MARC %]" >- - "[% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]" >- - "[% subfield.separator | html %][% subfield.value | html %]" >- - "[% END %]" >- - "[% UNLESS ( loop.last ) %];[% END %]" >- - "[% END %]" >- - "[% END %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% SET biblioitem = biblio.biblioitem %]" >- - "[% IF ( biblioitem.isbn ) %]" >- - "<span>" >- - "ISBN: [% FOREACH isbn IN biblioitem.isbn %]" >- - "[% isbn | html %]" >- - "[% UNLESS ( loop.last ) %]; [% END %]" >- - "[% END %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblioitem.publishercode ) %]" >- - "<span>" >- - "Published by: [% biblioitem.publishercode | html %]" >- - "[% IF ( biblioitem.publicationyear ) %]" >- - "in [% biblioitem.publicationyear | html %]" >- - "[% END %]" >- - "[% IF ( biblioitem.pages ) %]" >- - ", [% biblioitem.pages | html %]" >- - "[% END %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.seriestitle ) %]" >- - "<span>" >- - "Collection: [% biblio.seriestitle | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.copyrightdate ) %]" >- - "<span>" >- - "Copyright year: [% biblio.copyrightdate | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.notes ) %]" >- - "<span>" >- - "Notes: [% biblio.notes | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.unititle ) %]" >- - "<span>" >- - "Unified title: [% biblio.unititle | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.serial ) %]" >- - "<span>" >- - "Serial: [% biblio.serial | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblioitem.lccn ) %]" >- - "<span>" >- - "LCCN: [% biblioitem.lccn | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblioitem.url ) %]" >- - "<span>" >- - "URL: [% biblioitem.url | html %]" >- - "</span>" >- - "[% END %]" >- - "</p>" >- - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]" >- - "[% IF ( OPACBaseURL ) %]" >- - "<p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p>" >- - "[% END %]" >- - "[% IF ( biblio.items.count > 0 ) %]" >- - "<p>Items:" >- - "<ul>" >- - "[% FOREACH item IN biblio.items %]<li>" >- - "[% item.holding_branch.branchname | html %]" >- - "[% item.location | html %]" >- - "[% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]" >- - "[% item.barcode | html %]" >- - "</li>[% END %]" >- - "</ul>" >- - "</p>" >- - "[% END %]" >- - "<hr/>" >- - "</li>" >- - "[% END %]" >- - "</ol>" >+- "[% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% biblio.part_number | html %] [% biblio.part_name | html %]" >+ - "[% IF ( biblio.author || biblio.get_marc_authors ) %]Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %][% IF ( biblio.get_marc_authors ) %][% IF ( biblio.author ) %]; [% END %][% FOREACH author IN biblio.get_marc_authors %][% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %][% subfield.separator | html %][% subfield.value | html %][% END %][% UNLESS ( loop.last ) %];[% END %][% END %][% END %][% END %]" >+ - "[% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %]" >+ - "[% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %]" >+ - "[% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %]" >+ - "[% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %]" >+ - "[% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %]" >+ - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %]" >+ - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %]" >+ - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %]" >+ - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %]" >+ - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %]" >+ - "[% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% item.holding_branch.branchname | html %][% item.location | html %][% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %][% item.barcode | html %]</li>[% END %]</ul>[% END %]" >+ - "<hr/></li>[% END %]</ol>" > > - module: catalog > code: CART > branchcode: "" > name: "Send cart" >- is_html: 1 >+ is_html: 0 > title: "Your cart" > message_transport_type: email > lang: default > content: >- - "<p>Hi,</p>" >- - "<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.</p>" >- - "<p>Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.</p>" >- - "<hr/>" >- - "<p>[% comment | html %]</p>" >- - "<hr/>" >- - "<ol>" >- - "[% FOREACH biblio IN biblios %]" >- - "<li>" >- - "<span>" >+ - "Hi," >+ - "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog." >+ - "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %]." >+ - "Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite." >+ - "<hr/>[% comment | html %]<hr/>" >+ - "<ol>[% FOREACH biblio IN biblios %]<li>" > - "[% biblio.title | html %]" >- - "[% IF ( biblio.subtitle ) %]" >- - "[% FOREACH subtitle IN biblio.subtitle.split(' | ') %]" >- - "[% subtitle | html %]" >- - "[% END %]" >- - "[% END %]" >- - "[% biblio.part_number | html %] [% biblio.part_name | html %]" >- - "</span>" >- - "<p>" >- - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]" >- - "<span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %]" >- - "[% IF ( biblio.get_authors_from_MARC ) %]" >- - "[% IF ( biblio.author ) %]; [% END %]" >- - "[% FOREACH author IN biblio.get_authors_from_MARC %]" >- - "[% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]" >- - "[% subfield.separator | html %][% subfield.value | html %]" >- - "[% END %]" >- - "[% UNLESS ( loop.last ) %];[% END %]" >- - "[% END %]" >- - "[% END %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% SET biblioitem = biblio.biblioitem %]" >- - "[% IF ( biblioitem.isbn ) %]" >- - "<span>" >- - "ISBN: [% FOREACH isbn IN biblioitem.isbn %]" >- - "[% isbn | html %]" >- - "[% UNLESS ( loop.last ) %]; [% END %]" >- - "[% END %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblioitem.publishercode ) %]" >- - "<span>" >- - "Published by: [% biblioitem.publishercode | html %]" >- - "[% IF ( biblioitem.publicationyear ) %]" >- - "in [% biblioitem.publicationyear | html %]" >- - "[% END %]" >- - "[% IF ( biblioitem.pages ) %]" >- - ", [% biblioitem.pages | html %]" >- - "[% END %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.seriestitle ) %]" >- - "<span>" >- - "Collection: [% biblio.seriestitle | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.copyrightdate ) %]" >- - "<span>" >- - "Copyright year: [% biblio.copyrightdate | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.notes ) %]" >- - "<span>" >- - "Notes: [% biblio.notes | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.unititle ) %]" >- - "<span>" >- - "Unified title: [% biblio.unititle | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblio.serial ) %]" >- - "<span>" >- - "Serial: [% biblio.serial | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblioitem.lccn ) %]" >- - "<span>" >- - "LCCN: [% biblioitem.lccn | html %]" >- - "</span><br/>" >- - "[% END %]" >- - "[% IF ( biblioitem.url ) %]" >- - "<span>" >- - "URL: [% biblioitem.url | html %]" >- - "</span>" >- - "[% END %]" >- - "</p>" >- - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]" >- - "[% IF ( OPACBaseURL ) %]" >- - "<p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p>" >- - "[% END %]" >- - "[% IF ( biblio.items.count > 0 ) %]" >- - "<p>Items:" >- - "<ul>" >- - "[% FOREACH item IN biblio.items %]<li>" >- - "[% item.holding_branch.branchname | html %]" >- - "[% item.location | html %]" >- - "[% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]" >- - "[% item.barcode | html %]" >- - "</li>[% END %]" >- - "</ul>" >- - "</p>" >- - "[% END %]" >- - "<hr/>" >- - "</li>" >- - "[% END %]" >- - "</ol>" >+- "[% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% biblio.part_number | html %] [% biblio.part_name | html %]" >+ - "[% IF ( biblio.author || biblio.get_marc_authors ) %]Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %][% IF ( biblio.get_marc_authors ) %][% IF ( biblio.author ) %]; [% END %][% FOREACH author IN biblio.get_marc_authors %][% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %][% subfield.separator | html %][% subfield.value | html %][% END %][% UNLESS ( loop.last ) %];[% END %][% END %][% END %][% END %]" >+ - "[% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %]" >+ - "[% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %]" >+ - "[% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %]" >+ - "[% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %]" >+ - "[% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %]" >+ - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %]" >+ - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %]" >+ - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %]" >+ - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %]" >+ - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %]" >+ - "[% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% item.holding_branch.branchname | html %][% item.location | html %][% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %][% item.barcode | html %]</li>[% END %]</ul>[% END %]" >+ - "<hr/></li>[% END %]</ol>" >diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl >index 99ca57ef1b..f0e4668485 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -55,6 +55,7 @@ if ( $email_add ) { > }); > > my $patron = Koha::Patrons->find( $borrowernumber ); >+ my $user_email = $patron->first_valid_email_address; > > my $comment = $query->param('comment'); > >@@ -68,6 +69,9 @@ if ( $email_add ) { > if ( !defined $iso2709 ) { > carp "Error sending mail: empty basket"; > $template->param( error => 1 ); >+ } elsif ( !defined $user_email or $user_email eq '' ) { >+ carp "Error sending mail: sender's email address is invalid"; >+ $template->param( error => 1 ); > } else { > my %loops = ( > biblio => \@bibs, >@@ -95,7 +99,6 @@ if ( $email_add ) { > content => Encode::encode("UTF-8", $iso2709), > }; > >- my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress'); > C4::Letters::EnqueueLetter({ > letter => $letter, > message_transport_type => 'email', >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index a0b485c846..7de8f5bba2 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -70,7 +70,7 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { > ); > > my $patron = Koha::Patrons->find( $borrowernumber ); >- >+ my $user_email = $patron->first_valid_email_address; > my $shelf = Koha::Virtualshelves->find( $shelfid ); > my $contents = $shelf->get_contents; > my $iso2709; >@@ -84,6 +84,9 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { > if ( !defined $iso2709 ) { > carp "Error sending mail: empty list"; > $template->param( error => 1 ); >+ } elsif ( !defined $user_email or $user_email eq '' ) { >+ carp "Error sending mail: sender's email address is invalid"; >+ $template->param( error => 1 ); > } else { > my %loops = ( > biblio => \@biblionumbers, >@@ -117,7 +120,7 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { > message_transport_type => 'email', > borrowernumber => $patron->borrowernumber, > to_address => $email, >- reply_address => $patron->first_valid_email_address, >+ reply_address => $user_email, > attachments => [$attachment], > }); > >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index 25e5ac72f9..3e944c58c7 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -70,6 +70,7 @@ if ($to_address) { > ); > > my $patron = Koha:::Patrons->find( $borrowernumber ); >+ my $user_email = $patron->first_valid_email_address; > my $contents = $shelf->get_contents; > my @biblionumbers; > my $iso2709; >@@ -83,6 +84,9 @@ if ($to_address) { > if ( !defined $iso2709 ) { > carp "Error sending mail: empty basket"; > $template->param( error => 1 ); >+ } elsif ( !defined $user_email or $user_email eq '' ) { >+ carp "Error sending mail: sender's email address is invalid"; >+ $template->param( error => 1 ); > } else { > my %loops = ( > biblio => \@biblionumbers, >@@ -116,7 +120,7 @@ if ($to_address) { > message_transport_type => 'email', > borrowernumber => $patron->borrowernumber, > to_address => $to_address, >- reply_address => $patron->first_valid_email_address, >+ reply_address => $user_email, > attachments => [$attachment], > }); > >-- >2.20.1
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 3150
:
114127
|
114545
|
114579
|
114582
|
117237
|
118313
|
120477
|
120478
|
121026
|
121027
|
121037
|
121038
|
123020
|
123021
|
123022
|
125225
|
125226
|
125227
|
125379
|
126544
|
126545
|
126546
|
126547
|
130150
|
130151
|
130152
|
130153
|
134304
|
134305
|
134306
|
134307
|
134308
|
134477
|
137690
|
137691
|
137692
|
137693
|
137694
|
137716
|
137717
|
137718
|
137719
|
137720
|
137878
|
140246
|
140247
|
140248
|
140249
|
140250
|
140251
|
140252
|
140253
|
140254
|
140255
|
140256
|
140257
|
140258
|
140259
|
145229
|
145230
|
145231
|
145232
|
145233
|
145234
|
145676
|
145677
|
145678
|
145679
|
145680
|
145681
|
146560
|
146561
|
146562
|
146563
|
146564
|
146565
|
146566
|
146858
|
146859
|
146860
|
146861
|
146862
|
146863
|
146864
|
146865
|
146866
|
146867
|
146987
|
147423
|
147868
|
147869
|
147870
|
147871
|
147872
|
147873
|
147874
|
147875
|
147876
|
147877
|
147878
|
147879
|
147880
|
148045
|
148170
|
148171
|
148172
|
148173
|
148174
|
148175
|
148176
|
148177
|
148178
|
148179
|
148180
|
148181
|
148182
|
148183
|
148184
|
148185