|
Lines 38-52
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 38 |
); |
38 |
); |
| 39 |
|
39 |
|
| 40 |
my $action = $cgi->param('action') || ''; |
40 |
my $action = $cgi->param('action') || ''; |
|
|
41 |
my $course_id = $cgi->param('course_id'); |
| 41 |
|
42 |
|
| 42 |
if ( $action eq 'del' ) { |
43 |
if ( $action eq 'del' ) { |
| 43 |
DelCourse( $cgi->param('course_id') ); |
44 |
DelCourse( $course_id ); |
| 44 |
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl"); |
45 |
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl"); |
| 45 |
} else { |
46 |
} else { |
| 46 |
my %params; |
47 |
my %params; |
| 47 |
|
48 |
|
| 48 |
$params{'course_id'} = $cgi->param('course_id') |
49 |
$params{'course_id'} = $course_id; |
| 49 |
if ( $cgi->param('course_id') ); |
|
|
| 50 |
$params{'department'} = $cgi->param('department'); |
50 |
$params{'department'} = $cgi->param('department'); |
| 51 |
$params{'course_number'} = $cgi->param('course_number'); |
51 |
$params{'course_number'} = $cgi->param('course_number'); |
| 52 |
$params{'section'} = $cgi->param('section'); |
52 |
$params{'section'} = $cgi->param('section'); |
|
Lines 57-69
if ( $action eq 'del' ) {
Link Here
|
| 57 |
$params{'students_count'} = $cgi->param('students_count'); |
57 |
$params{'students_count'} = $cgi->param('students_count'); |
| 58 |
$params{'enabled'} = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no'; |
58 |
$params{'enabled'} = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no'; |
| 59 |
|
59 |
|
| 60 |
my $course_id = ModCourse(%params); |
60 |
my $new_course_id = ModCourse(%params); |
| 61 |
|
61 |
|
| 62 |
my @instructors = $cgi->multi_param('instructors'); |
62 |
my @instructors = $cgi->multi_param('instructors'); |
| 63 |
ModCourseInstructors( |
63 |
ModCourseInstructors( |
| 64 |
mode => 'replace', |
64 |
mode => 'replace', |
| 65 |
cardnumbers => \@instructors, |
65 |
cardnumbers => \@instructors, |
| 66 |
course_id => $course_id |
66 |
course_id => $new_course_id |
| 67 |
); |
67 |
); |
| 68 |
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$course_id"); |
68 |
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$new_course_id"); |
| 69 |
} |
69 |
} |