From c56dda8827d7db02e8a30bb8a6011f76d4f92dbc Mon Sep 17 00:00:00 2001 From: Aleisha Amohia 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. --- basket/sendbasket.pl | 6 +- .../bug_3150_-_add_LIST_and_CART_notices.perl | 264 ++++----------------- .../data/mysql/en/mandatory/sample_notices.yml | 257 ++++---------------- .../mysql/fr-CA/obligatoire/sample_notices.sql | 264 ++++----------------- .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 264 ++++----------------- .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 264 ++++----------------- opac/opac-sendbasket.pl | 6 +- opac/opac-sendshelf.pl | 7 +- virtualshelves/sendshelf.pl | 7 +- 9 files changed, 255 insertions(+), 1084 deletions(-) diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 05d041b8a2..3d18167d02 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -58,6 +58,7 @@ if ( $email_add ) { }); my $patron = Koha::Patrons->find( $borrowernumber ); + my $user_email = $patron->first_valid_email_address; my $comment = $query->param('comment'); @@ -73,6 +74,10 @@ if ( $email_add ) { 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, @@ -100,7 +105,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..4ea4b906c4 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 %]',"

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 %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
", 'email','default' ), - ('catalog','CART','','Send cart',1,'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.

-
-

[% comment | html %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
",'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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
", '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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
",'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 3c0f9c291d..8435e14aa7 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1550,234 +1550,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: - - "

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 %]

" - - "
" - - "
    " - - "[% FOREACH biblio IN biblios %]" - - "
  1. " - - "" + - "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 %]
    " + - "
      [% FOREACH biblio IN biblios %]
    1. " - "[% 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_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 %]" - - "

      " - - "[% 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:" - - "

        " - - "[% FOREACH item IN biblio.items %]
      • " - - "[% item.holding_branch.branchname | html %]" - - "[% item.location | html %]" - - "[% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]" - - "[% item.barcode | html %]" - - "
      • [% END %]" - - "
      " - - "

      " - - "[% END %]" - - "
      " - - "
    2. " - - "[% END %]" - - "
    " + - "[% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %][% item.location | html %][% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %][% item.barcode | html %]
    • [% END %]
    [% END %]" + - "
  2. [% END %]
" - module: catalog code: CART branchcode: "" name: "Send cart" - is_html: 1 + is_html: 0 title: "Your cart" message_transport_type: email lang: default content: - - "

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 %]

" - - "
" - - "
    " - - "[% FOREACH biblio IN biblios %]" - - "
  1. " - - "" + - "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." + - "
    [% comment | html %]
    " + - "
      [% FOREACH biblio IN biblios %]
    1. " - "[% 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_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 %]" - - "

      " - - "[% 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:" - - "

        " - - "[% FOREACH item IN biblio.items %]
      • " - - "[% item.holding_branch.branchname | html %]" - - "[% item.location | html %]" - - "[% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]" - - "[% item.barcode | html %]" - - "
      • [% END %]" - - "
      " - - "

      " - - "[% END %]" - - "
      " - - "
    2. " - - "[% END %]" - - "
    " + - "[% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %][% item.location | html %][% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %][% item.barcode | html %]
    • [% END %]
    [% END %]" + - "
  2. [% END %]
" diff --git a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql index 23254ede35..27c926d252 100644 --- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql @@ -363,219 +363,51 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport [% END %] ", 'email'); -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 %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
", 'email','default' ), -('catalog','CART','','Send cart',1,'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.

-
-

[% comment | html %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
",'email','default'); +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
", '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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
",'email','default'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql index 4b9af9de0f..a55e78fa0a 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -475,219 +475,51 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport [% END %] ", 'email'); -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 %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
", 'email','default' ), -('catalog','CART','','Send cart',1,'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.

-
-

[% comment | html %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
",'email','default'); +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
", '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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
", 'email','default' ); diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql index 63b7ef69b2..5d412d0847 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -494,219 +494,51 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport [% END %] ", 'email'); -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 %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
", 'email','default' ), -('catalog','CART','','Send cart',1,'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.

-
-

[% comment | html %]

-
-
    -[% FOREACH biblio IN biblios %] -
  1. - - [% 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_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 %] -

    - [% 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: -

      - [% FOREACH item IN biblio.items %]
    • - [% item.holding_branch.branchname | html %] - [% item.location | html %] - [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] - [% item.barcode | html %] -
    • [% END %] -
    -

    - [% END %] -
    -
  2. -[% END %] -
",'email','default'); +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
", '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. +
[% comment | html %]
+
    [% FOREACH biblio IN biblios %]
  1. + [% 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:
      [% FOREACH item IN biblio.items %]
    • [% item.holding_branch.branchname | html %] + [% item.location | html %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %] + [% item.barcode | html %]
    • [% END %]
    [% END %] +
  2. [% END %]
", 'email','default' ); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 5a0098132d..6971f8881d 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -59,6 +59,7 @@ if ( $email_add ) { }); my $patron = Koha::Patrons->find( $borrowernumber ); + my $user_email = $patron->first_valid_email_address; my $comment = $query->param('comment'); @@ -74,6 +75,10 @@ if ( $email_add ) { 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, @@ -101,7 +106,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 c9a2cf58a4..fc445f11d7 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -75,6 +75,7 @@ if ( $email ) { ); 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 @biblionumbers; @@ -90,6 +91,10 @@ if ( $email ) { 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, @@ -123,7 +128,7 @@ if ( $email ) { 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 4aa156aeca..c3f811b4aa 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -65,6 +65,7 @@ if ($to_address) { ); 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 @biblionumbers; @@ -80,6 +81,10 @@ if ($to_address) { 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, @@ -113,7 +118,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.11.0