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

kalberla kalberla@source.lon-capa.org
Sun, 26 Jul 2009 20:39:46 -0000


kalberla		Sun Jul 26 20:39:46 2009 EDT

  Modified files:              
    /loncom/interface	lonblockingstatus.pm lonmsgdisplay.pm 
                     	loncommon.pm 
  Log:
  Replaced blocking table in lonmsgdisplay.pm to new popup link.
  
  
  
Index: loncom/interface/lonblockingstatus.pm
diff -u loncom/interface/lonblockingstatus.pm:1.2 loncom/interface/lonblockingstatus.pm:1.3
--- loncom/interface/lonblockingstatus.pm:1.2	Thu Jul  9 12:53:28 2009
+++ loncom/interface/lonblockingstatus.pm	Sun Jul 26 20:39:46 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the blocking status table
 #
-# $Id: lonblockingstatus.pm,v 1.2 2009/07/09 12:53:28 kalberla Exp $
+# $Id: lonblockingstatus.pm,v 1.3 2009/07/26 20:39:46 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -31,6 +31,21 @@
 use strict;
 use Apache::Constants qw(:common);
 use Apache::loncommon();
+use Apache::lonnet;
+use GDBM_File;
+use POSIX qw(strftime mktime);
+use Apache::lonmenu();
+use Apache::lonenc();
+use Apache::lonlocal;
+use Apache::lonnet();
+use HTML::Entities;
+use Apache::lonhtmlcommon();
+use Apache::loncoursedata();
+use Apache::lontexconvert();
+use Apache::lonclonecourse();
+use LONCAPA qw(:DEFAULT :match);
+use DateTime::TimeZone;
+use DateTime::Locale::Catalog;
 
 sub handler {
     my $r = shift;
@@ -43,8 +58,8 @@
         Apache::loncommon::start_page(
             'Communication Blocking Status Information',
             undef, {'only_body' => 1, }));
-
-    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status_print('boards');
+    Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity']);
+    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status_print($env{'form.activity'});
     $r->print($blocktext);
 
     $r->print(Apache::loncommon::end_page());
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.128 loncom/interface/lonmsgdisplay.pm:1.129
--- loncom/interface/lonmsgdisplay.pm:1.128	Sat Jul 25 23:16:04 2009
+++ loncom/interface/lonmsgdisplay.pm	Sun Jul 26 20:39:46 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.128 2009/07/25 23:16:04 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.129 2009/07/26 20:39:46 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1218,8 +1218,12 @@
     my $finishblock = &Apache::lonlocal::locallocaltime($endblock);
     my $output = '<br /><br />'.
                   &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock);
-    $output .= &Apache::loncommon::build_block_table($startblock,$endblock,
-                                                     $setters);
+    #$output .= &Apache::loncommon::build_block_table($startblock,$endblock,
+    #                                                 $setters);
+    
+    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("msgdisplay");
+    $output .="<br />".$blocktext;
+
     return $output;
 }
 
@@ -2275,8 +2279,10 @@
     my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
     if ( $blocked{$msgid} eq 'ON' ) {
         &printheader($r,'/adm/email',&mt('Display a Message'));
-        $r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.'));
-        &build_block_table($r,$startblock,$endblock,\%setters);
+        #$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.'));
+        #&build_block_table($r,$startblock,$endblock,\%setters);
+        my($blocked, $blocktext) = &Apache::loncommon::blocking_status("msgdisplay");
+        $r->print("<br />".$blocktext);
         return;
     }
     if ($msgstatus eq '') {
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.865 loncom/interface/loncommon.pm:1.866
--- loncom/interface/loncommon.pm:1.865	Sat Jul 25 23:16:04 2009
+++ loncom/interface/loncommon.pm	Sun Jul 26 20:39:46 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.865 2009/07/25 23:16:04 raeburn Exp $
+# $Id: loncommon.pm,v 1.866 2009/07/26 20:39:46 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3766,7 +3766,7 @@
                  ($env{'request.role'} !~ m{^st\./\Q$cdom\E/\Q$cnum\E}));
         next if ($no_userblock);
 
-        # Retrieve blocking times and identity of blocker for course
+        # Retrieve blocking times and identity of locker for course
         # of specified user, unless user has 'evb' privilege.
         
         my ($start,$end)=&get_blocks($setters,$activity,$cdom,$cnum);
@@ -3916,8 +3916,12 @@
             my $category;
             if ($activity eq 'boards') {
                 $category = 'Discussion posts in this course';
+            } elsif ($activity eq 'chat') {
+                $category = 'Chat';
+            } elsif ($activity eq 'msgdisplay') {
+                $category = 'This message';
             } elsif ($activity eq 'blogs') {
-                $category = 'Blogs';
+                $category = 'Blogs'; 
             } elsif ($activity eq 'port') {
                 if (defined($uname) && defined($udom)) {
                     if ($uname eq $env{'user.name'} &&
@@ -3947,6 +3951,8 @@
                 }
             } elsif ($activity eq 'groups') {
                 $category = 'Groups in this course';
+            } else {
+                $category = 'Communication';
             }
             my $showstart = &Apache::lonlocal::locallocaltime($startblock);
             my $showend = &Apache::lonlocal::locallocaltime($endblock);