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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt (-23 / +1 lines)
Lines 22-48 Link Here
22
<body id="ser_routing-preview-slip" class="ser">
22
<body id="ser_routing-preview-slip" class="ser">
23
<div class="container-fluid">
23
<div class="container-fluid">
24
    <h1>[% tx("Routing slip for {title}", { title = title }) | html %]</h1>
24
    <h1>[% tx("Routing slip for {title}", { title = title }) | html %]</h1>
25
    <div class="page-section">
25
    <div class="page-section"> [% letter_content | $raw %] </div>
26
        <table>
27
            <tr>
28
                <td colspan="2"><h3>[% libraryname | html %]</h3></td>
29
            </tr>
30
            <tr>
31
                <td colspan="2"><strong>Title:</strong> [% title | html %]<br />[% issue | html %]</td>
32
            </tr>
33
            <tr>
34
                <td><strong>Name</strong></td>
35
                <td><strong>Date due</strong></td>
36
            </tr>
37
            [% FOREACH memberloo IN memberloop %]
38
                <tr>
39
                    <td>[% memberloo.name | html %]</td>
40
                    <td>&nbsp;</td>
41
                </tr>
42
            [% END %]
43
        </table>
44
    </div>
45
    <!-- /.page-section -->
46
26
47
    <div id="routingnotes">
27
    <div id="routingnotes">
48
        [%- SET RoutingListNote = AdditionalContents.get( location => "RoutingListNote", lang => lang, library => logged_in_user.branchcode ) -%]
28
        [%- SET RoutingListNote = AdditionalContents.get( location => "RoutingListNote", lang => lang, library => logged_in_user.branchcode ) -%]
Lines 56-63 Link Here
56
                [% END %]
36
                [% END %]
57
            </div>
37
            </div>
58
        [% END %]
38
        [% END %]
59
60
        <p id="routingnote">[% routingnotes | html %]</p>
61
    </div>
39
    </div>
62
40
63
    <nav class="navbar navbar-default fixed-bottom">
41
    <nav class="navbar navbar-default fixed-bottom">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt (-2 / +2 lines)
Lines 56-64 Link Here
56
                <select name="date_selected_top" id="date_selected_top" class="date_selected_top">
56
                <select name="date_selected_top" id="date_selected_top" class="date_selected_top">
57
                    [% FOREACH date IN dates %]
57
                    [% FOREACH date IN dates %]
58
                        [% IF ( date.selected ) %]
58
                        [% IF ( date.selected ) %]
59
                            <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
59
                            <option value="[% date.serialid | html %]" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
60
                        [% ELSE %]
60
                        [% ELSE %]
61
                            <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
61
                            <option value="[% date.serialid | html %]">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
62
                        [% END %]
62
                        [% END %]
63
                    [% END %]
63
                    [% END %]
64
                </select>
64
                </select>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (-1 / +1 lines)
Lines 315-321 Link Here
315
                                            [% IF ( routing ) %]
315
                                            [% IF ( routing ) %]
316
                                                <td class="actions">
316
                                                <td class="actions">
317
                                                    <a
317
                                                    <a
318
                                                        href="/cgi-bin/koha/serials/routing-preview.pl?op=print&amp;subscriptionid=[% serial.subscriptionid | uri %]&amp;issue=[% serial.serialseq.replace("'", "\\'") | uri %]%20([% serial.publisheddate | $KohaDates %])"
318
                                                        href="/cgi-bin/koha/serials/routing-preview.pl?op=print&amp;subscriptionid=[% serial.subscriptionid | uri %]&amp;issue=[% serial.serialid | uri %]"
319
                                                        class="btn btn-default btn-xs print_list"
319
                                                        class="btn btn-default btn-xs print_list"
320
                                                        ><i class="fa fa-print"></i> Print list</a
320
                                                        ><i class="fa fa-print"></i> Print list</a
321
                                                    >
321
                                                    >
(-)a/serials/routing-preview.pl (-21 / +37 lines)
Lines 26-36 use C4::Output qw( output_html_with_http_headers ); Link Here
26
use C4::Reserves qw( AddReserve ModReserve );
26
use C4::Reserves qw( AddReserve ModReserve );
27
use C4::Context;
27
use C4::Context;
28
use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing );
28
use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing );
29
use C4::Letters qw( GetPreparedLetter );
29
use URI::Escape;
30
use URI::Escape;
30
31
31
use Koha::Biblios;
32
use Koha::Biblios;
32
use Koha::Libraries;
33
use Koha::Libraries;
33
use Koha::Patrons;
34
use Koha::Patrons;
35
use Koha::Serials;
34
36
35
my $query          = CGI->new;
37
my $query          = CGI->new;
36
my $subscriptionid = $query->param('subscriptionid');
38
my $subscriptionid = $query->param('subscriptionid');
Lines 55-73 my $subs = GetSubscription($subscriptionid); Link Here
55
my ( $tmp, @serials ) = GetSerials($subscriptionid);
57
my ( $tmp, @serials ) = GetSerials($subscriptionid);
56
my ( $template, $loggedinuser, $cookie );
58
my ( $template, $loggedinuser, $cookie );
57
59
58
my $library;
60
# get biblio information....
59
if ( $op eq 'cud-save_and_preview' ) {
61
my $biblionumber = $subs->{'bibnum'};
60
62
61
    # get biblio information....
63
my $library;
62
    my $biblionumber = $subs->{'bibnum'};
64
my $biblio = Koha::Biblios->find($biblionumber);
65
my $items  = $biblio->items->search_ordered;
66
my $branch =
67
      $items->count
68
    ? $items->next->holding_branch->branchcode
69
    : $subs->{branchcode};
70
$library = Koha::Libraries->find($branch);
63
71
64
    my $biblio = Koha::Biblios->find($biblionumber);
72
if ( $op eq 'cud-save_and_preview' ) {
65
    my $items  = $biblio->items->search_ordered;
66
    my $branch =
67
          $items->count
68
        ? $items->next->holding_branch->branchcode
69
        : $subs->{branchcode};
70
    $library = Koha::Libraries->find($branch);
71
73
72
    if ( C4::Context->preference('RoutingListAddReserves') ) {
74
    if ( C4::Context->preference('RoutingListAddReserves') ) {
73
75
Lines 127-149 if ( $op eq 'cud-save_and_preview' ) { Link Here
127
129
128
$template->param( libraryname => $library->branchname ) if $library;
130
$template->param( libraryname => $library->branchname ) if $library;
129
131
130
my $memberloop = [];
132
my @borrowernumbers = map { $_->{borrowernumber} } @routinglist;
131
for my $routing (@routinglist) {
133
132
    my $member = Koha::Patrons->find( $routing->{borrowernumber} )->unblessed;
134
my $matching_serial;
133
    $member->{name} = "$member->{firstname} $member->{surname}";
135
if ($issue) {
134
    push @{$memberloop}, $member;
136
    my $serial_obj = Koha::Serials->find($issue);
137
    $matching_serial = $serial_obj->unblessed if $serial_obj;
135
}
138
}
136
139
137
my $routingnotes = $serials[0]->{'routingnotes'};
140
my $letter = GetPreparedLetter(
138
$routingnotes =~ s/\n/\<br \/\>/g;
141
    module                 => 'serial',
142
    letter_code            => 'ROUTING_LIST',
143
    message_transport_type => 'print',
144
    lang                   => 'default',
145
    tables                 => {
146
        subscription => $subscriptionid,
147
        biblio       => $subs->{bibnum},
148
        biblioitems  => $subs->{bibnum},
149
        branches     => $branch,
150
        serial       => $matching_serial ? $matching_serial->{serialid} : $serials[0]->{serialid},
151
152
    },
153
    loops => {
154
        borrowers => \@borrowernumbers,
155
    },
156
);
139
157
140
$template->param(
158
$template->param(
159
    letter_content                                   => $letter->{content},
141
    title                                            => $subs->{'bibliotitle'},
160
    title                                            => $subs->{'bibliotitle'},
142
    issue                                            => $issue,
161
    issue                                            => $issue,
143
    issue_escaped                                    => URI::Escape::uri_escape_utf8($issue),
162
    issue_escaped                                    => URI::Escape::uri_escape_utf8($issue),
144
    subscriptionid                                   => $subscriptionid,
163
    subscriptionid                                   => $subscriptionid,
145
    memberloop                                       => $memberloop,
146
    routingnotes                                     => $routingnotes,
147
    hasRouting                                       => check_routing($subscriptionid),
164
    hasRouting                                       => check_routing($subscriptionid),
148
    ( uc( C4::Context->preference("marcflavour") ) ) => 1
165
    ( uc( C4::Context->preference("marcflavour") ) ) => 1
149
);
166
);
150
- 

Return to bug 9750