--- loncom/interface/lonmsg.pm 2004/12/11 16:31:59 1.123
+++ loncom/interface/lonmsg.pm 2005/01/01 18:36:13 1.128
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.123 2004/12/11 16:31:59 raeburn Exp $
+# $Id: lonmsg.pm,v 1.128 2005/01/01 18:36:13 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -527,9 +527,11 @@ sub folderlist {
'critical' => &mt('Critical'),
'sent' => &mt('Sent Messages'),
map { $_ => $_ } @allfolders)).
- ' '.&mt('Show').' '.
- &Apache::loncommon::select_form($interdis,'interdis',
-(' 10' => '10', ' 20' => '20', ' 50' => '50', '100' => '100', '200' => '200')).
+ ' '.&mt('Show').
+ ''.
'
'.
''.
($folder=~/^(new|critical)/?'':'');
@@ -537,7 +539,9 @@ sub folderlist {
sub scrollbuttons {
my ($start,$maxdis,$first,$finish,$total)=@_;
+ unless ($total>0) { return ''; }
$start++; $maxdis++;$first++;$finish++;
+ return
''.
''.
' of '.$maxdis.
@@ -586,7 +590,6 @@ sub makefolder {
sub movemsg {
my ($msgid,$srcfolder,$trgfolder)=@_;
- my $unmsgid=&Apache::lonnet::unescape($msgid);
my $srcsuffix=&foldersuffix($srcfolder);
my $trgsuffix=&foldersuffix($trgfolder);
@@ -595,16 +598,13 @@ sub movemsg {
&Apache::lonnet::put('nohist_email'.$trgsuffix,{$msgid => $message{$msgid}});
# Copy status
- my %status=&Apache::lonnet::get('email_status'.$srcsuffix,[$unmsgid]);
- &Apache::lonnet::put('email_status'.$trgsuffix,{$unmsgid => $status{$unmsgid}});
-# See if was deleted -> becomes "read" in trash
- my $currentstatus=(&unpackmsgid($status{$unmsgid}),$srcfolder);
- if ($currentstatus eq 'deleted') {
- &statuschange($msgid,'read',$trgfolder);
+ unless ($trgfolder eq 'trash') {
+ my %status=&Apache::lonnet::get('email_status'.$srcsuffix,[$msgid]);
+ &Apache::lonnet::put('email_status'.$trgsuffix,{$msgid => $status{$msgid}});
}
# Delete orginals
&Apache::lonnet::del('nohist_email'.$srcsuffix,[$msgid]);
- &Apache::lonnet::del('email_status'.$srcsuffix,[$unmsgid]);
+ &Apache::lonnet::del('email_status'.$srcsuffix,[$msgid]);
}
# ======================================================= Display a course list
@@ -912,6 +912,13 @@ ENDDISHEADER
my $fsqs='&folder='.$folder;
my @temp=sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder);
my $totalnumber=$#temp+1;
+ unless ($totalnumber>0) {
+ $r->print('
'. + $r->print("\n
". ''.&mt('Check All').' '. ''.&mt('Uncheck All').'
'. ''); @@ -991,7 +998,8 @@ ENDDISHEADER &Apache::loncommon::select_form('','movetofolder', ( map { $_ => $_ } @allfolders)) ); - $r->print(''); + my $postedstartdis=$startdis+1; + $r->print(''); if ($numblocked > 0) { my $beginblock = &Apache::lonlocal::locallocaltime($startblock); my $finishblock = &Apache::lonlocal::locallocaltime($endblock); @@ -1730,9 +1738,8 @@ sub displaymessage { '">'.&mt('Mark Unread').''. '