--- loncom/interface/lonnotify.pm 2005/10/11 21:29:39 1.4 +++ loncom/interface/lonnotify.pm 2005/10/13 22:37:40 1.5 @@ -176,9 +176,7 @@ ENDONE $output .= ''; my @domcc = (); foreach my $server (keys %personnel) { - print STDERR "key level 1 is $server\n"; foreach my $user (sort(keys %{$personnel{$server}})) { - print STDERR "key level 2 is $user\n"; my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user); unless (grep/^$uname:$udom$/,@domcc) { my %userinfo = &Apache::lonnet::get('environment',['lastname','firstname'],$udom,$uname); @@ -289,7 +287,7 @@ ENDONE $recipients .= $dcmail{$msgid}{recipients}{$user}.', '; } $recipients =~ s/,\s$//; - $output .= ''.$date.''.$dcmail{$msgid}{subject}.''.$sname.':'.$sdom.''.$dcmail{$msgid}{message}.''.$recipients.''."\n"; + $output .= ''.$date.''.&cr_to_br($dcmail{$msgid}{subject}).''.$sname.':'.$sdom.''.&cr_to_br($dcmail{$msgid}{message}).''.$recipients.''."\n"; $rowNum ++; } } else { @@ -328,9 +326,10 @@ ENDONE } $recipients =~ s/,\s$//; } + my ($date,$subj,$sname,$sdom,$cdom) = split(/:/,$msgid,5); $date = &Apache::lonlocal::locallocaltime($date); - $output .= ''.$date.''.$dcmail{$msgid}{subject}.''.$sname.':'.$sdom.''.$dcmail{$msgid}{message}.''.$recipients.''."\n"; + $output .= ''.$date.''.&cr_to_br($dcmail{$msgid}{subject}).''.$sname.':'.$sdom.''.&cr_to_br($dcmail{$msgid}{message}).''.$recipients.''."\n"; $rowNum ++; } } @@ -413,7 +412,7 @@ $breadcrumbs
ENDONE $output .= &Apache::lonhtmlcommon::start_pick_box($table_width); - my @roles = ('cc','in','ta','ep','ad','st','cr'); + my @roles = ('ow','cc','in','ta','ep','ad','st','cr'); my %longtypes = (); my %authtypes = (); &form_elements(\%longtypes,\%authtypes); @@ -581,7 +580,15 @@ ENDONE $output .= ''.$username.'  '.$recipients{$username}.''; } } - $output .= ''; + $output .= ''; + if (@unmatched) { + $output .= '

'.&mt('Could not determine e-mail addresses for the following users:').''; + } + $output .= ''; $output .= &Apache::lonhtmlcommon::row_closure(); $output .= &Apache::lonhtmlcommon::row_title($col_width,$tablecolor,&mt('Sender e-mail address')); $output .= ''; @@ -638,6 +645,7 @@ ENDONE my @deliveries = (); &broadcast_email(\@recipients,$subject,$from,$message,\@deliveries); if (@deliveries > 0) { + &store_mail($subject,$message,$dom,\@deliveries); $output .= ' @@ -649,8 +657,8 @@ ENDONE - - + +
Sent'.$subject.''.$message.''.&cr_to_br($subject).''.&cr_to_br($message).' '; foreach my $person (@deliveries) { my ($username,$email) = split(/:/,$person); @@ -696,7 +704,7 @@ sub broadcast_email { } sub get_user_info { - my ($user,%email_defaults,$ltext) = @_; + my ($user,%email_defaults) = @_; my ($uname,$udom) = split(/:/,$user); my @emailtypes = ('permanentemail','critnotification','notification'); my %userinfo = &Apache::lonnet::get('environment',\@emailtypes,$udom,$uname); @@ -715,7 +723,7 @@ sub get_user_info { $email = $uname.'@'.$email_defaults{$authtype}{$autharg}; } } else { - if (defined($email_defaults{$authtype})) { + if ((defined($email_defaults{$authtype})) && ($email_defaults{$authtype} ne '')) { $email = $uname.'@'.$email_defaults{$authtype}; } } @@ -733,7 +741,7 @@ sub form_elements { %{$authtypes} = ( krb4 => 'Kerberos 4', krb5 => 'Kerberos 5', - int => 'Internal (LON-CAPA)', + internal => 'Internal (LON-CAPA)', unix => 'Filesystem (UNIX)', local => 'Local/Customized', ); @@ -857,4 +865,11 @@ sub echo_form_input { return $output; } +sub cr_to_br { + my $incoming = shift; + $incoming =~ s/\n/\
/g; + return $incoming; +} + + 1;