--- loncom/interface/loncreateuser.pm 2006/11/22 16:06:28 1.135 +++ loncom/interface/loncreateuser.pm 2006/11/23 00:04:09 1.137 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.135 2006/11/22 16:06:28 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.137 2006/11/23 00:04:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -623,7 +623,6 @@ END # Is this a custom role? Get role owner and title. my ($croleudom,$croleuname,$croletitle)= ($role_code=~/^cr\/(\w+)\/(\w+)\/(\w+)$/); - my $bgcol='ffffff'; my $allowed=0; my $delallowed=0; my $sortkey=$role_code; @@ -664,9 +663,6 @@ END } } # Compute the background color based on $area - $bgcol=$1.'_'.$2; - $bgcol=~s/[^7-9a-e]//g; - $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6); if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) { $carea.='
Section: '.$3; $sortkey.="\0$3"; @@ -706,9 +702,8 @@ END $allowed=0; } } - $bgcol='77FF77'; my $row = ''; - $row.=''; + $row.= ''; my $active=1; $active=0 if (($role_end_time) && ($now>$role_end_time)); if (($active) && ($allowed)) { @@ -745,7 +740,7 @@ END : ' ' ). ''.($role_end_time ?localtime($role_end_time) : ' ' ) - ."\n"; + .""; $sortrole{$sortkey}=$envkey; $roletext{$envkey}=$row; $roleclass{$envkey}=$class; @@ -758,30 +753,35 @@ END $output{$type} = ''; foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { if ( ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/ ) && ($rolepriv{$sortrole{$which}}) ) { - $output{$type}.=$roletext{$sortrole{$which}}; + $output{$type}.= + &Apache::loncommon::start_data_table_row(). + $roletext{$sortrole{$which}}. + &Apache::loncommon::end_data_table_row(); } } unless($output{$type} eq '') { - $output{$type} = "". - "".&mt($type)."". + $output{$type} = ''. + "".&mt($type)."". $output{$type}; $rolesdisplay = 1; } } if ($rolesdisplay == 1) { - $r->print(<print('
-

$lt{'rer'}

- - -END +

'.$lt{'rer'}.'

'. +&Apache::loncommon::start_data_table("LC_createuser"). +&Apache::loncommon::start_data_table_header_row(). +''. +&Apache::loncommon::end_data_table_header_row()); foreach my $type ('Construction Space','Course','Group','Domain','System','Unknown') { if ($output{$type}) { $r->print($output{$type}."\n"); } } - $r->print('
$lt{'rev'}$lt{'ren'}$lt{'del'}$lt{'rol'}$lt{'e -xt'}$lt{'sta'}$lt{'end'}'.$lt{'rev'}.''.$lt{'ren'}.''.$lt{'del'}. +''.$lt{'rol'}.''.$lt{'ext'}. +''.$lt{'sta'}.''.$lt{'end'}.'
'); + $r->print(&Apache::loncommon::end_data_table()); } } # End of unless my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain); @@ -1755,9 +1755,6 @@ sub course_level_table { my $area=$coursedata{'description'}; my $type=$coursedata{'type'}; if (!defined($area)) { $area=&mt('Unavailable course').': '.$protectedcourse; } - my $bgcol=$thiscourse; - $bgcol=~s/[^7-9a-e]//g; - $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6); my ($domain,$cnum)=split(/\//,$thiscourse); my %sections_count; if (defined($env{'request.course.id'})) { @@ -1769,18 +1766,17 @@ sub course_level_table { foreach my $role ('st','ta','ep','in','cc') { if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) { my $plrole=&Apache::lonnet::plaintext($role); - $table .= < - -$plrole -$area
Domain: $domain -ENDEXTENT + $table .= &Apache::loncommon::start_data_table_row(). +' +'.$plrole.' +'.$area.'
Domain: '.$domain.''."\n"; if ($role ne 'cc') { if (%sections_count) { my $currsec = &course_sections(\%sections_count,$protectedcourse.'_'.$role); $table .= - ''. - ' +'. +&Apache::loncommon::end_data_table_header_row(). +&Apache::loncommon::start_data_table_row(). +$table. +&Apache::loncommon::end_data_table_row(). +&Apache::loncommon::end_data_table(); return $result; } @@ -1899,8 +1898,12 @@ sub course_level_dc { 'sed' => "Set End Date" ); my $header = '

'.&mt('Course Level').'

'. - '
'.$lt{'exs'}.'
'. + '
'. + ' + '. ''. ' ENDTIMEENTRY - $table.= "\n"; + $table.= &Apache::loncommon::end_data_table_row(); } } foreach my $cust (sort keys %customroles) { @@ -1811,12 +1807,10 @@ ENDTIMEENTRY my $plrole=$cust; my $customrole=$protectedcourse.'_cr_cr_'.$env{'user.domain'}. '_'.$env{'user.name'}.'_'.$plrole; - $table .= < - - - -END + $table .= &Apache::loncommon::start_data_table_row(). +' + +'."\n"; if (%sections_count) { my $currsec = &course_sections(\%sections_count,$customrole); $table.= @@ -1839,20 +1833,25 @@ END "javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">$lt{'ssd'} +"javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">$lt{'sed'} ENDENTRY + $table .= &Apache::loncommon::end_data_table_row(); } } } return '' if ($table eq ''); # return nothing if there is nothing # in the table - my $result = <$lt{'crl'} -
'.$lt{'exs'}.'
'. $currsec.'
   '.$lt{'new'}.'
'. @@ -1803,7 +1799,7 @@ ENDEXTENT $lt{'sed'}
$plrole$area'.$plrole.''.$area.' $lt{'sed'}
- -$table -
$lt{'act'}$lt{'rol'}$lt{'ext'}$lt{'grs'}$lt{'sta'}$lt{'end'}
-ENDTABLE + my $result = ' +

'.$lt{'crl'}.'

'. +&Apache::loncommon::start_data_table(). +&Apache::loncommon::start_data_table_header_row(). +'
'.$lt{'act'}.''.$lt{'rol'}.''.$lt{'ext'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.'
'; - my $otheritems = ''. + &Apache::loncommon::end_data_table_header_row(); + my $otheritems = &Apache::loncommon::start_data_table_row(). + ' ENDTIMEENTRY - $otheritems .= "
'.$lt{'typ'}.''.$courseform.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.'
'.$lt{'typ'}.''.$courseform.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.'
\n"; + $otheritems .= &Apache::loncommon::end_data_table_row(). + &Apache::loncommon::end_data_table()."\n"; return $cb_jscript.$header.$hiddenitems.$otheritems; }