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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt (-33 / +141 lines)
Lines 2-46 Link Here
2
Your list : [% shelfname %]
2
Your list : [% shelfname %]
3
<END_SUBJECT>
3
<END_SUBJECT>
4
4
5
[% USE HtmlToText %]
6
[% myhtml FILTER html2text(leftmargin => 0, rightmargin => 0) %]
7
[% myhtmltext | html2text %]
8
5
<HEADER>
9
<HEADER>
6
Hi,
10
[% FILTER html2text %]
11
    <p>Hi,</p>
12
13
    <p>[% firstname %] [% surname %] sent you from our online catalog, the
14
    virtual shelf called : [% shelfname %].</p>
7
15
8
[% firstname %] [% surname %], sent you from our online catalog, the virtual shelf called :  [% shelfname %].
16
    <p>Please note that the attached file is a MARC bibliographic records file
17
    which can be imported into personal bibliographic software like EndNote,
18
    Reference Manager or ProCite.</p>
19
    <hr/>
20
[% END %]
9
21
10
Please note that the attached file is a MARC bibliographic records file
11
which can be imported into personal bibliographic software like EndNote,
12
Reference Manager or ProCite.
13
<END_HEADER>
22
<END_HEADER>
14
23
15
<MESSAGE>
24
<MESSAGE>
16
---------------------------------------------
25
[% FILTER html2text %]
17
[% IF ( comment ) %]
26
18
[% comment %]
27
    [% IF comment %]
19
[% END %]
28
        <p>[% comment %]</p>
20
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %][% BIBLIO_RESULT.title %][% IF ( BIBLIO_RESULT.subtitle.size ) %] [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %][% subtitle.subfield %][% END %][% END %][% IF ( BIBLIO_RESULT.author ) %]
29
        <hr/>
21
30
    [% END %]
22
by [% BIBLIO_RESULT.author %][% END %]
31
    <ol>
23
[% IF ( BIBLIO_RESULT.MARCAUTHORS.size ) %]
32
    [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
24
Additional author(s): [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %][% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %] [% MARCAUTHOR_SUBFIELDS_LOO.value %][% END %][% UNLESS ( loop.last ) %]; [% ELSE %]
33
        <li>
25
[% END %][% END %][% END %][% IF ( BIBLIO_RESULT.ISBN ) %]
34
            <span>
26
ISBN: [% BIBLIO_RESULT.ISBN %][% END %]
35
                [% BIBLIO_RESULT.title %]
27
[% IF ( BIBLIO_RESULT.publishercode ) %]Published by: [% BIBLIO_RESULT.publishercode %][% END %][% IF ( BIBLIO_RESULT.publicationyear ) %] in [% END %][% BIBLIO_RESULT.publicationyear %][% IF ( BIBLIO_RESULT.pages ) %], [% END %][% BIBLIO_RESULT.pages %][% IF ( BIBLIO_RESULT.size ) %], [% END %][% BIBLIO_RESULT.size %][% IF ( BIBLIO_RESULT.collection ) %]
36
                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
28
Collection: [% BIBLIO_RESULT.seriestitle %][% END %][% IF ( BIBLIO_RESULT.subject ) %]
37
            </span>
29
Subject: [% BIBLIO_RESULT.subject %][% END %][% IF ( BIBLIO_RESULT.copyrightdate ) %]
38
30
Copyright year: [% BIBLIO_RESULT.copyrightdate %][% END %][% IF ( BIBLIO_RESULT.notes ) %]
39
            <p>
31
Notes : [% BIBLIO_RESULT.notes %][% END %][% IF ( BIBLIO_RESULT.unititle ) %]
40
            [% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
32
Unified title: [% BIBLIO_RESULT.unititle %][% END %][% IF ( BIBLIO_RESULT.serial ) %]
41
            <span>Author(s): [% IF ( BIBLIO_RESULT.author ) %][% BIBLIO_RESULT.author %][% END %]
33
Serial: [% BIBLIO_RESULT.serial %][% END %][% IF ( BIBLIO_RESULT.dewey ) %]
42
34
Dewey: [% BIBLIO_RESULT.dewey %][% END %][% IF ( BIBLIO_RESULT.classification ) %]
43
            [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
35
Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT.lccn ) %]
44
                [% IF ( BIBLIO_RESULT.author ) %]; [% END %]
36
LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %]
45
                [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
37
URL: [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %]
46
                    [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
38
In the online catalog:
47
                        [% MARCAUTHOR_SUBFIELDS_LOO.separator %][% MARCAUTHOR_SUBFIELDS_LOO.value %]
39
    http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %]
48
                    [% END %]
40
Items: [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
49
                    [% UNLESS ( loop.last ) %];[% END %]
41
    [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %]
50
                [% END %]
42
51
            [% END %]
43
---------------------------------------------
52
            </span><br/>
53
            [% END %]
54
55
            [% IF BIBLIO_RESULT.publishercode %]
56
            <span>
57
                Published by: [% BIBLIO_RESULT.publishercode %]
58
                [% IF ( BIBLIO_RESULT.publicationyear ) %]
59
                    in [% BIBLIO_RESULT.publicationyear %]
60
                [% END %]
61
                [% IF ( BIBLIO_RESULT.pages ) %]
62
                    , [% BIBLIO_RESULT.pages %]
63
                [% END %]
64
                [% IF BIBLIO_RESULT.size %]
65
                , [% BIBLIO_RESULT.size %]
66
                [% END %]
67
            </span><br/>
68
            [% END %]
69
70
            [% IF BIBLIO_RESULT.collection %]
71
            <span>
72
                Collection: [% BIBLIO_RESULT.seriestitle %]
73
            </span><br/>
74
            [% END %]
75
76
            [% IF ( BIBLIO_RESULT.subject ) %]
77
            <span>
78
                Subject: [% BIBLIO_RESULT.subject %]
79
            <span><br/>
80
            [% END %]
81
82
            [% IF ( BIBLIO_RESULT.copyrightdate ) %]
83
            <span>
84
                Copyright year: [% BIBLIO_RESULT.copyrightdate %]
85
            </span><br/>
86
            [% END %]
87
88
            [% IF ( BIBLIO_RESULT.notes ) %]
89
            <span>
90
                Notes : [% BIBLIO_RESULT.notes %]
91
            </span><br/>
92
            [% END %]
93
94
            [% IF ( BIBLIO_RESULT.unititle ) %]
95
            <span>
96
                Unified title: [% BIBLIO_RESULT.unititle %]
97
            </span><br/>
98
            [% END %]
99
100
            [% IF ( BIBLIO_RESULT.serial ) %]
101
            <span>
102
                Serial: [% BIBLIO_RESULT.serial %]
103
            </span><br/>
104
            [% END %]
105
106
            [% IF ( BIBLIO_RESULT.dewey ) %]
107
            <span>
108
                Dewey: [% BIBLIO_RESULT.dewey %]
109
            </span><br/>
110
            [% END %]
111
112
            [% IF ( BIBLIO_RESULT.classification ) %]
113
            <span>
114
                Classification: [% BIBLIO_RESULT.classification %]
115
            </span><br/>
116
            [% END %]
117
118
            [% IF ( BIBLIO_RESULT.lccn ) %]
119
            <span>
120
                LCCN: [% BIBLIO_RESULT.lccn %]
121
            </span><br/>
122
            [% END %]
123
            [% IF ( BIBLIO_RESULT.url ) %]
124
            <span>
125
                URL: [% BIBLIO_RESULT.url |url %]
126
            </span>
127
            [% END %]
128
            </p>
129
130
            [% IF ( OPACBaseURL ) %]
131
            <p>
132
                In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]
133
            </p>
134
            [% END %]
135
            [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %]
136
            <p>Items:
137
            <ul>
138
                [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]<li>
139
                    [% ITEM_RESULT.branchname %]
140
                    [% ITEM_RESULT.location %]
141
                    [% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber %])[% END %]
142
                    [% ITEM_RESULT.barcode %]
143
                </li>[% END %]
144
            </ul>
145
            </p>
146
            [% END %]
147
            <hr/>
148
        </li>
149
    [% END %]
150
    </ol>
