View | Details | Raw Unified | Return to bug 3150
Collapse All | Expand All

(-)a/basket/sendbasket.pl (-2 / +5 lines)
Lines 55-61 if ( $email_add ) { Link Here
55
            token  => scalar $query->param('csrf_token'),
55
            token  => scalar $query->param('csrf_token'),
56
        });
56
        });
57
57
58
    my $patron = Koha:::Patrons->find( $borrowernumber );
58
    my $patron = Koha::Patrons->find( $borrowernumber );
59
    my $user_email = $patron->first_valid_email_address;
59
60
60
    my $comment = $query->param('comment');
61
    my $comment = $query->param('comment');
61
62
Lines 70-75 if ( $email_add ) { Link Here
70
    if ( !defined $iso2709 ) {
71
    if ( !defined $iso2709 ) {
71
        carp "Error sending mail: empty basket";
72
        carp "Error sending mail: empty basket";
72
        $template->param( error => 1 );
73
        $template->param( error => 1 );
74
    } elsif ( !defined $user_email or $user_email eq '' ) {
75
        carp "Error sending mail: sender's email address is invalid";
76
        $template->param( error => 1 );
73
    } else {
77
    } else {
74
        my %loops = (
78
        my %loops = (
75
            biblio => \@bibs,
79
            biblio => \@bibs,
Lines 97-103 if ( $email_add ) { Link Here
97
            content => Encode::encode("UTF-8", $iso2709),
101
            content => Encode::encode("UTF-8", $iso2709),
98
        };
102
        };
99
103
100
        my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress');
101
        C4::Letters::EnqueueLetter({
104
        C4::Letters::EnqueueLetter({
102
            letter => $letter,
105
            letter => $letter,
103
            message_transport_type => 'email',
106
            message_transport_type => 'email',
(-)a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl (-216 / +48 lines)
Lines 1-222 Link Here
1
$DBversion = 'XXX';
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{ INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES
3
    $dbh->do(q{ INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES
4
        ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"<p>Hi,</p>
4
('catalog','LIST','','Send list',0,'Your list: [% listname | html %]',"Hi,
5
<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].</p>
5
[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].
6
<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>
6
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.
7
<hr/>
7
<hr/>[% comment | html %]<hr/>
8
<p>[% comment | html %]</p>
8
<ol>[% FOREACH biblio IN biblios %]<li>
9
<hr/>
9
    [% biblio.title | html %]
10
<ol>
10
    [% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %]
11
[% FOREACH biblio IN biblios %]
11
    [% biblio.part_number | html %] [% biblio.part_name | html %]
12
    <li>
12
    [% 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 %]
13
        <span>
13
    [% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %]
14
            [% biblio.title | html %]
14
    [% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %]
15
            [% IF ( biblio.subtitle ) %]
15
    [% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %]
16
                [% FOREACH subtitle IN biblio.subtitle.split(' | ') %]
16
    [% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %]
17
                    [% subtitle | html %]
17
    [% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %]
18
                [% END %]
18
    [% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %]
19
            [% END %]
19
    [% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %]
20
            [% biblio.part_number | html %] [% biblio.part_name | html %]
20
    [% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %]
21
        </span>
21
    [% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %]
22
        <p>
22
    [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %]
23
            [% IF ( biblio.author || biblio.get_authors_from_MARC ) %]
23
    [% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
24
                <span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %]
24
    [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
25
                [% IF ( biblio.get_authors_from_MARC ) %]
25
    [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]
26
                    [% IF ( biblio.author ) %]; [% END %]
26
    [% item.barcode | html %]</li>[% END %]</ul>[% END %]
27
                    [% FOREACH author IN biblio.get_authors_from_MARC %]
27
<hr/></li>[% END %]</ol>", 'email','default' ),
28
                        [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]
28
        ('catalog','CART','','Send cart',0,'Your cart',"Hi,
29
                            [% subfield.separator | html %][% subfield.value | html %]
29
[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.
30
                        [% END %]
30
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.
31
                        [% UNLESS ( loop.last ) %];[% END %]
31
<hr/>[% comment | html %]<hr/>
32
                    [% END %]
32
<ol>[% FOREACH biblio IN biblios %]<li>
33
                [% END %]
33
    [% biblio.title | html %]
34
                </span><br/>
34
    [% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %]
35
            [% END %]
35
    [% biblio.part_number | html %] [% biblio.part_name | html %]
36
            [% SET biblioitem = biblio.biblioitem %]
36
    [% 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 %]
37
            [% IF ( biblioitem.isbn ) %]
37
    [% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %]
38
                <span>
38
    [% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %]
39
                    ISBN: [% FOREACH isbn IN biblioitem.isbn %]
39
    [% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %]
40
                        [% isbn | html %]
40
    [% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %]
41
                        [% UNLESS ( loop.last ) %]; [% END %]
41
    [% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %]
42
                    [% END %]
42
    [% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %]
43
                </span><br/>
43
    [% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %]
44
            [% END %]
44
    [% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %]
45
            [% IF ( biblioitem.publishercode ) %]
45
    [% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %]
46
                <span>
46
    [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %]
47
                    Published by: [% biblioitem.publishercode | html %]
47
    [% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
48
                    [% IF ( biblioitem.publicationyear ) %]
48
    [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
49
                        in [% biblioitem.publicationyear | html %]
49
    [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]
50
                    [% END %]
50
    [% item.barcode | html %]</li>[% END %]</ul>[% END %]
51
                    [% IF ( biblioitem.pages ) %]
51
<hr/></li>[% END %]</ol>",'email','default') });
52
                        , [% biblioitem.pages | html %]
53
                    [% END %]
54
                </span><br/>
55
            [% END %]
56
            [% IF ( biblio.seriestitle ) %]
57
                <span>
58
                    Collection: [% biblio.seriestitle | html %]
59
                </span><br/>
60
            [% END %]
61
            [% IF ( biblio.copyrightdate ) %]
62
                <span>
63
                    Copyright year: [% biblio.copyrightdate | html %]
64
                </span><br/>
65
            [% END %]
66
            [% IF ( biblio.notes ) %]
67
                <span>
68
                    Notes: [% biblio.notes | html %]
69
                </span><br/>
70
            [% END %]
71
            [% IF ( biblio.unititle ) %]
72
                <span>
73
                    Unified title: [% biblio.unititle | html %]
74
                </span><br/>
75
            [% END %]
76
            [% IF ( biblio.serial ) %]
77
                <span>
78
                    Serial: [% biblio.serial | html %]
79
                </span><br/>
80
            [% END %]
81
            [% IF ( biblioitem.lccn ) %]
82
                <span>
83
                    LCCN: [% biblioitem.lccn | html %]
84
                </span><br/>
85
            [% END %]
86
            [% IF ( biblioitem.url ) %]
87
                <span>
88
                    URL: [% biblioitem.url | html %]
89
                </span>
90
            [% END %]
91
        </p>
92
        [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]
93
        [% IF ( OPACBaseURL ) %]
94
            <p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p>
95
        [% END %]
96
        [% IF ( biblio.items.count > 0 ) %]
97
            <p>Items:
98
                <ul>
99
                    [% FOREACH item IN biblio.items %]<li>
100
                        [% Branches.GetName( item.holdingbranch ) | html %]
101
                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
102
                        [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]
103
                        [% item.barcode | html %]
104
                    </li>[% END %]
105
                </ul>
106
            </p>
107
        [% END %]
108
        <hr/>
109
    </li>
110
[% END %]
111
</ol>", 'email','default' ),
112
        ('catalog','CART','','Send cart',1,'Your cart',"<p>Hi,</p>
113
<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.</p>
114
<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>
115
<hr/>
116
<p>[% comment | html %]</p>
117
<hr/>
118
<ol>
119
[% FOREACH biblio IN biblios %]
120
    <li>
121
        <span>
122
            [% biblio.title | html %]
123
            [% IF ( biblio.subtitle ) %]
124
                [% FOREACH subtitle IN biblio.subtitle.split(' | ') %]
125
                    [% subtitle | html %]
126
                [% END %]
127
            [% END %]
128
            [% biblio.part_number | html %] [% biblio.part_name | html %]
129
        </span>
130
        <p>
131
            [% IF ( biblio.author || biblio.get_authors_from_MARC ) %]
132
                <span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %]
133
                [% IF ( biblio.get_authors_from_MARC ) %]
134
                    [% IF ( biblio.author ) %]; [% END %]
135
                    [% FOREACH author IN biblio.get_authors_from_MARC %]
136
                        [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]
137
                            [% subfield.separator | html %][% subfield.value | html %]
138
                        [% END %]
139
                        [% UNLESS ( loop.last ) %];[% END %]
140
                    [% END %]
141
                [% END %]
142
                </span><br/>
143
            [% END %]
144
            [% SET biblioitem = biblio.biblioitem %]
145
            [% IF ( biblioitem.isbn ) %]
146
                <span>
147
                    ISBN: [% FOREACH isbn IN biblioitem.isbn %]
148
                        [% isbn | html %]
149
                        [% UNLESS ( loop.last ) %]; [% END %]
150
                    [% END %]
151
                </span><br/>
152
            [% END %]
153
            [% IF ( biblioitem.publishercode ) %]
154
                <span>
155
                    Published by: [% biblioitem.publishercode | html %]
156
                    [% IF ( biblioitem.publicationyear ) %]
157
                        in [% biblioitem.publicationyear | html %]
158
                    [% END %]
159
                    [% IF ( biblioitem.pages ) %]
160
                        , [% biblioitem.pages | html %]
161
                    [% END %]
162
                </span><br/>
163
            [% END %]
164
            [% IF ( biblio.seriestitle ) %]
165
                <span>
166
                    Collection: [% biblio.seriestitle | html %]
167
                </span><br/>
168
            [% END %]
169
            [% IF ( biblio.copyrightdate ) %]
170
                <span>
171
                    Copyright year: [% biblio.copyrightdate | html %]
172
                </span><br/>
173
            [% END %]
174
            [% IF ( biblio.notes ) %]
175
                <span>
176
                    Notes: [% biblio.notes | html %]
177
                </span><br/>
178
            [% END %]
179
            [% IF ( biblio.unititle ) %]
180
                <span>
181
                    Unified title: [% biblio.unititle | html %]
182
                </span><br/>
183
            [% END %]
184
            [% IF ( biblio.serial ) %]
185
                <span>
186
                    Serial: [% biblio.serial | html %]
187
                </span><br/>
188
            [% END %]
189
            [% IF ( biblioitem.lccn ) %]
190
                <span>
191
                    LCCN: [% biblioitem.lccn | html %]
192
                </span><br/>
193
            [% END %]
194
            [% IF ( biblioitem.url ) %]
195
                <span>
196
                    URL: [% biblioitem.url | html %]
197
                </span>
198
            [% END %]
199
        </p>
200
        [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]
201
        [% IF ( OPACBaseURL ) %]
202
            <p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p>
203
        [% END %]
204
        [% IF ( biblio.items.count > 0 ) %]
205
            <p>Items:
206
                <ul>
207
                    [% FOREACH item IN biblio.items %]<li>
208
                        [% Branches.GetName( item.holdingbranch ) | html %]
209
                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
210
                        [% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]
211
                        [% item.barcode | html %]
212
                    </li>[% END %]
213
                </ul>
214
            </p>
215
        [% END %]
216
        <hr/>
217
    </li>
218
[% END %]
219
</ol>",'email','default') });
220
52
221
    NewVersion( $DBversion, 3150, 'Add LIST and CART notices' );
53
    NewVersion( $DBversion, 3150, 'Add LIST and CART notices' );
222
}
54
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-216 / +41 lines)
Lines 2191-2424 tables: Link Here
2191
          code: LIST
2191
          code: LIST
2192
          branchcode: ""
2192
          branchcode: ""
2193
          name: "Send list"
2193
          name: "Send list"
2194
          is_html: 1
2194
          is_html: 0
2195
          title: "Your list: [% listname | html %]"
2195
          title: "Your list: [% listname | html %]"
2196
          message_transport_type: email
2196
          message_transport_type: email
2197
          lang: default
2197
          lang: default
2198
          content:
2198
          content:
2199
            - "<p>Hi,</p>"
2199
            - "Hi,"
2200
            - "<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].</p>"
2200
            - "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %]."
2201
            - "<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>"
2201
            - "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."
2202
            - "<hr/>"
2202
            - "<hr/>[% comment | html %]<hr/>"
2203
            - "<p>[% comment | html %]</p>"
2203
            - "<ol>[% FOREACH biblio IN biblios %]<li>"
2204
            - "<hr/>"
2205
            - "<ol>"
2206
            - "[% FOREACH biblio IN biblios %]"
2207
            - "<li>"
2208
            - "<span>"
2209
            - "[% biblio.title | html %]"
2204
            - "[% biblio.title | html %]"
2210
            - "[% IF ( biblio.subtitle ) %]"
2205
            - "[% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% biblio.part_number | html %] [% biblio.part_name | html %]"
2211
            - "[% FOREACH subtitle IN biblio.subtitle.split(' | ') %]"
2206
            - "[% 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 %]"
2212
            - "[% subtitle | html %]"
2207
            - "[% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %]"
2213
            - "[% END %]"
2208
            - "[% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %]"
2214
            - "[% END %]"
2209
            - "[% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %]"
2215
            - "[% biblio.part_number | html %] [% biblio.part_name | html %]"
2210
            - "[% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %]"
2216
            - "</span>"
2211
            - "[% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %]"
2217
            - "<p>"
2212
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %]"
2218
            - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]"
2213
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %]"
2219
            - "<span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %]"
2214
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %]"
2220
            - "[% IF ( biblio.get_authors_from_MARC ) %]"
2215
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %]"
2221
            - "[% IF ( biblio.author ) %]; [% END %]"
2216
            - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %]"
2222
            - "[% FOREACH author IN biblio.get_authors_from_MARC %]"
2217
            - "[% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %][% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %][% item.barcode | html %]</li>[% END %]</ul>[% END %]"
2223
            - "[% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]"
2218
            - "<hr/></li>[% END %]</ol>"
2224
            - "[% subfield.separator | html %][% subfield.value | html %]"
2225
            - "[% END %]"
2226
            - "[% UNLESS ( loop.last ) %];[% END %]"
2227
            - "[% END %]"
2228
            - "[% END %]"
2229
            - "</span><br/>"
2230
            - "[% END %]"
2231
            - "[% SET biblioitem = biblio.biblioitem %]"
2232
            - "[% IF ( biblioitem.isbn ) %]"
2233
            - "<span>"
2234
            - "ISBN: [% FOREACH isbn IN biblioitem.isbn %]"
2235
            - "[% isbn | html %]"
2236
            - "[% UNLESS ( loop.last ) %]; [% END %]"
2237
            - "[% END %]"
2238
            - "</span><br/>"
2239
            - "[% END %]"
2240
            - "[% IF ( biblioitem.publishercode ) %]"
2241
            - "<span>"
2242
            - "Published by: [% biblioitem.publishercode | html %]"
2243
            - "[% IF ( biblioitem.publicationyear ) %]"
2244
            - "in [% biblioitem.publicationyear | html %]"
2245
            - "[% END %]"
2246
            - "[% IF ( biblioitem.pages ) %]"
2247
            - ", [% biblioitem.pages | html %]"
2248
            - "[% END %]"
2249
            - "</span><br/>"
2250
            - "[% END %]"
2251
            - "[% IF ( biblio.seriestitle ) %]"
2252
            - "<span>"
2253
            - "Collection: [% biblio.seriestitle | html %]"
2254
            - "</span><br/>"
2255
            - "[% END %]"
2256
            - "[% IF ( biblio.copyrightdate ) %]"
2257
            - "<span>"
2258
            - "Copyright year: [% biblio.copyrightdate | html %]"
2259
            - "</span><br/>"
2260
            - "[% END %]"
2261
            - "[% IF ( biblio.notes ) %]"
2262
            - "<span>"
2263
            - "Notes: [% biblio.notes | html %]"
2264
            - "</span><br/>"
2265
            - "[% END %]"
2266
            - "[% IF ( biblio.unititle ) %]"
2267
            - "<span>"
2268
            - "Unified title: [% biblio.unititle | html %]"
2269
            - "</span><br/>"
2270
            - "[% END %]"
2271
            - "[% IF ( biblio.serial ) %]"
2272
            - "<span>"
2273
            - "Serial: [% biblio.serial | html %]"
2274
            - "</span><br/>"
2275
            - "[% END %]"
2276
            - "[% IF ( biblioitem.lccn ) %]"
2277
            - "<span>"
2278
            - "LCCN: [% biblioitem.lccn | html %]"
2279
            - "</span><br/>"
2280
            - "[% END %]"
2281
            - "[% IF ( biblioitem.url ) %]"
2282
            - "<span>"
2283
            - "URL: [% biblioitem.url | html %]"
2284
            - "</span>"
2285
            - "[% END %]"
2286
            - "</p>"
2287
            - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]"
2288
            - "[% IF ( OPACBaseURL ) %]"
2289
            - "<p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p>"
2290
            - "[% END %]"
2291
            - "[% IF ( biblio.items.count > 0 ) %]"
2292
            - "<p>Items:"
2293
            - "<ul>"
2294
            - "[% FOREACH item IN biblio.items %]<li>"
2295
            - "[% Branches.GetName( item.holdingbranch ) | html %]"
2296
            - "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]"
2297
            - "[% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]"
2298
            - "[% item.barcode | html %]"
2299
            - "</li>[% END %]"
2300
            - "</ul>"
2301
            - "</p>"
2302
            - "[% END %]"
2303
            - "<hr/>"
2304
            - "</li>"
2305
            - "[% END %]"
2306
            - "</ol>"
2307
2219
2308
        - module: catalog
2220
        - module: catalog
2309
          code: CART
2221
          code: CART
2310
          branchcode: ""
2222
          branchcode: ""
2311
          name: "Send cart"
2223
          name: "Send cart"
2312
          is_html: 1
2224
          is_html: 0
2313
          title: "Your cart"
2225
          title: "Your cart"
2314
          message_transport_type: email
2226
          message_transport_type: email
2315
          lang: default
2227
          lang: default
2316
          content:
2228
          content:
2317
            - "<p>Hi,</p>"
2229
            - "Hi,"
2318
            - "<p>[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.</p>"
2230
            - "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog."
2319
            - "<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>"
2231
            - "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %]."
2320
            - "<hr/>"
2232
            - "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."
2321
            - "<p>[% comment | html %]</p>"
2233
            - "<hr/>[% comment | html %]<hr/>"
2322
            - "<hr/>"
2234
            - "<ol>[% FOREACH biblio IN biblios %]<li>"
2323
            - "<ol>"
2324
            - "[% FOREACH biblio IN biblios %]"
2325
            - "<li>"
2326
            - "<span>"
2327
            - "[% biblio.title | html %]"
2235
            - "[% biblio.title | html %]"
2328
            - "[% IF ( biblio.subtitle ) %]"
2236
            - "[% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% biblio.part_number | html %] [% biblio.part_name | html %]"
2329
            - "[% FOREACH subtitle IN biblio.subtitle.split(' | ') %]"
2237
            - "[% 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 %]"
2330
            - "[% subtitle | html %]"
2238
            - "[% SET biblioitem = biblio.biblioitem %][% IF ( biblioitem.isbn ) %]ISBN: [% FOREACH isbn IN biblioitem.isbn %][% isbn | html %][% UNLESS ( loop.last ) %]; [% END %][% END %][% END %]"
2331
            - "[% END %]"
2239
            - "[% IF ( biblioitem.publishercode ) %]Published by: [% biblioitem.publishercode | html %][% IF ( biblioitem.publicationyear ) %] in [% biblioitem.publicationyear | html %][% END %][% IF ( biblioitem.pages ) %], [% biblioitem.pages | html %][% END %][% END %]"
2332
            - "[% END %]"
2240
            - "[% IF ( biblio.seriestitle ) %]Collection: [% biblio.seriestitle | html %][% END %]"
2333
            - "[% biblio.part_number | html %] [% biblio.part_name | html %]"
2241
            - "[% IF ( biblio.copyrightdate ) %]Copyright year: [% biblio.copyrightdate | html %][% END %]"
2334
            - "</span>"
2242
            - "[% IF ( biblio.notes ) %]Notes: [% biblio.notes | html %][% END %]"
2335
            - "<p>"
2243
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %][% END %]"
2336
            - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]"
2244
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %][% END %]"
2337
            - "<span>Author(s): [% IF ( biblio.author ) %][% biblio.author | html %][% END %]"
2245
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %][% END %]"
2338
            - "[% IF ( biblio.get_authors_from_MARC ) %]"
2246
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %][% END %]"
2339
            - "[% IF ( biblio.author ) %]; [% END %]"
2247
            - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %][% IF ( OPACBaseURL ) %]In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %][% END %]"
