From 4ec0edc4e91806f24e9741b27b3ebf2fcecbf4aa Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Mar 2013 10:08:41 +0100 Subject: [PATCH] Bug 8215: Followup FIX QA issues --- C4/CourseReserves.pm | 5 ++- .../en/modules/course_reserves/add_items-step1.tt | 4 +-- .../en/modules/course_reserves/course-details.tt | 8 +++- .../en/modules/course_reserves/course-reserves.tt | 2 + .../prog/en/modules/course_reserves/course.tt | 2 +- t/db_dependent/CourseReserves.t | 34 ++++++++++---------- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm index f8ebb26..4737536 100644 --- a/C4/CourseReserves.pm +++ b/C4/CourseReserves.pm @@ -376,8 +376,9 @@ sub ModCourseInstructors { return unless ( $cardnumbers || $borrowernumbers ); return if ( $cardnumbers && $borrowernumbers ); - my @cardnumbers = @$cardnumbers if ( ref($cardnumbers) eq 'ARRAY' ); - my @borrowernumbers = @$borrowernumbers + my (@cardnumbers, @borrowernumbers); + @cardnumbers = @$cardnumbers if ( ref($cardnumbers) eq 'ARRAY' ); + @borrowernumbers = @$borrowernumbers if ( ref($borrowernumbers) eq 'ARRAY' ); my $field = (@cardnumbers) ? 'cardnumber' : 'borrowernumber'; 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 ab1b6ce..05bfe6d 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 @@ -36,9 +36,7 @@ $(document).ready(function() {
Add items: scan barcode - -

- +

  1. 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 3c91065..72f41fe 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 @@ -9,7 +9,7 @@ // @@ -39,7 +39,7 @@ }); function confirmDelete(p_oEvent){ - if ( ! confirm( _('Are you sure you want to delete this course?') ) ) { + if ( ! confirm( _("Are you sure you want to delete this course?") ) ) { YAHOO.util.Event.stopEvent( p_oEvent ); } } @@ -54,6 +54,7 @@ + @@ -64,8 +65,10 @@ +
    Course name[% course.course_name %]
    Term[% AuthorisedValues.GetByCode( 'TERM', course.term ) %]
    Department_[% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]
    Public note[% course.public_note %]
    Students count[% course.students_count %]
    Status[% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]
    + [% IF course_reserves %] @@ -177,6 +180,7 @@ [% END %]
    + [% END %] 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 dfae703..23d18ed 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 @@ -11,6 +11,8 @@ $(document).ready(function() { $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, { "sPaginationType": "four_button", + "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]], + "iDisplayLength": 20 })); }); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt index 14498fa..8568afc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt @@ -55,7 +55,7 @@ $(document).ready(function(){ }); function AddInstructor( name, cardnumber ) { - div = "
    " + name + " ( Remove )
    "; + div = "
    " + name + " ( Remove )
    "; $('#instructors').append( div ); $('#find_instructor').val('').focus(); diff --git a/t/db_dependent/CourseReserves.t b/t/db_dependent/CourseReserves.t index d8b6f36..d052a44 100755 --- a/t/db_dependent/CourseReserves.t +++ b/t/db_dependent/CourseReserves.t @@ -10,8 +10,8 @@ use Test::More tests => 16; use Data::Dumper; BEGIN { - use_ok('C4::Context'); - use_ok('C4::CourseReserves'); + use_ok('C4::Context'); + use_ok('C4::CourseReserves'); } my $dbh = C4::Context->dbh; @@ -21,38 +21,38 @@ $dbh->do("TRUNCATE TABLE course_reserves"); my $sth = $dbh->prepare("SELECT * FROM borrowers ORDER BY RAND() LIMIT 10"); $sth->execute(); -my @borrowers = @{$sth->fetchall_arrayref({})}; +my @borrowers = @{ $sth->fetchall_arrayref( {} ) }; $sth = $dbh->prepare("SELECT * FROM items ORDER BY RAND() LIMIT 10"); $sth->execute(); -my @items = @{$sth->fetchall_arrayref({})}; +my @items = @{ $sth->fetchall_arrayref( {} ) }; my $course_id = ModCourse( - course_name => "Test Course", - staff_note => "Test staff note", - public_note => "Test public note", + course_name => "Test Course", + staff_note => "Test staff note", + public_note => "Test public note", ); ok( $course_id, "ModCourse created course successfully" ); $course_id = ModCourse( - course_id => $course_id, - staff_note => "Test staff note 2", + course_id => $course_id, + staff_note => "Test staff note 2", ); -my $course = GetCourse( $course_id ); +my $course = GetCourse($course_id); -ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); -ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); +ok( $course->{'course_name'} eq "Test Course", "GetCourse returned correct course" ); +ok( $course->{'staff_note'} eq "Test staff note 2", "ModCourse updated course succesfully" ); my $courses = GetCourses(); ok( $courses->[0]->{'course_name'} eq "Test Course", "GetCourses returns valid array of course data" ); ModCourseInstructors( mode => 'add', course_id => $course_id, borrowernumbers => [ $borrowers[0]->{'borrowernumber'} ] ); -$course = GetCourse( $course_id ); -ok( $course->{'instructors'}->[0]->{'borrowernumber'} == $borrowers[0]->{'borrowernumber'}, "ModCourseInstructors added instructors correctly"); +$course = GetCourse($course_id); +ok( $course->{'instructors'}->[0]->{'borrowernumber'} == $borrowers[0]->{'borrowernumber'}, "ModCourseInstructors added instructors correctly" ); -my $course_instructors = GetCourseInstructors( $course_id ); +my $course_instructors = GetCourseInstructors($course_id); ok( $course_instructors->[0]->{'borrowernumber'} eq $borrowers[0]->{'borrowernumber'}, "GetCourseInstructors returns valid data" ); my $ci_id = ModCourseItem( 'itemnumber' => $items[0]->{'itemnumber'} ); @@ -77,8 +77,8 @@ DelCourseReserve( 'cr_id' => $cr_id ); $course_reserve = GetCourseReserve( 'cr_id' => $cr_id ); ok( !defined( $course_reserve->{'cr_id'} ), "DelCourseReserve functions correctly" ); -DelCourse( $course_id ); -$course = GetCourse( $course_id ); +DelCourse($course_id); +$course = GetCourse($course_id); ok( !defined( $course->{'course_id'} ), "DelCourse deleted course successfully" ); $dbh->do("TRUNCATE TABLE course_instructors"); -- 1.7.2.5