[% BLOCK b_layout %]<span>Layout: </span>[% END %]
[% BLOCK b_template %]<span>Template: </span>[% END %]
-[% IF ( error || CGI.param('pdferr') ) %]
+[% IF ( error || error_pdferr ) %]
<div class="dialog alert">
<p>
<strong>WARNING:</strong>
- [% IF CGI.param('pdferr') %]<span>Error while creating PDF file. </span>
- [% IF CGI.param('errnocards') %]<span>No cards created (empty batch or list?) </span>[% END %]
- [% IF CGI.param('errba') %][% INCLUDE b_batch %]<span class="ex">[%- CGI.param('errba') | html -%]</span>[% END %]
- [% IF CGI.param('errpl') %][% INCLUDE b_patronlist %]<span class="ex">[%- CGI.param('errpl') | html -%]</span>][% END %]
- [% IF CGI.param('errpt') %][% INCLUDE b_patronnumber %]<span class="ex">[%- CGI.param('errpt') | html -%]</span>[% END %]
- [% IF CGI.param('errlo') %][% INCLUDE b_layout %]<span class="ex">[%- CGI.param('errlo') | html -%]</span>[% END %]
- [% IF CGI.param('errtpl') %][% INCLUDE b_template %]<span class="ex">[%- CGI.param('errtpl') | html -%]</span>[% END %]
+ [% IF error_pdferr %]<span>Error while creating PDF file. </span>
+ [% IF error_errnocards %]<span>No cards created (empty batch or list?) </span>[% END %]
+ [% IF error_errba %][% INCLUDE b_batch %]<span class="ex">[%- error_errba | html -%]</span>[% END %]
+ [% IF error_errpl %][% INCLUDE b_patronlist %]<span class="ex">[%- error_errpl | html -%]</span>][% END %]
+ [% IF error_errpt %][% INCLUDE b_patronnumber %]<span class="ex">[%- error_errpt | html -%]</span>[% END %]
+ [% IF error_errlo %][% INCLUDE b_layout %]<span class="ex">[%- error_errlo | html -%]</span>[% END %]
+ [% IF error_errtpl %][% INCLUDE b_template %]<span class="ex">[%- error_errtpl | html -%]</span>[% END %]
[% INCLUDE asksysadmin %]
[% END %]
my $bor_num_list = $cgi->param('bor_num_list') || undef;
my $branch_code = C4::Context->userenv->{'branch'};
+my @errors = ( 'pdferr', 'errnocards', 'errba', 'errpl', 'errpt', 'errlo', 'errtpl', );
+foreach my $param (@errors) {
+ my $error = $cgi->param($param) ? 1 : 0;
+ $template->param( 'error_' . $param => $error )
+ if $error;
+}
+
if ($op eq 'remove') {
$batch = C4::Patroncards::Batch->retrieve(batch_id => $batch_id);
foreach my $label_id (@label_ids) {
my $op = $cgi->param('op') || 'none';
my @image_ids = $cgi->multi_param('image_id');
+my @errors = ( 'pdferr', 'errnocards', 'errba', 'errpl', 'errpt', 'errlo', 'errtpl', );
+foreach my $param (@errors) {
+ my $error = $cgi->param($param) ? 1 : 0;
+ $template->param( 'error_' . $param => $error )
+ if $error;
+}
+
my $source_file = "$file_name"; # otherwise we end up with what amounts to a pointer to a filehandle rather than a user-friendly filename
my $display_columns = { image => [ #{db column => {label => 'col label', is link? }},
}
);
+my @errors = ( 'pdferr', 'errnocards', 'errba', 'errpl', 'errpt', 'errlo', 'errtpl', );
+foreach my $param (@errors) {
+ my $error = $cgi->param($param) ? 1 : 0;
+ $template->param( 'error_' . $param => $error )
+ if $error;
+}
+
my $op = $cgi->param('op') || 'none';
my $card_element = $cgi->param('card_element') || 'template'; # default to template management
my $element_id = $cgi->param('element_id') || 0; # there should never be an element with a id of 0 so this is a safe default