use warnings;
use strict;
-use CGI;
+use CGI qw ( -utf8 );
use Graphics::Magick;
use POSIX qw(ceil);
use autouse 'Data::Dumper' => qw(Dumper);
my $cgi = CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user({
- template_name => "patroncards/image-manage.tmpl",
+ template_name => "patroncards/image-manage.tt",
query => $cgi,
type => "intranet",
authnotrequired => 0,
debug => 0,
});
-my $image_name = $cgi->param('image_name') || '';
my $file_name = $cgi->param('uploadfile') || '';
+my $image_name = $cgi->param('image_name') || $file_name;
my $upload_file = $cgi->upload('uploadfile') || '';
my $op = $cgi->param('op') || 'none';
-my @image_ids = $cgi->param('image_id') if $cgi->param('image_id');
+my @image_ids = $cgi->multi_param('image_id') if $cgi->param('image_id');
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? }},
{image_id => {label => 'ID', link_field => 0}},
{image_name => {label => 'Name', link_field => 0}},
+ {_delete => {label => 'Delete', link_field => 0}},
{select => {label => 'Select', value => 'image_id'}},
],
};
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
+ error => $errstr,
);
}
else {
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
+ error => $errstr,
);
}
else {
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
+ error => $errstr,
image_limit => $image_limit,
);
}
DELETE_SUCCESSFULL => 0,
IMAGE_IDS => join(', ', @image_ids),
TABLE => $table,
- error => 1,
- $errstr => 1,
+ error => $errstr,
image_ids => join(',',@image_ids),
);
}
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
+ error => $errstr,
);
}