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

(-)a/course_reserves/mod_course.pl (-1 / +1 lines)
Lines 62-68 if ( $action eq 'del' ) { Link Here
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
        borrowernumbers => \@instructors,
66
        course_id   => $new_course_id
66
        course_id   => $new_course_id
67
    );
67
    );
68
    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$new_course_id");
68
    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$new_course_id");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt (-10 / +9 lines)
Lines 79-86 Link Here
79
                            <span class="label">Instructors:</span>
79
                            <span class="label">Instructors:</span>
80
80
81
                            <fieldset id="course_instructors">
81
                            <fieldset id="course_instructors">
82
                                 <div id="instructors">[% FOREACH i IN instructors %]<div id="borrower_[% i.cardnumber | html %]">[% i.surname | html %], [% i.firstname | html %] ( <a href="#" class="removeInstructor"> Remove </a> )
82
                                 <div id="instructors">[% FOREACH i IN instructors %]<div id="borrower_[% i.borrowernumber | html %]">[% i.surname | html %], [% i.firstname | html %] ( <a href="#" class="removeInstructor"> Remove </a> )
83
                                             <input type='hidden' name='instructors' value='[% i.cardnumber | html %]' /></div>[% END %]</div>
83
                                             <input type='hidden' name='instructors' value='[% i.borrowernumber | html %]' /></div>[% END %]</div>
84
                            </fieldset>
84
                            </fieldset>
85
85
86
                            <fieldset>
86
                            <fieldset>
Lines 150-156 Link Here
150
                    source: "/cgi-bin/koha/circ/ysearch.pl",
150
                    source: "/cgi-bin/koha/circ/ysearch.pl",
151
                    minLength: 3,
151
                    minLength: 3,
152
                    select: function( event, ui ) {
152
                    select: function( event, ui ) {
153
                        AddInstructor( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber );
153
                        AddInstructor( ui.item.surname + ", " + ui.item.firstname, ui.item.borrowernumber );
154
                        return false;
154
                        return false;
155
                    }
155
                    }
156
                })
156
                })
Lines 168-188 Link Here
168
                $("body").on("click",".removeInstructor",function(e){
168
                $("body").on("click",".removeInstructor",function(e){
169
                    e.preventDefault();
169
                    e.preventDefault();
170
                    var divid = $(this).parent().attr("id");
170
                    var divid = $(this).parent().attr("id");
171
                    var cardnumber = divid.replace("borrower_","");
171
                    var borrowernumber = divid.replace("borrower_","");
172
                    RemoveInstructor(cardnumber);
172
                    RemoveInstructor(borrowernumber);
173
                });
173
                });
174
            });
174
            });
175
175
176
            function AddInstructor( name, cardnumber ) {
176
            function AddInstructor( name, borrowernumber ) {
177
                div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' class='removeInstructor'> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + cardnumber + "' /></div>";
177
                div = "<div id='borrower_" + borrowernumber + "'>" + name + " ( <a href='#' class='removeInstructor'> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + borrowernumber + "' /></div>";
178
                $('#instructors').append( div );
178
                $('#instructors').append( div );
179
179
180
                $('#find_instructor').val('').focus();
180
                $('#find_instructor').val('').focus();
181
                $('#course_instructors').show();
181
                $('#course_instructors').show();
182
            }
182
            }
183
183
184
            function RemoveInstructor( cardnumber ) {
184
            function RemoveInstructor( borrowernumber ) {
185
                $( '#borrower_' + cardnumber ).remove();
185
                $( '#borrower_' + borrowernumber ).remove();
186
186
187
                if ( ! $('#instructors').html() ) {
187
                if ( ! $('#instructors').html() ) {
188
                    $('#course_instructors').hide( 800 );
188
                    $('#course_instructors').hide( 800 );
189
- 

Return to bug 21349