Bug 8796 - patron cards not starting on designated card
authorMarc Véron <veron@veron.ch>
Sun, 29 Mar 2015 09:44:19 +0000 (11:44 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 9 Apr 2015 17:42:43 +0000 (14:42 -0300)
The patron cards always printed from position 1 on the print form, because patroncards/create-pdf.pl expected start_label as parameter and got star_card instead.

To verify and test:
1)
Go to Home > Tools >Patron card creator >Manage batches
2)
Select a batch anc click "Export"

3)
Set "Enter starting card number" e.g. to 5
4)
Export
5)
Download PDF and view it

Result: The first card is always printed on position 1 (top left) instead of position 5.

Apply patch
Repeat steps above
Step 3) should now read "Enter starting card position"

Result after step 5)
The first card ist printed at the correct position on the printing form.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Works as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Rebased for current master and tested. /MV

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt
patroncards/create-pdf.pl

index e8563b9..fd33c3f 100644 (file)
@@ -82,7 +82,7 @@
                             </select>
                         </li>
                         <li>
-                            <label style="width:9em" for="start_card">Enter starting card number: </label>
+                            <label style="width:9em" for="start_card">Enter starting card position: </label>
                             <input type="text" size="5" id="start_card" name="start_card" class="focus" title="Starting card number" value="1" />
                         </li>
                     </ol>
index 37df606..19ae31d 100755 (executable)
@@ -48,7 +48,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
 my $batch_id    = $cgi->param('batch_id') if $cgi->param('batch_id');
 my $template_id = $cgi->param('template_id') || undef;
 my $layout_id   = $cgi->param('layout_id') || undef;
-my $start_label = $cgi->param('start_label') || 1;
+my $start_card = $cgi->param('start_card') || 1;
 my @label_ids   = $cgi->param('label_id') if $cgi->param('label_id');
 my @borrower_numbers  = $cgi->param('borrower_number') if $cgi->param('borrower_number');
 
@@ -78,7 +78,7 @@ $pdf->Compress(1); # comment this out to debug pdf files, but be sure to uncomme
 $pdf->Mbox($lower_left_x, $lower_left_y, $upper_right_x, $upper_right_y);
 
 my ($llx, $lly) = 0,0;
-(undef, undef, $llx, $lly) = $pc_template->get_label_position($start_label);
+(undef, undef, $llx, $lly) = $pc_template->get_label_position($start_card);
 
 if (@label_ids) {
     my $batch_items = $batch->get_attr('items');