There's no creating, updating, or deleting about printing patron cards, and
the only time there's a lot of data (selecting individual patrons in a card
creator batch), it doesn't matter if the "Export selected" URL exceeds the
maxlength for Apache since the actual link to create the PDF also will.
Test plan:
1. Without the patch, Tools - Patron lists - New patron list - Name it and
Save
2. Type three characters in the Patron search form (mar works well) to get
at least three patrons. Click on each of three, then click Add patrons
3. You can only print cards from the list of lists, so back to Tools -
Patron lists
4. In the Actions menu choose Print patron cards, in the popup click Export
5. Watch the throbber spin around for a while (it will never stop), then
close the popup, apply the patch, restart_all
6. Tools - Patron lists - Actions menu - Print patron cards - Export
7. Click the PDF link, make sure it has all three of your patrons
8. Tools - Patron card creator - New - Card batch
9. Without putting anything in the textarea, click Add patrons, in the
search popup search for your three characters (mar) again, and click
the checkboxes to the left of three of the names, then Add selected
patrons, then Close, then Add patrons
10. Click the checkboxes for two of the three patrons, then Export selected
card(s), then Export in the popup
11. Hover the link to the PDF, verify that it doesn't have stray 'amp;'
after the & and before label_id= anymore
12. Click the PDF link, verify it has your two patrons
13. Back at the card batch, click Export card batch, then Export
14. Check the PDF to verify it has all three of your patrons
15. Tools - Patron lists - click your list's name to open it
16. Click the card number for a patron, then the Patron lists tab in Checkout
17. Actions menu - Print patron cards - Export, verify the PDF has all three
patrons
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Looks like create-csv never made it.
Some op's look like GET to me. Creating a pdf is just downloading.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Error when saving Patron card Template:
Can't bless non-reference value at
/home/vagrant/kohaclone/C4/Creators/Profile.pm line 89
This is caused by the profile dropdown offering invalid choices and is
fixed by adding a filter to limit options to creator = 'Patroncards'.
The UI already handles the case where no valid profile is avaiable.
Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Test plan:
Create a new card batch and add new borrowernumber using the "Add
patron(s)" button.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch modifies the maximum size of a patron's image, from 500KB to
2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a
patron, you can now see the supported file types AND the maximum size.
The following places are affected by this patch:
- Home/Patrons/anyPatron
- Home/Tools/Upload patron images
- Home/Tools/Patron card creator/Images
To test:
1)Search for any patron and go to his page.
2)Hover over the image area on the left and click on the "Add" button.
3)Notice that the message above the choose file button only specifies
file types without the maximum size.
4)Add an image bigger than 500KB.
5)Nothing happens. (This is because the maximum size is 5KB)
6)Apply the patch.
7)Repeat steps from 1 to 3.
8)Notice that the message now includes the maximum size.
9)Add an image bigger than 500KB, but smaller than 2MB.
10)The image is succesfully uploaded.
11)Add an image bigger than 2MB.
12)Nothing happens. (The maximum size is now 2MB)
13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and
"Home/Tools/Patron card creator/Images".
14)Notice that the maximum size is updated.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch removes calls to CGI->param from within the templates
(patroncards-errors.inc) and passes error_* variables with the same
codes from the controllers to the template instead.
This way we can be sure CGI->param is not called in list context.
To test, try those pages and see they don't show warnings anymore.
Verify that error situations still show the error messages.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch removes warnings generated by the script itself.
To test:
- Go to Tools › Patron card creator › Manage layouts and
Tools › Patron card creator › New layout
- Add a new layout, adit existing.
=> FAIL: Warnings logged by edit-layout.pl
- Apply this patch
- Go to Tools › Patron card creator › Manage layouts and
Tools › Patron card creator › New layout
- Add a new layout, adit existing.
=> SUCCESS: No warnings generated by edit-layout.pl
- Sign off :-D
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
On bug 17591 we discovered that there was something weird going on with
the way we export and use subroutines/modules.
This patch tries to standardize our EXPORT to use EXPORT_OK only.
That way we will need to explicitely define the subroutine we want to
use from a module.
This patch is a squashed version of:
Bug 17600: After export.pl
Bug 17600: After perlimport
Bug 17600: Manual changes
Bug 17600: Other manual changes after second perlimports run
Bug 17600: Fix tests
And a lot of other manual changes.
export.pl is a dirty script that can be found on bug 17600.
"perlimport" is:
git clone https://github.com/oalders/App-perlimports.git
cd App-perlimports/
cpanm --installdeps .
export PERL5LIB="$PERL5LIB:/kohadevbox/koha/App-perlimports/lib"
find . \( -name "*.pl" -o -name "*.pm" \) -exec perl App-perlimports/script/perlimports --inplace-edit --no-preserve-unused --filename {} \;
The ideas of this patch are to:
* use EXPORT_OK instead of EXPORT
* perltidy the EXPORT_OK list
* remove '&' before the subroutine names
* remove some uneeded use statements
* explicitely import the subroutines we need within the controllers or
modules
Note that the private subroutines (starting with _) should not be
exported (and not used from outside of the module except from tests).
EXPORT vs EXPORT_OK (from
https://www.thegeekstuff.com/2010/06/perl-exporter-examples/)
"""
Export allows to export the functions and variables of modules to user’s namespace using the standard import method. This way, we don’t need to create the objects for the modules to access it’s members.
@EXPORT and @EXPORT_OK are the two main variables used during export operation.
@EXPORT contains list of symbols (subroutines and variables) of the module to be exported into the caller namespace.
@EXPORT_OK does export of symbols on demand basis.
"""
If this patch caused a conflict with a patch you wrote prior to its
push:
* Make sure you are not reintroducing a "use" statement that has been
removed
* "$subroutine" is not exported by the C4::$MODULE module
means that you need to add the subroutine to the @EXPORT_OK list
* Bareword "$subroutine" not allowed while "strict subs"
means that you didn't imported the subroutine from the module:
- use $MODULE qw( $subroutine list );
You can also use the fully qualified namespace: C4::$MODULE::$subroutine
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We should remove the debug statements or use Koha::Logger when we want
to keep it.
Test plan:
Confirm that occurrences of remaining occurrences of DEBUG need to be
kept (historical scripts for instance)
Confirm that the occurrences removed by this patch can be removed
Confirm that the occurrences replaced by Koha::Logger are correct
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks good to me, noting a few minor points on BZ.
JD amended patch: replace "warn #Finished" with "#warn Finished", and
put the statement on a single line
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We are using Koha::Logger when it makes sense to keep the info,
otherwise we simply remove it
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 28572: Replace missing occurrence in misc/admin/koha-preferences
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
There is a "debug" parameter we are passing from the controller scripts
to C4::Auth::get_template_and_user, but it's not actually used!
Test plan:
Confirm the assumption
Review the changes from this patch
Generated with:
perl -p -i -e 's#\s*debug\s*=\>\s*(0|1),?\s*##gms' **/*.pl
git checkout misc/devel/update_dbix_class_files.pl # Wrong catch
+ Manual fix in acqui/neworderempty.pl
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The various subpages of the label creator tool we're under the
'catalogue' permission. There is however a 'label_creator' subpermission
of tools which is more appropriate.
Test plan
1/ Setup a user with just the 'catelogue' permission (to enable logging
into the staff interface)
2/ With the patch applied you should not be able to access the following
pages (either via navigation in the UI or by typing them into the
browser address bar directly)
- /patroncards/add_user_search.pl
- /patroncards/edit-batch.pl
- /patroncards/edit-layout.pl
- /patroncards/edit-profile.pl
- /patroncards/edit-template.pl
- /patroncards/home.pl
- /patroncards/image-manage.pl
- /patroncards/manage.pl
- /patroncards/print.pl
3/ Signoff
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
It defaults to 0 in get_template_and_user
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds a .perlcriticrc (copied from qa-test-tools) and fixes
almost all perlcrictic violations according to this .perlcriticrc
The remaining violations are silenced out by appending a '## no critic'
to the offending lines. They can still be seen by using the --force
option of perlcritic
This patch also modify t/00-testcritic.t to check all Perl files using
the new .perlcriticrc.
I'm not sure if this test script is still useful as it is now equivalent
to `perlcritic --quiet .` and it looks like it is much slower
(approximatively 5 times slower on my machine)
Test plan:
1. Run `perlcritic --quiet .` from the root directory. It should output
nothing
2. Run `perlcritic --quiet --force .`. It should output 7 errors (6
StringyEval, 1 BarewordFileHandles)
3. Run `TEST_QA=1 prove t/00-testcritic.t`
4. Read the patch. Check that all changes make sense and do not
introduce undesired behaviour
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 9978 should have fixed them all, but some were missing.
We want all the license statements part of Koha to be identical, and
using the GPLv3 statement.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch was generated using codespell
Test plan:
Read through changes and confirm they make sense
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=21706
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds a 'description' column to the creator_batches table. The
description for a batch can be added and updated using ajax.
To test:
1) Apply patch and update database (you will have to restart memcached)
2) Go to Tools -> Patron card creator -> Manage batches
3) There should now be a Description column next to Batch ID. This
will be empty (as none of the batches have descriptions yet)
4) Click Edit for any batch
5) Notice new Batch description text field. Enter a description for
the batch in here and click Save description. Some text should show
saying the description was saved.
6) If you go back to the manage batches page, the description should
now show under the Description column.
7) Go to Tools -> Label Creator -> Manage labels
8) Repeat steps 3 to 6
Sponsored-by: Catalyst IT
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch corrects referential problems which caused the script to
"re-use" images as well as other sorts of bad image behaviour.
To test:
1. Ensure that you can reproduce the original bug or some variation thereof
using the steps described in either of these two comments:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604#c0https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604#c6
NOTE: This is not an easy bug to reproduce.
2. Once you can reproduce the bug, apply this patch and follow the same steps
used to reproduce the bug.
3. Observe that the symptoms are corrected.
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Reproduced the bug and resolved it with this patch.
Code is hard to read; exact cause of the problem was not fully uncovered.
Fixed spelling 'Destory' => 'Destroy'
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Test Plan:
Check the following files have been updated from
use strict;
use warnings;
to
use Modern::Perl;
create-pdf.pl
edit-batch.pl
edit-layout.pl
edit-profile.pl
edit-template.pl
home.pl
image-manage.pl
manage.pl
print.pl
Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch changes variable names as mentioned in comments #11 and #13
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Add a layout grid to patron card creator to figure out the positions of text
fields, barcode and images.
To test:
- Apply on top of patch 18465
- Go to Home > Tools > Patron card creator
- Edit or create a layout
- Turn on new choice 'Guide grid' in section 'General settings'
- Leave 'Units' unchanged
- Crate a PDF using 'Card batches'
- Notice that card is printed with a layout grid that reflects selected unit
with each 5th and 10th line in different color, unit description displayed
bottom left, card dimensions displayed top right in small print inside the
layout grid
- Print PDF. Set printer settings in Adobe Reader or other PDF printing
software to 'Actual size' to prevent scaling to printer's printable
region
- Mesure out printed PDF and verify that grid corresponds to selecte unit.
- Go back to layout definition and choose an other unit, repeat steps
to verify that grid respects selected unit.
- Go back to layout definition, turn grid off, create PDF, verify that grid
does not display in PDF
Note for testers / QAers: Position of card elements (text, image...) do not
respect the unit, this will be fixed in Bug 18550
Followed test plan and it worked as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
GetMember returned a patron given a borrowernumber, cardnumber or
userid.
All of these 3 attributes are defined as a unique key at the DB level
and so we can use Koha::Patrons->find to replace this subroutine.
Additionaly GetMember set category_type and description.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This followup fixes duplex printing with patron lists.
Additionaly, it uses simple copy instead of clone and removes a
superfluous line, see comments #15 - #17
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Card printers with duplex functionality need as input a PDF file where odd pages contain
the front side and even pages the back side of the cards.
This patch adds such functionality.
To prepare test:
- In Patron card creator > Templates, prepare a 1 up template (1 column / 1 row) that
fits to a single card. Give it a name like 'Duplex card template'
(Attention, Card with and Card height seem to have wrong labels, that will go
to a separate bug).
- In Patron card creator > Layouts create a layout for the front side and one for
the back side. Give them names to easily remember (Card front layout, Card back layout)
- Go to Patron card creator > Batches and test both layouts together with the
1 up template. Save and keepp both test files as reference.
To test:
- Apply patch. Restart memcached and plack.
- Go to Patron card creator > Batches
- Click "Export" for a batch
- In the following screen, note the new field "Select a layout for the back side"
with a hint what it is used for
- Leave it on 'Back side layout not used', export and compare output with test ooutput
from preparation. It should be the same
- Select the layout you prepared for the back side.
- Export - this file should contain 2 PDF pages per patron, one first with the
front side, second with the back side.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To reproduce:
1) Create a new layout
2) Select an unit in "Units selection"
3) Save
4) Edit layout again
5) Select other unit, e.g. 'SI Centimeter'
6) Save
7) Repeat
8) Edit again
Error: Latest unit seems to stick and can no longer be changed, because
in units drop down, multiple untis are marked as selected.
To test:
1) Apply patch
2) Repeat steps above, verify that value for units always display as expected.
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
To reproduce:
1. Make a new layout
2. Tick "Print card number as barcode"
3. Change 'Barcode Type' to anything other than Code39
4. Save
5. Edit it again
6. Its back to Code39
To test:
1. Apply patch
2. Repeat steps above
3. Verify that 'Barcode type' is selected as expected
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
https://bugs.koha-community.org/show_bug.cgi?id=18063https://bugs.koha-community.org/show_bug.cgi?id=8063
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
To recreate:
/cgi-bin/koha/patroncards/edit-template.pl?op=edit&element_id=23%20and%201%3d2+union+all+select+1,user(),@@version+--%20
Look at the Profile dropdown list.
To fix this problem and to make sure it does not appears anywhere else
in the label and patroncards modules, I have refactored the way the
queries are built in C4::Creators::Lib
Now all of the subroutine takes a hashref in parameters with a 'fields'
and 'filters' parameters.
From these 2 parameters the new internal subroutine _build_query will
build the query and use placeholders.
Test plan:
1/ Make sure you do not recreate the vulnerability with this patch
applied.
2/ With decent data in the labels and patroncards modules, compare all
the different view (undef the New and Manage button groups) with and
without this patch applied.
=> You should not see any differences.
This vulnerability has been reported by MDSec.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
- do not prepare statement when used only once
- remove use of Data::Dumper
- remove $duplicate, not needed
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch adds a check for duplicates before uploading the image.
To test:
1) Go to Tools -> Patron card creator -> Manage images
2) If you haven't already, upload an image
3) Try to upload another image with the same image name
4) Notice the first image is replaced with the second image, with no
warning.
5) Apply patch and refresh page
6) Try to upload an image with the same image name again
7) Notice you are now warned about a duplicate image name.
8) Check that uploading an image with a unique name still works.
Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch changes the code to use the filename of the uploaded image if
no specific image name is entered.
To test:
1) Go to Tools -> Patron card creator -> Manage images
2) Upload an image and leave the image name field empty
3) Notice this works and 'Name' is left empty.
4) Apply patch and refresh page
5) Upload an image and leave the image name field empty
6) Notice the image name is given the filename so that 'Name' is no
longer empty.
Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
As per Jonathan's comment in Comment 3, I've put that line of code in an
if statement that will only call the get_attr method if we are editing
an existing profile (therefore the profile id will exist).
To test:
1) Go to Tools -> Patron Card Creator -> New printer profile
2) Notice warn
3) Apply patch
4) Refresh page
5) Confirm warn is gone and page still works as expected
Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
The C4::Category module contained only 1 method to return the patron
categories available for the logged in user.
The new method Koha::Patron::Categories->search_limited does exactly the
same thing (see tests) and must be used in place of it.
Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to
other libraries.
- On the 'Item circulation alerts' admin page
(admin/item_circulation_alerts.pl), modify the settings for check-in
and checkout (NOTE: Should not we display all patron categories on
this page? If yes, it must be done in another bug report to ease
backporting it).
- Search for patrons in the admin (budget) and acquisition (order) module.
- On the patron home page (search form in the header)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Change patroncards/create-pdf.pl to redirect with an error message
instead of writing an invalid pdf that does not open in pdf viewer.
To test:
- Apply patch
- Test that pdf creator behaves as before (with valid batches and
patron lists)
- While testing, copy pdf link address from window with title 'Click
the following link(s) to download...'
- Open another staff client browser tab
- Paste link to browser address field, change batch id rsp. patron
list id to an invalid value and submit
- The window should redirect to cgi-bin/koha/patroncards/create-pdf.pl
and display an error message
- Bonus test 1: Create an empty patron list and test patron card
creation. You should get an error message as appropriate.
- Bonus test 2: Use a link with params like the following:
...create-pdf.pl?borrower_number=61&template_id=2&layout_id=1&start_card=1
Verify that you can create a pdf with a valid borrower_number and that
you get the error message with an invalid borrower number
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Currently, serials => 'routing' is required, which does not make any
sense.
It's a copy/paste error when this file has been created (you can blame
me).
Note that I am not sure catalogue is the correct permission, but it's
the one used almost everywhere in this module
Test plan:
Confirm that catalogue is enough to search for patrons to add to a
patron card.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To reproduce:
- Prepare a patron car layout with Image 1 using Patron Image
- Create a patron card for a patron without patron image
Result: OK, PDF can be opened wit PDF viewer
- Try to create a patron card with a patron who has a patron image
Result: The PDF file is corrupt (contains text only with error message)
intranet error log contains: create-pdf.pl: Illegal division
by zero at /usr/share/kohaclone/patroncards/create-pdf.pl line 200
To test:
- Apply patch
- Create a patron card with a patron who has a patron image
Result: PDF is OK and contains the image
Bonus test: Do the same with a card layout with an additional image
(Image 2: Image source: Other image)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Test and bonus test pass: PDF generated without errors.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This patch assigns $field and $image values in the for loops
To test:
1) Go to Tools -> Patron Card Creator -> New layout
2) Notice warns
3) Apply patch and refresh page
4) Notice warns are gone and page still works as expected
Sponsored-by: Catalyst IT
NOTE: Trivial initialization in a loop issue.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch replaces the occurrences of
my @foo = $cgi->param('foo');
with
my @foo = $cgi->multi_param('foo');
perl -p -i -e
's/^(\s*my\s*@\w+\s*=\s*)\$(cgi|input|query)\->param\(/$1\$$2\->multi_param\(/xms'
**/*.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
I can find no reference to card-print.pl being used in Koha. This patch
deletes it and its associated template.
To test, apply the patch and search for references to "card-print" in
Koha. There should be none.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This script does not work, it fails with 'Undefined subroutine
get_label_output_formats'. This subroutine was in C4::Labels::Lib which
has been removed by 2433a91 (Feb 8 2010): Removing depricated file from the
C4::Labels module.
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
To retrieve a patron image, we can call Koha::Patron::Images->find or
Koha::Patrons->find->image
Both will return a Koha::Patron::Image object.
Test plan:
1/ From the patron/member module, open all tabs on the left (Checkouts,
detail, fines, etc.)
The image should be correctly displayed.
2/ At the OPAC, on the patron details page (opac-memberentry.pl) the
image should be displayed as well.
3/ Same on the sco module.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>