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

raeburn raeburn@source.lon-capa.org
Mon, 25 Jan 2010 19:31:00 -0000


This is a MIME encoded message

--raeburn1264447860
Content-Type: text/plain

raeburn		Mon Jan 25 19:31:00 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  - Backport 1.125 (part), 1.138.
  
  
--raeburn1264447860
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20100125193100.txt"

Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.124.4.4 loncom/interface/lonmsgdisplay.pm:1.124.4.5
--- loncom/interface/lonmsgdisplay.pm:1.124.4.4	Mon Jan 25 17:59:43 2010
+++ loncom/interface/lonmsgdisplay.pm	Mon Jan 25 19:30:59 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.124.4.4 2010/01/25 17:59:43 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.124.4.5 2010/01/25 19:30:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -509,6 +509,7 @@
 sub discourse {
     my ($statushash) = @_;
     my ($result,$active,$previous,$future);
+    my $crstype = &Apache::loncommon::course_type();
     my ($course_personnel,
 	$current_members,
 	$expired_members,
@@ -524,11 +525,20 @@
                                                                \%defaultUsers,
                                                                1,"selectedusers",1,'email')
        ) {
-       $result .= '<fieldset id="LC_activeusers"><legend><b>'.&mt('Bcc: course members with current access').'</b></legend><form name="activeusers">';
-       $result .= $tmptext.'</form></fieldset><br />';
-       if (ref($statushash) eq 'HASH') {
-           $statushash->{'active'} = 1;
-       }
+        my $bcc_curr_hdr;
+        if ($crstype eq 'Community') {
+            $bcc_curr_hdr = &mt('Bcc: community participants with current access');
+        } else {
+            $bcc_curr_hdr = &mt('Bcc: course members with current access');
+        }
+        $result .= '<fieldset id="LC_activeusers"><legend>'
+                   .'<b>'.$bcc_curr_hdr.'</b>'.
+                   .'</legend>'
+                   .'<form name="activeusers">';
+        $result .= $tmptext.'</form></fieldset><br />';
+        if (ref($statushash) eq 'HASH') {
+            $statushash->{'active'} = 1;
+        }
     }
     if ($tmptext = &Apache::lonselstudent::render_student_list($expired_members,
                                                                "previoususers",
@@ -536,12 +546,20 @@
                                                                \%defaultUsers,
                                                                1, "selectedusers",0,'email')
        ) {
-       $result .= '<fieldset id="LC_previoususers"><legend><b>'.&mt('Bcc: course members with expired access').'</b></legend><form name="futureusers">';
+        my $bcc_prev_hdr;
+        if ($crstype eq 'Community') {
+            $bcc_prev_hdr = &mt('Bcc: community participants with expired access');
+        } else {
+            $bcc_prev_hdr = &mt('Bcc: course members with expired access');
+        }
+        $result .= '<fieldset id="LC_previoususers"><legend>'
+                   .'<b>'.$bcc_prev_hdr.'</b>'.
+                   .'</legend>'
+                   .'<form name="previoususers">';
        $result .= $tmptext.'</form></fieldset><br />';
        if (ref($statushash) eq 'HASH') {
            $statushash->{'previous'} = 1;
        }
-
     }
     if ($tmptext = &Apache::lonselstudent::render_student_list($future_members,
                                                                "futureusers",
@@ -549,12 +567,20 @@
                                                                \%defaultUsers,
                                                                1, "selectedusers",0,'email')
        ) {
-       $result .= '<fieldset id="LC_futureusers"><legend><b>'.&mt('Bcc: course members with future access').'</b></legend><form name="previoususers">';
+        my $bcc_future_hdr;
+        if ($crstype eq 'Community') {
+            $bcc_future_hdr = &mt('Bcc: community participants with future access');
+        } else {
+            $bcc_future_hdr = &mt('Bcc: course members with future access');
+        }
+        $result .= '<fieldset id="LC_futureusers"><legend>'
+                   .'<b>'.$bcc_future_hdr.'</b>'.
+                   .'</legend>'
+                   .'<form name="futureusers">';
        $result .= $tmptext.'</form></fieldset>';
        if (ref($statushash) eq 'HASH') {
            $statushash->{'future'} = 1;
        }
-
     }
     return $result;
 }
