Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
Marc Véron b51f2baa7c Bug 14138: Patroncard: Warn user if PDF creation fails
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>
2016-07-15 15:00:56 +00:00

46 lines
3.4 KiB
HTML

[% IF ( error || CGI.param('pdferr') ) %]
<div class="dialog alert">
<p>
<strong>WARNING:</strong>
[% IF CGI.param('pdferr') %]
Error while creating PDF file.
[% IF CGI.param('errnocards') %]No cards created (empty batch or list?)[% END %]
[% IF CGI.param('errba') %]Batch: [% '<span class="ex">' _ CGI.param('errba') _ '</span>' %][% END %]
[% IF CGI.param('errpl') %]Patron list: [% '<span class="ex">' _ CGI.param('errpl') _ '</span>' %][% END %]
[% IF CGI.param('errpt') %]Patron number: [% '<span class="ex">' _ CGI.param('errpt') _ '</span>' %][% END %]
[% IF CGI.param('errlo') %]Layout: [% '<span class="ex">' _ CGI.param('errlo') _ '</span>' %][% END %]
[% IF CGI.param('errtpl') %]Template: [% '<span class="ex">' _ CGI.param('errtpl') _ '</span>' %][% END %]
Please have your system administrator check the error log for details.
[% END %]
[% IF ( error == 101 ) %]
The database returned an error while [% IF ( card_element ) %]saving [% card_element %] [% element_id %][% ELSE %]attempting a save operation[% END %]. Please have your system administrator check the error log for details.
[% ELSIF ( error == 102 ) %]
The database returned an error while [% IF ( card_element ) %]deleting [% card_element %] [% element_id %][% ELSIF ( image_ids ) %][% image_ids %][% ELSE %]attempting a delete operation[% END %]. Please have your system administrator check the error log for details.
[% ELSIF ( error == 201 ) %]
An unsupported operation was attempted[% IF ( element_id ) %] on [% card_element %] [% element_id %][% END %]. Please have your system administrator check the error log for details.
[% ELSIF ( error == 202 ) %]
An error has occurred. Please ask your system administrator to check the error log for more details.
[% ELSIF ( error == 203 ) %]
A non-existent or invalid library code was supplied. Please <a href="/cgi-bin/koha/circ/selectbranchprinter.pl">verify</a> that you have a library selected.
[% ELSIF ( error == 301 ) %]
An error has occurred while attempting to upload the image file. Please ask you system administrator to check the error log for more details.
[% ELSIF ( error == 302 ) %]
Image exceeds 500KB. Please resize and import again.
[% ELSIF ( error == 303 ) %]
The database image quota currently only allows a maximum of [% image_limit %] images to be stored at any one time. Please delete one or more images to free up quota space.
[% ELSIF ( error == 401 ) %]
An error has occurred and the item(s) was not added to batch [% batch_id %]. Please have your system administrator check the error log for details.
[% ELSIF ( error == 402 ) %]
The item(s) was not added because the library is not set. Please set your library before adding items to a batch.
[% ELSIF ( error == 403 ) %]
An error has occurred and the item(s) was not removed from batch [% batch_id %]. Please have your system administrator check the error log for details.
[% ELSIF ( error == 404 ) %]
An error has occurred and batch [% batch_id %] was not deleted. Please have your system administrator check the error log for details.
[% ELSIF ( error == 405 ) %]
An error has occurred and batch [% batch_id %] not fully de-duplicated.
[% ELSE %]
[% END %]
</p>
</div>
[% END %]