2340
            - "[% FOREACH author IN biblio.get_authors_from_MARC %]"
2248
            - "[% IF ( biblio.items.count > 0 ) %]Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %][% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %][% item.barcode | html %]</li>[% END %]</ul>[% END %]"
2341
            - "[% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]"
2249
            - "<hr/></li>[% END %]</ol>"
2342
            - "[% subfield.separator | html %][% subfield.value | html %]"
2343
            - "[% END %]"
2344
            - "[% UNLESS ( loop.last ) %];[% END %]"
2345
            - "[% END %]"
2346
            - "[% END %]"
2347
            - "</span><br/>"
2348
            - "[% END %]"
2349
            - "[% SET biblioitem = biblio.biblioitem %]"
2350
            - "[% IF ( biblioitem.isbn ) %]"
2351
            - "<span>"
2352
            - "ISBN: [% FOREACH isbn IN biblioitem.isbn %]"
2353
            - "[% isbn | html %]"
2354
            - "[% UNLESS ( loop.last ) %]; [% END %]"
2355
            - "[% END %]"
2356
            - "</span><br/>"
2357
            - "[% END %]"
2358
            - "[% IF ( biblioitem.publishercode ) %]"
2359
            - "<span>"
2360
            - "Published by: [% biblioitem.publishercode | html %]"