44
151
45
[% END %]
152
[% END %]
153
46
<END_MESSAGE>
154
<END_MESSAGE>
(-)a/opac/opac-sendshelf.pl (-18 / +13 lines)
Lines 21-27 use strict; Link Here
21
use warnings;
21
use warnings;
22
22
23
use CGI;
23
use CGI;
24
use Encode qw(encode);
24
use Encode;
25
use Carp;
25
use Carp;
26
26
27
use Mail::Sendmail;
27
use Mail::Sendmail;
Lines 91-102 if ( $email ) { Link Here
91
91
92
        my @items = GetItemsInfo( $biblionumber );
92
        my @items = GetItemsInfo( $biblionumber );
93
93
94
        $dat->{ISBN}           = GetMarcISBN($record, $marcflavour);
94
        $dat->{MARCNOTES}      = $marcnotesarray;
95
        $dat->{MARCNOTES}      = $marcnotesarray;
95
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
96
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
96
        $dat->{MARCAUTHORS}    = $marcauthorsarray;
97
        $dat->{MARCAUTHORS}    = $marcauthorsarray;
97
        $dat->{'biblionumber'} = $biblionumber;
98
        $dat->{'biblionumber'} = $biblionumber;
98
        $dat->{ITEM_RESULTS}   = \@items;
99
        $dat->{ITEM_RESULTS}   = \@items;
99
        $dat->{subtitle}       = $subtitle;
100
        $dat->{subtitle}       = $subtitle;
101
        $dat->{HASAUTHORS}     = $dat->{'author'} || @$marcauthorsarray;
100
102
101
        $iso2709 .= $record->as_usmarc();
103
        $iso2709 .= $record->as_usmarc();
102
104
Lines 120-144 if ( $email ) { Link Here
120
122
121
    # Getting template result
123
    # Getting template result
122
    my $template_res = $template2->output();
124
    my $template_res = $template2->output();
123
    my $body;
124
125
125
    # Analysing information and getting mail properties
126
    # Analysing information and getting mail properties
126
    if ( $template_res =~ /<SUBJECT>\n(.*)\n<END_SUBJECT>/s ) {
127
    $mail{'subject'} = $template_res =~ /<SUBJECT>\n(.*)\n?<END_SUBJECT>/s
127
        $mail{'subject'} = $1;
128
        ? $1 : "no subject";
128
    }
129
    else { $mail{'subject'} = "no subject"; }
130
129
131
    my $email_header = "";
130
    my ($email_header) = $template_res =~ /<HEADER>\n(.*)\n?<END_HEADER>/s;
132
    if ( $template_res =~ /<HEADER>\n(.*)\n<END_HEADER>/s ) {
133
        $email_header = $1;
134
    }
135
131
136
    my $email_file = "basket.txt";
132
    my $email_file = $template_res =~ /<FILENAME>\n(.*)\n?<END_FILENAME>/s
137
    if ( $template_res =~ /<FILENAME>\n(.*)\n<END_FILENAME>/s ) {
133
        ? $1
138
        $email_file = $1;
134
        : "list.txt";
139
    }
140
135
141
    if ( $template_res =~ /<MESSAGE>\n(.*)\n<END_MESSAGE>/s ) { $body = encode_qp($1); }
136
    my ($body) = $template_res =~ /<MESSAGE>\n(.*)\n?<END_MESSAGE>/s;
142
137
143
    my $boundary = "====" . time() . "====";
138
    my $boundary = "====" . time() . "====";
144
139
Lines 150-164 if ( $email ) { Link Here
150
145
151
    $mail{body} = <<END_OF_BODY;
146
    $mail{body} = <<END_OF_BODY;
152
$boundary
147
$boundary
148
MIME-Version: 1.0
153
Content-Type: text/plain; charset="utf-8"
149
Content-Type: text/plain; charset="utf-8"
154
Content-Transfer-Encoding: quoted-printable
150
Content-Transfer-Encoding: quoted-printable
155
151
156
$email_header
152
$email_header
157
$body
153
$body
158
$boundary
154
$boundary
159
Content-Type: application/octet-stream; name="shelf.iso2709"
155
Content-Type: application/octet-stream; name="list.iso2709"
160
Content-Transfer-Encoding: base64
156
Content-Transfer-Encoding: base64
161
Content-Disposition: attachment; filename="shelf.iso2709"
157
Content-Disposition: attachment; filename="list.iso2709"
162
158
163
$isofile
159
$isofile
164
$boundary--
160
$boundary--
165
- 

Return to bug 8368