version 1.40, 2006/08/29 00:12:02
|
version 1.42, 2006/11/23 16:40:17
|
Line 486 sub discrit {
|
Line 486 sub discrit {
|
'<input type="hidden" name="confirm" value="true" />'; |
'<input type="hidden" name="confirm" value="true" />'; |
my %what=&Apache::lonnet::dump('critical'); |
my %what=&Apache::lonnet::dump('critical'); |
my $result = ''; |
my $result = ''; |
foreach (sort keys %what) { |
foreach my $key (sort(keys(%what))) { |
my %content=&Apache::lonmsg::unpackagemsg($what{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($what{$key}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
$result.='<hr />'.&mt('From').': <b>'. |
$result.='<hr />'.&mt('From').': <b>'. |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::aboutmewrapper( |
Line 500 $content{'sendername'}.':'.
|
Line 500 $content{'sendername'}.':'.
|
'</pre><small>'. |
'</pre><small>'. |
&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox'). |
&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox'). |
'</small><br />'. |
'</small><br />'. |
'<input type="submit" name="rec_'.$_.'" value="'.&mt('Confirm Receipt').'" />'. |
'<input type="submit" name="rec_'.$key.'" value="'.&mt('Confirm Receipt').'" />'. |
'<input type="submit" name="reprec_'.$_.'" '. |
'<input type="submit" name="reprec_'.$key.'" '. |
'value="'.&mt('Confirm Receipt and Reply').'" />'; |
'value="'.&mt('Confirm Receipt and Reply').'" />'; |
} |
} |
# Check to see if there were any messages. |
# Check to see if there were any messages. |
Line 658 sub disnew {
|
Line 658 sub disnew {
|
my %status_cache = |
my %status_cache = |
&Apache::lonnet::get('email_status',\@msgids); |
&Apache::lonnet::get('email_status',\@msgids); |
my %descriptions; |
my %descriptions; |
foreach (@msgids) { |
foreach my $id (@msgids) { |
my $msgid=&escape($_); |
my $msgid=&escape($id); |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
&Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache); |
&Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache); |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
Line 668 sub disnew {
|
Line 668 sub disnew {
|
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
if ($status eq 'new') { |
if ($status eq 'new') { |
if ($numsendtime >= $startblock && ($numsendtime <= $endblock && $endblock > 0) ) { |
if ($numsendtime >= $startblock && ($numsendtime <= $endblock && $endblock > 0) ) { |
$blocked{$_} = 'ON'; |
$blocked{$id} = 'ON'; |
$numblocked ++; |
$numblocked ++; |
} else { |
} else { |
push @newmsgs, { |
push @newmsgs, { |
Line 694 TABLEHEAD
|
Line 694 TABLEHEAD
|
<tr class="LC_mail_new"> |
<tr class="LC_mail_new"> |
<td><a href="/adm/email?dismode=new&display=$msg->{'msgid'}">$lt{'op'}</a></td> |
<td><a href="/adm/email?dismode=new&display=$msg->{'msgid'}">$lt{'op'}</a></td> |
ENDLINK |
ENDLINK |
foreach ('sendtime','from','fromdom','shortsub','course') { |
foreach my $item ('sendtime','from','fromdom','shortsub','course') { |
$r->print("<td>$msg->{$_}</td>"); |
$r->print("<td>$msg->{$item}</td>"); |
} |
} |
$r->print("</td></tr>"); |
$r->print("</td></tr>"); |
} |
} |
Line 766 sub disfolder {
|
Line 766 sub disfolder {
|
</script> |
</script> |
ENDDISHEADER |
ENDDISHEADER |
my $fsqs='&folder='.$folder; |
my $fsqs='&folder='.$folder; |
my @temp=sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder); |
my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder); |
my $totalnumber=$#temp+1; |
my $totalnumber=$#temp+1; |
unless ($totalnumber>0) { |
unless ($totalnumber>0) { |
$r->print('<h2>'.&mt('Empty Folder').'</h2>'); |
$r->print('<h2>'.&mt('Empty Folder').'</h2>'); |
Line 1135 sub retrieve_instructor_comments {
|
Line 1135 sub retrieve_instructor_comments {
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
'%255b'.$user.'%253a'.$domain.'%255d'); |
'%255b'.$user.'%253a'.$domain.'%255d'); |
my $result=''; |
my $result=''; |
foreach (sort(keys(%records))) { |
foreach my $key (sort(keys(%records))) { |
my %content=&Apache::lonmsg::unpackagemsg($records{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($records{$key}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'subject'} !~ /^Record/); |
next if ($content{'subject'} !~ /^Record/); |
# &Apache::lonfeedback::newline_to_br(\$content{'message'}); |
# &Apache::lonfeedback::newline_to_br(\$content{'message'}); |
Line 1163 sub disfacetoface {
|
Line 1163 sub disfacetoface {
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
'%255b'.$user.'%253a'.$domain.'%255d'); |
'%255b'.$user.'%253a'.$domain.'%255d'); |
my $result=''; |
my $result=''; |
foreach (sort keys %records) { |
foreach my $key (sort(keys(%records))) { |
my %content=&Apache::lonmsg::unpackagemsg($records{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($records{$key}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
&Apache::lonfeedback::newline_to_br(\$content{'message'}); |
&Apache::lonfeedback::newline_to_br(\$content{'message'}); |
if ($content{'subject'}=~/^Record/) { |
if ($content{'subject'}=~/^Record/) { |
Line 1387 sub blockstore {
|
Line 1387 sub blockstore {
|
my $addtotal = 0; |
my $addtotal = 0; |
my %blocking = (); |
my %blocking = (); |
$r->print('<h3>'.$lt{'head'}.'</h3>'); |
$r->print('<h3>'.$lt{'head'}.'</h3>'); |
foreach (keys %env) { |
foreach my $envkey (keys(%env)) { |
if ($_ =~ m/^form\.modify_(\w+)$/) { |
if ($envkey =~ m/^form\.modify_(\w+)$/) { |
$adds{$1} = $1; |
$adds{$1} = $1; |
$removals{$1} = $1; |
$removals{$1} = $1; |
$modtotal ++; |
$modtotal ++; |
} elsif ($_ =~ m/^form\.cancel_(\d+)$/) { |
} elsif ($envkey =~ m/^form\.cancel_(\d+)$/) { |
$cancels{$1} = $1; |
$cancels{$1} = $1; |
unless ( defined($removals{$1}) ) { |
unless ( defined($removals{$1}) ) { |
$removals{$1} = $1; |
$removals{$1} = $1; |
$canceltotal ++; |
$canceltotal ++; |
} |
} |
} elsif ($_ =~ m/^form\.add_(\d+)$/) { |
} elsif ($envkey =~ m/^form\.add_(\d+)$/) { |
$adds{$1} = $1; |
$adds{$1} = $1; |
$addtotal ++; |
$addtotal ++; |
} |
} |
} |
} |
|
|
foreach (keys %removals) { |
foreach my $key (keys(%removals)) { |
my $hashkey = $env{'form.key_'.$_}; |
my $hashkey = $env{'form.key_'.$key}; |
&Apache::lonnet::del('comm_block',["$hashkey"], |
&Apache::lonnet::del('comm_block',["$hashkey"], |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'} |
$env{'course.'.$env{'request.course.id'}.'.num'} |
); |
); |
} |
} |
foreach (keys %adds) { |
foreach my $key (keys(%adds)) { |
unless ( defined($cancels{$_}) ) { |
unless ( defined($cancels{$key}) ) { |
my ($newstart,$newend) = &get_dates_from_form($_); |
my ($newstart,$newend) = &get_dates_from_form($key); |
my $newkey = $newstart.'____'.$newend; |
my $newkey = $newstart.'____'.$newend; |
$blocking{$newkey} = $env{'user.name'}.':'.$env{'user.domain'}.':'.$env{'form.title_'.$_}; |
$blocking{$newkey} = $env{'user.name'}.':'.$env{'user.domain'}.':'.$env{'form.title_'.$key}; |
} |
} |
} |
} |
if ($addtotal + $modtotal > 0) { |
if ($addtotal + $modtotal > 0) { |
Line 1588 sub blockcheck {
|
Line 1588 sub blockcheck {
|
$setters->{$course}{'staff'} = []; |
$setters->{$course}{'staff'} = []; |
$setters->{$course}{'times'} = []; |
$setters->{$course}{'times'} = []; |
my %records = &Apache::lonnet::dump('comm_block',$cdom,$cnum); |
my %records = &Apache::lonnet::dump('comm_block',$cdom,$cnum); |
foreach my $record (keys %records) { |
foreach my $record (keys(%records)) { |
my ($start,$end) = ($record =~ m/^(\d+)____(\d+)$/); |
my ($start,$end) = ($record =~ m/^(\d+)____(\d+)$/); |
if ($start <= time && $end >= time) { |
if ($start <= time && $end >= time) { |
my ($staff_name,$staff_dom,$title) = |
my ($staff_name,$staff_dom,$title) = |
Line 1790 sub header {
|
Line 1790 sub header {
|
|
|
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
if ($baseurl) { |
if ($baseurl) { |
$extra .= "<base href=\"http://$ENV{'SERVER_NAME'}/$baseurl\" />"; |
$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />"; |
} |
} |
$r->print(&Apache::loncommon::start_page('Communication and Messages', |
$r->print(&Apache::loncommon::start_page('Communication and Messages', |
$extra)); |
$extra)); |
Line 1814 sub storecomment {
|
Line 1814 sub storecomment {
|
my ($r)=@_; |
my ($r)=@_; |
my $msgtxt=&Apache::lonfeedback::clear_out_html($env{'form.message'}); |
my $msgtxt=&Apache::lonfeedback::clear_out_html($env{'form.message'}); |
my $cleanmsgtxt=''; |
my $cleanmsgtxt=''; |
foreach (split(/[\n\r]/,$msgtxt)) { |
foreach my $line (split(/[\n\r]/,$msgtxt)) { |
unless ($_=~/^\s*(\>|\>\;)/) { |
unless ($line=~/^\s*(\>|\>\;)/) { |
$cleanmsgtxt.=$_."\n"; |
$cleanmsgtxt.=$line."\n"; |
} |
} |
} |
} |
my $key=&escape($env{'form.baseurl'}).'___'.time; |
my $key=&escape($env{'form.baseurl'}).'___'.time; |
Line 1833 sub storedcommentlisting {
|
Line 1833 sub storedcommentlisting {
|
$r->print(&mt('No stored comments yet.')); |
$r->print(&mt('No stored comments yet.')); |
} else { |
} else { |
my $found=0; |
my $found=0; |
foreach (sort keys %msgs) { |
foreach my $key (sort(keys(%msgs))) { |
$r->print("\n".$msgs{$_}."<hr />"); |
$r->print("\n".$msgs{$key}."<hr />"); |
$found=1; |
$found=1; |
} |
} |
unless ($found) { |
unless ($found) { |
Line 1918 sub sendoffmail {
|
Line 1918 sub sendoffmail {
|
} |
} |
} |
} |
if ($env{'form.additionalrec'}) { |
if ($env{'form.additionalrec'}) { |
foreach (split(/\,/,$env{'form.additionalrec'})) { |
foreach my $rec (split(/\,/,$env{'form.additionalrec'})) { |
my ($auname,$audom)=split(/\@/,$_); |
my ($auname,$audom)=split(/\@/,$rec); |
if (($auname ne "") && ($audom ne "")) { |
if (($auname ne "") && ($audom ne "")) { |
$toaddr{$auname.':'.$audom}=''; |
$toaddr{$auname.':'.$audom}=''; |
} |
} |
Line 2140 sub handler {
|
Line 2140 sub handler {
|
} elsif ($env{'form.confirm'}) { |
} elsif ($env{'form.confirm'}) { |
&printheader($r,'','Confirmed Receipt'); |
&printheader($r,'','Confirmed Receipt'); |
my $replying = 0; |
my $replying = 0; |
foreach (keys %env) { |
foreach my $envkey (keys(%env)) { |
if ($_=~/^form\.rec\_(.*)$/) { |
if ($envkey=~/^form\.rec\_(.*)$/) { |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
&Apache::lonmsg::user_crit_received($1).'<br>'); |
&Apache::lonmsg::user_crit_received($1).'<br>'); |
} |
} |
if ($_=~/^form\.reprec\_(.*)$/) { |
if ($envkey=~/^form\.reprec\_(.*)$/) { |
my $msgid=$1; |
my $msgid=$1; |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
&Apache::lonmsg::user_crit_received($msgid).'<br>'); |
&Apache::lonmsg::user_crit_received($msgid).'<br>'); |