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.replace(/([$.:\[\],=@])/g, "\\$1") ).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 |
- |
|
|