version 1.60, 2006/12/27 20:42:12
|
version 1.66, 2007/01/29 20:07:44
|
Line 924 sub disfolder {
|
Line 924 sub disfolder {
|
nome => 'No messages have been selected to apply ths action to.', |
nome => 'No messages have been selected to apply ths action to.', |
chec => 'Check the checkbox for at least one message.', |
chec => 'Check the checkbox for at least one message.', |
); |
); |
|
my $jscript = &Apache::loncommon::check_uncheck_jscript(); |
$r->print(<<ENDDISHEADER); |
$r->print(<<ENDDISHEADER); |
<script type="text/javascript"> |
<script type="text/javascript"> |
function checkall() { |
$jscript |
for (i=0; i<document.forms.disall.delmark.length; i++) { |
|
document.forms.disall.delmark[i].checked=true; |
|
} |
|
} |
|
|
|
function uncheckall() { |
|
for (i=0; i<document.forms.disall.delmark.length; i++) { |
|
document.forms.disall.delmark[i].checked=false; |
|
} |
|
} |
|
function checkfoldermove() { |
function checkfoldermove() { |
if (document.disall.checkedaction.options[document.disall.checkedaction.selectedIndex].value == 'markedmove') { |
if (document.disall.checkedaction.options[document.disall.checkedaction.selectedIndex].value == 'markedmove') { |
if (document.disall.movetofolder.options[document.disall.movetofolder.selectedIndex].value == "") { |
if (document.disall.movetofolder.options[document.disall.movetofolder.selectedIndex].value == "") { |
Line 956 sub disfolder {
|
Line 948 sub disfolder {
|
} |
} |
} |
} |
var checktotal = 0; |
var checktotal = 0; |
for (var i=0; i<document.forms.disall.delmark.length; i++) { |
if (document.forms.disall.delmark.length > 0) { |
if (document.forms.disall.delmark[i].checked) { |
for (var i=0; i<document.forms.disall.delmark.length; i++) { |
|
if (document.forms.disall.delmark[i].checked) { |
|
checktotal ++; |
|
} |
|
} |
|
} else { |
|
if (document.forms.disall.delmark.checked) { |
checktotal ++; |
checktotal ++; |
} |
} |
} |
} |
if (checktotal == 0) { |
if (checktotal == 0) { |
alert("$lt{'nome'}\\n$lt{'chec'}"); |
alert("$lt{'nome'}\\n$lt{'chec'}"); |
return; |
return; |
Line 982 ENDDISHEADER
|
Line 980 ENDDISHEADER
|
} else { |
} else { |
$r->print('<h2>'.&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.').'</h2>'); |
$r->print('<h2>'.&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.').'</h2>'); |
} |
} |
|
if ($numblocked > 0) { |
|
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock, |
|
\%setters)); |
|
} |
return; |
return; |
} |
} |
my $interdis = $env{'form.interdis'}; |
my $interdis = $env{'form.interdis'}; |
Line 1072 ENDDISHEADER
|
Line 1074 ENDDISHEADER
|
' value="'.$origID.'" /></nobr></td>'); |
' value="'.$origID.'" /></nobr></td>'); |
foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) { |
foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) { |
$r->print('<td>'.(($status eq 'new')?'<b>':''). |
$r->print('<td>'.(($status eq 'new')?'<b>':''). |
'<a href="/adm/email?display='.$origID.$sqs.$fsqs.'">'. |
'<a href="/adm/email?display='.$origID.$sqs.'">'. |
$item.(($status eq 'new')?'</b>':'').'</td>'); |
$item.(($status eq 'new')?'</b>':'').'</td>'); |
} |
} |
my $showstatus; |
my $showstatus; |
Line 1097 ENDDISHEADER
|
Line 1099 ENDDISHEADER
|
$r->print('<table border="0" cellspacing="2" cellpadding="2"> |
$r->print('<table border="0" cellspacing="2" cellpadding="2"> |
<tr> |
<tr> |
<td>'. |
<td>'. |
'<input type="button" onclick="javascript:checkall()" value="'.&mt('Check All').'" /><br />'."\n". |
'<input type="button" onclick="javascript:checkAll(document.disall.delmark)" value="'.&mt('Check All').'" /><br />'."\n". |
'<input type="button" onclick="javascript:uncheckall()" value="'.&mt('Uncheck All').'" />'."\n". |
'<input type="button" onclick="javascript:uncheckAll(document.disall.delmark)" value="'.&mt('Uncheck All').'" />'."\n". |
'<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" /></td><td> </td>'."\n". |
'<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" /></td><td> </td>'."\n". |
'<td align="center"><b>'.&mt('Action').'</b><br />'."\n". |
'<td align="center"><b>'.&mt('Action').'</b><br />'."\n". |
' <select name="checkedaction" onchange="javascript:checkfoldermove()">'."\n"); |
' <select name="checkedaction" onchange="javascript:checkfoldermove()">'."\n"); |
Line 1138 ENDDISHEADER
|
Line 1140 ENDDISHEADER
|
my $postedstartdis=$startdis+1; |
my $postedstartdis=$startdis+1; |
$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) { |
my $beginblock = &Apache::lonlocal::locallocaltime($startblock); |
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock, |
my $finishblock = &Apache::lonlocal::locallocaltime($endblock); |
\%setters)); |
$r->print('<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)); |
|
$r->print(&Apache::loncommon::build_block_table($startblock,$endblock, |
|
\%setters)); |
|
} |
} |
} |
} |
|
|
|
sub blocked_in_folder { |
|
my ($numblocked,$startblock,$endblock,$setters) = @_; |
|
my $beginblock = &Apache::lonlocal::locallocaltime($startblock); |
|
my $finishblock = &Apache::lonlocal::locallocaltime($endblock); |
|
my $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); |
|
$output .= &Apache::loncommon::build_block_table($startblock,$endblock, |
|
$setters); |
|
return $output; |
|
} |
|
|
# ============================================================== Compose output |
# ============================================================== Compose output |
|
|
sub compout { |
sub compout { |
Line 2045 sub displaymessage {
|
Line 2054 sub displaymessage {
|
if (defined($content{'courseid'}) && defined($env{'request.course.id'})) { |
if (defined($content{'courseid'}) && defined($env{'request.course.id'})) { |
if ($content{'courseid'} eq $env{'request.course.id'}) { |
if ($content{'courseid'} eq $env{'request.course.id'}) { |
my $symblink; |
my $symblink; |
|
my $showsymb = &Apache::lonenc::check_decrypt($symb); |
|
my $showurl = &Apache::lonenc::check_decrypt($baseurl); |
|
my $encrypturl = &Apache::lonnet::EXT('resource.0.encrypturl', |
|
$showsymb,$env{'user.domain'},$env{'user.name'}); |
if ($symb) { |
if ($symb) { |
&Apache::lonenc::check_decrypt(\$symb); |
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
$symblink = '?symb='.$symb; |
$showsymb = &Apache::lonenc::check_encrypt($symb); |
|
} |
|
$symblink = '?symb='.$showsymb; |
|
} |
|
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
|
$showurl = $baseurl; |
} |
} |
&Apache::lonenc::check_decrypt(\$baseurl); |
$r->print('<br /><b>'.&mt('Refers to').':</b> <a href="'.$showurl.$symblink.'">'.$restitle.'</a>'); |
$r->print('<br /><b>'.&mt('Refers to').':</b> <a href="'.$baseurl.$symblink.'">'.$restitle.'</a>'); |
|
$refers_to = 1; |
$refers_to = 1; |
} |
} |
} |
} |
if (!$refers_to) { |
if (!$refers_to) { |
if ($baseurl =~ m-^/enc/-) { |
if ($baseurl =~ m-^/enc/-) { |
if (defined($content{'courseid'})) { |
if (defined($content{'courseid'})) { |
my $unencurl = |
if (!$env{'request.course.id'}) { |
&Apache::lonenc::unencrypted($baseurl, |
my $unencurl = |
$content{'courseid'}); |
&Apache::lonenc::unencrypted($baseurl, |
if (defined($unencurl)) { |
$content{'courseid'}); |
if (&Apache::lonnet::allowed('bre',$unencurl)) { |
if ($unencurl ne '') { |
$r->print('<br /><b>'.&mt('Refers to'). |
if (&Apache::lonnet::allowed('bre',$unencurl)) { |
':</b> <a href="'.$unencurl.'">'.$restitle.'</a>'); |
$r->print('<br /><b>'.&mt('Refers to'). |
|
':</b> <a href="'.$unencurl.'">'. |
|
$restitle.'</a>'); |
|
} |
} |
} |
} |
} |
} |
} |
Line 2260 sub sendoffmail {
|
Line 2280 sub sendoffmail {
|
} |
} |
} |
} |
if ($env{'form.additionalrec'}) { |
if ($env{'form.additionalrec'}) { |
foreach my $rec (split(/\,/,$env{'form.additionalrec'})) { |
foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec'})) { |
my ($auname,$audom)=split(/:/,$rec); |
my ($auname,$audom)=split(/:/,$rec); |
if (($auname ne "") && ($audom ne "")) { |
if (($auname ne "") && ($audom ne "")) { |
$toaddr{$auname.':'.$audom}=''; |
$toaddr{$auname.':'.$audom}=''; |
Line 2707 sub handler {
|
Line 2727 sub handler {
|
my $delresult = &deletefolder($folder); |
my $delresult = &deletefolder($folder); |
if ($delresult eq 'ok') { |
if ($delresult eq 'ok') { |
$r->print(&mt('Mail folder "[_1]" deleted.',$folder).'<br />'); |
$r->print(&mt('Mail folder "[_1]" deleted.',$folder).'<br />'); |
|
$env{'form.folder'} = ''; |
} else { |
} else { |
$r->print(&mt('Deletion failed.').' '.$delresult.'<br />'); |
$r->print(&mt('Deletion failed.').' '.$delresult.'<br />'); |
$showfolder = $folder; |
$showfolder = $folder; |