--- loncom/interface/loncreateuser.pm 2008/08/26 23:20:22 1.249.2.6
+++ loncom/interface/loncreateuser.pm 2008/07/07 23:54:27 1.250
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.249.2.6 2008/08/26 23:20:22 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.250 2008/07/07 23:54:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -967,7 +967,7 @@ sub display_existing_roles {
if (defined($coursedata{'description'})) {
$carea=$coursedata{'description'}.
'
'.&mt('Domain').': '.$coursedom.(' 'x8).
- &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$coursedir,$coursedom);
+ &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom);
$sortkey.="\0".$coursedata{'description'};
$class=$coursedata{'type'};
} else {
@@ -1396,12 +1396,10 @@ sub modify_login_block {
}
sub personal_data_display {
- my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_;
+ my ($ccuname,$ccdomain,$newuser,$context,$inst_results) = @_;
my ($output,$showforceid,%userenv,%canmodify);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
- my $rowcount = 0;
- my $editable = 0;
if (!$newuser) {
# Get the users information
%userenv = &Apache::lonnet::get('environment',
@@ -1409,10 +1407,7 @@ sub personal_data_display {
'permanentemail','id'],$ccdomain,$ccuname);
%canmodify =
&Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
- \@userinfo,$rolesarray);
- } elsif ($context eq 'selfcreate') {
- %canmodify = &selfcreate_canmodify($context,$ccdomain,\@userinfo,
- $inst_results,$rolesarray);
+ \@userinfo);
}
my %lt=&Apache::lonlocal::texthash(
'pd' => "Personal Data",
@@ -1421,7 +1416,7 @@ sub personal_data_display {
'lastname' => "Last Name",
'generation' => "Generation",
'permanentemail' => "Permanent e-mail address",
- 'id' => "Student/Employee ID",
+ 'id' => "ID/Student Number",
'lg' => "Login Data"
);
my %textboxsize = (
@@ -1437,93 +1432,40 @@ sub personal_data_display {
&Apache::lonhtmlcommon::start_pick_box();
foreach my $item (@userinfo) {
my $rowtitle = $lt{$item};
- my $hiderow = 0;
if ($item eq 'generation') {
$rowtitle = $genhelp.$rowtitle;
}
- my $row = &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n";
if ($newuser) {
if (ref($inst_results) eq 'HASH') {
if ($inst_results->{$item} ne '') {
- $row .= ''.$inst_results->{$item};
+ $output .= ''.$inst_results->{$item};
} else {
- if ($context eq 'selfcreate') {
- if ($canmodify{$item}) {
- $row .= '';
- $editable ++;
- } else {
- $hiderow = 1;
- }
- } else {
- $row .= '';
- }
+ $output .= '';
}
} else {
- if ($context eq 'selfcreate') {
- if ($canmodify{$item}) {
- $row .= '';
- $editable ++;
- } else {
- $hiderow = 1;
- }
- } else {
- $row .= '';
- }
+ $output .= '';
}
} else {
if ($canmodify{$item}) {
- $row .= '';
+ $output .= '';
} else {
- $row .= $userenv{$item};
+ $output .= $userenv{$item};
}
if ($item eq 'id') {
$showforceid = $canmodify{$item};
}
}
- $row .= &Apache::lonhtmlcommon::row_closure(1);
- if (!$hiderow) {
- $output .= $row;
- $rowcount ++;
- }
+ $output .= &Apache::lonhtmlcommon::row_closure(1);
}
$output .= &Apache::lonhtmlcommon::end_pick_box();
if (wantarray) {
- if ($context eq 'selfcreate') {
- return($output,$rowcount,$editable);
- } else {
- return ($output,$showforceid);
- }
+ return ($output,$showforceid);
} else {
return $output;
}
}
-sub selfcreate_canmodify {
- my ($context,$dom,$userinfo,$inst_results,$rolesarray) = @_;
- if (ref($inst_results) eq 'HASH') {
- my @inststatuses = &get_inststatuses($inst_results);
- if (@inststatuses == 0) {
- @inststatuses = ('default');
- }
- $rolesarray = \@inststatuses;
- }
- my %canmodify =
- &Apache::lonuserutils::can_modify_userinfo($context,$dom,$userinfo,
- $rolesarray);
- return %canmodify;
-}
-
-sub get_inststatuses {
- my ($insthashref) = @_;
- my @inststatuses = ();
- if (ref($insthashref) eq 'HASH') {
- if (ref($insthashref->{'inststatus'}) eq 'ARRAY') {
- @inststatuses = @{$insthashref->{'inststatus'}};
- }
- }
- return @inststatuses;
-}
-
# ================================================================= Phase Three
sub update_user_data {
my ($r,$context) = @_;
@@ -1847,7 +1789,7 @@ sub update_user_data {
$env{'form.c'.$item} = $userenv{$item};
}
}
- # Check to see if we can change the Student/Employee ID
+ # Check to see if we can change the ID/student number
my $forceid = $env{'form.forceid'};
my $recurseid = $env{'form.recurseid'};
my (%alerts,%rulematch,%idinst_results,%curr_rules,%got_rules);
@@ -1858,10 +1800,7 @@ sub update_user_data {
(!$forceid)) {
if ($env{'form.cid'} ne $uidhash{$env{'form.ccuname'}}) {
$env{'form.cid'} = $userenv{'id'};
- $no_forceid_alert = &mt('New Student/Employee ID does not match existing ID for this user.')
- .'
'
- .&mt("Change is not permitted without checking the 'Force ID change' checkbox on the previous page.")
- .'
'."\n";
+ $no_forceid_alert = &mt('New student/employeeID does not match existing ID for this user.').'
'.&mt('Change is not permitted without checking the \'Force ID change\' checkbox on the previous page.').'
'."\n";
}
}
if ($env{'form.cid'} ne $userenv{'id'}) {
@@ -1975,7 +1914,7 @@ sub update_user_data {
'mddl' => "middle",
'lst' => "last",
'gen' => "generation",
- 'id' => "Student/Employee ID",
+ 'id' => "ID/Student number",
'mail' => "permanent e-mail",
'disk' => "disk space allocated to portfolio files",
'prvs' => "Previous",
@@ -2058,7 +1997,7 @@ END
# They did not want to change the users name or quota but we can
# still tell them what the name and quota are
my %lt=&Apache::lonlocal::texthash(
- 'id' => "Student/Employee ID",
+ 'id' => "ID/Student number",
'mail' => "Permanent e-mail",
'disk' => "Disk space allocated to user's portfolio files",
);
@@ -2101,10 +2040,8 @@ END
$r->print(''.$rolestr.'
'.
&mt('Contact your helpdesk for more information.',"javascript:helpMenu('display')").'
');
}
- $r->print(''
- .$no_forceid_alert
- .&Apache::lonuserutils::print_namespacing_alerts($env{'form.ccdomain'},\%alerts,\%curr_rules)
- .'');
+ $r->print($no_forceid_alert.
+ &Apache::lonuserutils::print_namespacing_alerts($env{'form.ccdomain'},\%alerts,\%curr_rules));
}
if ($env{'form.action'} eq 'singlestudent') {
&enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context);
@@ -3412,32 +3349,14 @@ function getIndexByName(item) {
return -1;
}
ENDSCRIPT
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
-
my $output = ''."\n".
- '
'.$visactions->{'vis'}.'
'; - } else { - $output .= $visactions->{'miss'}.''.$visactions->{'gen'}.'
'.$visactions->{'coca'};
- if (ref($vismsgs) eq 'ARRAY') {
- $output .= '
'.$visactions->{'make'}.'