View | Details | Raw Unified | Return to bug 19230
Collapse All | Expand All

(-)a/course_reserves/mod_course.pl (-6 / +6 lines)
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
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt (-1 / +3 lines)
Lines 210-215 Link Here
210
210
211
            $("#delete_course").click(function(){
211
            $("#delete_course").click(function(){
212
                [% SET count = course_reserves.size %]
212
                [% SET count = course_reserves.size %]
213
                [% UNLESS count %]
214
                    [% count = 0 %]
215
                [% END %]
213
                [% IF count == 1 %]
216
                [% IF count == 1 %]
214
                    return confirmDelete(_("Are you sure you want to delete this course? There is [% count %] attached item.") );
217
                    return confirmDelete(_("Are you sure you want to delete this course? There is [% count %] attached item.") );
215
                [% ELSIF count > 1 %]
218
                [% ELSIF count > 1 %]
216
- 

Return to bug 19230