From 00a641d3568d3f001d9594e580fd2f32f80ecebd Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 21 Jun 2024 17:15:57 +0000 Subject: [PATCH] Bug 26777: (follow-up) Fix file permssions and tidy Signed-off-by: Laura Escamilla Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../data/mysql/atomicupdate/bug_37118.pl | 6 +++-- opac/opac-virtual-card.pl | 23 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_37118.pl mode change 100644 => 100755 opac/opac-virtual-card.pl diff --git a/installer/data/mysql/atomicupdate/bug_37118.pl b/installer/data/mysql/atomicupdate/bug_37118.pl old mode 100644 new mode 100755 index 26d3554c94..4c3990c89f --- a/installer/data/mysql/atomicupdate/bug_37118.pl +++ b/installer/data/mysql/atomicupdate/bug_37118.pl @@ -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'"; diff --git a/opac/opac-virtual-card.pl b/opac/opac-virtual-card.pl old mode 100644 new mode 100755 index 423de58dcb..57bab5f493 --- a/opac/opac-virtual-card.pl +++ b/opac/opac-virtual-card.pl @@ -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 }; -- 2.39.5