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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt (-14 / +14 lines)
Lines 23-39 Link Here
23
                        [% IF ( batche.label_ids ) %]
23
                        [% IF ( batche.label_ids ) %]
24
                        <legend>[% batche.card_count | html %] Single patron cards</legend>
24
                        <legend>[% batche.card_count | html %] Single patron cards</legend>
25
                        <p>
25
                        <p>
26
                                <a class="document pdf" href="/cgi-bin/koha/patroncards/[% batche.create_script | html %]?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]]&amp;layout_back_id=[% batche.layout_back_id | html %]&amp;start_card=[% batche.start_card | html %][% batche.label_ids | html %]">label_single_[% batche.card_count | html %].pdf</a>
26
                                <a class="document pdf" href="/cgi-bin/koha/patroncards/[% batche.create_script | html %]?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]]&amp;layout_back_id=[% batche.layout_back_id | html %]&amp;start_card=[% batche.start_card | html %][% batche.label_ids | html %]&amp;order_by=[% order_by | html %]">label_single_[% batche.card_count | html %].pdf</a>
27
                        </p>
27
                        </p>
28
                        [% ELSIF ( batche.borrower_numbers ) %]
28
                        [% ELSIF ( batche.borrower_numbers ) %]
29
                        <legend>[% batche.card_count | html %] Single patron cards</legend>
29
                        <legend>[% batche.card_count | html %] Single patron cards</legend>
30
                        <p>
30
                        <p>
31
                                <a class="document pdf" href="/cgi-bin/koha/patroncards/[% batche.create_script | html %]?template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;layout_back_id=[% batche.layout_back_id | html %]&amp;start_card=[% batche.start_card | html %][% batche.borrower_numbers | html %]">label_single_[% batche.card_count | html %].pdf</a>
31
                                <a class="document pdf" href="/cgi-bin/koha/patroncards/[% batche.create_script | html %]?template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;layout_back_id=[% batche.layout_back_id | html %]&amp;start_card=[% batche.start_card | html %][% batche.borrower_numbers | html %]&amp;order_by=[% order_by | html %]">label_single_[% batche.card_count | html %].pdf</a>
32
                        </p>
32
                        </p>
33
                        [% ELSE %]
33
                        [% ELSE %]
34
                        <legend>Card batch number [% batche.batch_id | html %]</legend>
34
                        <legend>Card batch number [% batche.batch_id | html %]</legend>
35
                        <p>
35
                        <p>
36
                                <a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;layout_back_id=[% batche.layout_back_id | html %]&amp;start_card=[% batche.start_card | html %]">label_batch_[% batche.batch_id | html %].pdf</a>
36
                                <a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;layout_back_id=[% batche.layout_back_id | html %]&amp;start_card=[% batche.start_card | html %]&amp;order_by=[% order_by | html %]">label_batch_[% batche.batch_id | html %].pdf</a>
37
                        </p>
37
                        </p>
38
                        [% END %]
38
                        [% END %]
39
                    [% END %]
39
                    [% END %]
Lines 76-92 Link Here
76
                [% IF (patronlist_id) %] <input type="hidden" name="patronlist_id" value="[% patronlist_id | html %]" /> [% END %]
76
                [% IF (patronlist_id) %] <input type="hidden" name="patronlist_id" value="[% patronlist_id | html %]" /> [% END %]
77
                <fieldset class="rows">
77
                <fieldset class="rows">
78
                    <ol>
78
                    <ol>
79
                    [% IF (patronlist_id) %]
80
                        <li>
81
                            <label style="width:9em" for="order_by">Order by: </label>
82
                            <select name="order_by" id="order_by">
83
                                <option value=""></option>
84
                                <option value="cardnumber">Card number</option>
85
                                <option value="firstname">First name</option>
86
                                <option value="surname">Surname</option>
87
                            </select>
88
                        </li>
89
                    [% END %]
90
                        <li>
79
                        <li>
91
                            <label style="width:9em" for="template_id">Select a template to be applied: </label>
80
                            <label style="width:9em" for="template_id">Select a template to be applied: </label>
92
                            <select name="template_id" id="template_id">
81
                            <select name="template_id" id="template_id">
Lines 118-123 Link Here
118
                            <label style="width:9em" for="start_card">Enter starting card position: </label>
107
                            <label style="width:9em" for="start_card">Enter starting card position: </label>
119
                            <input type="text" size="5" id="start_card" name="start_card" class="focus" title="Starting card number" value="1" />
108
                            <input type="text" size="5" id="start_card" name="start_card" class="focus" title="Starting card number" value="1" />
