version 1.20, 2006/07/07 13:43:20
|
version 1.26, 2007/03/08 01:58:45
|
Line 1
|
Line 1
|
|
# The LearningOnline Network with CAPA |
|
# Sending messages |
|
# |
|
# $Id$ |
# |
# |
# Copyright Michigan State University Board of Trustees |
# Copyright Michigan State University Board of Trustees |
# |
# |
Line 27 package Apache::lonnotify;
|
Line 31 package Apache::lonnotify;
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonsupportreq; |
use Apache::courseclassifier; |
use LONCAPA::Enrollment; |
use LONCAPA::Enrollment; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 205 sub print_display_option_form {
|
Line 209 sub print_display_option_form {
|
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user); |
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user); |
unless (grep/^$uname:$udom$/,@domcc) { |
unless (grep/^$uname:$udom$/,@domcc) { |
my %userinfo = &Apache::lonnet::get('environment',['lastname','firstname'],$udom,$uname); |
my %userinfo = &Apache::lonnet::get('environment',['lastname','firstname'],$udom,$uname); |
$output .= '<input type="checkbox" name="sender" value="'.$uname.':'.$udom.'" /> '.$userinfo{firstname}.' '.$userinfo{lastname}.' ('.$uname.':'.$udom.')'; |
$output .= '<input type="checkbox" name="sender" value="'.$uname.':'.$udom.'" /> '.$userinfo{'firstname'}.' '.$userinfo{'lastname'}.' ('.$uname.':'.$udom.')'; |
push (@domcc,$uname.':'.$udom); |
push (@domcc,$uname.':'.$udom); |
} |
} |
} |
} |
Line 265 ENDSCRIPT
|
Line 269 ENDSCRIPT
|
} |
} |
$output .= &Apache::loncommon::start_data_table(); |
$output .= &Apache::loncommon::start_data_table(); |
if ($msgcount > 0) { |
if ($msgcount > 0) { |
my $rowNum = 0; |
|
$output .= &Apache::loncommon::start_data_table_header_row(). |
$output .= &Apache::loncommon::start_data_table_header_row(). |
'<th><a href="javascript:changeSort(\'date\')">Date</a></th>'. |
'<th><a href="javascript:changeSort(\'date\')">Date</a></th>'. |
'<th><a href="javascript:changeSort(\'subject\')">Subject</a></th>'. |
'<th><a href="javascript:changeSort(\'subject\')">Subject</a></th>'. |
Line 380 sub print_selection_form {
|
Line 383 sub print_selection_form {
|
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({text=>"Select Audience"}); |
({text=>"Select Audience"}); |
|
|
$totcodes = &Apache::lonsupportreq::retrieve_instcodes(\%coursecodes,$cdom,$totcodes); |
$totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$cdom,$totcodes); |
if ($totcodes > 0) { |
if ($totcodes > 0) { |
$format_reply = &Apache::lonnet::auto_instcode_format($caller,$cdom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); |
$format_reply = &Apache::lonnet::auto_instcode_format($caller,$cdom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); |
if ($format_reply eq 'ok') { |
if ($format_reply eq 'ok') { |
my $numtypes = @codetitles; |
my $numtypes = @codetitles; |
&Apache::lonsupportreq::build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); |
&Apache::courseclassifier::build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); |
&Apache::lonsupportreq::javascript_code_selections($formname,$numtypes,\%cat_titles,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles); |
my ($scripttext,$longtitles) = &Apache::courseclassifier::javascript_definitions(\@codetitles,\%idlist,\%idlist_titles,\%idnums,\%cat_titles); |
|
my $longtitles_str = join('","',@{$longtitles}); |
|
my $allidlist = $idlist{$codetitles[0]}; |
|
$jscript .= &Apache::courseclassifier::courseset_js_start($formname,$longtitles_str,$allidlist); |
|
$jscript .= $scripttext; |
|
$jscript .= &Apache::courseclassifier::javascript_code_selections($formname,@codetitles); |
} |
} |
} |
} |
|
|
Line 499 function goBack(target) {
|
Line 507 function goBack(target) {
|
my $coursefilter = $env{'form.coursepick'}; |
my $coursefilter = $env{'form.coursepick'}; |
my %courses = (); |
my %courses = (); |
if ($coursefilter eq 'all') { |
if ($coursefilter eq 'all') { |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.'); |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.', |
|
undef,undef,'Course'); |
} elsif ($coursefilter eq 'category') { |
} elsif ($coursefilter eq 'category') { |
my $instcode = ''; |
my $instcode = ''; |
my @cats = ('Semester','Year','Department','Number'); |
my @cats = ('Semester','Year','Department','Number'); |
Line 513 function goBack(target) {
|
Line 522 function goBack(target) {
|
if ($instcode eq '') { |
if ($instcode eq '') { |
$instcode = '.'; |
$instcode = '.'; |
} |
} |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.'); |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.', |
|
undef,undef,'Course'); |
} elsif ($coursefilter eq 'specific') { |
} elsif ($coursefilter eq 'specific') { |
if ($env{'form.coursetotal'} > 1) { |
if ($env{'form.coursetotal'} > 1) { |
my @course_ids = split(/&&/,$env{'form.courselist'}); |
my @course_ids = split(/&&/,$env{'form.courselist'}); |
Line 606 function goBack(target) {
|
Line 616 function goBack(target) {
|
$output .= &Apache::loncommon::start_data_table(); |
$output .= &Apache::loncommon::start_data_table(); |
if (keys(%recipients) > 0) { |
if (keys(%recipients) > 0) { |
$output .= &Apache::loncommon::start_data_table_header_row(); |
$output .= &Apache::loncommon::start_data_table_header_row(); |
$output .= '<th> <th>username:domain</th><th> </th><th>'.$lt{'emad'}.'</th>'; |
$output .= '<th> <th>username:domain</th><th>'.$lt{'emad'}.'</th>'; |
$output .= &Apache::loncommon::end_data_table_header_row(); |
$output .= &Apache::loncommon::end_data_table_header_row(); |
} |
} |
foreach my $username (sort(keys(%recipients))) { |
foreach my $username (sort(keys(%recipients))) { |
$output .= &Apache::loncommon::start_data_table_row(); |
$output .= &Apache::loncommon::start_data_table_row(); |
if ($recipients{$username} =~ /\@/) { |
if ($recipients{$username} =~ /\@/) { |
my $value=&escape($username).':'.&escape($recipients{$username}); |
my $value=&escape($username).':'.&escape($recipients{$username}); |
$output .= '<td><input type="checkbox" name="recipient" value="'.$value.'" /></td><td>'.$username.'</td><td> </td><td>'.$recipients{$username}.'</td>'; |
$output .= '<td><input type="checkbox" name="recipient" value="'.$value.'" /></td><td>'.$username.'</td><td>'.$recipients{$username}.'</td>'; |
} |
} |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
Line 729 sub get_user_info {
|
Line 739 sub get_user_info {
|
my ($user,%email_defaults) = @_; |
my ($user,%email_defaults) = @_; |
my ($uname,$udom) = split(/:/,$user); |
my ($uname,$udom) = split(/:/,$user); |
my @emailtypes = ('permanentemail','critnotification','notification'); |
my @emailtypes = ('permanentemail','critnotification','notification'); |
my %userinfo = &Apache::lonnet::get('environment',\@emailtypes,$udom,$uname); |
my %userinfo = &Apache::loncommon::getemails($uname,$udom); |
my $email = ''; |
my $email = ''; |
foreach my $type (@emailtypes) { |
foreach my $type (@emailtypes) { |
$email = $userinfo{$type}; |
$email = $userinfo{$type}; |
Line 777 sub store_mail {
|
Line 787 sub store_mail {
|
$attachmenturl,$recipients,undef,undef,'dcmail'); |
$attachmenturl,$recipients,undef,undef,'dcmail'); |
|
|
# Store in dc email db files on primary library server for domain. |
# Store in dc email db files on primary library server for domain. |
my $server = $Apache::lonnet::domain_primary{$domain}; |
my $server = &Apache::lonnet::domain($domain,'primary'); |
if (defined($server)) { |
if (defined($server)) { |
unless (&Apache::lonnet::dcmailput($domain,$msgid,$message,$server) |
unless (&Apache::lonnet::dcmailput($domain,$msgid,$message,$server) |
eq 'ok') { |
eq 'ok') { |