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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt (-33 / +145 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.size ) %]
28
Collection: [% BIBLIO_RESULT.seriestitle %][% END %][% IF ( BIBLIO_RESULT.subject ) %]
37
                  [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %]
29
Subject: [% BIBLIO_RESULT.subject %][% END %][% IF ( BIBLIO_RESULT.copyrightdate ) %]
38
                    [% subtitle.subfield %]
30
Copyright year: [% BIBLIO_RESULT.copyrightdate %][% END %][% IF ( BIBLIO_RESULT.notes ) %]
39
                  [% END %]
31
Notes : [% BIBLIO_RESULT.notes %][% END %][% IF ( BIBLIO_RESULT.unititle ) %]
40
                [% END %]
32
Unified title: [% BIBLIO_RESULT.unititle %][% END %][% IF ( BIBLIO_RESULT.serial ) %]
41
            </span>
33
Serial: [% BIBLIO_RESULT.serial %][% END %][% IF ( BIBLIO_RESULT.dewey ) %]
42
34
Dewey: [% BIBLIO_RESULT.dewey %][% END %][% IF ( BIBLIO_RESULT.classification ) %]
43
            <p>
35
Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT.lccn ) %]
44
            [% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
36
LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %]
45
            <span>Author(s): [% IF ( BIBLIO_RESULT.author ) %][% BIBLIO_RESULT.author %][% END %]
37
URL: [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %]
46
38
In the online catalog:
47
            [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
39
    http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %]
48
                [% IF ( BIBLIO_RESULT.author ) %]; [% END %]
40
Items: [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
49
                [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
41
    [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %]
50
                    [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
42
51
                        [% MARCAUTHOR_SUBFIELDS_LOO.separator %][% MARCAUTHOR_SUBFIELDS_LOO.value %]
43
---------------------------------------------
52
                    [% END %]
53
                    [% UNLESS ( loop.last ) %];[% END %]
54
                [% END %]
55
            [% END %]
56
            </span><br/>
57
            [% END %]
58
59
            [% IF BIBLIO_RESULT.publishercode %]
60
            <span>
61
                Published by: [% BIBLIO_RESULT.publishercode %]
62
                [% IF ( BIBLIO_RESULT.publicationyear ) %]
63
                    in [% BIBLIO_RESULT.publicationyear %]
64
                [% END %]
65
                [% IF ( BIBLIO_RESULT.pages ) %]
66
                    , [% BIBLIO_RESULT.pages %]
67
                [% END %]
68
                [% IF BIBLIO_RESULT.size %]
69
                , [% BIBLIO_RESULT.size %]
70
                [% END %]
71
            </span><br/>
72
            [% END %]
73
74
            [% IF BIBLIO_RESULT.collection %]
75
            <span>
76
                Collection: [% BIBLIO_RESULT.seriestitle %]
77
            </span><br/>
78
            [% END %]
79
80
            [% IF ( BIBLIO_RESULT.subject ) %]
81
            <span>
82
                Subject: [% BIBLIO_RESULT.subject %]
83
            <span><br/>
84
            [% END %]
85
86
            [% IF ( BIBLIO_RESULT.copyrightdate ) %]
87
            <span>
88
                Copyright year: [% BIBLIO_RESULT.copyrightdate %]
89
            </span><br/>
90
            [% END %]
91
92
            [% IF ( BIBLIO_RESULT.notes ) %]
93
            <span>
94
                Notes : [% BIBLIO_RESULT.notes %]
95
            </span><br/>
96
            [% END %]
97
98
            [% IF ( BIBLIO_RESULT.unititle ) %]
99
            <span>
100
                Unified title: [% BIBLIO_RESULT.unititle %]
101
            </span><br/>
102
            [% END %]
103
104
            [% IF ( BIBLIO_RESULT.serial ) %]
105
            <span>
106
                Serial: [% BIBLIO_RESULT.serial %]
107
            </span><br/>
108
            [% END %]
109
110
            [% IF ( BIBLIO_RESULT.dewey ) %]
111
            <span>
112
                Dewey: [% BIBLIO_RESULT.dewey %]
113
            </span><br/>
114
            [% END %]
115
116
            [% IF ( BIBLIO_RESULT.classification ) %]
117
            <span>
118
                Classification: [% BIBLIO_RESULT.classification %]
119
            </span><br/>
120
            [% END %]
121
122
            [% IF ( BIBLIO_RESULT.lccn ) %]
123
            <span>
124
                LCCN: [% BIBLIO_RESULT.lccn %]
125
            </span><br/>
126
            [% END %]
127
            [% IF ( BIBLIO_RESULT.url ) %]
128
            <span>
129
                URL: [% BIBLIO_RESULT.url |url %]
130
            </span>
131
            [% END %]
132
            </p>
133
134
            [% IF ( OPACBaseURL ) %]
135
            <p>
136
                In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]
137
            </p>
138
            [% END %]
139
            [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %]
140
            <p>Items:
141
            <ul>
142
                [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]<li>
143
                    [% ITEM_RESULT.branchname %]
144
                    [% ITEM_RESULT.location %]
145
                    [% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber %])[% END %]
146
                    [% ITEM_RESULT.barcode %]
147
                </li>[% END %]
148
            </ul>
149
            </p>
150
            [% END %]
151
            <hr/>
152
        </li>
153
    [% END %]
154
    </ol>
44
155
45
[% END %]
156
[% END %]
157
46
<END_MESSAGE>
158
<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