--- loncom/interface/lonmsgdisplay.pm 2010/02/12 17:22:24 1.149 +++ loncom/interface/lonmsgdisplay.pm 2013/07/15 16:13:21 1.163 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.149 2010/02/12 17:22:24 bisitz Exp $ +# $Id: lonmsgdisplay.pm,v 1.163 2013/07/15 16:13:21 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,7 +110,7 @@ use Apache::lonfeedback; use Apache::lonrss(); use Apache::lonselstudent(); use lib '/home/httpd/lib/perl/'; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); # Querystring component with sorting type my $sqs=''; @@ -222,26 +222,30 @@ function folder_choice(targetform,caller $output .= '
+
+ '.&mt('Folder Actions').' - + +
'.$lt{'fold'}.'
'."\n". - &Apache::loncommon::select_form($folder,'folder',%formhash).' + &Apache::loncommon::select_form($folder,'folder',\%formhash).'
'.$lt{'show'}.'
'."\n". &Apache::loncommon::select_form($env{'form.interdis'},'interdis', - %show).' + \%show).'
'.$lt{'status'}.'
'."\n". - &Apache::loncommon::select_form($msgstatus,'msgstatus',%statushash).' + &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
'.$lt{'actn'}.'
'."\n".' '. - &Apache::loncommon::select_form('view','folderaction',%actions). + &Apache::loncommon::select_form('view','folderaction',\%actions). '
'.&mt('New Folder').'
'."\n".' +
'.&mt('New Folder').'
'."\n".' '. ''. @@ -543,7 +548,7 @@ sub discourse { $result .= '
' .$bcc_curr_hdr .'' - .''; + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'active'} = 1; @@ -564,7 +569,7 @@ sub discourse { $result .= '
' .$bcc_prev_hdr .'' - .'
'; + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'previous'} = 1; @@ -587,7 +592,7 @@ sub discourse { $result .= '
' .$bcc_future_hdr .'' - .'
'; + .''; $result .= $tmptext.'
'; if (ref($statushash) eq 'HASH') { $statushash->{'future'} = 1; @@ -626,9 +631,7 @@ sub disgroup { return; } else { $hasfloat = 1; - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print('
'); - } + $r->print('
'); my %Sortby = ( active => {}, previous => {}, @@ -664,7 +667,7 @@ sub disgroup { } $r->print('
'. ''.$lt{$status}.''. - '
'. + ''. ''. ''. @@ -701,9 +704,7 @@ sub disgroup { } } } - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print('
'); - } + $r->print('
'); } return $hasfloat; } @@ -818,6 +819,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( @@ -829,8 +839,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') @@ -867,8 +882,9 @@ sub discrit { '

'. &mt('You have no critical messages.'). '

'. - ''.&mt('Select a course').'
'. - ''.&mt('Communicate').''; + &Apache::lonhtmlcommon::actionbox( + [''.&mt('Select a course').'', + ''.&mt('Communicate').'']); } else { $r->print($header); } @@ -985,10 +1001,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; } @@ -1217,17 +1238,17 @@ ENDDISHEADER # Bottom Functions - $r->print(' + $r->print(' +
+'.&mt('Message Actions').' +
- '."\n". ''."\n"); if (keys(%gotfolders) > 0) { - $r->print(''); } - $r->print(''."\n". - '
-
- '.&mt('Select').' +
'.&mt('Select Messages').'
'."\n". ' '."\n". ' -
'.&mt('Action').'
'."\n". '
'.&mt('Destination folder').'
'); + $r->print('
'.&mt('Destination folder').'
'); my %userfolders; foreach my $key (keys(%gotfolders)) { $userfolders{$key} = $key; } $userfolders{''} = ""; - $r->print(&Apache::loncommon::select_form('','movetofolder',%userfolders). + $r->print(&Apache::loncommon::select_form('','movetofolder',\%userfolders). '
'. + $r->print(''. '
'); + '
'."\n". + '
'."\n" + ); my $postedstartdis=$startdis+1; $r->print(''); if ($numblocked > 0) { @@ -1423,11 +1446,7 @@ sub compout { if ($group eq '') { my $studentsel = &discourse(\%access_status); if ($studentsel) { - if ($env{'environment.wysiwygeditor'} eq 'on') { - $r->print($studentsel); - } else { - $r->print('
'.$studentsel.'
'); - } + $r->print('
'.$studentsel.'
'); $hasfloat = 1; } } else { @@ -1451,9 +1470,12 @@ function courseRecipients() { document.compemail.groupmail.value = document.$formname.groupmail[document.$formname.groupmail.selectedIndex].value; |; } + #typeof(...forminput.length) returns 'undefined' if only one entry exists $broadcast_js .= qq| if (typeof(document.$formname.selectedusers_forminput.length)=="undefined") { - document.compemail.courserecips.value += '_&&&_'+document.$formname.selectedusers_forminput.value; + if (document.$formname.selectedusers_forminput.checked) { + document.compemail.courserecips.value += '_&&&_'+document.$formname.selectedusers_forminput.value; + } } else { for (var i=0; iprint($broadcast_js); - } else { - $r->print($broadcast_js.'
'); - } + $r->print($broadcast_js.'
'); $onsubmit = ' onsubmit="javascript:courseRecipients();" '; } $r->print( @@ -1637,7 +1655,11 @@ ENDREPSCRIPT } } my $latexHelp = &Apache::loncommon::helpLatexCheatsheet(undef,undef,1); - my $wysiwyglink=&Apache::lonhtmlcommon::htmlareaselectactive('message').'
'; + my $textareaclass; + if (&Apache::lonhtmlcommon::htmlareabrowser()) { + $r->print(&Apache::lonhtmlcommon::htmlareaselectactive()); + $textareaclass = 'class="LC_richDefaultOff"'; + } my $subj_size; if ($multiforward) { $r->print(&additional_rec_row(\%lt)); @@ -1659,8 +1681,7 @@ ENDREPSCRIPT '."\n". $latexHelp."
\n". &mt("Any new text to display before the text of the original messages:").'
'."\n". -''. -$wysiwyglink); +''); my @to_forward = &Apache::loncommon::get_env_multiple('form.delmark'); foreach my $msg (@to_forward) { $r->print(''); @@ -1680,8 +1701,9 @@ $wysiwyglink); $attachrow
$latexHelp
-$wysiwyglink + +
$sendmode $dispcrit $disbase @@ -1706,8 +1728,8 @@ ENDCOMP Subject:

$lt{'gmt'}:
-$wysiwyglink

+

$lt{'tff'}: ENDBLOCK @@ -1733,9 +1755,7 @@ ENDUPLOAD } $r->print(''); if ($hasfloat) { - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print('

'); - } + $r->print('
'); } $r->print(&generate_preview_form); } @@ -2009,6 +2029,7 @@ sub facetoface { .&Apache::lonhtmlcommon::end_pick_box() .'
' .'' + .'' ); if (($stage ne 'query') && @@ -2028,7 +2049,7 @@ sub facetoface { .&mt('Discussion and message records for [_1] ([_2])' ,$aboutmelink ,$env{'form.recuname'}.':'.$env{'form.recdomain'}) - .'

' + .'

' ); &disfacetoface($r,$env{'form.recuname'},$env{'form.recdomain'}); $r->print(<print('Not allowed'); - return; - } - my $usertype; - my $crstype = &Apache::loncommon::course_type(); - if ($crstype eq 'Community') { - $usertype = 'members'; - } else { - $usertype = 'students'; - } - my $lctype = lc($crstype); - 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 $lctype 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 or community, 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'}.'

-
- '); - - $r->print('

'.$lt{'mecb'}.'

'); - my %records = (); - my $blockcount = 0; - my $parmcount = 0; - &get_blockdates(\%records,\$blockcount); - if ($blockcount > 0) { - $parmcount = &display_blocker_status($r,\%records,\%ltext); - } else { - $r->print($lt{'ncbc'}.'

'); - } - &display_addblocker_table($r,$parmcount,\%ltext); - my $end_page=&Apache::loncommon::end_page(); - $r->print(<<"END"); -
- - -
-$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"); - - $ltext->{'dura'} - $ltext->{'setb'} - $ltext->{'even'} - $ltext->{'blck'} - $ltext->{'actn'} - -END - foreach my $record (sort(keys(%{$records}))) { - my $onchange = 'onFocus="javascript:window.document.forms['. - "'blockform'].elements['modify_".$parmcount."'].". - 'checked=true;"'; - my ($start,$end) = split(/____/,$record); - my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange); - my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange); - - my ($setuname,$setudom,$title,$blocks) = - &Apache::loncommon::parse_block_record($$records{$record}); - $title = &HTML::Entities::encode($title,'"<>&'); - my $settername = - &Apache::loncommon::aboutmewrapper( - &Apache::loncommon::plainname($setuname,$setudom), - $setuname,$setudom); - $r->print(&Apache::loncommon::start_data_table_row()); - $r->print(<<"END"); - $ltext->{'star'}: $startform
$ltext->{'endd'}:  $endform - $settername - - -END - foreach my $block (@{$typeorder}) { - my $blockstatus = ''; - if ($blocks->{$block} eq 'on') { - $blockstatus = 'checked="checked"'; - } - $r->print('
'); - } - $r->print(<<"END"); - -
- -END - $r->print(&Apache::loncommon::end_data_table_row()); - $parmcount++; - } - $r->print(<<"END"); - -
-
-END - return $parmcount; -} - -sub display_addblocker_table { - my ($r,$parmcount,$ltext) = @_; - my $start = time; - my $end = $start + (60 * 60 * 2); #Default is an exam of 2 hours duration. - my $onchange = 'onFocus="javascript:window.document.forms['. - "'blockform'].elements['add_".$parmcount."'].". - 'checked=true;"'; - my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange); - my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange); - my %lt = &Apache::lonlocal::texthash( - 'addb' => 'Add block', - 'exam' => 'e.g., Exam 1', - 'addn' => 'Add new communication blocking periods' - ); - my ($typeorder,$types) = &blocktype_text(); - $r->print(<<"END"); -

$lt{'addn'}

-END - $r->print(&Apache::loncommon::start_data_table()); - $r->print(<<"END"); - - $ltext->{'dura'} - $ltext->{'even'} $lt{'exam'} - $ltext->{'blck'} - $ltext->{'actn'} - -END - $r->print(&Apache::loncommon::start_data_table_row()); - $r->print(<<"END"); - $ltext->{'star'}: $startform
$ltext->{'endd'}:  $endform - - -END - foreach my $block (@{$typeorder}) { - $r->print('
'); - } - $r->print(<<"END"); - - -END - $r->print(&Apache::loncommon::end_data_table_row()); - $r->print(&Apache::loncommon::end_data_table()); - return; -} - -sub blocktype_text { - my %types = &Apache::lonlocal::texthash( - 'com' => 'Messaging', - 'chat' => 'Chat Room', - 'boards' => 'Discussion', - 'port' => 'Portfolio', - 'groups' => 'Groups', - 'blogs' => 'Blogs', - ); - my $typeorder = ['com','chat','boards','port','groups','blogs']; - return ($typeorder,\%types); -} - # ----------------------------------------------------------- Display a message sub displaymessage { @@ -2374,7 +2084,6 @@ sub displaymessage { if ( $blocked{$msgid} eq 'ON' ) { &printheader($r,'/adm/email',&mt('Display a Message')); #$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.')); - #&build_block_table($r,$startblock,$endblock,\%setters); my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); $r->print("
".$blocktext); return; @@ -2411,7 +2120,6 @@ sub displaymessage { 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'}); # Prepare available functions my @functionlist; @@ -2429,19 +2137,22 @@ sub displaymessage { push(@functionlist,'' .&mt('Delete') .''); - push(@functionlist,'' - .&mt('Back to Folder Display') - .''); + +# Prepare available navigation + my @navigationlist; if ($counter > 0){ - push(@functionlist,'' + push(@navigationlist,'' .&mt('Previous') .''); } if ($counter < $number_of_messages - 1){ - push(@functionlist,'' + push(@navigationlist,'' .&mt('Next') .''); } + push(@navigationlist,'' + .&mt('Back to Folder Display') + .''); # Prepare available actions my $symb; @@ -2450,7 +2161,7 @@ sub displaymessage { } elsif (defined($content{'baseurl'})) { $symb=&Apache::lonnet::symbread($content{'baseurl'}); } - my @actionlist; + my @actionlist; if ($env{'user.adv'}) { if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { @@ -2478,7 +2189,7 @@ sub displaymessage { } } -# Print functionlist and actionlist in page header +# Print functionlist, navigationlist, and actionlist in page header my $functions='
'; # Functionlist @@ -2488,10 +2199,18 @@ sub displaymessage { } $functions .= &Apache::lonhtmlcommon::end_funclist(); + # Navigationlist + $functions.=&Apache::lonhtmlcommon::start_funclist( + &mt('Navigation')); + foreach my $item (@navigationlist) { + $functions.=&Apache::lonhtmlcommon::add_item_funclist($item); + } + $functions .= &Apache::lonhtmlcommon::end_funclist(); + # Actionlist if (@actionlist) { - my $legendtext=&mt('Currently available actions (will open extra window)'); - $functions.=&Apache::lonhtmlcommon::start_funclist($legendtext); + $functions.=&Apache::lonhtmlcommon::start_funclist( + &mt('Currently available actions (will open extra window)')); foreach my $item (@actionlist) { $functions.=&Apache::lonhtmlcommon::add_item_funclist($item); } @@ -2655,12 +2374,14 @@ sub displaymessage { } if ($content{'group'} ne '') { if (&check_group_priv($content{'group'})) { - $groupcclist = join(', ',@{$recipients{'group_cc_broadcast'}}); - if ($groupcclist) { - $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group Cc')) - .$groupcclist - .&Apache::lonhtmlcommon::row_closure() - ); + if (ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') { + $groupcclist = join(', ',@{$recipients{'group_cc_broadcast'}}); + if ($groupcclist) { + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group Cc')) + .$groupcclist + .&Apache::lonhtmlcommon::row_closure() + ); + } } } } @@ -2668,14 +2389,22 @@ sub displaymessage { } # Course - if ($content{'courseid'}) { - $r->print(&Apache::lonhtmlcommon::row_title(&mt($crstype)) - .$courseinfo{'description'} - ); - if ($content{'coursesec'}) { - $r->print(' ('.&mt('Section').': '.$content{'coursesec'}.')'); + if ($content{'courseid'} ne '') { + if ($content{'courseid'} =~ m{^$match_domain\_$match_courseid$}) { + my %courseinfo; + %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}, + {'one_time' => 1}); + my $description = $courseinfo{'description'}; + if ($description ne '') { + $r->print(&Apache::lonhtmlcommon::row_title(&mt($crstype)) + .$description + ); + if ($content{'coursesec'}) { + $r->print(' ('.&mt('Section').': '.$content{'coursesec'}.')'); + } + $r->print(&Apache::lonhtmlcommon::row_closure()); + } } - $r->print(&Apache::lonhtmlcommon::row_closure()); } $r->print(&Apache::lonhtmlcommon::row_title(&mt('Time')) .$content{'time'} @@ -3184,7 +2913,7 @@ sub sendoffmail { my ($recuname,$recdomain)=split(/\:/,$address); my $msgtxt = $savemsg; if ($toaddr{$address}) { - $msgtxt.='
'.$toaddr{$address}; + $msgtxt.="\n".'
'."\n".$toaddr{$address}; } my @thismsg; if ($msgtype eq 'critical') { @@ -3309,6 +3038,9 @@ sub sendoffmail { $r->print($message); } } + } else { + &printheader($r,'','Messages cancelled.'); + return 'cancelled'; } return $sendstatus; } @@ -3329,15 +3061,13 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['display','replyto','forward','markread','markdel','markunread', 'sendreply','compose','sendmail','critical','recname','recdom', - 'recordftf','sortedby','block','folder','startdis','interdis', + 'recordftf','sortedby','folder','startdis','interdis', 'showcommentbaseurl','dismode','group','subject','text','ref', 'msgstatus']); $sqs='&sortedby='.$env{'form.sortedby'}; # ------------------------------------------------------ They checked for email - unless ($env{'form.block'}) { - &Apache::lonnet::put('email_status',{'recnewemail'=>0}); - } + &Apache::lonnet::put('email_status',{'recnewemail'=>0}); # ----------------------------------------------------------------- Breadcrumbs @@ -3540,8 +3270,6 @@ sub handler { &compout($r,'','',$env{'form.compose'}); } elsif ($env{'form.recordftf'}) { &facetoface($r,$env{'form.recordftf'}); - } elsif ($env{'form.block'}) { - &examblock($r,$env{'form.block'}); } elsif ($env{'form.sendmail'}) { if ($env{'form.multiforward'}) { &printheader($r,'','Messages being sent.');