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;
31 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33 template_name => "about.tmpl",
37 flagsrequired => { coursereserves => 'manage_courses' },
41 my $action = $cgi->param('action');
43 if ( $action eq 'del' ) {
44 DelCourse( $cgi->param('course_id') );
45 print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl");
50 $params{'course_id'} = $cgi->param('course_id')
51 if ( $cgi->param('course_id') );
52 $params{'department'} = $cgi->param('department');
53 $params{'course_number'} = $cgi->param('course_number');
54 $params{'section'} = $cgi->param('section');
55 $params{'course_name'} = $cgi->param('course_name');
56 $params{'term'} = $cgi->param('term');
57 $params{'staff_note'} = $cgi->param('staff_note');
58 $params{'public_note'} = $cgi->param('public_note');
59 $params{'students_count'} = $cgi->param('students_count');
60 $params{'enabled'} = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no';
62 my $course_id = ModCourse(%params);
64 my @instructors = $cgi->param('instructors');
67 cardnumbers => \@instructors,
68 course_id => $course_id
71 "/cgi-bin/koha/course_reserves/course-details.pl?course_id=$course_id");