From 082d53a6caa41c6b5b9d8ecb8df585baa9cf6bf4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Sun, 3 Oct 2021 11:51:22 +0000 Subject: [PATCH] Bug 24698: QA fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is a squashed patch of the following patches: Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced The original patch "Bug 24698: Add plugin and template files for unimarc authority leader" doesn't work without explictly importing the methods from C4::Auth and C4::Output due to the default exports being changed in those modules after the patch was made. Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Remove debug info being outputted to the template This is only needed during development. Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Align variables with whitespace Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Remove dead code These were left off from the copy&paste taken from unimarc_field_100_authorities.pl Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Fix formatting and typos Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter It should only be used when we want to override the default of auth being required. Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Make plugin script executable Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Use spaces instead of tabs This makes the QA script happy. Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Don't specify select element's size if it is 1 This is to make the QA script happy, in order to not to break Bootstrap CSS rules, see Bug 28066 for more info Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (QA follow-up) Don't specify script type explictly It's makes the QA script complain because the option doesn't have any effect nowadays: https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features Signed-off-by: George Veranis Signed-off-by: Joonas Kylmälä Bug 24698: (follow-up) remove HTML select option for Series The IFLA authorities format specification defines only the letters a-l as possible values for authority leader 000 character position 9 ("Type of entity"). Therefore, the first option from the HTML select dropdown menu (" - Series") must be removed. Mentored-by: Andreas Roussos Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- .../unimarc_leader_authorities.pl | 22 +- .../unimarc_leader_authorities.tt | 354 +++++++++--------- 2 files changed, 181 insertions(+), 195 deletions(-) mode change 100644 => 100755 cataloguing/value_builder/unimarc_leader_authorities.pl diff --git a/cataloguing/value_builder/unimarc_leader_authorities.pl b/cataloguing/value_builder/unimarc_leader_authorities.pl old mode 100644 new mode 100755 index becdc574af..0f205611b3 --- a/cataloguing/value_builder/unimarc_leader_authorities.pl +++ b/cataloguing/value_builder/unimarc_leader_authorities.pl @@ -20,10 +20,10 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { @@ -52,35 +52,27 @@ sub plugin { my $index = $input->param('index'); my $result = $input->param('result'); - my $dbh = C4::Context->dbh; - - #my $defaultlanguage = C4::Context->preference("UNIMARCField100Language"); - # $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3); - my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "cataloguing/value_builder/unimarc_leader_authorities.tt", query => $input, type => "intranet", - authnotrequired => 0, flagsrequired => { editcatalogue => '*' }, - debug => 1, } ); $result = " nz a22 3 4500" unless $result; - - my $f5 = substr( $result, 5, 1 ); $f5 = wrapper( $f5 ) if $f5; - my $f6 = substr( $result, 6, 1 ); $f6 = wrapper( $f6 ) if $f6; - my $f9 = substr( $result, 9, 1 ); $f9 = wrapper( $f9 ) if $f9; - my $f17 = substr( $result, 17, 1 ); $f17 = wrapper( $f17 ) if $f17; + my $f5 = substr( $result, 5, 1 ); $f5 = wrapper( $f5 ) if $f5; + my $f6 = substr( $result, 6, 1 ); $f6 = wrapper( $f6 ) if $f6; + my $f9 = substr( $result, 9, 1 ); $f9 = wrapper( $f9 ) if $f9; + my $f17 = substr( $result, 17, 1 ); $f17 = wrapper( $f17 ) if $f17; $template->param( index => $index, "f5$f5" => 1, "f6$f6" => 1, "f9$f9" => 1, - "f17$f17" => 1, + "f17$f17" => 1, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_leader_authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_leader_authorities.tt index 6a9ce16861..390a7cc67d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_leader_authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_leader_authorities.tt @@ -8,193 +8,187 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1-4 Record length(auto-calculated)
- -
- -
- -
(auto-calculated)
- -
18-19 Undefined
20-24 Entry map & lengths(auto-filled)
1-4 Record length(auto-calculated)
+ +
+ +
+ +
(auto-calculated)
+ +
18-19 Undefined
20-24 Entry map & lengths(auto-filled)
Cancel
- -- 2.39.5