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

musolffc musolffc at source.lon-capa.org
Wed May 21 13:36:59 EDT 2014


musolffc		Wed May 21 17:36:59 2014 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  Addresses bug #5676
  Critical messages are now displayed in reverse chronological order.  Also,
  only the CRITICAL message folder will be accessible until all critical
  messages have been dealt with instead of defaulting to the INBOX.
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.174 loncom/interface/lonmsgdisplay.pm:1.175
--- loncom/interface/lonmsgdisplay.pm:1.174	Fri Apr 25 17:56:42 2014
+++ loncom/interface/lonmsgdisplay.pm	Wed May 21 17:36:58 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.174 2014/04/25 17:56:42 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.175 2014/05/21 17:36:58 musolffc Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -813,7 +813,9 @@
                 .'<input type="hidden" name="confirm" value="true" />';
     my %what=&Apache::lonnet::dump('critical');
     my $result = '';
-    foreach my $key (sort(keys(%what))) {
+    # Sort by date in descending order
+    foreach my $key (sort{$b <=> $a}(keys(%what))) {    
+        print STDERR "key = ||$key||\n";
         my %content=&Apache::lonmsg::unpackagemsg($what{$key});
         next if ($content{'senderdomain'} eq '');
         my $description;
@@ -1023,6 +1025,13 @@
     &Apache::loncommon::store_settings('user','mail',\%saveable);
     &Apache::loncommon::restore_settings('user','mail',\%saveable);
     $folder    ||= $env{'form.folder'};
+    # Always show critical messages if present
+    my @what=&Apache::lonnet::dump('critical',$env{'user.domain'},$env{'user.name'});
+    if ($what[0]) {
+	if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) {
+            $folder = 'critical';
+        }
+    }
     $msgstatus ||= $env{'form.msgstatus'};
     $env{'form.interdis'} ||= 20;
 




More information about the LON-CAPA-cvs mailing list