2361
            - "[% IF ( biblioitem.publicationyear ) %]"
2362
            - "in [% biblioitem.publicationyear | html %]"
2363
            - "[% END %]"
2364
            - "[% IF ( biblioitem.pages ) %]"
2365
            - ", [% biblioitem.pages | html %]"
2366
            - "[% END %]"
2367
            - "</span><br/>"
2368
            - "[% END %]"
2369
            - "[% IF ( biblio.seriestitle ) %]"
2370
            - "<span>"
2371
            - "Collection: [% biblio.seriestitle | html %]"
2372
            - "</span><br/>"
2373
            - "[% END %]"
2374
            - "[% IF ( biblio.copyrightdate ) %]"
2375
            - "<span>"
2376
            - "Copyright year: [% biblio.copyrightdate | html %]"
2377
            - "</span><br/>"
2378
            - "[% END %]"
2379
            - "[% IF ( biblio.notes ) %]"
2380
            - "<span>"
2381
            - "Notes: [% biblio.notes | html %]"
2382
            - "</span><br/>"
2383
            - "[% END %]"
2384
            - "[% IF ( biblio.unititle ) %]"
2385
            - "<span>"
2386
            - "Unified title: [% biblio.unititle | html %]"
2387
            - "</span><br/>"
2388
            - "[% END %]"
