Bug 8215: Followup FIX QA issues
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This commit is contained in:
parent
a38032e469
commit
0ba129131c
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue