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

raeburn raeburn@source.lon-capa.org
Sun, 04 Jan 2009 17:43:19 -0000


raeburn		Sun Jan  4 17:43:19 2009 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  - Don't duplicate contents of "Broadcast to:" in "To: " row if $tolist is empty.
  - Don't show "To: " row if $tolist is empty.
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.106 loncom/interface/lonmsgdisplay.pm:1.107
--- loncom/interface/lonmsgdisplay.pm:1.106	Mon Dec 22 09:08:47 2008
+++ loncom/interface/lonmsgdisplay.pm	Sun Jan  4 17:43:19 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.106 2008/12/22 09:08:47 riegler Exp $
+# $Id: lonmsgdisplay.pm,v 1.107 2009/01/04 17:43:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2377,7 +2377,16 @@
             $bcclist = join(', ',@{$recipients{'bcc'}});
         }
     }
-    if (!$tolist && ref($content{'recuser'}) eq 'ARRAY') {
+
+    my $broadcast_link;
+    if (($content{'courseid'}) && ($content{'recipid'} &&
+        (ref($recipients{'course_broadcast'}) eq 'ARRAY') ||
+        (ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') ||
+        (ref($recipients{'group_bcc_broadcast'}) eq 'ARRAY'))) {
+        $broadcast_link = &recipients_link($r,\%content,\%recipients);
+    }
+
+    if (((!$tolist) && (!$broadcast_link)) && ref($content{'recuser'}) eq 'ARRAY') {
         my @recipients;
         for (my $i=0; $i<@{$content{'recuser'}}; $i++) {
             $recipients[$i] =  &Apache::loncommon::aboutmewrapper(
@@ -2404,14 +2413,6 @@
 	$r->print(&Apache::loncommon::student_image_tag($content{'senderdomain'},$content{'sendername'}).'</br>');
     }
 
-    my $broadcast_link;
-    if (($content{'courseid'}) && ($content{'recipid'} && 
-        (ref($recipients{'course_broadcast'}) eq 'ARRAY') || 
-        (ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') ||
-        (ref($recipients{'group_bcc_broadcast'}) eq 'ARRAY'))) {
-        $broadcast_link = &recipients_link($r,\%content,\%recipients);
-    }
-
     # Display LON-CAPA Message (Start)
     # Subject
     $r->print('</div>'
@@ -2422,10 +2423,12 @@
     );
     if ($folder eq 'sent') {
         # To
-        $r->print(&Apache::lonhtmlcommon::row_title(&mt('To'))
-                 .$tolist
-                 .&Apache::lonhtmlcommon::row_closure()
-        );
+        if ($tolist) {
+            $r->print(&Apache::lonhtmlcommon::row_title(&mt('To'))
+                     .$tolist
+                     .&Apache::lonhtmlcommon::row_closure()
+            );
+        }
         if ($cclist) {
             $r->print(&Apache::lonhtmlcommon::row_title(&mt('Cc'))
                      .$cclist