-
-
+
- '.$lt{'fold'}.' '."\n".
- &Apache::loncommon::select_form($folder,'folder',%formhash).'
+ | '.$lt{'fold'}.' '."\n".
+ &Apache::loncommon::select_form($folder,'folder',\%formhash).'
|
- '.$lt{'show'}.' '."\n".
+ | '.$lt{'show'}.' '."\n".
&Apache::loncommon::select_form($env{'form.interdis'},'interdis',
- %show).'
+ \%show).'
+ |
+ '.$lt{'status'}.' '."\n".
+ &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
|
- '.$lt{'status'}.' '."\n".
- &Apache::loncommon::select_form($msgstatus,'msgstatus',%statushash).'
+ | '.$lt{'actn'}.' '."\n".'
+ '.
+ &Apache::loncommon::select_form('view','folderaction',\%actions).
+ '
+
|
- '.$lt{'actn'}.' '.
- &Apache::loncommon::select_form('view','folderaction',%actions).'
- | '.
- '
+ | '.&mt('New Folder').' '."\n".'
+
+
+
+
|
- | | | |
-
-
- |
-
- '."\n".
+'."\n".
''.
''.
($folder=~/^critical/?'':'');
@@ -273,12 +268,13 @@ sub get_permanent_folders {
}
sub get_msgstatus_types {
- my %statushash = &Apache::lonlocal::texthash(
- '' => 'Any',
- new => 'Unread',
- read => 'Read',
- replied => 'Replied to',
- forwarded => 'Forwarded',
+ # Don't translate here!
+ my %statushash = (
+ '' => 'Any',
+ 'new' => 'Unread',
+ 'read' => 'Read',
+ 'replied' => 'Replied to',
+ 'forwarded' => 'Forwarded',
);
return %statushash;
}
@@ -291,18 +287,31 @@ sub scrollbuttons {
my %statushash = &get_msgstatus_types();
my $status;
if ($msgstatus eq '') {
- $status = &mt('All');
+ $status = 'All'; # Don't translate here!
} else {
$status = $statushash{$msgstatus};
}
- return
- ''.&mt('Page').': '.
- ''.
- ''.
- ' / '.$maxdis.' '.
- ''.
- ' '.
- &mt('[_1] messages: showing messages [_2] through [_3] of [_4].',$status,$first,$finish,$total).'';
+ my $output = ''.&mt('Page:').' ';
+ if ($maxdis == 1) {
+ # No buttons if only one page is displayed
+ $output .= '1/1';
+ } else {
+ $output .=
+ ''.
+ ''.
+ ' / '.$maxdis.' '.
+ ''.
+ '';
+ }
+ $output .=
+ ''
+ .''.&mt($status.' messages:').' '
+ .&mt('showing messages [_1] through [_2] of [_3].',
+ $first,$finish,$total)
+ .' '
+ .'';
+
+ return $output;
}
# =============================================================== Status Change
@@ -369,7 +378,7 @@ sub deletefolder {
my ($folder)=@_;
my %permfolders = &get_permanent_folders();
if (defined($permfolders{$folder})) {
- return &mt('The folder "[_1]" may not be deleted',$folder);
+ return &mt('The folder "[_1]" may not be deleted.',$folder);
}
my %userfolders = &Apache::lonmsg::get_user_folders();
if (!defined($userfolders{$folder})) {
@@ -509,6 +518,7 @@ sub movemsg {
sub discourse {
my ($statushash) = @_;
my ($result,$active,$previous,$future);
+ my $crstype = &Apache::loncommon::course_type();
my ($course_personnel,
$current_members,
$expired_members,
@@ -524,8 +534,14 @@ sub discourse {
\%defaultUsers,
1,"selectedusers",1,'email')
) {
+ my $bcc_curr_hdr;
+ if ($crstype eq 'Community') {
+ $bcc_curr_hdr = &mt('Bcc: community participants with current access');
+ } else {
+ $bcc_curr_hdr = &mt('Bcc: course members with current access');
+ }
$result .= ' ';
@@ -539,8 +555,14 @@ sub discourse {
\%defaultUsers,
1, "selectedusers",0,'email')
) {
+ my $bcc_prev_hdr;
+ if ($crstype eq 'Community') {
+ $bcc_prev_hdr = &mt('Bcc: community participants with expired access');
+ } else {
+ $bcc_prev_hdr = &mt('Bcc: course members with expired access');
+ }
$result .= ' ';
@@ -555,10 +577,17 @@ sub discourse {
\%defaultUsers,
1, "selectedusers",0,'email')
) {
+ my $bcc_future_hdr;
+ if ($crstype eq 'Community') {
+ $bcc_future_hdr = &mt('Bcc: community participants with future access');
+ } else {
+ $bcc_future_hdr = &mt('Bcc: course members with future access');
+ }
+
$result .= '';
if (ref($statushash) eq 'HASH') {
$statushash->{'future'} = 1;
@@ -597,9 +626,7 @@ sub disgroup {
return;
} else {
$hasfloat = 1;
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('');
- }
+ $r->print(' ');
my %Sortby = (
active => {},
previous => {},
@@ -672,9 +699,7 @@ sub disgroup {
}
}
}
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print(' ');
- }
+ $r->print(' ');
}
return $hasfloat;
}
@@ -730,10 +755,16 @@ sub groupmail_header {
}
&Apache::lonhtmlcommon::clear_breadcrumbs();
if ($refarg) {
+ my $brtitle;
+ if (&Apache::loncommon::course_type() eq 'Community') {
+ $brtitle = 'View community groups';
+ } else {
+ $brtitle = 'View course groups';
+ }
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/coursegroups",
text=>"Groups",
- title=>"View course groups"});
+ title=>$brtitle});
}
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg",
@@ -783,6 +814,15 @@ sub discrit {
foreach my $key (sort(keys(%what))) {
my %content=&Apache::lonmsg::unpackagemsg($what{$key});
next if ($content{'senderdomain'} eq '');
+ my $description;
+ if ($content{'courseid'} ne '') {
+ if ($content{'courseid'} =~ m{/^$match_domain\_$match_courseid$}) {
+ my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'},{'one_time' => 1});
+ if ($courseinfo{'description'} ne '') {
+ $description = $courseinfo{'description'};
+ }
+ }
+ }
$result .= &Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_title(&mt('From'),undef,'LC_oddrow_value')
.''.&Apache::loncommon::aboutmewrapper(
@@ -794,8 +834,13 @@ sub discrit {
.&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')
+ .&Apache::lonhtmlcommon::row_closure(1);
+ if ($description ne '') {
+ $result .= &Apache::lonhtmlcommon::row_title(&mt('Course'),undef,'LC_oddrow_value')
+ .$description
+ .&Apache::lonhtmlcommon::row_closure(1);
+ }
+ $result .= &Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
.''.&Apache::lontexconvert::msgtexconverted($content{'message'}).' '
.&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value')
@@ -828,8 +873,11 @@ sub discrit {
}
# Check to see if there were any messages.
if ($result eq '') {
- $result = "".&mt('You have no critical messages.')."".
- ''.&mt('Select a course').' '.
+ $result =
+ ''.
+ &mt('You have no critical messages.').
+ ' '.
+ ''.&mt('Select a course').' '.
''.&mt('Communicate').'';
} else {
$r->print($header);
@@ -947,10 +995,15 @@ sub get_course_desc {
if (defined($env{'course.'.$fromcid.'.description'})) {
$description = $env{'course.'.$fromcid.'.description'};
} else {
- my %courseinfo=&Apache::lonnet::coursedescription($fromcid);
- $description = $courseinfo{'description'};
+ if ($fromcid =~ m{/^$match_domain\_$match_courseid$}) {
+ my %courseinfo=&Apache::lonnet::coursedescription($fromcid,
+ {'one_time' => 1});
+ $description = $courseinfo{'description'};
+ }
+ }
+ if ($description ne '') {
+ $$descriptions{$fromcid} = $description;
}
- $$descriptions{$fromcid} = $description;
}
return $description;
}
@@ -989,7 +1042,7 @@ sub disfolder {
my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com');
my %lt = &Apache::lonlocal::texthash(
sede => 'Select a destination folder to which the messages will be moved.',
- nome => 'No messages have been selected to apply ths action to.',
+ nome => 'No messages have been selected to apply this action to.',
chec => 'Check the checkbox for at least one message.',
);
my $jscript = &Apache::loncommon::check_uncheck_jscript();
@@ -1032,18 +1085,20 @@ ENDDISHEADER
my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
my $totalnumber=$#temp+1;
if ($totalnumber < 1) {
+ $r->print('');
if ($msgstatus eq '') {
- $r->print(' '.&mt('Empty Folder').'');
+ $r->print(&mt('There are no messages in this folder.'));
} elsif ($msgstatus eq 'replied') {
- $r->print(''.&mt('You have not replied to any messages in this folder.').'');
- } else {
- $r->print(''.&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.').'');
+ $r->print(&mt('You have not replied to any messages in this folder.'));
+ } else {
+ $r->print(&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.'));
}
+ $r->print('');
if ($numblocked > 0) {
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock,
\%setters));
}
- return;
+ return;
}
my $interdis = $env{'form.interdis'};
my $number=int($totalnumber/$interdis);
@@ -1058,61 +1113,65 @@ ENDDISHEADER
if ($lastdis>$#temp) { $lastdis=$#temp; }
$r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber,$msgstatus));
$r->print('');
if ($hasfloat) {
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('');
- }
+ $r->print('');
}
$r->print(&generate_preview_form);
}
@@ -1781,8 +1872,10 @@ sub retrieve_instructor_comments {
}
sub disfacetoface {
- my ($r,$user,$domain)=@_;
- my $target=$env{'form.grade_target'};
+ my ($r,$user,$domain,$target)=@_;
+ if ($target eq '') {
+ $target=$env{'form.grade_target'};
+ }
unless ($env{'request.course.id'}) { return; }
if (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
&& ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
@@ -1794,11 +1887,13 @@ sub disfacetoface {
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'},
'%255b'.$user.'%253a'.$domain.'%255d');
- my $result='';
+ my $result='';
foreach my $key (sort(keys(%records))) {
my %content=&Apache::lonmsg::unpackagemsg($records{$key});
next if ($content{'senderdomain'} eq '');
- &Apache::lonfeedback::newline_to_br(\$content{'message'});
+ if (!&Apache::lonfeedback::contains_block_html($content{'message'})) {
+ &Apache::lonfeedback::newline_to_br(\$content{'message'});
+ }
if ($content{'subject'}=~/^Record/) {
$result.=' '.&mt('Record').'';
} elsif ($content{'subject'}=~/^Broadcast/) {
@@ -1858,9 +1953,11 @@ $content{'sendername'}.':'.
} else {
$r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');
}
+ } elsif ($target ne 'tex') {
+ $r->print($result.'');
} else {
- $r->print($result);
- }
+ $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result));
+ }
}
sub general_message {
@@ -1924,6 +2021,7 @@ sub facetoface {
.&Apache::lonhtmlcommon::end_pick_box()
.' '
.''
+ .''
);
if (($stage ne 'query') &&
@@ -1962,304 +2060,6 @@ ENDBFORM
}
}
-# ----------------------------------------------------------- Blocking during exams
-
-sub examblock {
- my ($r,$action) = @_;
- unless ($env{'request.course.id'}) { return;}
- if (!&Apache::lonnet::allowed('dcm',$env{'request.course.id'})
- && ! &Apache::lonnet::allowed('dcm',$env{'request.course.id'}.
- '/'.$env{'request.course.sec'})) {
- $r->print('Not allowed');
- return;
- }
- my $usertype = (&Apache::loncommon::course_type() eq 'Community') ? 'members'
- : 'students';
- my %lt=&Apache::lonlocal::texthash(
- 'comb' => 'Communication Blocking',
- '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 saved',
- 'stor' => 'Save',
- );
-
- my %ltext = &Apache::lonlocal::texthash(
- 'dura' => 'Duration',
- 'setb' => 'Set by',
- 'even' => 'Event',
- 'blck' => 'Blocked?',
- 'actn' => 'Action',
- 'star' => 'Start',
- 'endd' => 'End'
- );
-
- &printheader($r,'/adm/email?block=display',$lt{'comb'});
- $r->print(''.$lt{'cbds'}.'');
-
- if ($action eq 'store') {
- &blockstore($r);
- }
-
- $r->print($lt{'desc'}.'
-
-$end_page
-END
- return;
-}
-
-sub blockstore {
- my $r = shift;
- my %lt=&Apache::lonlocal::texthash(
- 'tfcm' => 'The following changes were made',
- 'ncwm' => 'No changes were made.'
- );
- my %adds = ();
- my %removals = ();
- my %cancels = ();
- my $modtotal = 0;
- my $canceltotal = 0;
- my $addtotal = 0;
- my %blocking = ();
- $r->print(''.$lt{'head'}.'');
- foreach my $envkey (keys(%env)) {
- if ($envkey =~ m/^form\.modify_(\d+)$/) {
- $adds{$1} = $1;
- $removals{$1} = $1;
- $modtotal ++;
- } elsif ($envkey =~ m/^form\.cancel_(\d+)$/) {
- $cancels{$1} = $1;
- unless ( defined($removals{$1}) ) {
- $removals{$1} = $1;
- $canceltotal ++;
- }
- } elsif ($envkey =~ m/^form\.add_(\d+)$/) {
- $adds{$1} = $1;
- $addtotal ++;
- }
- }
-
- foreach my $key (keys(%removals)) {
- my $hashkey = $env{'form.key_'.$key};
- &Apache::lonnet::del('comm_block',["$hashkey"],
- $env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'}
- );
- }
- foreach my $key (keys(%adds)) {
- unless ( defined($cancels{$key}) ) {
- my ($newstart,$newend) = &get_dates_from_form($key);
- my $newkey = $newstart.'____'.$newend;
- my $blocktypes = &get_block_choices($key);
- $blocking{$newkey} = {
- setter => $env{'user.name'}.':'.$env{'user.domain'},
- event => &escape($env{'form.title_'.$key}),
- blocks => $blocktypes,
- };
- }
- }
- if ($addtotal + $modtotal > 0) {
- &Apache::lonnet::put('comm_block',\%blocking,
- $env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'}
- );
- }
- my $chgestotal = $canceltotal + $modtotal + $addtotal;
- if ($chgestotal > 0) {
- $r->print($lt{'tfcm'}.'');
- if ($canceltotal > 0) {
- $r->print('- '.&mt('[quant,_1,communication blocking period was,communication blocking periods were] removed.',$canceltotal).'
');
- }
- if ($modtotal > 0) {
- $r->print('- '.&mt('[quant,_1,communication blocking period was,communication blocking periods were] modified.',$modtotal).'
');
- }
- if ($addtotal > 0) {
- $r->print('- '.&mt('[quant,_1,communication blocking period was,communication blocking periods were] added.',$addtotal).'
');
- }
- $r->print(' ');
- } else {
- $r->print($lt{'ncwm'});
- }
- $r->print(' ');
- return;
-}
-
-sub get_dates_from_form {
- my $item = shift;
- my $startdate = &Apache::lonhtmlcommon::get_date_from_form('startdate_'.$item);
- my $enddate = &Apache::lonhtmlcommon::get_date_from_form('enddate_'.$item);
- return ($startdate,$enddate);
-}
-
-sub get_blockdates {
- my ($records,$blockcount) = @_;
- $$blockcount = 0;
- %{$records} = &Apache::lonnet::dump('comm_block',
- $env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'}
- );
- $$blockcount = keys(%{$records});
-
- if ((keys(%{$records}))[0] =~ /^error: 2 /) {
- $records = {};
- $$blockcount = 0;
- }
-}
-
-sub get_block_choices {
- my $item = shift;
- my $blocklist;
- my ($typeorder,$types) = &blocktype_text();
- foreach my $type (@{$typeorder}) {
- if ($env{'form.'.$type.'_'.$item}) {
- $blocklist->{$type} = 'on';
- } else {
- $blocklist->{$type} = 'off';
- }
- }
- return $blocklist;
-}
-
-sub display_blocker_status {
- my ($r,$records,$ltext) = @_;
- my $parmcount = 0;
-
- my %lt = &Apache::lonlocal::texthash(
- 'modi' => 'Modify',
- 'canc' => 'Cancel',
- );
- my ($typeorder,$types) = &blocktype_text();
- $r->print(&Apache::loncommon::start_data_table());
- $r->print(<<"END");
- |