--- loncom/interface/lonmsgdisplay.pm 2007/04/22 02:25:36 1.69
+++ loncom/interface/lonmsgdisplay.pm 2008/06/06 22:50:41 1.88
@@ -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.88 2008/06/06 22:50:41 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);
}
@@ -510,22 +513,34 @@ sub discourse {
$result .= ''."\n";
- $result .= &Apache::lonselstudent::render_student_list($current_members,
- "compemail",
- "current",
- \%defaultUsers,
- 1,"selectedusers",1);
-
- $result .= &Apache::lonselstudent::render_student_list($expired_members,
- "compemail",
- "expired",
- \%defaultUsers,
- 1, "selectedusers",0);
- $result .= &Apache::lonselstudent::render_student_list($future_members,
- "compemail",
- "future",
- \%defaultUsers,
- 1, "selectedusers", 0);
+ my $tmptext;
+ if ($tmptext = &Apache::lonselstudent::render_student_list($current_members,
+ "compemail",
+ "current",
+ \%defaultUsers,
+ 1,"selectedusers",1)
+ ) {
+ $result .= '
'.
-&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox').
- ' '.
- ''.
- '';
+ $result .= &Apache::lonhtmlcommon::start_pick_box()
+ .&Apache::lonhtmlcommon::row_title(&mt('From'),undef,'LC_oddrow_value')
+ .''.&Apache::loncommon::aboutmewrapper(
+ &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).''
+ .' ('.$content{'sendername'}.':'.$content{'senderdomain'}.')'
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title(&mt('Date'),undef,'LC_evenrow_value')
+ .$content{'time'}
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title(&mt('Subject'),undef,'LC_oddrow_value')
+ .$content{'subject'}
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
+ .'
';
+ 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 .= '
'
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title('',undef,'LC_evenrow_value')
+ .'';
+ if (!$content{'noreplies'}) {
+ $result .= ''
+ }
+ $result .= &Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::end_pick_box()
+ .' ';
}
# Check to see if there were any messages.
if ($result eq '') {
@@ -874,8 +917,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 +954,6 @@ sub disfolder {
+ENDREPSCRIPT
}
my $citation=&displayresource(%content);
my ($can_grp_broadcast,$viewgrps,$editgrps);
@@ -1292,14 +1360,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 +1709,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 +1724,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 +1788,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 +2092,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 +2102,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('