From 477a554151c4f2995764a00c307f608e594cdc89 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 29 Jan 2024 16:47:38 -0300 Subject: [PATCH] Bug 34478: Manual fix - Add items (course reserves) Signed-off-by: Jonathan Druart --- course_reserves/add_items.pl | 13 ++++++------- .../en/modules/course_reserves/add_items-step1.tt | 4 ++-- .../en/modules/course_reserves/add_items-step2.tt | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index 85eaa9fa5f..bb1e25020a 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -26,7 +26,6 @@ use C4::Auth qw( get_template_and_user ); use C4::Circulation qw( barcodedecode ); use C4::Output qw( output_html_with_http_headers ); use C4::Koha qw( GetAuthorisedValues ); -use Koha::Items; use C4::CourseReserves qw( GetCourse GetCourseReserve ModCourse ModCourseItem ModCourseReserve ); @@ -35,7 +34,7 @@ use Koha::ItemTypes; my $cgi = CGI->new; -my $action = $cgi->param('action') || ''; +my $op = $cgi->param('op') || ''; my $course_id = $cgi->param('course_id') || ''; my $barcode = $cgi->param('barcode') || ''; my $return = $cgi->param('return') || ''; @@ -60,7 +59,7 @@ if ( $barcode || $itemnumber ) { $biblio = Koha::Biblios->find( $biblionumber ); } -my $step = ( $action eq 'lookup' && ( $item or $biblio ) ) ? '2' : '1'; +my $step = ( $op eq 'lookup' && ( $item or $biblio ) ) ? '2' : '1'; my $tmpl = ($course_id) ? "add_items-step$step.tt" : "invalid-course.tt"; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -71,7 +70,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -if ( !$item && !$biblio && $action eq 'lookup' ){ +if ( !$item && !$biblio && $op eq 'lookup' ){ $template->param( ERROR_ITEM_NOT_FOUND => 1 ); $template->param( UNKNOWN_BARCODE => $barcode ) if $barcode; $template->param( UNKNOWN_BIBLIONUMBER => $biblionumber ) if $biblionumber; @@ -79,7 +78,7 @@ if ( !$item && !$biblio && $action eq 'lookup' ){ $template->param( course => GetCourse($course_id) ); -if ( $action eq 'lookup' and $item ) { +if ( $op eq 'lookup' and $item ) { my $course_item = Koha::Course::Items->find({ itemnumber => $item->id }); my $course_reserve = ($course_item) @@ -103,7 +102,7 @@ if ( $action eq 'lookup' and $item ) { return => $return, ); -} elsif ( $action eq 'lookup' and $biblio ) { +} elsif ( $op eq 'lookup' and $biblio ) { my $course_item = Koha::Course::Items->find({ biblionumber => $biblio->biblionumber }); my $course_reserve = ($course_item) @@ -123,7 +122,7 @@ if ( $action eq 'lookup' and $item ) { return => $return, ); -} elsif ( $action eq 'cud-add' ) { +} elsif ( $op eq 'cud-add' ) { my $itype = scalar $cgi->param('itype'); my $ccode = scalar $cgi->param('ccode'); my $homebranch = $cgi->param('homebranch'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt index 26f183c30c..927b274fe2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt @@ -46,10 +46,10 @@ [% END %] [% END %] -
+ [% INCLUDE 'csrf-token.inc' %] - +
Add items: scan barcode diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt index cfbf43b31a..9ccd4458ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt @@ -63,7 +63,7 @@ [% INCLUDE 'csrf-token.inc' %] - + [% IF item # adding an item to course items %] -- 2.39.5