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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt (-1 / +12 lines)
Lines 40-46 Link Here
40
                <div id="export_patron_list">
40
                <div id="export_patron_list">
41
                    <h3>Click on the link to download the patron cards from the patron list.</h3>
41
                    <h3>Click on the link to download the patron cards from the patron list.</h3>
42
                    <p>
42
                    <p>
43
                        <a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?patronlist_id=[% patronlist_id | html %]&amp;template_id=[% template_id | html %]&amp;layout_id=[% layout_id | html %]&amp;layout_back_id=[% layout_back_id | html %]&amp;start_card=[% start_card | html %]">label_patronlist_[% patronlist_id | html %].pdf</a>
43
                        <a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?patronlist_id=[% patronlist_id | html %]&amp;template_id=[% template_id | html %]&amp;layout_id=[% layout_id | html %]&amp;layout_back_id=[% layout_back_id | html %]&amp;start_card=[% start_card | html %]&amp;order_by=[% order_by | html %]">label_patronlist_[% patronlist_id | html %].pdf</a>
44
                    </p>
44
                    </p>
45
                </div>
45
                </div>
46
            [% ELSE %]
46
            [% ELSE %]
Lines 69-74 Link Here
69
                [% IF (patronlist_id) %] <input type="hidden" name="patronlist_id" value="[% patronlist_id | html %]" /> [% END %]
69
                [% IF (patronlist_id) %] <input type="hidden" name="patronlist_id" value="[% patronlist_id | html %]" /> [% END %]
70
                <fieldset class="rows">
70
                <fieldset class="rows">
71
                    <ol>
71
                    <ol>
72
                    [% IF (patronlist_id) %]
73
                        <li>
74
                            <label style="width:9em" for="order_by">Order by: </label>
75
                            <select name="order_by" id="order_by">
76
                                <option value=""></option>
77
                                <option value="cardnumber">Card number</option>
78
                                <option value="firstname">First name</option>
79
                                <option value="surname">Surname</option>
80
                            </select>
81
                        </li>
82
                    [% END %]
72
                        <li>
83
                        <li>
73
                            <label style="width:9em" for="template_id">Select a template to be applied: </label>
84
                            <label style="width:9em" for="template_id">Select a template to be applied: </label>
74
                            <select name="template_id" id="template_id">
85
                            <select name="template_id" id="template_id">
(-)a/patroncards/create-pdf.pl (+2 lines)
Lines 49-54 my $start_card = $cgi->param('start_card') || 1; Link Here
49
my @label_ids   = $cgi->multi_param('label_id');
49
my @label_ids   = $cgi->multi_param('label_id');
50
my @borrower_numbers  = $cgi->multi_param('borrower_number');
50
my @borrower_numbers  = $cgi->multi_param('borrower_number');
51
my $patronlist_id = $cgi->param('patronlist_id');
51
my $patronlist_id = $cgi->param('patronlist_id');
52
my $order_by = $cgi->param('order_by') || undef;
52
53
53
my $items = undef; # items = cards
54
my $items = undef; # items = cards
54
my $new_page = 0;
55
my $new_page = 0;
Lines 99-104 elsif ( $patronlist_id ) { Link Here
99
    my ($list) = GetPatronLists( { patron_list_id => $patronlist_id } );
100
    my ($list) = GetPatronLists( { patron_list_id => $patronlist_id } );
100
    my @borrowerlist = $list->patron_list_patrons()->search_related('borrowernumber')
101
    my @borrowerlist = $list->patron_list_patrons()->search_related('borrowernumber')
101
    ->get_column('borrowernumber')->all();
102
    ->get_column('borrowernumber')->all();
103
    @borrowerlist =  map { $_->borrowernumber } Koha::Patrons->search( {borrowernumber => { -in => \@borrowerlist }}, { order_by => [$order_by]} )->as_list if($order_by);
102
    grep {
104
    grep {
103
        push(@{$items}, {borrower_number => $_});
105
        push(@{$items}, {borrower_number => $_});
104
    } @borrowerlist;
106
    } @borrowerlist;
(-)a/patroncards/print.pl (-1 / +2 lines)
Lines 47-52 my $start_card = $cgi->param('start_card') || 1; Link Here
47
my @borrower_numbers = $cgi->multi_param('borrower_number');
47
my @borrower_numbers = $cgi->multi_param('borrower_number');
48
my $output_format = $cgi->param('output_format') || 'pdf';
48
my $output_format = $cgi->param('output_format') || 'pdf';
49
my $referer = $cgi->param('referer') || undef;
49
my $referer = $cgi->param('referer') || undef;
50
my $order_by = $cgi->param('order_by') || undef;
50
51
51
my $layouts = undef;
52
my $layouts = undef;
52
my $templates = undef;
53
my $templates = undef;
Lines 113-118 if ($op eq 'export') { Link Here
113
                         layout_back_id  => $layout_back_id,
114
                         layout_back_id  => $layout_back_id,
114
                         start_card      => $start_card,
115
                         start_card      => $start_card,
115
                         referer         => $referer,
116
                         referer         => $referer,
117
                         order_by        => $order_by,
116
                        );
118
                        );
117
    }
119
    }
118
}
120
}
119
- 

Return to bug 32742