Can koha admin generate patron-card without making a batch (Tools › Patron card creator)? I was looking for a feature that administrator can generate the patron-card directly from Patron detail page. During my code browsing I found two files 'print.pl' and 'create-pdf.pl' in 'patroncards' folder. Good thing was there was already a GET parameter 'borrower_number' (@borrower_numbers) that seem to be used to generate the PDF for a list of borrower. So, I think there is/was a feature from where i could chose a list of patrons without making a Batch. This code also seem to have a bug! I didn't find any online browse-able code therefore a snip-it from create-pdf.pl is here: grep { push(@{$items}, {*item_number* => $_}); } @borrower_numbers; 'item_number' itself is not used anywhere. 'browser_number' is used to retrieved this data. foreach my $item (@{$items}) { if ($item) { my $borrower_number = $item->{'*borrower_number*'}; When I replaced second with the first one, it stared to generate the pdf local URL to test: http://waqar/cgi-bin/koha/patroncards/print.pl?borrower_number=19 -- Thanks & Best Regards, Waqar Azeem
On Fri, Oct 12, 2012 at 8:32 AM, Waqar Azeem <waqar.azeem@itcompletes.com> wrote:
This code also seem to have a bug!
I didn't find any online browse-able code therefore a snip-it from create-pdf.pl is here:
grep { push(@{$items}, {item_number => $_}); } @borrower_numbers;
'item_number' itself is not used anywhere. 'browser_number' is used to retrieved this data.
Indeed this is a bug. those lines should read: grep { push(@{$items}, {borrower_number => $_}); } @borrower_numbers; Correcting this bug will permit calling the print.pl script thus: patroncards/print.pl?borrower_number=X&borrower_number=Y.... allowing one to print single or multiple cards without batching. Please feel free to open a bug at bugs.koha-community.org and submit a patch or wait until I get around to it (probably in late December). Kind Regards, Chris
participants (2)
-
Chris Nighswonger -
Waqar Azeem