version 1.144, 2005/06/04 21:11:30
|
version 1.155, 2005/11/18 13:35:30
|
Line 114 use HTML::Entities();
|
Line 114 use HTML::Entities();
|
use Mail::Send; |
use Mail::Send; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::loncommunicate; |
use Apache::loncommunicate; |
|
use Apache::lonfeedback; |
|
use Apache::lonrss(); |
|
|
# Querystring component with sorting type |
# Querystring component with sorting type |
my $sqs; |
my $sqs; |
Line 337 sub del_url_author_res_msg {
|
Line 339 sub del_url_author_res_msg {
|
} |
} |
return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author); |
return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author); |
} |
} |
|
# =================================== Clear out all author messages in URL path |
|
|
|
sub clear_author_res_msg { |
|
my $url=shift; |
|
$url=&Apache::lonnet::declutter($url); |
|
my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//); |
|
my @delmsgs=(); |
|
foreach (&Apache::lonnet::getkeys('nohist_res_msgs',$domain,$author)) { |
|
if ($_=~/^\Q$url\E/) { |
|
push (@delmsgs,$_); |
|
} |
|
} |
|
return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author); |
|
} |
# ================= Return hash with URLs for which there is a resource message |
# ================= Return hash with URLs for which there is a resource message |
|
|
sub all_url_author_res_msg { |
sub all_url_author_res_msg { |
Line 564 sub scrollbuttons {
|
Line 579 sub scrollbuttons {
|
my ($start,$maxdis,$first,$finish,$total)=@_; |
my ($start,$maxdis,$first,$finish,$total)=@_; |
unless ($total>0) { return ''; } |
unless ($total>0) { return ''; } |
$start++; $maxdis++;$first++;$finish++; |
$start++; $maxdis++;$first++;$finish++; |
return |
return |
|
&mt('Page').': '. |
'<input type="submit" name="firstview" value="'.&mt('First').'" />'. |
'<input type="submit" name="firstview" value="'.&mt('First').'" />'. |
'<input type="submit" name="prevview" value="'.&mt('Previous').'" />'. |
'<input type="submit" name="prevview" value="'.&mt('Previous').'" />'. |
'<input type="text" size="5" name="startdis" value="'.$start.'" onChange="this.form.submit()" /> of '.$maxdis. |
'<input type="text" size="5" name="startdis" value="'.$start.'" onChange="this.form.submit()" /> of '.$maxdis. |
'<input type="submit" name="nextview" value="'.&mt('Next').'" />'. |
'<input type="submit" name="nextview" value="'.&mt('Next').'" />'. |
'<input type="submit" name="lastview" value="'.&mt('Last').'" /><br />'. |
'<input type="submit" name="lastview" value="'.&mt('Last').'" /><br />'. |
&mt('Messages [_1] through [_2] of [_3]',$first,$finish,$total).'</form>'; |
&mt('Showing messages [_1] through [_2] of [_3]',$first,$finish,$total).'</form>'; |
} |
} |
|
|
# =============================================================== Folder suffix |
# =============================================================== Folder suffix |
Line 596 sub statuschange {
|
Line 612 sub statuschange {
|
if (($newstatus eq 'deleted') || ($newstatus eq 'new')) { |
if (($newstatus eq 'deleted') || ($newstatus eq 'new')) { |
&Apache::lonnet::put('email_status'.$suffix,{$msgid => $newstatus}); |
&Apache::lonnet::put('email_status'.$suffix,{$msgid => $newstatus}); |
} |
} |
|
if ($newstatus eq 'deleted') { |
|
&movemsg(&Apache::lonnet::unescape($msgid),$folder,'trash'); |
|
} |
} |
} |
|
|
# ============================================================= Make new folder |
# ============================================================= Make new folder |
Line 869 sub disnew {
|
Line 888 sub disnew {
|
TABLEHEAD |
TABLEHEAD |
foreach my $msg (@newmsgs) { |
foreach my $msg (@newmsgs) { |
$r->print(<<"ENDLINK"); |
$r->print(<<"ENDLINK"); |
<tr bgcolor="#FFBB77"> |
<tr class="new" bgcolor="#FFBB77" onMouseOver="javascript:style.backgroundColor='#DD9955'" |
|
onMouseOut="javascript:style.backgroundColor='#FFBB77'"> |
<td><a href="/adm/email?dismode=new&display=$msg->{'msgid'}">$lt{'op'}</a></td> |
<td><a href="/adm/email?dismode=new&display=$msg->{'msgid'}">$lt{'op'}</a></td> |
ENDLINK |
ENDLINK |
foreach ('sendtime','from','fromdom','shortsub') { |
foreach ('sendtime','from','fromdom','shortsub') { |
Line 996 ENDDISHEADER
|
Line 1016 ENDDISHEADER
|
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID)= @{$temp[$n]}; |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID)= @{$temp[$n]}; |
if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { |
if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { |
if ($status eq 'new') { |
if ($status eq 'new') { |
$r->print('<tr bgcolor="#FFBB77">'); |
$r->print('<tr bgcolor="#FFBB77" onMouseOver="javascript:style.backgroundColor=\'#DD9955\'" onMouseOut="javascript:style.backgroundColor=\'#FFBB77\'">'); |
} elsif ($status eq 'read') { |
} elsif ($status eq 'read') { |
$r->print('<tr bgcolor="#BBBB77">'); |
$r->print('<tr bgcolor="#BBBB77" onMouseOver="javascript:style.backgroundColor=\'#999944\'" onMouseOut="javascript:style.backgroundColor=\'#BBBB77\'">'); |
} elsif ($status eq 'replied') { |
} elsif ($status eq 'replied') { |
$r->print('<tr bgcolor="#AAAA88">'); |
$r->print('<tr bgcolor="#AAAA88" onMouseOver="javascript:style.backgroundColor=\'#888855\'" onMouseOut="javascript:style.backgroundColor=\'#AAAA88\'">'); |
} else { |
} else { |
$r->print('<tr bgcolor="#99BBBB">'); |
$r->print('<tr bgcolor="#99BBBB" onMouseOver="javascript:style.backgroundColor=\'#669999\'" onMouseOut="javascript:style.backgroundColor=\'#99BBBB\'">'); |
} |
} |
$r->print('<td><input type="checkbox" name="delmark_'.$origID.'" /></td><td><a href="/adm/email?display='.$origID.$sqs. |
$r->print('<td><input type="checkbox" name="delmark_'.$origID.'" /></td><td><a href="/adm/email?display='.$origID.$sqs. |
'">'.&mt('Open').'</a></td><td>'. |
'">'.&mt('Open').'</a></td><td>'. |
Line 1095 sub compout {
|
Line 1115 sub compout {
|
'<label><input type="checkbox" name="sendbck" /> '.&mt('Send as critical message').' ' . |
'<label><input type="checkbox" name="sendbck" /> '.&mt('Send as critical message').' ' . |
&mt('and return receipt') . '</label>' . $crithelp . |
&mt('and return receipt') . '</label>' . $crithelp . |
'</p><p><label><input type="checkbox" name="permanent" /> '. |
'</p><p><label><input type="checkbox" name="permanent" /> '. |
&mt('Send copy to permanent email address (if known)').'</label></p>'; |
&mt('Send copy to permanent email address (if known)').'</label></p>'. |
} |
'<p><label><input type="checkbox" name="rsspost" /> '. |
|
&mt('Include in course RSS newsfeed').'</label></p>'; } |
my %message; |
my %message; |
my %content; |
my %content; |
my $defdom=$env{'user.domain'}; |
my $defdom=$env{'user.domain'}; |
Line 1215 ENDUPLOAD
|
Line 1236 ENDUPLOAD
|
&discourse; |
&discourse; |
} |
} |
$r->print('</form>'. |
$r->print('</form>'. |
|
&Apache::lonfeedback::generate_preview_button('compemail','message'). |
&Apache::lonhtmlcommon::htmlareaselectactive('message')); |
&Apache::lonhtmlcommon::htmlareaselectactive('message')); |
} |
} |
|
|
Line 1236 sub retrieve_instructor_comments {
|
Line 1258 sub retrieve_instructor_comments {
|
my %content=&unpackagemsg($records{$_}); |
my %content=&unpackagemsg($records{$_}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'subject'} !~ /^Record/); |
next if ($content{'subject'} !~ /^Record/); |
# $content{'message'}=~s/\n/\<br\>/g; |
# &Apache::lonfeedback::newline_to_br(\$content{'message'}); |
$result.='Recorded by '. |
$result.='Recorded by '. |
$content{'sendername'}.'@'.$content{'senderdomain'}."\n"; |
$content{'sendername'}.'@'.$content{'senderdomain'}."\n"; |
$result.= |
$result.= |
&Apache::lontexconvert::msgtexconverted($content{'message'})."\n"; |
&Apache::lontexconvert::msgtexconverted($content{'message'})."\n"; |
Line 1260 sub disfacetoface {
|
Line 1282 sub disfacetoface {
|
foreach (sort keys %records) { |
foreach (sort keys %records) { |
my %content=&unpackagemsg($records{$_}); |
my %content=&unpackagemsg($records{$_}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
$content{'message'}=~s/\n/\<br\>/g; |
&Apache::lonfeedback::newline_to_br(\$content{'message'}); |
if ($content{'subject'}=~/^Record/) { |
if ($content{'subject'}=~/^Record/) { |
$result.='<h3>'.&mt('Record').'</h3>'; |
$result.='<h3>'.&mt('Record').'</h3>'; |
} elsif ($content{'subject'}=~/^Broadcast/) { |
} elsif ($content{'subject'}=~/^Broadcast/) { |
Line 1777 sub displaymessage {
|
Line 1799 sub displaymessage {
|
'<td><a href="/adm/email?markunread='.&Apache::lonnet::escape($msgid).$sqs. |
'<td><a href="/adm/email?markunread='.&Apache::lonnet::escape($msgid).$sqs. |
'"><b>'.&mt('Mark Unread').'</b></a></td>'. |
'"><b>'.&mt('Mark Unread').'</b></a></td>'. |
'<td><a href="/adm/email?markdel='.&Apache::lonnet::escape($msgid).$sqs. |
'<td><a href="/adm/email?markdel='.&Apache::lonnet::escape($msgid).$sqs. |
'"><b>Delete</b></a></td>'. |
'"><b>'.&mt('Delete').'</b></a></td>'. |
'<td><a href="/adm/email?'.$sqs. |
'<td><a href="/adm/email?'.$sqs. |
($env{'form.dismode'} eq 'new'?'&folder=new':''). |
($env{'form.dismode'} eq 'new'?'&folder=new':''). |
'"><b>'.&mt('Back to Folder Display').'</b></a></td>'); |
'"><b>'.&mt('Back to Folder Display').'</b></a></td>'); |
Line 1790 sub displaymessage {
|
Line 1812 sub displaymessage {
|
'"><b>'.&mt('Next').'</b></a></td>'); |
'"><b>'.&mt('Next').'</b></a></td>'); |
} |
} |
$r->print('</tr></table>'); |
$r->print('</tr></table>'); |
|
if ($env{'user.adv'}) { |
|
$r->print('<table border="2" width="100%"><tr bgcolor="#FFAAAA"><td>'.&mt('Currently available actions (will open extra window)').':</td>'); |
|
my $symb=&Apache::lonnet::symbread($content{'baseurl'}); |
|
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { |
|
$r->print('<td><b>'.&Apache::loncommon::track_student_link(&mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check').'</b></td>'); |
|
} |
|
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) && $symb) { |
|
$r->print('<td><b>'.&Apache::loncommon::pprmlink(&mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check').'</b></td>'); |
|
} |
|
if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}) && $symb) { |
|
$r->print('<td><b>'.&Apache::loncommon::pgrdlink(&mt('Set/Change grades'),$content{'sendername'},$content{'senderdomain'},$symb,'check').'</b></td>'); |
|
} |
|
$r->print('</tr></table>'); |
|
} |
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}. |
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}. |
($folder ne 'sent'?'<br /><b>'.&mt('From').':</b> '. |
($folder ne 'sent'?'<br /><b>'.&mt('From').':</b> '. |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::aboutmewrapper( |
Line 2161 sub handler {
|
Line 2197 sub handler {
|
if ($env{'form.storebasecomment'}) { |
if ($env{'form.storebasecomment'}) { |
&storecomment($r); |
&storecomment($r); |
} |
} |
|
if (($env{'form.rsspost'}) && ($env{'request.course.id'})) { |
|
&Apache::lonrss::addentry($env{'course.'.$env{'request.course.id'}.'.num'}, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
'Course_Announcements', |
|
$env{'form.subject'}, |
|
$env{'form.message'},'/adm/communicate','public'); |
|
} |
&disall($r,($folder?$folder:$dismode)); |
&disall($r,($folder?$folder:$dismode)); |
} elsif ($env{'form.newfolder'}) { |
} elsif ($env{'form.newfolder'}) { |
&printheader($r,'','New Folder'); |
&printheader($r,'','New Folder'); |