@@ -720,10 +746,16 @@
     }
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     if ($refarg) {
+        my $brtitle;
+        if (&Apache::loncommon::course_type() eq 'Community') {
+            $brtitle = 'View community groups';  
+        } else {
+            $brtitle = 'View course groups';
+        }
         &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>"/adm/coursegroups",
               text=>"Groups",
-              title=>"View course groups"});
+              title=>$brtitle});
     }
     &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg",
@@ -1300,22 +1332,34 @@
     if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
 	|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
 				    '/'.$env{'request.course.sec'})) {
+         my $crstype = &Apache::loncommon::course_type();
 	 my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
+         my $rsstxt;
+         if (&Apache::loncommon::course_type() eq 'Community') {
+             $rsstxt = &mt('Include in community RSS newsfeed');
+         } else {
+             $rsstxt = &mt('Include in course RSS newsfeed');
+         }
          $dispcrit=
  '<span class="LC_nobreak"><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'.</label>'.$crithelp.'&nbsp;&nbsp;'.&mt('Require return receipt?').'<label><input type="radio" name="sendbck" value="1" />'.&mt('Yes').'</label>&nbsp;&nbsp;<label><input type="radio" name="sendbck" value="" checked="checked" />'.&mt('No').'</label></span><br />'.
  '<label><input type="checkbox" name="permanent" /> '.
 &mt('Send copy to permanent e-mail address (if known)').'</label><br />'.
 '<label><input type="checkbox" name="rsspost" /> '.
-		  &mt('Include in course RSS newsfeed').'</label><br />';
+		  $rsstxt.'</label><br />';
     }
     if ($broadcast ne 'group') {
         if (&Apache::lonnet::allowed('dff',$env{'request.course.id'}) ||
             &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
                                      '/'.$env{'request.course.sec'})) {
-
+            my $rectxt;
+            if (&Apache::loncommon::course_type() eq 'Community') {
+                $rectxt = &mt("Include in community's 'User records' for recipient(s)");
+            } else {
+                $rectxt = &mt("Include in course's 'User records' for recipient(s)");
+            }
             $dispcrit.='<label>'.
                        '<input type="checkbox" name="courserecord" value="1" /> '.
-                       &mt("Include in course's 'User records' for recipient(s)").
+                       $rectxt.
                        '</label><br />';
         }
     }
@@ -1963,12 +2007,18 @@
 	$r->print('Not allowed');
 	return;
     }
-    my $usertype = (&Apache::loncommon::course_type() eq 'Community') ? 'members'
-	                                                          : 'students';
+    my $usertype;
+    my $crstype = &Apache::loncommon::course_type();
+    if ($crstype eq 'Community') {
+        $usertype = 'members';
+    } else {
+	$usertype = 'students';
+    }
+    my $lctype = lc($crstype);
     my %lt=&Apache::lonlocal::texthash(
             'comb' => 'Communication Blocking',
             'cbds' => 'Communication blocking during scheduled exams',
-            'desc' => "You can use communication blocking to prevent $usertype enrolled in this course from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",
+            'desc' => "You can use communication blocking to prevent $usertype enrolled in this $lctype from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course or community, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",
              'mecb' => 'Modify existing communication blocking periods',
              'ncbc' => 'No communication blocks currently saved',
              'stor' => 'Save',
@@ -2828,10 +2878,10 @@
     if ($baseurl) {
 	$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />";
     }
-    $r->print(&Apache::loncommon::start_page('Communication',
+    $r->print(&Apache::loncommon::start_page('Messages',
  					$extra));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs
-     		(($title?$title:'Send and Receive Messages')));
+     		(($title?$title:'Send and display messages')));
 }
 
 # ---------------------------------------------------------------- Print header
@@ -3244,7 +3294,7 @@
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"/adm/communicate",
-          text=>"Communication/Messages",
+          text=>"Messages",
           faq=>12,bug=>'Communication Tools',});
 
 # ------------------------------------------------------------------ Get Folder

--raeburn1264447860--