From c4d7ec20b01f69edf605751a5f3a2503bb7b04ff Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 21 Mar 2013 06:15:28 -0700 Subject: [PATCH] Bug 8215 - Add Course Reserves - QA Followup --- course_reserves/add_items.pl | 5 +-- course_reserves/course-details.pl | 5 +-- course_reserves/course-reserves.pl | 2 +- course_reserves/course.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 4 +++ .../en/modules/course_reserves/course-details.tt | 10 ++----- .../en/modules/course_reserves/course-reserves.tt | 9 +------ .../en/modules/course_reserves/invalid-course.tt | 24 ++++++++++++++++++++ 8 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index bbf67d5..bb770a3 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -36,15 +36,14 @@ my $action = $cgi->param('action') || ''; my $course_id = $cgi->param('course_id') || ''; my $barcode = $cgi->param('barcode') || ''; -die('No course_id provided') unless ($course_id); - my $item = GetBiblioFromItemNumber( undef, $barcode ); my $step = ( $action eq 'lookup' && $item ) ? '2' : '1'; +my $tmpl = ( $course_id ) ? "add_items-step$step.tt" : "invalid-course.tt"; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "course_reserves/add_items-step$step.tmpl", + template_name => "course_reserves/$tmpl", query => $cgi, type => "intranet", authnotrequired => 0, diff --git a/course_reserves/course-details.pl b/course_reserves/course-details.pl index a0b03e9..e1440f1 100755 --- a/course_reserves/course-details.pl +++ b/course_reserves/course-details.pl @@ -36,9 +36,10 @@ my $course_id = $cgi->param('course_id'); my $flagsrequired; $flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' ); +my $tmpl = ( $course_id ) ? "course-details.tt" : "invalid-course.tt"; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "course_reserves/course-details.tmpl", + template_name => "course_reserves/$tmpl", query => $cgi, type => "intranet", authnotrequired => 0, @@ -46,8 +47,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -die("No course_id given") unless ($course_id); - if ( $action eq 'del_reserve' ) { DelCourseReserve( cr_id => $cgi->param('cr_id') ); } diff --git a/course_reserves/course-reserves.pl b/course_reserves/course-reserves.pl index ebffed4..8b4e50e 100755 --- a/course_reserves/course-reserves.pl +++ b/course_reserves/course-reserves.pl @@ -35,7 +35,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $cgi, type => "intranet", authnotrequired => 0, - flagsrequired => {}, + flagsrequired => { coursereserves => '*' }, } ); diff --git a/course_reserves/course.pl b/course_reserves/course.pl index e2af77f..1a3d4a4 100755 --- a/course_reserves/course.pl +++ b/course_reserves/course.pl @@ -32,7 +32,7 @@ my $cgi = new CGI; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "course_reserves/course.tmpl", + template_name => "course_reserves/course.tt", query => $cgi, type => "intranet", authnotrequired => 0, diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index 53fc249..2cb8b80 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -13,6 +13,10 @@ function _(s) { return s; } // dummy function for gettext if($("#header_search #catalog_search").length > 0){ $(document).bind('keydown','Alt+q',function (){ $("#header_search").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); } $(".focus").focus(); + + $('.noEnterSubmit').keypress(function(e){ + if ( e.which == 13 ) return false; + }); }); // http://jennifermadden.com/javascript/stringEnterKeyDetector.html diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index 72f41fe..6b2f787 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -31,10 +31,6 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt index 23d18ed..c757518 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt @@ -33,16 +33,9 @@
-
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt new file mode 100644 index 0000000..d1ae392 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/invalid-course.tt @@ -0,0 +1,24 @@ +[% INCLUDE 'doc-head-open.inc' %] +Koha › Course reserves +[% INCLUDE 'doc-head-close.inc' %] + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'cat-search.inc' %] + + + +
+
+
+
+
+

Invalid course!

+
+
+
+
+
+ + +[% INCLUDE 'intranet-bottom.inc' %] -- 1.7.2.5