--- loncom/interface/lonmsg.pm 2004/03/01 02:21:57 1.88 +++ loncom/interface/lonmsg.pm 2004/03/01 20:57:47 1.91 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.88 2004/03/01 02:21:57 www Exp $ +# $Id: lonmsg.pm,v 1.91 2004/03/01 20:57:47 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -802,7 +802,9 @@ ENDDISHEADER sub compout { my ($r,$forwarding,$broadcast)=@_; - my $dispcrit=''; + &printheader($r,'/adm/email?compose=upload', + 'Distribute from uploaded file'); + my $dispcrit=''; my $dissub=''; my $dismsg=''; my $func=&mt('Send New'); @@ -855,8 +857,8 @@ ENDREC $r->print(<<"ENDCOMP"); $lt{'ad'}
username\@domain,username\@domain, ... - -$lt{'sb'}: + +$lt{'sb'}: $latexHelp

The file format for the uploaded portion of the message is: @@ -888,9 +890,9 @@ username3\@domain1: text The messages will be assembled from all lines with the respective username\@domain, and appended to the general message text.

-

+

$dispcrit - +

ENDUPLOAD } if ($broadcast eq 'group') { @@ -949,11 +951,9 @@ sub facetoface { unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { return; } - &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/dropadd?recordftf=query', - text=>"User Notes, Face-to-Face, Critical Messages", - faq=>12,bug=>'Communication Tools'}); - &header($r); + &printheader($r, + '/adm/email?recordftf=query', + "User Notes, Face-to-Face, Critical Messages"); # from query string if ($ENV{'form.recname'}) { $ENV{'form.recuname'}=$ENV{'form.recname'}; } @@ -1017,10 +1017,78 @@ ENDBFORM } } +# ----------------------------------------------- Generate the text input field + +sub textinputarea { + my ($r,$name,$quote)=@_; + $r->print(''); +} + +# ----------------------------------------------------------- Display a message + +sub displaymessage { + my ($r,$msgid)=@_; + &statuschange($msgid,'read'); + my %message=&Apache::lonnet::get('nohist_email',[$msgid]); + my %content=&unpackagemsg($message{$msgid}); +# info to generate "next" and "previous" buttons + my @messages=&sortedmessages(); + my $counter=0; + $r->print('
');
+    my $escmsgid=&Apache::lonnet::escape($msgid);
+    foreach (@messages) {
+	if ($_->[5] eq $escmsgid){
+	    last;
+	}
+	$counter++;
+    }
+    $r->print('
'); + my $number_of_messages = scalar(@messages); #subtract 1 for last index +# start output + &printheader($r,'/adm/email?display='.$msgid,'Display a Message','',$content{'baseurl'}); + my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); +# Functions + $r->print(''. + ''. + ''. + ''. + ''. + ''); + if ($counter > 0){ + $r->print(''); + } + if ($counter < $number_of_messages - 1){ + $r->print(''); + } + $r->print('
'.&mt('Functions').':'.&mt('Reply').''.&mt('Forward').''.&mt('Mark Unread').'Delete'.&mt('Display all Messages').''.&mt('Previous').''.&mt('Next').'
'); + $r->print('
'.&mt('Subject').': '.$content{'subject'}. + '
'.&mt('From').': '. + &Apache::loncommon::aboutmewrapper( + &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}), + $content{'sendername'},$content{'senderdomain'}).' ('. + $content{'sendername'}.' at '. + $content{'senderdomain'}.') '. + ($content{'courseid'}?'
'.&mt('Course').': '.$courseinfo{'description'}. + ($content{'coursesec'}?' ('.&mt('Group/Section').': '.$content{'coursesec'}.')':''):''). + '
'.&mt('Time').': '.$content{'time'}. + '

'.
+	      &Apache::lontexconvert::msgtexconverted($content{'message'},1).
+	      '

'.$content{'citation'}.'

'); + return; +} + # ================================================================== The Header sub header { - my ($r,$baseurl)=@_; + my ($r,$title,$baseurl)=@_; $r->print('Communication and Messages'); if ($baseurl) { $r->print(""); @@ -1028,10 +1096,21 @@ sub header { $r->print(&Apache::loncommon::studentbrowser_javascript().''. &Apache::loncommon::bodytag('Communication and Messages')); $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Communication and Messages')); + (undef,($title?$title:'Communication and Messages'))); + +} +# ---------------------------------------------------------------- Print header + +sub printheader { + my ($r,$url,$desc,$title,$baseurl)=@_; + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>$url, + text=>$desc}); + &header($r,$title,$baseurl); } + # ===================================================================== Handler sub handler { @@ -1064,64 +1143,7 @@ sub handler { # --------------------------------------------------------------- Render Output if ($ENV{'form.display'}) { - my $msgid=$ENV{'form.display'}; - &statuschange($msgid,'read'); - my %message=&Apache::lonnet::get('nohist_email',[$msgid]); - my %content=&unpackagemsg($message{$msgid}); -# info to generate "next" and "previous" buttons - my @messages=&sortedmessages(); - my $counter=0; - $r->print('
');
-	my $escmsgid=&Apache::lonnet::escape($msgid);
-	foreach (@messages) {
-	    if ($_->[5] eq $escmsgid){
-		last;
-	    }
-	    $counter++;
-	}
-	$r->print('
'); - my $number_of_messages = scalar(@messages); #subtract 1 for last index -# start output - $r->print('EMail and Messaging'); - $r->print(&Apache::loncommon::studentbrowser_javascript(). - ''. - &Apache::loncommon::bodytag('EMail and Messages'). - &Apache::loncommon::help_open_faq(12). - &Apache::loncommon::help_open_bug('Communication Tools')); - my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); - - $r->print('
'.&mt('Subject').': '.$content{'subject'}. - '
'.&mt('From').': '. - &Apache::loncommon::aboutmewrapper( - &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}), - $content{'sendername'},$content{'senderdomain'}).' ('. - $content{'sendername'}.' at '. - $content{'senderdomain'}.') '. - ($content{'courseid'}?'
'.&mt('Course').': '.$courseinfo{'description'}. - ($content{'coursesec'}?' ('.&mt('Group/Section').': '.$content{'coursesec'}.')':''):''). - '
'.&mt('Time').': '.$content{'time'}.'

'. - ''. - ''. - ''. - ''. - ''. - ''); - if ($counter > 0){ - $r->print(''); - } - if ($counter < $number_of_messages - 1){ - $r->print(''); - } - $r->print('
'.&mt('Functions').':'.&mt('Reply').''.&mt('Forward').''.&mt('Mark Unread').'Delete'.&mt('Display all Messages').''.&mt('Previous').''.&mt('Next').'

'.
-		  &Apache::lontexconvert::msgtexconverted($content{'message'},1).
-		  '

'.$content{'citation'}); + &displaymessage($r,$ENV{'form.display'}); } elsif ($ENV{'form.replyto'}) { &comprep($r,$ENV{'form.replyto'}); } elsif ($ENV{'form.sendreply'}) {