2389
            - "[% IF ( biblio.serial ) %]"
2390
            - "<span>"
2391
            - "Serial: [% biblio.serial | html %]"
2392
            - "</span><br/>"
2393
            - "[% END %]"
2394
            - "[% IF ( biblioitem.lccn ) %]"
2395
            - "<span>"
2396
            - "LCCN: [% biblioitem.lccn | html %]"
2397
            - "</span><br/>"
2398
            - "[% END %]"
2399
            - "[% IF ( biblioitem.url ) %]"
2400
            - "<span>"
2401
            - "URL: [% biblioitem.url | html %]"
2402
            - "</span>"
2403
            - "[% END %]"
2404
            - "</p>"
2405
            - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]"
2406
            - "[% IF ( OPACBaseURL ) %]"
2407
            - "<p>In online catalog: [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]</p>"
2408
            - "[% END %]"
2409
            - "[% IF ( biblio.items.count > 0 ) %]"
2410
            - "<p>Items:"
2411
            - "<ul>"
2412
            - "[% FOREACH item IN biblio.items %]<li>"
2413
            - "[% Branches.GetName( item.holdingbranch ) | html %]"
2414
            - "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]"
2415
            - "[% IF item.itemcallnumber %]([% item.itemcallnumber | html %])[% END %]"
