From: Arnie P. v. a. <we...@ma...> - 2005-09-28 01:08:06
|
Log Message: ----------- Make email addresses active on the classlist page just as they are on the student progress page. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.70 retrieving revision 1.71 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.70 -r1.71 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -1391,6 +1391,14 @@ my $items = $properties->{items}; my $synonyms = $properties->{synonyms}; + if ($type eq "email") { + if ($value eq ' ') { + return $value;} + else { + return CGI::a({-href=>"mailto:$value"},$value); + } + } + if ($access eq "readonly") { return $value; } @@ -1398,7 +1406,7 @@ if ($type eq "number" or $type eq "text") { return CGI::input({type=>"text", name=>$fieldName, value=>$value, size=>$size}); } - + if ($type eq "enumerable") { my $matched = undef; # Whether a synonym match has occurred @@ -1521,20 +1529,21 @@ # User Fields foreach my $field ($User->NONKEYFIELDS) { - my $fieldName = "user." . $User->user_id . "." . $field, + my $fieldName = 'user.' . $User->user_id . '.' . $field, my $fieldValue = $User->$field; my %properties = %{ FIELD_PROPERTIES()->{$field} }; - $properties{access} = "readonly" unless $editMode; + $properties{access} = 'readonly' unless $editMode; + $properties{type} = 'email' if ($field eq 'email_address' and !$editMode and !$passwordMode); $fieldValue = $self->nbsp($fieldValue) unless $editMode; push @tableCells, CGI::div({class=>$statusClass}, $self->fieldEditHTML($fieldName, $fieldValue, \%properties)); } # PermissionLevel Fields foreach my $field ($PermissionLevel->NONKEYFIELDS) { - my $fieldName = "permission." . $PermissionLevel->user_id . "." . $field, + my $fieldName = 'permission.' . $PermissionLevel->user_id . '.' . $field, my $fieldValue = $PermissionLevel->$field; my %properties = %{ FIELD_PROPERTIES()->{$field} }; - $properties{access} = "readonly" unless $editMode; + $properties{access} = 'readonly' unless $editMode; $fieldValue = $self->nbsp($fieldValue) unless $editMode; push @tableCells, CGI::div({class=>$statusClass}, $self->fieldEditHTML($fieldName, $fieldValue, \%properties)); } |