version 1.14, 2009/08/16 19:16:16
|
version 1.15, 2009/08/17 04:39:15
|
Line 689 sub print_request_form {
|
Line 689 sub print_request_form {
|
$r->print('<div>'.&Apache::lonhtmlcommon::start_pick_box().$codepicker. |
$r->print('<div>'.&Apache::lonhtmlcommon::start_pick_box().$codepicker. |
&Apache::lonhtmlcommon::end_pick_box().'</div>'); |
&Apache::lonhtmlcommon::end_pick_box().'</div>'); |
} else { |
} else { |
$r->print(&courseinfo_form($dom,$formname,$crstype)); |
$r->print(&courseinfo_form($dom,$formname,$crstype,$next)); |
} |
} |
} else { |
} else { |
$r->print(&courseinfo_form($dom,$formname,$crstype)); |
$r->print(&courseinfo_form($dom,$formname,$crstype,$next)); |
} |
} |
} elsif ($prev eq 'codepick') { |
} elsif ($prev eq 'codepick') { |
$r->print(&courseinfo_form($dom,$formname,$crstype)); |
$r->print(&courseinfo_form($dom,$formname,$crstype,$next)); |
} elsif ($state eq 'enrollment') { |
} elsif ($state eq 'enrollment') { |
if ($crstype eq 'official') { |
if ($crstype eq 'official') { |
&Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles, |
&Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles, |
Line 743 sub print_request_form {
|
Line 743 sub print_request_form {
|
push(@excluded,'instcode'); |
push(@excluded,'instcode'); |
} |
} |
$r->print(&Apache::lonhtmlcommon::echo_form_input(\@excluded).'</form>'); |
$r->print(&Apache::lonhtmlcommon::echo_form_input(\@excluded).'</form>'); |
&display_navbuttons($r,$formname,$prev,$navtxt{'prev'},$next,$navtxt{'next'}); |
&display_navbuttons($r,$formname,$prev,$navtxt{'prev'},$next,$navtxt{'next'},$state); |
return; |
return; |
} |
} |
|
|
Line 1216 sub print_review {
|
Line 1216 sub print_review {
|
$inst_headers .= '<th>'.&mt('Clone From').'</th>'; |
$inst_headers .= '<th>'.&mt('Clone From').'</th>'; |
if (($env{'form.clonecrs'} =~ /^$match_name$/) && |
if (($env{'form.clonecrs'} =~ /^$match_name$/) && |
($env{'form.clonedom'} =~ /^$match_domain$/)) { |
($env{'form.clonedom'} =~ /^$match_domain$/)) { |
my %coursehash = |
my $canclone = &Apache::loncoursequeueadmin::can_clone_course($env{'user.name'}, |
&Apache::lonnet::courseiddump($env{'form.clonedom'},'.',1,'.','.', |
$env{'user.domain'},$env{'form.clonecrs'}, $env{'form.clonedom'}); |
$env{'form.clonecrs'},undef,undef,'.'); |
if ($canclone) { |
my $cloneid = $env{'form.clonedom'}.'_'.$env{'form.clonecrs'}; |
my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'}, |
if (ref($coursehash{$cloneid}) eq 'HASH') { |
$env{'form.clonecrs'},('description','internal.coursecode')); |
$inst_headers .= '<th>'.$ctxt{'dsh'}.'</th>'; |
if (keys(%courseenv) > 0) { |
my $clonedesc = $coursehash{$cloneid}{'description'}; |
$inst_headers .= '<th>'.$ctxt{'dsh'}.'</th>'; |
my $cloneinst = $coursehash{$cloneid}{'inst_code'}; |
$inst_values .= '<td>'.$courseenv{'description'}.' '; |
|
my $cloneinst = $courseenv{'internal.coursecode'}; |
$inst_values .= '<td>'.$clonedesc.' '; |
if ($cloneinst ne '') { |
if ($cloneinst ne '') { |
$inst_values .= &mt('([_1] in [_2])',$cloneinst,$env{'form.clonedom'}); |
$inst_values .= &mt('([_1] in [_2])',$cloneinst,$env{'form.clonedom'}); |
} else { |
} else { |
$inst_values .= &mt('(from [_1])',$env{'form.clonedom'}); |
$inst_values .= &mt('(from [_1])',$env{'form.clonedom'}); |
} |
} |
$inst_values .= '</td><td>'; |
$inst_values .= '</td><td>'; |
if ($env{'form.datemode'} eq 'preserve') { |
if ($env{'form.datemode'} eq 'preserve') { |
$inst_values .= $ctxt{'pcd'}; |
$inst_values .= $ctxt{'pcd'}; |
} elsif ($env{'form.datemode'} eq 'shift') { |
} elsif ($env{'form.datemode'} eq 'shift') { |
$inst_values .= &mt('Shift dates by [_1] days',$env{'form.dateshift'}); |
$inst_values .= &mt('Shift dates by [_1] days',$env{'form.dateshift'}); |
} else { |
} else { |
$inst_values .= $ctxt{'ncd'}; |
$inst_values .= $ctxt{'ncd'}; |
} |
} |
$inst_values .= '</td>'; |
$inst_values .= '</td>'; |
} else { |
} else { |
$inst_values .= '<td>'.&mt('Unknown').'</td>'; |
$inst_values .= '<td>'.&mt('Unknown').'</td>'; |
} |
} |
} else { |
|
$inst_values .= '<td>'.&mt('Not permitted'),'</td>'; |
|
} |
} else { |
} else { |
$inst_values .= '<td>'.&mt('None').'</td>'; |
$inst_values .= '<td>'.&mt('None').'</td>'; |
} |
} |
Line 1346 sub dates_from_form {
|
Line 1348 sub dates_from_form {
|
} |
} |
|
|
sub courseinfo_form { |
sub courseinfo_form { |
my ($dom,$formname,$crstype) = @_; |
my ($dom,$formname,$crstype,$next) = @_; |
my $output = '<div>'.&Apache::lonhtmlcommon::start_pick_box(). |
my $nodescr = &mt('You must provide a (brief) course description.'); |
&Apache::lonhtmlcommon::row_title('Course Description'). |
my $js_validate = <<"ENDJS"; |
|
<script type="text/javascript"> |
|
// <![CDATA[' |
|
|
|
function validateForm() { |
|
if ((document.$formname.cdescr.value == "") || (document.$formname.cdescr.value == "undefined")) { |
|
alert('$nodescr'); |
|
return; |
|
} |
|
nextPage(document.$formname,'$next'); |
|
} |
|
// ]] |
|
</script> |
|
|
|
ENDJS |
|
|
|
my $output .= $js_validate."\n".'<div>'.&Apache::lonhtmlcommon::start_pick_box(). |
|
&Apache::lonhtmlcommon::row_title('Course Description'). |
'<input type="text" size="40" name="cdescr" />'; |
'<input type="text" size="40" name="cdescr" />'; |
my ($home_server_pick,$numlib) = |
my ($home_server_pick,$numlib) = |
&Apache::loncommon::home_server_form_item($dom,'chome', |
&Apache::loncommon::home_server_form_item($dom,'chome', |
Line 1510 sub get_course_dom {
|
Line 1529 sub get_course_dom {
|
} |
} |
|
|
sub display_navbuttons { |
sub display_navbuttons { |
my ($r,$formname,$prev,$prevtext,$next,$nexttext) = @_; |
my ($r,$formname,$prev,$prevtext,$next,$nexttext,$state) = @_; |
$r->print('<div class="LC_navbuttons">'); |
$r->print('<div class="LC_navbuttons">'); |
if ($prev) { |
if ($prev) { |
$r->print(' |
$r->print(' |
Line 1523 sub display_navbuttons {
|
Line 1542 sub display_navbuttons {
|
onclick="javascript:history.back()"/> |
onclick="javascript:history.back()"/> |
'); |
'); |
} |
} |
if ($next) { |
if ($state eq 'courseinfo') { |
|
$r->print(' |
|
<input type="button" name="next" value="'.$nexttext.'" onclick="javascript:validateForm();" />'); |
|
} elsif ($next) { |
$r->print(' |
$r->print(' |
<input type="button" name="next" value="'.$nexttext.'" |
<input type="button" name="next" value="'.$nexttext.'" |
onclick="javascript:nextPage(document.'.$formname.','."'".$next."'".')" />'); |
onclick="javascript:nextPage(document.'.$formname.','."'".$next."'".')" />'); |
Line 1653 sub print_request_outcome {
|
Line 1675 sub print_request_outcome {
|
if (exists($env{'form.instcode'})) { |
if (exists($env{'form.instcode'})) { |
$instcode = $env{'form.instcode'}; |
$instcode = $env{'form.instcode'}; |
} |
} |
|
my $clonecrs = ''; |
|
my $clonedom = ''; |
|
if (($env{'form.clonecrs'} =~ /^($match_courseid)$/) && |
|
($env{'form.clonedom'} =~ /^($match_domain)$/)) { |
|
my $clonehome = &Apache::lonnet::homeserver($env{'form.clonedom'},$env{'form.clonecrs'}); |
|
if ($clonehome ne 'no_host') { |
|
my $canclone = &can_clone_course($env{'user.name'},$env{'user.domain'}, |
|
$env{'form.clonecrs'}, $env{'form.clonedom'}); |
|
if ($canclone) { |
|
$clonecrs = $env{'form.clonecrs'}; |
|
$clonedom = $env{'form.clonedom'}; |
|
} |
|
} |
|
} |
my $details = { |
my $details = { |
owner => $env{'user.name'}, |
owner => $env{'user.name'}, |
domain => $env{'user.domain'}, |
domain => $env{'user.domain'}, |
Line 1662 sub print_request_outcome {
|
Line 1698 sub print_request_outcome {
|
cdescr => $env{'form.cdescr'}, |
cdescr => $env{'form.cdescr'}, |
crstype => $env{'form.crstype'}, |
crstype => $env{'form.crstype'}, |
instcode => $instcode, |
instcode => $instcode, |
clonedom => $env{'form.clonedom'}, |
clonedom => $clonedom, |
clonecrs => $env{'form.clonecrs'}, |
clonecrs => $clonecrs, |
datemode => $env{'form.datemode'}, |
datemode => $env{'form.datemode'}, |
dateshift => $env{'form.dateshift'}, |
dateshift => $env{'form.dateshift'}, |
sectotal => $sectotal, |
sectotal => $sectotal, |