3 # Copyright 2012 ByWater Solutions
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 use C4::CourseReserves qw(DelCourse ModCourse ModCourseInstructors);
31 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32 { template_name => "about.tmpl",
36 flagsrequired => { coursereserves => 'manage_courses' },
40 my $action = $cgi->param('action') || '';
42 if ( $action eq 'del' ) {
43 DelCourse( $cgi->param('course_id') );
44 print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl");
48 $params{'course_id'} = $cgi->param('course_id')
49 if ( $cgi->param('course_id') );
50 $params{'department'} = $cgi->param('department');
51 $params{'course_number'} = $cgi->param('course_number');
52 $params{'section'} = $cgi->param('section');
53 $params{'course_name'} = $cgi->param('course_name');
54 $params{'term'} = $cgi->param('term');
55 $params{'staff_note'} = $cgi->param('staff_note');
56 $params{'public_note'} = $cgi->param('public_note');
57 $params{'students_count'} = $cgi->param('students_count');
58 $params{'enabled'} = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no';
60 my $course_id = ModCourse(%params);
62 my @instructors = $cgi->param('instructors');
65 cardnumbers => \@instructors,
66 course_id => $course_id
68 print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$course_id");