--- loncom/interface/Attic/londropadd.pm 2006/02/18 01:27:07 1.137 +++ loncom/interface/Attic/londropadd.pm 2006/05/01 19:37:33 1.141 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.137 2006/02/18 01:27:07 raeburn Exp $ +# $Id: londropadd.pm,v 1.141 2006/05/01 19:37:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,15 +43,9 @@ use Apache::lonlocal; ############################################################### ############################################################### sub header { - my $html=&Apache::lonxml::xmlbegin(); - my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager'); - my $title = &mt('LON-CAPA Enrollment Manager'); + my $start_page=&Apache::loncommon::start_page('Enrollment Manager'); return(< -$title - -$bodytag +$start_page
ENDHEAD @@ -911,7 +905,8 @@ sub make_dates_default { $result .= "Set default start and end dates for course
"; # # Refresh the course environment - &Apache::lonnet::coursedescription($env{'request.course.id'}); + &Apache::lonnet::coursedescription($env{'request.course.id'}, + {'freshen_cache' => 1}); } else { $result .= &mt('Unable to set default dates for course').":".$put_result. '
'; @@ -1187,10 +1182,11 @@ sub print_html_classlist { $env{'form.output'} = 'html'; } # - $r->print('
'); + $r->print('
'.&Apache::loncommon::start_data_table()); foreach my $role (sort keys %coursepersonnel) { next if ($role =~ /^\s*$/); - $r->print(''); + $r->print(''.&Apache::loncommon::end_data_table_row()); } - $r->print('
'.$role.''); + $r->print(&Apache::loncommon::start_data_table_row(). + ''.$role.''); foreach my $user (split(',',$coursepersonnel{$role})) { my ($puname,$pudom)=split(':',$user); $r->print(' '.&Apache::loncommon::aboutmewrapper( @@ -1198,9 +1194,9 @@ sub print_html_classlist { $pudom), $puname,$pudom)); } - $r->print('
'); + $r->print(&Apache::loncommon::end_data_table()); # # Interface output $r->print(' - +".&Apache::loncommon::start_data_table()." "); if ($mode eq 'autoenroll') { @@ -1445,7 +1441,7 @@ END } else { $end = &Apache::lonlocal::locallocaltime($end); } - $r->print("\n "); + $r->print(&Apache::loncommon::start_data_table_row()); if ($mode eq 'autoenroll') { my $lockedtype = $sdata->[$index{'lockedtype'}]; $studentcount++; @@ -1506,7 +1502,7 @@ END $r->print(' '); } } - $r->print(' '); + $r->print(&Apache::loncommon::end_data_table_row()); } elsif ($mode eq 'csv') { next if (! defined($CSVfile)); # no need to bother with $linkto @@ -1546,7 +1542,7 @@ END } } if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') { - $r->print('
 

'); + $r->print(&Apache::loncommon::end_data_table().'
'); } elsif ($mode eq 'excel') { $excel_workbook->close(); $r->print('

'. @@ -1586,7 +1582,7 @@ sub print_modify_student_form { '

'. &mt('Unable to retrieve environment data for').' '.$sname. &mt('in domain').' '.$sdom.'

'. - &mt('Please contact your LON-CAPA administrator regarding this situation.').'

'); + &mt('Please contact your LON-CAPA administrator regarding this situation.').'

'.&Apache::loncommon::end_page()); return; } # determine the students starting and ending times and section @@ -1675,8 +1671,8 @@ $lt{'disn'}

$current_date_description

$date_table

- END + $r->print(&Apache::loncommon::end_page()); return; } @@ -1684,7 +1680,7 @@ END # modify a single students section # sub modify_single_student { - my $r = shift; + my ($r) = @_; # # Remove non alphanumeric values from the section $env{'form.section'} =~ s/\W//g; @@ -1826,8 +1822,8 @@ END
$Masd - END + $r->print(&Apache::loncommon::end_page()); return; } @@ -1930,8 +1926,8 @@ my %lt=&Apache::lonlocal::texthash('usrn 'end' => "end date", ); if ($nosort) { + $r->print(&Apache::loncommon::start_data_table()); $r->print(<   $lt{'usrn'} @@ -1945,8 +1941,8 @@ my %lt=&Apache::lonlocal::texthash('usrn END } else { + $r->print(&Apache::loncommon::start_data_table()); $r->print(<   $lt{'usrn'} @@ -2006,8 +2002,8 @@ END my $status = $sdata->[$index{'status'}]; next if ($status ne 'Active'); # + $r->print(&Apache::loncommon::start_data_table_row()); $r->print(<<"END"); - $username $domain @@ -2016,10 +2012,10 @@ END $section $start $end - END + $r->print(&Apache::loncommon::end_data_table_row()); } - $r->print('
'); + $r->print(&Apache::loncommon::end_data_table().'
'); %lt=&Apache::lonlocal::texthash( 'dp' => "Drop Students", 'ca' => "check all", @@ -2056,7 +2052,7 @@ sub print_first_courselist_upload_form { $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV", &mt("How do I create a CSV file from a spreadsheet")). "
\n"; - $str .= "\n\n"; + $str .= &Apache::loncommon::end_page(); $r->print($str); return; } @@ -2112,7 +2108,7 @@ sub upfile_drop_add { if (! exists($home_servers{$desiredhost})) { $r->print(''.&mt('Error').''. &mt('Invalid home server specified')); - $r->print("\n\n"); + $r->print(&Apache::loncommon::end_page()); return; } } @@ -2392,16 +2388,15 @@ sub handler { # # Main switch on form.action and form.state, as appropriate if (! exists($env{'form.action'})) { - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Enrollment Manager')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment Manager')); &print_main_menu($r,$enrl_permission,$view_permission,$grp_manage_permission, $grp_view_permission); } elsif ($env{'form.action'} eq 'upload' && $enrl_permission) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=upload&state=', text=>"Upload Classlist"}); - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Upload Classlist','Course_Create_Class_List')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Upload Classlist', + 'Course_Create_Class_List')); if (! exists($env{'form.state'})) { &print_first_courselist_upload_form($r); } elsif ($env{'form.state'} eq 'got_file') { @@ -2419,8 +2414,8 @@ sub handler { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=drop', text=>"Drop Students"}); - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Drop Students','Course_Drop_Student')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Drop Students', + 'Course_Drop_Student')); if (! exists($env{'form.state'})) { &print_drop_menu($r); } elsif ($env{'form.state'} eq 'done') { @@ -2432,8 +2427,8 @@ sub handler { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=enrollstudent', text=>"Enroll Student"}); - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Enroll Student','Course_Add_Student')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enroll Student', + 'Course_Add_Student')); if (! exists($env{'form.state'})) { &get_student_username_domain_form($r); } elsif ($env{'form.state'} eq 'gotusername') { @@ -2447,8 +2442,8 @@ sub handler { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=classlist', text=>"View Classlist"}); - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'View Classlist','Course_View_Class_List')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('View Classlist', + 'Course_View_Class_List')); if (! exists($env{'form.state'})) { &print_html_classlist($r,undef); } elsif ($env{'form.state'} eq 'csv') { @@ -2462,8 +2457,8 @@ sub handler { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=modifystudent', text=>"Modify Student Data"}); - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Modify Student Data','Course_Modify_Student_Data')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Modify Student Data', + 'Course_Modify_Student_Data')); if (! exists($env{'form.state'})) { &print_html_classlist($r); } elsif ($env{'form.state'} eq 'selected') { @@ -2478,13 +2473,12 @@ sub handler { &Apache::lonnet::logthis("Undetermined state in londropadd.pm. ". "form.action = ".$env{'form.action'}. "Someone should fix this."); - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Enrollment Manager')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment Manager')); &print_main_menu($r,$enrl_permission,$view_permission); } # # Finish up - $r->print(''); + $r->print(''.&Apache::loncommon::end_page()); return OK; }