Bugzilla – Attachment 18284 Details for
Bug 8215
Add Course Reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8215: Followup FIX QA issues
Bug-8215-Followup-FIX-QA-issues.patch (text/plain), 9.00 KB, created by
Kyle M Hall (khall)
on 2013-05-21 20:26:03 UTC
(
hide
)
Description:
Bug 8215: Followup FIX QA issues
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-21 20:26:03 UTC
Size:
9.00 KB
patch
obsolete
>From b5d48db60273027d400c5abf91dc4a8274c570c9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 21 Mar 2013 10:08:41 +0100 >Subject: [PATCH] Bug 8215: Followup FIX QA issues > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > 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() { > > <fieldset class="rows"> > <legend>Add items: scan barcode</legend> >- >- <p> >- >+ <ol> > <li> > <label class="required" for="barcode">Item barcode:</label> > <input id="barcode" name="barcode" type="text" /> >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 @@ > //<![CDATA[ > > function confirmItemDelete(){ >- return confirm( _('Are you sure you want to delete this item?'); >+ return confirm( _("Are you sure you want to delete this item?")); > } > > //]]> >@@ -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 @@ > </div><!-- /toolbar --> > > <table> >+ <tbody> > <tr><th>Course name</th><td>[% course.course_name %]</td></tr> > <tr><th>Term</th><td>[% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</td></tr> > <tr><th>Department</th><td>_[% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</td></tr> >@@ -64,8 +65,10 @@ > <tr><th>Public note</th><td>[% course.public_note %]</td></tr> > <tr><th>Students count</th><td>[% course.students_count %]</td></tr> > <tr><th>Status</th><td>[% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]</td></tr> >+ </tbody> > </table> > >+ [% IF course_reserves %] > <table> > <thead> > <tr> >@@ -177,6 +180,7 @@ > [% END %] > </tbody> > </table> >+ [% END %] > </div> > </div> > </div> >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 = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' onclick='RemoveInstructor(" + cardnumber + ");'> Remove </a> ) <input type='hidden' name='instructors' value='" + cardnumber + "' /></div>"; >+ div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' onclick='RemoveInstructor(" + cardnumber + ");return false;'> Remove </a> ) <input type='hidden' name='instructors' value='" + cardnumber + "' /></div>"; > $('#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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8215
:
9990
|
10181
|
10224
|
11131
|
11612
|
11657
|
11677
|
11678
|
11679
|
11680
|
11681
|
11682
|
11683
|
11860
|
11861
|
11862
|
11865
|
11875
|
11881
|
11882
|
11980
|
12039
|
12120
|
12128
|
12188
|
12189
|
12192
|
12246
|
12361
|
12400
|
12413
|
12414
|
12593
|
12627
|
13496
|
13497
|
13498
|
13499
|
15195
|
15196
|
15197
|
15198
|
15199
|
16228
|
16229
|
16251
|
16252
|
16532
|
16533
|
16534
|
16536
|
16537
|
16545
|
16567
|
16568
|
16587
|
16588
|
16599
|
16621
|
16623
|
16634
|
17333
|
17334
|
17335
|
17336
|
17337
|
17377
|
17378
|
17379
|
17894
|
17895
|
17896
|
17897
|
17898
|
17899
|
18274
|
18275
|
18276
|
18277
|
18278
|
18279
|
18282
|
18283
| 18284 |
18285
|
18286
|
18287
|
18288
|
18289
|
18290
|
18291
|
18292
|
18293
|
21885
|
23264