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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 25 Apr 2006 20:02:30 -0000


albertel		Tue Apr 25 16:02:30 2006 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  
  - change display of username@domain to username:domain
  - blocks were storing username@domain:title, changed to username:domain:title
    added code to support both old and new formats
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.13 loncom/interface/lonmsgdisplay.pm:1.14
--- loncom/interface/lonmsgdisplay.pm:1.13	Tue Apr 25 15:50:09 2006
+++ loncom/interface/lonmsgdisplay.pm	Tue Apr 25 16:02:30 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.13 2006/04/25 19:50:09 albertel Exp $
+# $Id: lonmsgdisplay.pm,v 1.14 2006/04/25 20:02:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -338,7 +338,7 @@
         if (! defined($fullname) || $fullname eq '') { $fullname = $sname; }
         $r->print('<tr><td><label>'.
                   qq{<input type="checkbox" name="$key" />}.('&nbsp;'x2).
-                  $fullname.'</label></td><td>'.$sname.'@'.$sdom.'</td><td>'.$section.
+                  $fullname.'</label></td><td>'.$sname.':'.$sdom.'</td><td>'.$section.
                   '</td></tr>');
     }
     $r->print('</table>');
@@ -359,7 +359,7 @@
         $result.='<hr />'.&mt('From').': <b>'.
 &Apache::loncommon::aboutmewrapper(
  &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).'</b> ('.
-$content{'sendername'}.'@'.
+$content{'sendername'}.':'.
             $content{'senderdomain'}.') '.$content{'time'}.
             '<br />'.&mt('Subject').': '.$content{'subject'}.
             '<br /><pre>'.
@@ -867,7 +867,7 @@
 	    $r->print('<tr><td colspan="2">'.&mt('Replying to').' '.
 		      &Apache::loncommon::aboutmewrapper(
 							 &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('.
-		      $content{'sendername'}.'@'.
+		      $content{'sendername'}.':'.
 		      $content{'senderdomain'}.')'.
 		      '<input type="hidden" name="recuname" value="'.$content{'sendername'}.'" />'.
 		      '<input type="hidden" name="recdomain" value="'.$content{'senderdomain'}.'" />'.
@@ -960,7 +960,7 @@
         next if ($content{'subject'} !~ /^Record/);
 	# &Apache::lonfeedback::newline_to_br(\$content{'message'});
 	$result.='Recorded by '.
-            $content{'sendername'}.'@'.$content{'senderdomain'}."\n";
+            $content{'sendername'}.':'.$content{'senderdomain'}."\n";
         $result.=
             &Apache::lontexconvert::msgtexconverted($content{'message'})."\n";
      }
@@ -1018,7 +1018,7 @@
         $result.=&mt('By').': <b>'.
 &Apache::loncommon::aboutmewrapper(
  &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).'</b> ('.
-$content{'sendername'}.'@'.
+$content{'sendername'}.':'.
             $content{'senderdomain'}.') '.$content{'time'}.
             '<br /><pre>'.
               &Apache::lontexconvert::msgtexconverted($content{'message'}).
@@ -1232,7 +1232,7 @@
         unless ( defined($cancels{$_}) ) {
             my ($newstart,$newend) = &get_dates_from_form($_);
             my $newkey = $newstart.'____'.$newend;
-            $blocking{$newkey} = $env{'user.name'}.'@'.$env{'user.domain'}.':'.$env{'form.title_'.$_};
+            $blocking{$newkey} = $env{'user.name'}.':'.$env{'user.domain'}.':'.$env{'form.title_'.$_};
         }
     }
     if ($addtotal + $modtotal > 0) {
@@ -1319,8 +1319,14 @@
         my ($start,$end) = split/____/,$_;
         my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange);
         my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange);
-        my ($setter,$title) = split/:/,$$records{$_};
-        my ($setuname,$setudom) = split/@/,$setter;
+	my (@data,$setuname,$setudom,$title);
+	@data = split(/:/,$$records{$_},3);
+	if (scalar(@data) eq 2) {
+	    $title = $data[1];
+	    ($setuname,$setudom) = split(/@/,$data[0]);
+	} else {
+	    ($setuname,$setudom,$title) = @data;
+	}
         my $settername = &Apache::loncommon::plainname($setuname,$setudom);
         $r->print(<<"END");
        <tr bgcolor="$bgcols[$iter]">
@@ -1487,7 +1493,7 @@
             $closeblock= &Apache::lonlocal::locallocaltime($closeblock);
             $r->print('<tr><td>'.$courseinfo{'description'}.'</td>'.
                       '<td>'.$openblock.' to '.$closeblock.'</td>'.
-                      '<td>'.$fullname.' ('.$uname.'@'.$udom.
+                      '<td>'.$fullname.' ('.$uname.':'.$udom.
                       ')</td></tr>');
         }
     }
@@ -1722,7 +1728,7 @@
 
 	my %toaddr;
 	if ($env{'form.sendmode'} eq 'group') {
-	    foreach $address (keys(%env)) {
+	    foreach my $address (keys(%env)) {
 		if ($address=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) {
 		    $toaddr{$1}='';
 		}
@@ -1778,7 +1784,7 @@
 						   $env{'form.permanent'},
 						   \$sentmessage{$address});
 	    } else {
-		$r->print(&mt('Sending').' '.$recuname.'@'.$recdomain.': ');
+		$r->print(&mt('Sending').' '.$recuname.':'.$recdomain.': ');
 		@thismsg=
 		    &Apache::lonmsg::user_normal_msg($recuname,$recdomain,
 						     $msgsubj,$msgtxt,