--- loncom/interface/lonmsg.pm 2003/08/15 17:57:57 1.62 +++ loncom/interface/lonmsg.pm 2003/08/17 19:13:32 1.63 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.62 2003/08/15 17:57:57 www Exp $ +# $Id: lonmsg.pm,v 1.63 2003/08/17 19:13:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -638,13 +638,13 @@ sub disall { } ENDDISHEADER - $r->print('

Display All Messages

'. - '
 '); + $r->print('

Display All Messages

'. + ''); } else { - $r->print('Date'); + $r->print('Date'); } $r->print(''); } $r->print(''); -my @messages = split(/\&/,&Apache::lonnet::reply('keys:'.$ENV{'user.domain'}.':'.$ENV{'user.name'}.':nohist_email',$ENV{'user.home'})); -#unpack the varibles and repack into temp for sorting -my @temp; -foreach (@messages) -{ - my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= + my @messages = split(/\&/,&Apache::lonnet::reply('keys:'.$ENV{'user.domain'}.':'.$ENV{'user.name'}.':nohist_email',$ENV{'user.home'})); + #unpack the varibles and repack into temp for sorting + my @temp; + foreach (@messages) { + my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= &Apache::lonmsg::unpackmsgid($_); -my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status); - push @temp ,\@temp1; -} -#default sort - @temp = sort {$a->[0] <=> $b->[0]} @temp; -if ($ENV{'form.sortedby'} eq "date"){ + my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status); + push @temp ,\@temp1; + } + #default sort + @temp = sort {$a->[0] <=> $b->[0]} @temp; + if ($ENV{'form.sortedby'} eq "date"){ @temp = sort {$a->[0] <=> $b->[0]} @temp; -} -if ($ENV{'form.sortedby'} eq "revdate"){ + } + if ($ENV{'form.sortedby'} eq "revdate"){ @temp = sort {$b->[0] <=> $a->[0]} @temp; -} -if ($ENV{'form.sortedby'} eq "user"){ + } + if ($ENV{'form.sortedby'} eq "user"){ @temp = sort {lc($a->[2]) cmp lc($b->[2])} @temp; -} -if ($ENV{'form.sortedby'} eq "revuser"){ + } + if ($ENV{'form.sortedby'} eq "revuser"){ @temp = sort {lc($b->[2]) cmp lc($a->[2])} @temp; -} -if ($ENV{'form.sortedby'} eq "domain"){ + } + if ($ENV{'form.sortedby'} eq "domain"){ @temp = sort {$a->[3] cmp $b->[3]} @temp; -} -if ($ENV{'form.sortedby'} eq "revdomain"){ + } + if ($ENV{'form.sortedby'} eq "revdomain"){ @temp = sort {$b->[3] cmp $a->[3]} @temp; -} -if ($ENV{'form.sortedby'} eq "subject"){ + } + if ($ENV{'form.sortedby'} eq "subject"){ @temp = sort {lc($a->[1]) cmp lc($b->[1])} @temp; -} -if ($ENV{'form.sortedby'} eq "revsubject"){ + } + if ($ENV{'form.sortedby'} eq "revsubject"){ @temp = sort {lc($b->[1]) cmp lc($a->[1])} @temp; -} -if ($ENV{'form.sortedby'} eq "status"){ + } + if ($ENV{'form.sortedby'} eq "status"){ @temp = sort {$a->[4] cmp $b->[4]} @temp; -} -if ($ENV{'form.sortedby'} eq "revstatus"){ + } + if ($ENV{'form.sortedby'} eq "revstatus"){ @temp = sort {$b->[4] cmp $a->[4]} @temp; -} - foreach (@temp){ - my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= @$_; - if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { + } + foreach (@temp){ + my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)= @$_; + if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { if ($status eq 'new') { $r->print(''); } elsif ($status eq 'read') { $r->print(''); } elsif ($status eq 'replied') { $r->print(''); - } else { $r->print(''); } @@ -733,9 +731,9 @@ if ($ENV{'form.sortedby'} eq "revstatus" $fromname.''); - } - } - $r->print('
 '); if ($ENV{'form.sortedby'} eq "revdate") { $r->print('Date'); if ($ENV{'form.sortedby'} eq "revuser") { @@ -671,58 +671,56 @@ ENDDISHEADER $r->print('Status
'.$fromdomain.''. &Apache::lonnet::unescape($shortsubj).''. $status.'

'. + } + } + $r->print('

'. 'Check All '. 'Uncheck All

'. ''.