version 1.105.2.11, 2016/08/07 02:06:00
|
version 1.117, 2014/12/15 17:13:25
|
Line 1275 sub process_update {
|
Line 1275 sub process_update {
|
|
|
sub getnormalmail { |
sub getnormalmail { |
my ($newmsgs) = @_; |
my ($newmsgs) = @_; |
# Check for unread messages in user's INBOX (which were sent in context of current course). |
# Check for unread mail in course |
my $msgcount = 0; |
my $msgcount = 0; |
my @messages = &Apache::lonnet::getkeys('nohist_email'); |
|
return $msgcount if (!@messages); |
my @messages = sort(&Apache::lonnet::getkeys('nohist_email')); |
my %emailstatus = &Apache::lonnet::dump('email_status'); |
foreach my $message (@messages) { |
foreach my $msgid (sort(@messages)) { |
my $msgid=&escape($message); |
if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) { |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
my $skipstatus; |
&Apache::lonmsg::unpackmsgid($msgid); |
if ($emailstatus{$msgid} eq 'new') { |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
$skipstatus = 1; |
if (defined($sendtime) && $sendtime!~/error/) { |
} |
if ($status eq 'new') { |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
&Apache::lonmsg::unpackmsgid($msgid,undef,$skipstatus,undef, |
$msgcount ++; |
$env{'request.course.id'}); |
if ($shortsubj eq '') { |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
$shortsubj = &mt('No subject'); |
if (defined($sendtime) && $sendtime!~/error/) { |
|
if (($emailstatus{$msgid} eq 'new') || ($status eq 'new')) { |
|
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
|
$msgcount ++; |
|
if ($shortsubj eq '') { |
|
$shortsubj = &mt('No subject'); |
|
} |
|
push(@{$newmsgs}, { |
|
msgid => $msgid, |
|
sendtime => $sendtime, |
|
shortsub => $shortsubj, |
|
from => $fromname, |
|
fromdom => $fromdom |
|
}); |
|
} |
} |
|
push(@{$newmsgs}, { |
|
msgid => $msgid, |
|
sendtime => $sendtime, |
|
shortsub => $shortsubj, |
|
from => $fromname, |
|
fromdom => $fromdom |
|
}); |
} |
} |
} |
} |
} |
} |
Line 1314 sub getnormalmail {
|
Line 1307 sub getnormalmail {
|
|
|
sub getcritmail { |
sub getcritmail { |
my ($critmsgs) = @_; |
my ($critmsgs) = @_; |
# Check for critical messages which were sent in context of current course. |
# Check for critical messages in course |
my %what=&Apache::lonnet::dump('critical'); |
my %what=&Apache::lonnet::dump('critical'); |
my $result = ''; |
my $result = ''; |
my $critmsgcount = 0; |
my $critmsgcount = 0; |
foreach my $msgid (sort(keys(%what))) { |
foreach my $msgid (sort(keys(%what))) { |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
&Apache::lonmsg::unpackmsgid($msgid,undef,1,undef, |
&Apache::lonmsg::unpackmsgid($msgid); |
$env{'request.course.id'}); |
|
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
Line 1630 sub display_handgrade {
|
Line 1622 sub display_handgrade {
|
foreach my $res (@{$tograde}) { |
foreach my $res (@{$tograde}) { |
$rowNum ++; |
$rowNum ++; |
my $css_class = $rowNum%2?' class="LC_odd_row"':''; |
my $css_class = $rowNum%2?' class="LC_odd_row"':''; |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my $linkurl='/adm/grades'; |
my $linkurl=&Apache::lonnet::clutter($url); |
|
$linkurl .= '?symb='.&escape($res); |
|
if ($$ungraded{$res}{'enclink'}) { |
if ($$ungraded{$res}{'enclink'}) { |
$linkurl = |
$linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; |
$$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'}; |
} else { |
|
$linkurl.='?symb='.&escape($res); |
} |
} |
|
$linkurl.='&command=ungraded'; |
$r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>'); |
$r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>'); |
} |
} |
} elsif ($itemserror) { |
} elsif ($itemserror) { |
Line 1958 sub display_coursediscussion {
|
Line 1950 sub display_coursediscussion {
|
my $forum_title = $$unread{$ressymb}{'title'}; |
my $forum_title = $$unread{$ressymb}{'title'}; |
my $type = 'Resource'; |
my $type = 'Resource'; |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $disclink = $feedurl.'?symb='.&escape($$unread{$ressymb}{symb}); |
my $disclink = $feedurl.'?symb='. &escape($$unread{$ressymb}{symb}); |
if ($feedurl =~ /bulletinboard/) { |
if ($feedurl =~ /bulletinboard/) { |
$type = 'Discussion Board'; |
$type = 'Discussion Board'; |
} |
} |