2416
            - "[% item.barcode | html %]"
2417
            - "</li>[% END %]"
2418
            - "</ul>"
2419
            - "</p>"
2420
            - "[% END %]"
2421
            - "<hr/>"
2422
            - "</li>"
2423
            - "[% END %]"
2424
            - "</ol>"
(-)a/opac/opac-sendbasket.pl (-1 / +4 lines)
Lines 55-60 if ( $email_add ) { Link Here
55
    });
55
    });
56
56
57
    my $patron = Koha::Patrons->find( $borrowernumber );
57
    my $patron = Koha::Patrons->find( $borrowernumber );
58
    my $user_email = $patron->first_valid_email_address;
58
59
59
    my $comment    = $query->param('comment');
60
    my $comment    = $query->param('comment');
60
61
Lines 68-73 if ( $email_add ) { Link Here
68
    if ( !defined $iso2709 ) {
69
    if ( !defined $iso2709 ) {
69
        carp "Error sending mail: empty basket";
70
        carp "Error sending mail: empty basket";
70
        $template->param( error => 1 );
71
        $template->param( error => 1 );
72
    } elsif ( !defined $user_email or $user_email eq '' ) {
73
        carp "Error sending mail: sender's email address is invalid";
74
        $template->param( error => 1 );
71
    } else {
75
    } else {
72
        my %loops = (
76
        my %loops = (
73
            biblio => \@bibs,
77
            biblio => \@bibs,
Lines 95-101 if ( $email_add ) { Link Here
95
            content => Encode::encode("UTF-8", $iso2709),
99
            content => Encode::encode("UTF-8", $iso2709),
96
        };
100
        };
97
101
98
        my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress');
99
        C4::Letters::EnqueueLetter({
102
        C4::Letters::EnqueueLetter({
100
            letter => $letter,
103
            letter => $letter,
101
            message_transport_type => 'email',
104
            message_transport_type => 'email',
(-)a/opac/opac-sendshelf.pl (-2 / +5 lines)
Lines 70-76 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
70
    );
70
    );
71
71
72
    my $patron = Koha::Patrons->find( $borrowernumber );
72
    my $patron = Koha::Patrons->find( $borrowernumber );
73
73
    my $user_email = $patron->first_valid_email_address;
74
    my $shelf = Koha::Virtualshelves->find( $shelfid );
74
    my $shelf = Koha::Virtualshelves->find( $shelfid );
75
    my $contents = $shelf->get_contents;
75
    my $contents = $shelf->get_contents;
76
    my $iso2709;
76
    my $iso2709;
Lines 84-89 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
84
    if ( !defined $iso2709 ) {
84
    if ( !defined $iso2709 ) {
85
        carp "Error sending mail: empty list";
85
        carp "Error sending mail: empty list";
86
        $template->param( error => 1 );
86
        $template->param( error => 1 );
87
    } elsif ( !defined $user_email or $user_email eq '' ) {
88
        carp "Error sending mail: sender's email address is invalid";
89
        $template->param( error => 1 );
87
    } else {
90
    } else {
88
         my %loops = (
91
         my %loops = (
89
             biblio => \@biblionumbers,
92
             biblio => \@biblionumbers,
Lines 117-123 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
117
            message_transport_type => 'email',
120
            message_transport_type => 'email',
118
            borrowernumber => $patron->borrowernumber,
121
            borrowernumber => $patron->borrowernumber,
119
            to_address => $email,
122
            to_address => $email,
120
            reply_address => $patron->first_valid_email_address,
123
            reply_address => $user_email,
121
            attachments => [$attachment],
124
            attachments => [$attachment],
122
        });
125
        });
123
126
(-)a/virtualshelves/sendshelf.pl (-2 / +5 lines)
Lines 70-75 if ($to_address) { Link Here
70
    );
70
    );
71
71
72
    my $patron = Koha:::Patrons->find( $borrowernumber );
72
    my $patron = Koha:::Patrons->find( $borrowernumber );
73
    my $user_email = $patron->first_valid_email_address;
73
    my $contents = $shelf->get_contents;
74
    my $contents = $shelf->get_contents;
74
    my @biblionumbers;
75
    my @biblionumbers;
75
    my $iso2709;
76
    my $iso2709;
Lines 83-88 if ($to_address) { Link Here
83
    if ( !defined $iso2709 ) {
84
    if ( !defined $iso2709 ) {
84
        carp "Error sending mail: empty basket";
85
        carp "Error sending mail: empty basket";
85
        $template->param( error => 1 );
86
        $template->param( error => 1 );
87
    } elsif ( !defined $user_email or $user_email eq '' ) {
88
        carp "Error sending mail: sender's email address is invalid";
89
        $template->param( error => 1 );
86
    } else {
90
    } else {
87
        my %loops = (
91
        my %loops = (
88
            biblio => \@biblionumbers,
92
            biblio => \@biblionumbers,
Lines 116-122 if ($to_address) { Link Here
116
            message_transport_type => 'email',
120
            message_transport_type => 'email',
117
            borrowernumber => $patron->borrowernumber,
121
            borrowernumber => $patron->borrowernumber,
118
            to_address => $to_address,
122
            to_address => $to_address,
119
            reply_address => $patron->first_valid_email_address,
123
            reply_address => $user_email,
120
            attachments => [$attachment],
124
            attachments => [$attachment],
121
        });
125
        });
122
126
123
- 

Return to bug 3150