@@ -, +, @@ sender email --- basket/sendbasket.pl | 7 +- .../bug_3150_-_add_LIST_and_CART_notices.perl | 264 ++++----------------- .../data/mysql/en/mandatory/sample_notices.yml | 257 ++++---------------- .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 264 ++++----------------- opac/opac-sendbasket.pl | 5 +- opac/opac-sendshelf.pl | 7 +- virtualshelves/sendshelf.pl | 6 +- 7 files changed, 156 insertions(+), 654 deletions(-) --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -56,7 +56,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'); @@ -71,6 +72,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, @@ -98,7 +102,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', --- a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl +++ a/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 %]',"
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.
-[% comment | html %]
-
- [% IF ( biblio.author || biblio.get_authors_from_MARC ) %]
- 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 %]
-
- [% 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 %]
-
In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]
- [% END %] - [% IF ( biblio.items.count > 0 ) %] -Items: -
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.
-[% comment | html %]
-
- [% IF ( biblio.author || biblio.get_authors_from_MARC ) %]
- 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 %]
-
- [% 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 %]
-
In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]
- [% END %] - [% IF ( biblio.items.count > 0 ) %] -Items: -
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.
" - - "[% comment | html %]
" - - ""
- - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]"
- - "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 %]"
- - "
"
- - "[% 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 %]"
- - "
In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]
" - - "[% END %]" - - "[% IF ( biblio.items.count > 0 ) %]" - - "Items:" - - "
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.
" - - "[% comment | html %]
" - - ""
- - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]"
- - "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 %]"
- - "
"
- - "[% 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 %]"
- - "
In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]
" - - "[% END %]" - - "[% IF ( biblio.items.count > 0 ) %]" - - "Items:" - - "
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.
-[% comment | html %]
-
- [% IF ( biblio.author || biblio.get_authors_from_MARC ) %]
- 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 %]
-
- [% 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 %]
-
In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]
- [% END %] - [% IF ( biblio.items.count > 0 ) %] -Items: -
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.
-[% comment | html %]
-
- [% IF ( biblio.author || biblio.get_authors_from_MARC ) %]
- 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 %]
-
- [% 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 %]
-
In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]
- [% END %] - [% IF ( biblio.items.count > 0 ) %] -Items: -