[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 15 Dec 2004 01:17:10 -0000


www		Tue Dec 14 20:17:10 2004 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  Bug #3709: ISE on PREVIOUS
  
  I could not get the ISE on line 956 to happen by using PREVIOUS, in spite of
  doing lots of PREVIOUS, NEXT, FIRST, LAST - but I could make it happen with
  an empty folder.
  
  Detecting empty folders now. Will keep on trying.
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.123 loncom/interface/lonmsg.pm:1.124
--- loncom/interface/lonmsg.pm:1.123	Sat Dec 11 11:31:59 2004
+++ loncom/interface/lonmsg.pm	Tue Dec 14 20:17:09 2004
@@ -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.124 2004/12/15 01:17:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -537,7 +537,9 @@
 
 sub scrollbuttons {
     my ($start,$maxdis,$first,$finish,$total)=@_;
+    unless ($total>0) { return ''; }
     $start++; $maxdis++;$first++;$finish++;
+    return 
    '<input type="submit" name="firstview" value="'.&mt('First').'" />'.
    '<input type="submit" name="prevview" value="'.&mt('Previous').'" />'.
    '<input type="text" size="5" name="startdis" value="'.$start.'" onChange="this.form.submit()" /> of '.$maxdis.
@@ -912,6 +914,10 @@
     my $fsqs='&folder='.$folder;
     my @temp=sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder);
     my $totalnumber=$#temp+1;
+    unless ($totalnumber>0) {
+	$r->print('<h2>'.&mt('Empty Folder').'</h2>');
+	return;
+    }
     my $number=int($totalnumber/$interdis);
     if (($startdis<0) || ($startdis>$number)) { $startdis=$number; }
     my $firstdis=$interdis*$startdis;