Bug 26777: (follow-up) Fix file permssions and tidy

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Lucas Gass 2024-06-21 17:15:57 +00:00 committed by Katrin Fischer
parent 049836607d
commit 00a641d356
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 15 additions and 14 deletions

6
installer/data/mysql/atomicupdate/bug_37118.pl Normal file → Executable file
View File

@ -9,10 +9,12 @@ return {
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Do you stuffs here
$dbh->do(q{
$dbh->do(
q{
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('OPACVirtualCard', '0', NULL,'Enable virtual library cards for patrons on the OPAC.', 'YesNo')
});
}
);
# sysprefs
say $out "Added new system preference 'OPACVirtualCard'";

23
opac/opac-virtual-card.pl Normal file → Executable file
View File

@ -19,39 +19,38 @@
use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user );
use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers );
use Koha::Libraries;
use Koha::Patrons;
my $query = CGI->new;
# if OPACVirtualCard is disabled, leave immediately
if ( ! C4::Context->preference('OPACVirtualCard') ) {
if ( !C4::Context->preference('OPACVirtualCard') ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");
exit;
}
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-virtual-card.tt",
query => $query,
type => "opac",
template_name => "opac-virtual-card.tt",
query => $query,
type => "opac",
}
);
my $patron = Koha::Patrons->find( $borrowernumber );
my $patron = Koha::Patrons->find($borrowernumber);
# Find and display patron image if allowed
if (C4::Context->preference('OPACpatronimages')) {
$template->param( display_patron_image => 1 ) if $patron->image;
}
if ( C4::Context->preference('OPACpatronimages') ) {
$template->param( display_patron_image => 1 ) if $patron->image;
}
$template->param(
virtualcardview => 1,
patron => $patron,
);
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };