--- loncom/interface/lonmsgdisplay.pm 2007/04/22 02:25:36 1.69
+++ loncom/interface/lonmsgdisplay.pm 2008/02/22 13:32:49 1.84
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.69 2007/04/22 02:25:36 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.84 2008/02/22 13:32:49 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -390,6 +390,9 @@ sub renamefolder {
if ($env{'form.renamed'} eq '') {
return &mt('The folder "[_1]" may not be renamed to "[_2]" as the new name you requested is an invalid name.',$folder,$newname);
}
+ if (defined($permfolders{$folder})) {
+ return &mt('The folder "[_1]" may not be renamed as it is a folder provided by the system.',$folder);
+ }
if (defined($permfolders{$newname})) {
return &mt('The folder "[_1]" may not be renamed to "[_2]" as the new name you requested is reserved for folders provided automatically by the system.',$folder,$newname);
}
@@ -734,12 +737,27 @@ $content{'sendername'}.':'.
' '.&mt('Subject').': '.$content{'subject'}.
'
'.
-&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox').
- ' '.
- ''.
- '';
+ '
';
+ my ($rec_button,$reprec_button);
+ $rec_button = &mt('Move to Inbox');
+ if (!$content{'noreplies'}) {
+ $reprec_button = &mt('Move to Inbox/Compose reply');
+ }
+ if ($content{'sendback'}) {
+ $rec_button = &mt('Confirm Receipt');
+ if (!$content{'noreplies'}) {
+ $reprec_button = &mt('Confirm Receipt and Reply');
+ }
+ $result .= &mt('You have to confirm that you have received this message before you can view other pages. After confirmation, this message will be moved to your regular inbox');
+ } else {
+ $result .= &mt('Access to other pages will be prevented until you have moved the message to your inbox.');
+ }
+ $result .= '
'.
+ '';
+ if (!$content{'noreplies'}) {
+ $result .= '';
+ }
}
# Check to see if there were any messages.
if ($result eq '') {
@@ -874,8 +892,7 @@ sub get_course_desc {
sub disall {
my ($r,$folder,$msgstatus)=@_;
- my %saveable = ('folder' => 'scalar',
- 'msgstatus' => 'scalar',
+ my %saveable = ('msgstatus' => 'scalar',
'sortedby' => 'scalar',
'interdis' => 'scalar',
);
@@ -912,16 +929,6 @@ sub disfolder {
+ENDREPSCRIPT
}
my $citation=&displayresource(%content);
my ($can_grp_broadcast,$viewgrps,$editgrps);
@@ -1292,14 +1325,52 @@ sub compout {
}
if (($broadcast ne 'group') && ($broadcast ne 'upload')) {
if ($replying) {
- $r->print('
';
+ if (defined($content{'coursemsgid'})) {
+ my $crsmsgid = &escape($content{'coursemsgid'});
+ my $archive_message = &general_message($crsmsgid);
+ $content{'message'} = ''.&mt('Subject').': '.$content{'message'}.' '.$archive_message;
+ } else {
+ %content=&Apache::lonmsg::unpackagemsg($content{'message'});
+ $content{'message'} =
+ ''.&mt('Subject').': '.$content{'subject'}.' '.&mt('Critical Message').'';
if (defined($content{'coursemsgid'})) {
@@ -1570,7 +1670,7 @@ sub facetoface {
: 'faculty and staff';
&printheader($r,
'/adm/email?recordftf=query',
- "User Notes, Face-to-Face, Critical Messages, Broadcast Messages");
+ "User Notes, Face-to-Face, Critical Messages, Broadcast Messages, Archived Messages");
# from query string
if ($env{'form.recname'}) { $env{'form.recuname'}=$env{'form.recname'}; }
@@ -1585,7 +1685,7 @@ sub facetoface {
('stdselect','recuname','recdomain');
my %lt=&Apache::lonlocal::texthash('user' => 'Username',
'dom' => 'Domain',
- 'head' => "User Notes, Records of Face-To-Face Discussions, Critical Messages, and Broadcast Messages in $crstype",
+ 'head' => "User Notes, Records of Face-To-Face Discussions, Critical Messages, Broadcast Messages and Archived Messages in $crstype",
'subm' => 'Retrieve discussion and message records',
'newr' => 'New Record (record is visible to '.lc($crstype).' '.$leaders.')',
'post' => 'Post this Record');
@@ -1649,8 +1749,8 @@ sub examblock {
'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.",
'mecb' => 'Modify existing communication blocking periods',
- 'ncbc' => 'No communication blocks currently stored',
- 'stor' => 'Store',
+ 'ncbc' => 'No communication blocks currently saved',
+ 'stor' => 'Save',
);
my %ltext = &Apache::lonlocal::texthash(
@@ -1953,7 +2053,6 @@ sub displaymessage {
}
my %message=&Apache::lonnet::get('nohist_email'.$suffix,[$msgid]);
my %content=&Apache::lonmsg::unpackagemsg($message{$msgid});
-
my $counter=0;
$r->print('
');
my $escmsgid=&escape($msgid);
@@ -1964,15 +2063,33 @@ sub displaymessage {
$counter++;
}
$r->print('
');
+
+ my $see_anonymous;
+ my $from_student = 0;
+ if ($env{'request.course.id'} eq $content{'courseid'}) {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $username = $content{'sendername'}.':'.$content{'senderdomain'};
+ my %classlist_entry =
+ &Apache::lonnet::get('classlist',[$username],$cdom,$cnum);
+ if (exists($classlist_entry{$username})) {
+ $from_student = 1;
+ $see_anonymous = &Apache::lonnet::allowed('rin',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''));
+ }
+ }
+
+
my $number_of_messages = scalar(@messages); #subtract 1 for last index
# start output
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'});
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'});
# Functions
- $r->print('