Lines 34-40
my $action = $cgi->param('action') || '';
Link Here
|
34 |
my $course_id = $cgi->param('course_id'); |
34 |
my $course_id = $cgi->param('course_id'); |
35 |
|
35 |
|
36 |
my $flagsrequired; |
36 |
my $flagsrequired; |
37 |
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' ); |
37 |
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' or $action eq 'rm_all' ); |
38 |
|
38 |
|
39 |
my $tmpl = ($course_id) ? "course-details.tt" : "invalid-course.tt"; |
39 |
my $tmpl = ($course_id) ? "course-details.tt" : "invalid-course.tt"; |
40 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
40 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
Lines 49-54
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
49 |
if ( $action eq 'del_reserve' ) { |
49 |
if ( $action eq 'del_reserve' ) { |
50 |
DelCourseReserve( cr_id => scalar $cgi->param('cr_id') ); |
50 |
DelCourseReserve( cr_id => scalar $cgi->param('cr_id') ); |
51 |
} |
51 |
} |
|
|
52 |
elsif ( $action eq 'rm_all' ) { |
53 |
my $course_res = GetCourseReserves(course_id => $course_id); |
54 |
foreach my $cr (@$course_res) { |
55 |
if(exists $cr->{'cr_id'}) { |
56 |
DelCourseReserve(cr_id => $cr->{cr_id}); |
57 |
} |
58 |
} |
59 |
} |
52 |
|
60 |
|
53 |
my $course = GetCourse($course_id); |
61 |
my $course = GetCourse($course_id); |
54 |
my $course_reserves = GetCourseReserves( |
62 |
my $course_reserves = GetCourseReserves( |