--- loncom/interface/lonmsg.pm 2004/03/01 01:19:51 1.87
+++ loncom/interface/lonmsg.pm 2004/03/01 18:30:50 1.90
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.87 2004/03/01 01:19:51 www Exp $
+# $Id: lonmsg.pm,v 1.90 2004/03/01 18:30:50 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');
@@ -949,7 +951,11 @@ sub facetoface {
unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
return;
}
+ &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'}; }
if ($ENV{'form.recdom'}) { $ENV{'form.recdomain'}=$ENV{'form.recdom'}; }
@@ -960,17 +966,23 @@ sub facetoface {
my $domform = &Apache::loncommon::select_dom_form($defdom,'recdomain');
my $stdbrws = &Apache::loncommon::selectstudent_link
('stdselect','recuname','recdomain');
+ my %lt=&Apache::lonlocal::texthash('user' => 'Username',
+ 'dom' => 'Domain',
+ 'head' => 'User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course',
+ 'subm' => 'Retrieve discussion and message records',
+ 'newr' => 'New Record (record is visible to course faculty and staff)',
+ 'post' => 'Post this Record');
$r->print(<<"ENDTREC");
-
User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course
+$lt{'head'}
@@ -982,7 +994,8 @@ ENDTREC
&user_normal_msg_raw(
$ENV{'course.'.$ENV{'request.course.id'}.'.num'},
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
- 'Record ['.$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}.']',
+ &mt('Record').
+ ' ['.$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}.']',
$ENV{'form.newrecord'});
}
$r->print(''.&Apache::loncommon::plainname($ENV{'form.recuname'},
@@ -994,15 +1007,100 @@ ENDTREC
ENDRHEAD
$r->print(< New Record (record is visible to course faculty and staff)
+ $lt{'newr'}
-
+
ENDBFORM
}
}
+# ----------------------------------------------------------- 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(' ');
+ $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,$title,$baseurl)=@_;
+ $r->print('Communication and Messages ');
+ if ($baseurl) {
+ $r->print(" ");
+ }
+ $r->print(&Apache::loncommon::studentbrowser_javascript().''.
+ &Apache::loncommon::bodytag('Communication and Messages'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs
+ (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
@@ -1024,76 +1122,19 @@ sub handler {
$sqs='&sortedby='.$ENV{'form.sortedby'};
# ------------------------------------------------------ They checked for email
&Apache::lonnet::put('email_status',{'recnewemail'=>0});
+
+# ----------------------------------------------------------------- Breadcrumbs
+
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/communicate",
+ text=>"Communication/Messages",
+ faq=>12,bug=>'Communication Tools',});
+
# --------------------------------------------------------------- Render Output
- if (!$ENV{'form.display'}) {
- $r->print('EMail and Messaging '.
- &Apache::loncommon::studentbrowser_javascript().''.
- &Apache::loncommon::bodytag('EMail and Messages').
- &Apache::loncommon::help_open_faq(12).
- &Apache::loncommon::help_open_bug('Communication Tools'));
- }
+
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 ');
- if (defined($content{'baseurl'})) {
- $r->print(" ");
- }
- $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'}.''.
- '
'.
- &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'}) {