version 1.42, 2008/12/09 17:59:51
|
version 1.48, 2022/01/18 17:33:13
|
Line 42 sub menu {
|
Line 42 sub menu {
|
my $usertype = 'student'; |
my $usertype = 'student'; |
if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) { |
if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) { |
$crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
$crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
if ($crstype eq 'Group') { |
if ($crstype eq 'Community') { |
$usertype = 'member'; |
$usertype = 'member'; |
} |
} |
} |
} |
|
|
# my %lt=&Apache::lonlocal::texthash( |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
# 'vcm' => 'View Critical Messages', |
my %setters; |
# 'smu' => 'Send Message to User(s)', |
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = |
# 'bmc' => "Broadcast Message to $crstype", |
&Apache::loncommon::blockcheck(\%setters,'com',$clientip); |
# 'dmu' => "Distribute Messages from Uploaded File to $crstype", |
if ($by_ip) { |
# 'unr' => 'User Notes, Records of Face-to-Face Discussions, and Critical Messages', |
my $showdom = &Apache::lonnet::domain($blockdom); |
# 'cbs' => "Configure Blocking of $usertype Communication during Exams", |
if ($showdom eq '') { |
# ); |
$showdom = $blockdom; |
|
} |
# my %help=(); |
$r->print('<p class="LC_warning">'. |
# foreach ('Course_Face_To_Face_Records,Course_Critical_Message', 'Course_Broadcast_Message') { |
&mt('Sending of LON-CAPA messages is blocked for your current IP address: [_1].',$clientip).'</p>'. |
# $help{$_}=&Apache::loncommon::help_open_topic($_); |
'<ul><li>'.&mt('Note: communication is being blocked for certain IP address(es).'). |
# } |
'</li><li>'. |
|
&mt('This restriction was set by an administrator in the [_1] LON-CAPA domain.',$showdom). |
|
'</li></ul><br />'); |
|
} |
|
|
# ------------------------------------------------------------------------ Menu |
# ------------------------------------------------------------------------ Menu |
my ($can_srm,$can_dcm,$can_dff); |
my ($can_srm,$can_dcm,$can_dff); |
Line 79 sub menu {
|
Line 82 sub menu {
|
$env{'request.course.sec'}))) { |
$env{'request.course.sec'}))) { |
$can_dff = 1; |
$can_dff = 1; |
} |
} |
} |
} |
|
|
my @reports = ( |
my @reports; |
{categorytitle => 'Send Messages', |
unless ($by_ip) { |
items => [ |
@reports = ( |
|
{categorytitle => 'Send Messages', |
|
items => [ |
{url => '/adm/email?compose=individual', |
{url => '/adm/email?compose=individual', |
permission => 'F', |
permission => 'F', |
icon => 'mail-reply-sender.png', |
icon => 'mail-message-new.png', |
linktext => 'New Message', |
linktext => 'New Message', |
linktitle => 'Send a message to users.'}, |
linktitle => 'Send a message to users.'}, |
|
|
Line 100 sub menu {
|
Line 105 sub menu {
|
{url => '/adm/email?compose=upload', |
{url => '/adm/email?compose=upload', |
permission => "$can_srm", |
permission => "$can_srm", |
icon => 'fromfile.png', |
icon => 'fromfile.png', |
linktext => 'New Messages from Template', |
linktext => 'New Messages from File', |
linktitle => 'Create a message from template and send to users.'}, |
linktitle => 'Create a message from file and send to users.'}, |
]}, |
]}, |
); |
); |
|
} |
|
|
if ($can_dff || $can_dcm ){ |
if ($can_dff || $can_dcm ){ |
push(@reports,{categorytitle => 'Message Administration', |
push(@reports,{categorytitle => 'Message Administration', |
items => [ |
items => [ |
{url => '/adm/email?recordftf=query', |
{url => '/adm/email?recordftf=query', |
permission => "$can_dff", |
permission => "$can_dff", |
icon => 'messalog.png', |
icon => 'messalog.png', |
Line 115 sub menu {
|
Line 121 sub menu {
|
help => 'Course_Face_To_Face_Records,Course_Critical_Message', |
help => 'Course_Face_To_Face_Records,Course_Critical_Message', |
linktitle => "User notes, records of face-to-face discussions, critical messages, broadcast messages and archived messages in $crstype."}, |
linktitle => "User notes, records of face-to-face discussions, critical messages, broadcast messages and archived messages in $crstype."}, |
|
|
{url => '/adm/email?block=display', |
{url => '/adm/setblock?caller=email', |
permission => "$can_dcm", |
permission => "$can_dcm", |
icon => 'comblock.png', |
icon => 'comblock.png', |
linktext => 'Communication Blocking', |
linktext => 'Communication Blocking', |
linktitle => "Blocking of $usertype communication during exams."}, |
linktitle => "Blocking of $usertype communication during exams."}, |
]}); |
]}); |
} |
} |
$r->print(&Apache::lonhtmlcommon::generate_menu(@reports)); |
if (@reports) { |
|
$r->print(&Apache::lonhtmlcommon::generate_menu(@reports)); |
# $r->print(<<END); |
} |
#<table cellspacing="10" cellpadding="2"> |
return; |
#<tr> |
|
#<td bgcolor="#FFFFAA"> |
|
# <b><a href="/adm/email?compose=individual">$lt{'smu'}</a></b> |
|
#</td> |
|
#<td></td> |
|
#</tr> |
|
#END |
|
|
|
# if ($can_srm) { |
|
# $r->print(<<END); |
|
#<tr> |
|
#<td bgcolor="#FFFFAA"> |
|
# <b><a href="/adm/email?compose=group">$lt{'bmc'}</a></b>$help{'Course_Broadcast_Message'} |
|
#</td> |
|
#<td bgcolor="#FFFFAA"> |
|
# <b><a href="/adm/email?compose=upload">$lt{'dmu'}</a></b> |
|
#</td></tr> |
|
#END |
|
# } |
|
|
|
# if ($can_dcm || $can_dff) { |
|
# $r->print('<tr>'); |
|
# } |
|
|
|
# if ($can_dff) { |
|
# $r->print(<<END); |
|
#<td bgcolor="#FFFFAA"> |
|
#<b><a href="/adm/email?recordftf=query">$lt{'unr'}</a></b>$help{'Course_Face_To_Face_Records,Course_Critical_Message'} |
|
#</td> |
|
#END |
|
# } |
|
|
|
# if ($can_dcm) { |
|
# $r->print(' |
|
#<td bgcolor="#FFFFAA"> |
|
# <b><a href="/adm/email?block=display">'.$lt{'cbs'}.'</a></b> |
|
#</td>'); |
|
# } |
|
|
|
# if ($can_dff || $can_dcm) { |
|
# $r->print('</tr>'); |
|
# } |
|
|
|
# $r->print('</table>'); |
|
|
|
} |
} |
|
|
sub handler { |
sub handler { |