--- loncom/interface/lonnotify.pm 2010/05/14 18:29:52 1.36
+++ loncom/interface/lonnotify.pm 2014/12/11 13:15:35 1.41
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Sending messages
#
-# $Id: lonnotify.pm,v 1.36 2010/05/14 18:29:52 bisitz Exp $
+# $Id: lonnotify.pm,v 1.41 2014/12/11 13:15:35 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -220,8 +220,8 @@ sub print_display_option_form {
$output .= &Apache::lonhtmlcommon::row_title(&mt('Choose sender(s)'));
my %personnel = &Apache::lonnet::get_domain_roles($cdom,\@roles);
my @domcc = ();
- foreach my $server (keys %personnel) {
- foreach my $user (sort(keys %{$personnel{$server}})) {
+ foreach my $server (keys(%personnel)) {
+ foreach my $user (sort(keys(%{$personnel{$server}}))) {
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user);
unless (grep/^$uname:$udom$/,@domcc) {
my %userinfo = &Apache::lonnet::get('environment',['lastname','firstname'],$udom,$uname);
@@ -286,11 +286,11 @@ ENDSCRIPT
$output .= &Apache::loncommon::start_data_table();
if ($msgcount > 0) {
$output .= &Apache::loncommon::start_data_table_header_row().
- '
Date | '.
- 'Subject | '.
- 'Sender | '.
- 'Message | '.
- 'Recipients | '.
+ ''.&mt('Date').' | '.
+ ''.&mt('Subject').' | '.
+ ''.&mt('Sender').' | '.
+ ''.&mt('Message').' | '.
+ ''.&mt('Recipients').' | '.
&Apache::loncommon::end_data_table_header_row();
if (($env{'form.sortby'} eq 'date') || ($env{'form.sortby'} eq '') || (!defined($env{'form.sortby'})) || (($env{'form.sortby'} eq 'sender') && (@senders <= 1))) {
@@ -357,7 +357,7 @@ ENDSCRIPT
}
} else {
$output .= &Apache::loncommon::start_data_table_empty_row().
- 'No mail sent matching supplied criteria | '.
+ ''.&mt('No mail sent matching supplied criteria').' | '.
&Apache::loncommon::end_data_table_empty_row();
}
$output .= &Apache::loncommon::end_data_table();
@@ -413,6 +413,7 @@ sub print_selection_form {
$jscript .= &Apache::courseclassifier::javascript_code_selections($formname,@codetitles);
}
}
+ my @standardnames = &Apache::loncommon::get_standard_codeitems();
my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($cdom);
@@ -436,7 +437,7 @@ function setCourseCat(formname) {
if (formname.Year.options[formname.Year.selectedIndex].value == -1) {
return;
}
- courseSet('Year');
+ courseSet('$codetitles[0]');
for (var j=0; j E-mail conversion'),$descrip);
$output .= &Apache::lonhtmlcommon::submit_row(&mt('Submit'),$cmd,$submit_text);
@@ -526,20 +527,15 @@ function goBack(target) {
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.',
undef,undef,'Course');
} elsif ($coursefilter eq 'category') {
- my $instcode = '';
- my @cats = ('Semester','Year','Department','Number');
- foreach my $category (@cats) {
- if (defined($env{'form.'.$category})) {
- unless ($env{'form.'.$category} eq '-1') {
- $instcode .= $env{'form.'.$category};
- }
- }
- }
+ my $instcode = &Apache::courseclassifier::instcode_from_selectors($cdom);
+ my $regexp = '';
if ($instcode eq '') {
$instcode = '.';
+ } else {
+ $regexp = 1;
}
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.',
- undef,undef,'Course');
+ undef,undef,'Course',$regexp);
} elsif ($coursefilter eq 'specific') {
if ($env{'form.coursetotal'} > 1) {
my @course_ids = split(/&&/,$env{'form.courselist'});
@@ -649,7 +645,7 @@ function goBack(target) {
$output .= &Apache::loncommon::end_data_table();
if (@unmatched) {
$output .= '
'.&mt('Could not determine e-mail addresses for the following users:').'';
- foreach my $username (sort @unmatched) {
+ foreach my $username (sort(@unmatched)) {
$output .= '- '.$username.'
';
}
$output .= '
';
@@ -709,7 +705,7 @@ ENDSCRIPT
''.&mt('Status').' | '.
''.&mt('Subject').' | '.
''.&mt('Message').' | '.
- ''.&mt('Recipents').' | '.
+ ''.&mt('Recipients').' | '.
&Apache::loncommon::end_data_table_header_row();
$output .= &Apache::loncommon::start_data_table_row().
''.&mt('Sent').' | '.
@@ -724,7 +720,7 @@ ENDSCRIPT
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table();
} else {
- $output .= 'No mail sent - no recipients identified';
+ $output .= &mt('No mail sent - no recipients identified');
}
$output .= '
'.&mt('Send another e-mail').''."\n";
$output .= ''."\n".
@@ -746,6 +742,7 @@ sub broadcast_email {
$msg->to($to);
$msg->subject($subject);
$msg->add('From',"$from");
+ $msg->add('Content-type','text/plain; charset=UTF-8');
if (my $fh = $msg->open()) {
print $fh $message;
$fh->close;