120
                        </li>
109
                        </li>
110
                    [% IF patronlist_id || batch_id %]
111
                        <li>
112
                            <label style="width:9em" for="order_by">Order by: </label>
113
                            <select name="order_by" id="order_by">
114
                                <option value=""></option>
115
                                <option value="cardnumber">Card number</option>
116
                                <option value="firstname">First name</option>
117
                                <option value="surname">Surname</option>
118
                            </select>
119
                        </li>
120
                    [% END %]
121
                    </ol>
121
                    </ol>
122
                </fieldset>
122
                </fieldset>
123
                <fieldset class="action">
123
                <fieldset class="action">
(-)a/patroncards/create-pdf.pl (-2 / +24 lines)
Lines 86-97 my ($llx, $lly) = 0,0; Link Here
86
86
87
if (@label_ids) {
87
if (@label_ids) {
88
    my $batch_items = $batch->get_attr('items');
88
    my $batch_items = $batch->get_attr('items');
89
    my @borrowernumbers;
89
    grep {
90
    grep {
90
        my $label_id = $_;
91
        my $label_id = $_;
91
        push(@{$items}, grep{$_->{'label_id'} == $label_id;} @{$batch_items});
92
        push( @borrowernumbers, grep { $_->{'label_id'} == $label_id; } @{$batch_items} );
92
    } @label_ids;
93
    } @label_ids;
94
    @borrowernumbers = map { $_->{borrower_number} } @borrowernumbers;
95
    @borrowernumbers =
96
        map { $_->borrowernumber }
97
        Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } }, { order_by => [$order_by] } )
98
        ->as_list
99
        if ($order_by);
100
    grep { push( @{$items}, { borrower_number => $_ } ); } @borrowernumbers;
93
}
101
}
94
elsif (@borrower_numbers) {
102
elsif (@borrower_numbers) {
103
    @borrower_numbers =
104
        map { $_->borrowernumber }
105
        Koha::Patrons->search( { borrowernumber => { -in => \@borrower_numbers } }, { order_by => [$order_by] } )
106
        ->as_list
107
        if ($order_by);
95
    grep {
108
    grep {
96
        push(@{$items}, {borrower_number => $_});
109
        push(@{$items}, {borrower_number => $_});
97
    } @borrower_numbers;
110
    } @borrower_numbers;
Lines 106-112 elsif ( $patronlist_id ) { Link Here
106
    } @borrowerlist;
119
    } @borrowerlist;
107
}
120
}
108
else {
121
else {
109
    $items = $batch->get_attr('items');
122
    my $batch_items     = $batch->get_attr('items');
123
    my @borrowernumbers = map { $_->{borrower_number} } @{$batch_items};
124
    @borrowernumbers =
125
        map { $_->borrowernumber }
126
        Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } }, { order_by => [$order_by] } )
127
        ->as_list
128
        if ($order_by);
129
    grep {
130
        push(@{$items}, {borrower_number => $_});
131
    } @borrowernumbers;
110
}
132
}
111
133
112
my $layout_xml = XMLin($layout->get_attr('layout_xml'), ForceArray => 1);
134
my $layout_xml = XMLin($layout->get_attr('layout_xml'), ForceArray => 1);
(-)a/patroncards/print.pl (-1 / +3 lines)
Lines 73-78 if ($op eq 'export') { Link Here
73
        $template->param(
73
        $template->param(
74
                        batches     => \@batches,
74
                        batches     => \@batches,
75
                        referer     => $referer,
75
                        referer     => $referer,
76
                        order_by    => $order_by,
76
                        );
77
                        );
77
    }
78
    }
78
    elsif (@borrower_numbers) {
79
    elsif (@borrower_numbers) {
Lines 89-94 if ($op eq 'export') { Link Here
89
        $template->param(
90
        $template->param(
90
                        batches     => \@batches,
91
                        batches     => \@batches,
91
                        referer     => $referer,
92
                        referer     => $referer,
93
                        order_by    => $order_by,
92
                        );
94
                        );
93
    }
95
    }
94
    elsif (@batch_ids) {
96
    elsif (@batch_ids) {
Lines 104-109 if ($op eq 'export') { Link Here
104
        $template->param(
106
        $template->param(
105
                        batches     => \@batches,
107
                        batches     => \@batches,
106
                        referer     => $referer,
108
                        referer     => $referer,
109
                        order_by    => $order_by,
107
                        );
110
                        );
108
    }
111
    }
109
    elsif ($patronlist_id ) {
112
    elsif ($patronlist_id ) {
110
- 

Return to bug 32742