--- loncom/interface/lonmsgdisplay.pm 2007/05/01 18:40:57 1.71
+++ 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.71 2007/05/01 18:40:57 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);
@@ -1310,14 +1360,52 @@ will be forwarded to the recipient(s) yo
}
if (($broadcast ne 'group') && ($broadcast ne 'upload')) {
if ($replying) {
- $r->print('
ENDADD
return $output;
}
@@ -1458,7 +1566,7 @@ sub submit_button_row {
sub msg_subject_row {
my ($dissub,$lt,$subj_size,$extra) = @_;
- my $output = '
'.$lt->{'sb'}.':
'.$lt->{'sb'}.': '.$extra.
'
';
return $output;
@@ -1680,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(
@@ -1984,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);
@@ -1995,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('