version 1.181.2.1, 2017/04/02 13:31:48
|
version 1.181.2.8, 2021/12/14 00:20:07
|
Line 102 use HTML::TokeParser();
|
Line 102 use HTML::TokeParser();
|
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
|
use Apache::longroup; |
|
use Apache::lonnavmaps; |
use Apache::lontexconvert(); |
use Apache::lontexconvert(); |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 773 sub groupmail_header {
|
Line 775 sub groupmail_header {
|
text=>"Groups", |
text=>"Groups", |
title=>$brtitle}); |
title=>$brtitle}); |
} |
} |
|
my $view_permission = |
|
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
|
my $navmap=Apache::lonnavmaps::navmap->new(); |
|
my $grouppagelink = &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,$view_permission,$refarg); |
|
if ($grouppagelink) { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>$grouppagelink, |
|
text=>&mt('Group').": $description", |
|
title=>&mt("Go to group's home page"), |
|
no_mt=>1, |
|
},); |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({text=>&mt('Group').": $description", |
|
no_mt=>1,}); |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg", |
({href=>"/adm/email?compose=group&group=". |
text=>"Group: $description", |
"$env{'form.group'}&$refarg", |
title=>"Go to group's home page"}, |
text=>"Send a Message in a Group", |
{href=>"/adm/email?compose=group&group=". |
title=>"Compose Group Message"},); |
"$env{'form.group'}&$refarg", |
|
text=>"Send a Message in a Group", |
|
title=>"Compose Group Message"},); |
|
if ($action eq 'sending') { |
if ($action eq 'sending') { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({text=>"Messages being sent.", |
({text=>"Messages being sent.", |
title=>"E-mails sent"},); |
title=>"E-mails sent"},); |
} |
} |
my $groupheader = &Apache::loncommon::start_page('Group Message'); |
my $groupheader = &Apache::loncommon::start_page('Group Message'); |
$groupheader .= &Apache::lonhtmlcommon::breadcrumbs |
$groupheader .= &Apache::lonhtmlcommon::breadcrumbs( |
('Group - '.$env{'form.group'}.' Email'); |
&mt('Group messages - [_1]',$description), |
|
undef,undef,undef,undef,1); |
return $groupheader; |
return $groupheader; |
} |
} |
|
|
Line 849 sub discrit {
|
Line 865 sub discrit {
|
.&Apache::lonhtmlcommon::row_closure(1); |
.&Apache::lonhtmlcommon::row_closure(1); |
} |
} |
$result .= &Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value') |
$result .= &Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value') |
.'<pre>'.&Apache::lontexconvert::msgtexconverted($content{'message'}).'</pre>' |
.'<pre class="LC_wordwrap">'.&Apache::lontexconvert::msgtexconverted($content{'message'}).'</pre>' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value') |
.&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value') |
.'<div class="LC_warning">'; |
.'<div class="LC_warning">'; |
Line 896 sub discrit {
|
Line 912 sub discrit {
|
} |
} |
|
|
sub sortedmessages { |
sub sortedmessages { |
my ($blocked,$startblock,$endblock,$numblocked,$folder,$msgstatus) = @_; |
my ($blocked,$startblock,$endblock,$by_ip,$numblocked,$folder,$msgstatus) = @_; |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix); |
my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix); |
#unpack the varibles and repack into temp for sorting |
#unpack the varibles and repack into temp for sorting |
Line 928 sub sortedmessages {
|
Line 944 sub sortedmessages {
|
push(@temp1,$content{'recuser'},$content{'recdomain'}); |
push(@temp1,$content{'recuser'},$content{'recdomain'}); |
} |
} |
# Check whether message was sent during blocking period. |
# Check whether message was sent during blocking period. |
if ($sendtime >= $startblock && ($sendtime <= $endblock && $endblock > 0) ) { |
if (($by_ip) || |
|
(($sendtime >= $startblock) && ($sendtime <= $endblock && $endblock > 0))) { |
$$blocked{$msgid} = 'ON'; |
$$blocked{$msgid} = 'ON'; |
$$numblocked ++; |
$$numblocked ++; |
} else { |
} else { |
Line 1055 sub disfolder {
|
Line 1072 sub disfolder {
|
my %blocked = (); |
my %blocked = (); |
my %setters = (); |
my %setters = (); |
my $numblocked = 0; |
my $numblocked = 0; |
my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com'); |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = |
|
&Apache::loncommon::blockcheck(\%setters,'com',$clientip); |
my %js_lt = &Apache::lonlocal::texthash( |
my %js_lt = &Apache::lonlocal::texthash( |
sede => 'Select a destination folder to which the messages will be moved.', |
sede => 'Select a destination folder to which the messages will be moved.', |
nome => 'No messages have been selected to apply this action to.', |
nome => 'No messages have been selected to apply this action to.', |
Line 1099 sub disfolder {
|
Line 1118 sub disfolder {
|
ENDDISHEADER |
ENDDISHEADER |
|
|
my $fsqs='&folder='.$folder; |
my $fsqs='&folder='.$folder; |
my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus); |
my @temp=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus); |
my $totalnumber=$#temp+1; |
my $totalnumber=$#temp+1; |
if ($totalnumber < 1) { |
if ($totalnumber < 1) { |
$r->print('<p class="LC_info">'); |
$r->print('<p class="LC_info">'); |
Line 1112 ENDDISHEADER
|
Line 1131 ENDDISHEADER
|
} |
} |
$r->print('</p>'); |
$r->print('</p>'); |
if ($numblocked > 0) { |
if ($numblocked > 0) { |
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock, |
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom, |
\%setters)); |
\%setters)); |
} |
} |
return; |
return; |
Line 1302 ENDDISHEADER
|
Line 1321 ENDDISHEADER
|
$r->print('<input type="hidden" name="folder" value="'.$folder.'" /><input type="hidden" name="startdis" value="'.$postedstartdis.'" /><input type="hidden" name="interdis" value="'.$env{'form.interdis'}.'" /><input type="hidden" name="msgstatus" value="'.$msgstatus.'" /><input type="hidden" name="markedaction" value="" /></form>'); |
$r->print('<input type="hidden" name="folder" value="'.$folder.'" /><input type="hidden" name="startdis" value="'.$postedstartdis.'" /><input type="hidden" name="interdis" value="'.$env{'form.interdis'}.'" /><input type="hidden" name="msgstatus" value="'.$msgstatus.'" /><input type="hidden" name="markedaction" value="" /></form>'); |
if ($numblocked > 0) { |
if ($numblocked > 0) { |
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock, |
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock, |
\%setters)); |
$by_ip,$clientip,$blockdom,\%setters)); |
} |
} |
} |
} |
|
|
sub blocked_in_folder { |
sub blocked_in_folder { |
my ($numblocked,$startblock,$endblock,$setters) = @_; |
my ($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom,$setters) = @_; |
my $beginblock = &Apache::lonlocal::locallocaltime($startblock); |
my $output; |
my $finishblock = &Apache::lonlocal::locallocaltime($endblock); |
if ($by_ip) { |
my $output = '<br /><br />'. |
$output = '<br /><br />'. |
|
&mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages is blocked for your current IP address: [_2].',$numblocked,$clientip).'<br />'. |
|
&mt('Note: communication is being blocked for certain IP address(es).'); |
|
} else { |
|
my $beginblock = &Apache::lonlocal::locallocaltime($startblock); |
|
my $finishblock = &Apache::lonlocal::locallocaltime($endblock); |
|
$output = '<br /><br />'. |
&mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock); |
&mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock); |
|
} |
#$output .= &Apache::loncommon::build_block_table($startblock,$endblock, |
#$output .= &Apache::loncommon::build_block_table($startblock,$endblock, |
# $setters); |
# $setters); |
|
my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com",$clientip); |
my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); |
|
$output .="<br /><br />".$blocktext; |
$output .="<br /><br />".$blocktext; |
|
|
return $output; |
return $output; |
Line 1400 sub compout {
|
Line 1425 sub compout {
|
'to' => 'To:', |
'to' => 'To:', |
); |
); |
my %attachmax = ( |
my %attachmax = ( |
text => &mt('(128 KB max size)'), |
text => &mt('(1 MB max size)'), |
num => 131072, |
num => 1048576, |
); |
); |
if (!$forwarding && !$multiforward) { |
if (!$forwarding && !$multiforward) { |
$attachrow = '<tr><td colspan="3"><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'}.': <input type="file" name="attachment" /></td></tr>'; |
$attachrow = '<tr><td colspan="3"><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'} |
|
.': <input type="file" name="attachment" class="LC_flUpload" />' |
|
.'<input type="hidden" id="LC_free_space" value="'.$attachmax{'num'}.'" />' |
|
.'</td></tr>'; |
} |
} |
if (&Apache::lonnet::allowed('srm',$env{'request.course.id'}) |
if (&Apache::lonnet::allowed('srm',$env{'request.course.id'}) |
|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}. |
|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}. |
Line 1959 sub disfacetoface {
|
Line 1987 sub disfacetoface {
|
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).'</b> ('. |
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).'</b> ('. |
$content{'sendername'}.':'. |
$content{'sendername'}.':'. |
$content{'senderdomain'}.') '.$content{'time'}. |
$content{'senderdomain'}.') '.$content{'time'}. |
'<br /><pre>'. |
'<br /><pre class="LC_wordwrap">'. |
&Apache::lontexconvert::msgtexconverted($content{'message'}). |
&Apache::lontexconvert::msgtexconverted($content{'message'}). |
'</pre>'; |
'</pre>'; |
} |
} |
Line 2087 sub displaymessage {
|
Line 2115 sub displaymessage {
|
my %setters = (); |
my %setters = (); |
my $numblocked = 0; |
my $numblocked = 0; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
|
# info to generate "next" and "previous" buttons and check if message is blocked |
# info to generate "next" and "previous" buttons and check if message is blocked |
my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com'); |
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = |
my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus); |
&Apache::loncommon::blockcheck(\%setters,'com',$clientip); |
|
my @messages=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus); |
if ( $blocked{$msgid} eq 'ON' ) { |
if ( $blocked{$msgid} eq 'ON' ) { |
&printheader($r,'/adm/email',&mt('Display a Message')); |
&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.')); |
#$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.')); |
my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); |
my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com",$clientip); |
$r->print("<br />".$blocktext); |
$r->print("<br />".$blocktext); |
return; |
return; |
} |
} |
Line 2128 sub displaymessage {
|
Line 2158 sub displaymessage {
|
|
|
|
|
my $number_of_messages = scalar(@messages); #subtract 1 for last index |
my $number_of_messages = scalar(@messages); #subtract 1 for last index |
|
my $head_extra; |
|
|
|
# if student's view of resource will be included |
|
# get <link> tag(s) for css file(s) in use, and pass to &header to include |
|
# in call to loncommon::start_page() |
|
|
|
if (($env{'request.course.id'} eq $content{'courseid'}) && |
|
(&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { |
|
my $symb; |
|
if (defined($content{'symb'})) { |
|
$symb = $content{'symb'}; |
|
} elsif (defined($content{'baseurl'})) { |
|
$symb=&Apache::lonnet::symbread($content{'baseurl'}); |
|
} |
|
if ($symb) { |
|
$head_extra = &Apache::loncommon::css_links($symb); |
|
} |
|
} |
|
|
# start output |
# start output |
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); |
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','', |
|
$content{'baseurl'},$head_extra); |
|
|
# Prepare available functions |
# Prepare available functions |
my @functionlist; |
my @functionlist; |
Line 2478 sub displaymessage {
|
Line 2528 sub displaymessage {
|
|
|
# Message |
# Message |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Message')) |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Message')) |
.'<pre>' |
.'<pre class="LC_wordwrap">' |
.&Apache::lontexconvert::msgtexconverted($content{'message'},1) |
.&Apache::lontexconvert::msgtexconverted($content{'message'},1) |
.'</pre>' |
.'</pre>' |
); |
); |
Line 2663 sub displayresource {
|
Line 2713 sub displayresource {
|
# ================================================================== The Header |
# ================================================================== The Header |
|
|
sub header { |
sub header { |
my ($r,$title,$baseurl)=@_; |
my ($r,$title,$baseurl,$head_extra)=@_; |
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
if ($baseurl) { |
if ($baseurl) { |
$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />"; |
$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />"; |
} |
} |
|
$extra .= '<script type="text/javascript" |
|
src="/res/adm/includes/file_upload.js"></script>'; |
|
if ($head_extra) { |
|
$extra .= "\n$head_extra"; |
|
} |
$r->print(&Apache::loncommon::start_page('Messages', |
$r->print(&Apache::loncommon::start_page('Messages', |
$extra)); |
$extra)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
Line 2677 sub header {
|
Line 2732 sub header {
|
# ---------------------------------------------------------------- Print header |
# ---------------------------------------------------------------- Print header |
|
|
sub printheader { |
sub printheader { |
my ($r,$url,$desc,$title,$baseurl)=@_; |
my ($r,$url,$desc,$title,$baseurl,$head_extra)=@_; |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>$url, |
({href=>$url, |
text=>$desc}); |
text=>$desc}); |
&header($r,$title,$baseurl); |
&header($r,$title,$baseurl,$head_extra); |
} |
} |
|
|
# ------------------------------------------------------------ Store the comment |
# ------------------------------------------------------------ Store the comment |
Line 2908 sub sendoffmail {
|
Line 2963 sub sendoffmail {
|
&Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'}); |
&Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'}); |
} |
} |
if ($env{'form.attachment'}) { |
if ($env{'form.attachment'}) { |
if (length($env{'form.attachment'})<131072) { |
if (length($env{'form.attachment'}) <= 1048576) { |
$attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now); |
$attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now); |
} else { |
} else { |
$r->print('<p><span class="LC_warning">'.&mt('Attachment not included - exceeded permitted length').'</span><br /></p>'); |
$r->print('<p><span class="LC_warning">'.&mt('Attachment not included - exceeded permitted length').'</span><br /></p>'); |