version 1.70, 2007/04/22 13:41:22
|
version 1.72, 2007/05/02 01:33:49
|
Line 1229 will be forwarded to the recipient(s) yo
|
Line 1229 will be forwarded to the recipient(s) yo
|
'<p><label><input type="checkbox" name="rsspost" /> '. |
'<p><label><input type="checkbox" name="rsspost" /> '. |
&mt('Include in course RSS newsfeed').'</label></p>'; |
&mt('Include in course RSS newsfeed').'</label></p>'; |
} |
} |
if (&Apache::lonnet::allowed('dff',$env{'request.course.id'}) || |
if ($broadcast ne 'group') { |
&Apache::lonnet::allowed('dff',$env{'request.course.id'}. |
if (&Apache::lonnet::allowed('dff',$env{'request.course.id'}) || |
'/'.$env{'request.course.sec'})) { |
&Apache::lonnet::allowed('dff',$env{'request.course.id'}. |
|
'/'.$env{'request.course.sec'})) { |
$dispcrit.='<p><label>'. |
|
'<input type="checkbox" name="courserecord" value="1" /> '. |
$dispcrit.='<p><label>'. |
&mt("Include in course's 'User records' for recipient(s)"). |
'<input type="checkbox" name="courserecord" value="1" /> '. |
'</label></p>'; |
&mt("Include in course's 'User records' for recipient(s)"). |
|
'</label></p>'; |
|
} |
} |
} |
|
|
my %message; |
my %message; |
Line 1271 will be forwarded to the recipient(s) yo
|
Line 1273 will be forwarded to the recipient(s) yo
|
if ($content{'baseurl'}) { |
if ($content{'baseurl'}) { |
$disbase='<input type="hidden" name="baseurl" value="'.&escape($content{'baseurl'}).'" />'; |
$disbase='<input type="hidden" name="baseurl" value="'.&escape($content{'baseurl'}).'" />'; |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
$disbase.='<label><input type="checkbox" name="storebasecomment" />'.&mt('Store message for re-use'). |
$disbase.='<label><input type="checkbox" name="storebasecomment" />'.&mt('Save message for re-use'). |
'</label> <a href="/adm/email?showcommentbaseurl='. |
'</label> <a href="/adm/email?showcommentbaseurl='. |
&escape($content{'baseurl'}).'" target="comments">'. |
&escape($content{'baseurl'}).'" target="comments">'. |
&mt('Show re-usable messages').'</a><br />'; |
&mt('Show re-usable messages').'</a><br />'; |
Line 1678 sub examblock {
|
Line 1680 sub examblock {
|
'cbds' => 'Communication blocking during scheduled exams', |
'cbds' => 'Communication blocking during scheduled exams', |
'desc' => "You can use communication blocking to prevent $usertype enrolled in this course 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, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.", |
'desc' => "You can use communication blocking to prevent $usertype enrolled in this course 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, 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', |
'mecb' => 'Modify existing communication blocking periods', |
'ncbc' => 'No communication blocks currently stored', |
'ncbc' => 'No communication blocks currently saved', |
'stor' => 'Store', |
'stor' => 'Save', |
); |
); |
|
|
my %ltext = &Apache::lonlocal::texthash( |
my %ltext = &Apache::lonlocal::texthash( |
Line 2206 sub storedcommentlisting {
|
Line 2208 sub storedcommentlisting {
|
my ($r)=@_; |
my ($r)=@_; |
my %msgs=&Apache::lonnet::dump('nohist_stored_comments',undef,undef, |
my %msgs=&Apache::lonnet::dump('nohist_stored_comments',undef,undef, |
'^'.&escape(&escape($env{'form.showcommentbaseurl'}))); |
'^'.&escape(&escape($env{'form.showcommentbaseurl'}))); |
$r->print(&Apache::loncommon::start_page('Stored Comment Listing',undef, |
$r->print(&Apache::loncommon::start_page('Saved Comment Listing',undef, |
{'onlybody' => 1})); |
{'onlybody' => 1})); |
if ((keys %msgs)[0]=~/^error\:/) { |
if ((keys %msgs)[0]=~/^error\:/) { |
$r->print(&mt('No stored comments yet.')); |
$r->print(&mt('No saved comments yet.')); |
} else { |
} else { |
my $found=0; |
my $found=0; |
foreach my $key (sort(keys(%msgs))) { |
foreach my $key (sort(keys(%msgs))) { |
Line 2217 sub storedcommentlisting {
|
Line 2219 sub storedcommentlisting {
|
$found=1; |
$found=1; |
} |
} |
unless ($found) { |
unless ($found) { |
$r->print(&mt('No stored comments yet for this resource.')); |
$r->print(&mt('No saved comments yet for this resource.')); |
} |
} |
} |
} |
} |
} |
Line 2228 sub sendoffmail {
|
Line 2230 sub sendoffmail {
|
my ($r,$folder)=@_; |
my ($r,$folder)=@_; |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my $sendstatus=''; |
my $sendstatus=''; |
my %specialmsg_status; |
my %msg_status; |
my $numspecial = 0; |
my $numsent = 0; |
|
my $nosentstore = 1; |
my ($cdom,$cnum,$group); |
my ($cdom,$cnum,$group); |
if (exists($env{'form.group'})) { |
if (exists($env{'form.group'})) { |
$group = $env{'form.group'}; |
$group = $env{'form.group'}; |
Line 2286 sub sendoffmail {
|
Line 2289 sub sendoffmail {
|
} |
} |
} |
} |
} elsif ($env{'form.sendmode'} eq 'upload') { |
} elsif ($env{'form.sendmode'} eq 'upload') { |
|
$nosentstore = 0; |
foreach my $line (split(/[\n\r\f]+/,$env{'form.upfile'})) { |
foreach my $line (split(/[\n\r\f]+/,$env{'form.upfile'})) { |
my ($rec,$txt) = ($line =~ /^([^:]+:[^:]+):(.*)$/); |
my ($rec,$txt) = ($line =~ /^([^:]+:[^:]+):(.*)$/); |
if ($txt) { |
if ($txt) { |
Line 2323 sub sendoffmail {
|
Line 2327 sub sendoffmail {
|
} else { |
} else { |
$savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'}); |
$savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'}); |
} |
} |
|
my @recusers; |
|
my @recudoms; |
foreach my $address (sort(keys(%toaddr))) { |
foreach my $address (sort(keys(%toaddr))) { |
my ($recuname,$recdomain)=split(/\:/,$address); |
my ($recuname,$recdomain)=split(/\:/,$address); |
my $msgtxt = $savemsg; |
my $msgtxt = $savemsg; |
Line 2337 sub sendoffmail {
|
Line 2342 sub sendoffmail {
|
$msgsubj,$msgtxt, |
$msgsubj,$msgtxt, |
$env{'form.sendbck'}, |
$env{'form.sendbck'}, |
$env{'form.permanent'}, |
$env{'form.permanent'}, |
\$sentmessage{$address}); |
\$sentmessage{$address}, |
|
$nosentstore); |
} else { |
} else { |
$r->print(&mt('Sending').' '.$recuname.':'.$recdomain.': '); |
$r->print(&mt('Sending').' '.$recuname.':'.$recdomain.': '); |
@thismsg= |
@thismsg= |
Line 2346 sub sendoffmail {
|
Line 2352 sub sendoffmail {
|
$content{'citation'}, |
$content{'citation'}, |
undef,undef, |
undef,undef, |
$env{'form.permanent'}, |
$env{'form.permanent'}, |
\$sentmessage{$address}); |
\$sentmessage{$address}, |
|
undef,undef,undef, |
|
$nosentstore); |
} |
} |
if (($env{'request.course.id'}) && |
$msg_status{$recuname.':'.$recdomain}=join(' ',@thismsg); |
(($msgtype eq 'critical') || |
if ($msg_status{$recuname.':'.$recdomain} =~ /(ok|con_delayed)/) { |
($env{'form.sendmode'} eq 'group') || |
$numsent++; |
($env{'form.courserecord'}))) { |
push(@recusers,$recuname); |
$specialmsg_status{$recuname.':'.$recdomain} = |
push(@recudoms,$recdomain); |
join(' ',@thismsg); |
|
foreach my $result (@thismsg) { |
|
if ($result eq 'ok' || $result eq 'con_delayed') { |
|
$numspecial++; |
|
} |
|
} |
|
} |
} |
$sendstatus.=' '.join(' ',@thismsg); |
$sendstatus.=' '.join(' ',@thismsg); |
} |
} |
if (($env{'request.course.id'}) && |
my $subj_prefix; |
(($env{'form.sendmode'} eq 'group') || |
if ($numsent > 0) { |
($env{'form.courserecord'}) || |
if (($env{'request.course.id'}) && |
($msgtype eq 'critical'))) { |
(($env{'form.sendmode'} eq 'group') || |
my $subj_prefix; |
($env{'form.courserecord'}) || |
if ($msgtype eq 'critical') { |
($msgtype eq 'critical'))) { |
$subj_prefix = 'Critical.'; |
if ($msgtype eq 'critical') { |
} elsif ($env{'form.sendmode'} eq 'group') { |
$subj_prefix = 'Critical.'; |
$subj_prefix = 'Broadcast.'; |
} elsif ($env{'form.sendmode'} eq 'group') { |
} else { |
$subj_prefix = 'Broadcast.'; |
$subj_prefix = 'Archive'; |
} else { |
} |
$subj_prefix = 'Archive'; |
my ($specialmsgid,$specialresult); |
} |
my $course_str = &escape('['.$cnum.':'.$cdom.']'); |
my ($specialmsgid,$specialresult); |
|
my $course_str = &escape('['.$cnum.':'.$cdom.']'); |
|
|
if ($numspecial) { |
$specialresult = |
$specialresult = &Apache::lonmsg::user_normal_msg_raw($cnum,$cdom,$subj_prefix. |
&Apache::lonmsg::user_normal_msg_raw($cnum,$cdom, |
' '.$course_str,$savemsg,undef,undef,undef, |
$subj_prefix.' '.$course_str,$savemsg,undef,undef, |
undef,undef,\$specialmsgid); |
undef,undef,undef,\$specialmsgid,undef,undef,undef, |
|
undef,undef,1); |
$specialmsgid = &unescape($specialmsgid); |
$specialmsgid = &unescape($specialmsgid); |
} |
if ($specialresult eq 'ok') { |
if ($specialresult eq 'ok') { |
my ($stamp,$crssubj,$msgname,$msgdom,$msgcount,$context,$pid) = |
my $record_sent; |
split(/\:/,&unescape($specialmsgid)); |
my @recusers; |
|
my @recudoms; |
foreach my $recipient (sort(keys(%toaddr))) { |
my ($stamp,$crssubj,$msgname,$msgdom,$msgcount,$context,$pid) = |
if ($msg_status{$recipient} =~ /\s*(ok|con_delayed)\s*/) { |
split(/\:/,&unescape($specialmsgid)); |
my $usersubj = $subj_prefix.'['.$recipient.']'; |
|
my $usermsgid = |
foreach my $recipient (sort(keys(%toaddr))) { |
&Apache::lonmsg::buildmsgid($stamp,$usersubj, |
if ($specialmsg_status{$recipient} =~ /\s*(ok|con_delayed)\s*/) { |
$msgname,$msgdom, |
my $usersubj = $subj_prefix.'['.$recipient.']'; |
$msgcount,$context, |
my $usermsgid = |
$pid); |
&Apache::lonmsg::buildmsgid($stamp,$usersubj, |
&Apache::lonmsg::user_normal_msg_raw($cnum,$cdom, |
$msgname,$msgdom, |
$subj_prefix.' ['.$recipient.']',$msgsubj, |
$msgcount,$context, |
undef,undef,undef,undef,$usermsgid,undef, |
$pid); |
undef,$specialmsgid,undef,undef,undef,1); |
&Apache::lonmsg::user_normal_msg_raw($cnum,$cdom,$subj_prefix. |
} |
' ['.$recipient.']',$msgsubj,undef, |
|
undef,undef,undef,$usermsgid,undef,undef,$specialmsgid); |
|
my ($uname,$udom) = split(/:/,$recipient); |
|
push(@recusers,$uname); |
|
push(@recudoms,$udom); |
|
} |
} |
} |
if (($env{'form.sendmode'} ne 'upload') && (@recusers > 0)) { |
if (@recusers) { |
&Apache::lonmsg::process_sent_mail($msgsubj, |
my $specialmessage; |
$subj_prefix,$numsent,$stamp,$msgname,$msgdom, |
my $sentsubj = |
$msgcount,$context,$pid,$savemsg,\@recusers, |
$subj_prefix.' ('.$numspecial.' sent) '.$msgsubj; |
\@recudoms); |
$sentsubj = &HTML::Entities::encode($sentsubj,'<>&"'); |
} |
my $sentmsgid = |
} else { |
&Apache::lonmsg::buildmsgid($stamp,$sentsubj,$msgname, |
&Apache::lonnet::logthis('Failed to create record of critical, broadcast or archived message in '.$env{'course.'.$env{'request.course.id'}.'.num'}.' at '.$env{'course.'.$env{'request.course.id'}.'.domain'}.' - no msgid generated'); |
$msgdom,$msgcount,$context, |
|
$pid); |
|
($specialmsgid,$specialmessage) = &Apache::lonmsg::packagemsg($msgsubj,$savemsg, |
|
undef,undef,undef,\@recusers,\@recudoms,$sentmsgid); |
|
$record_sent = &Apache::lonmsg::store_sent_mail($specialmsgid,$specialmessage); |
|
} |
} |
} else { |
} else { |
&Apache::lonnet::logthis('Failed to create record of critical message or broadcast in '.$env{'course.'.$env{'request.course.id'}.'.num'}.' at '.$env{'course.'.$env{'request.course.id'}.'.domain'}.' - no msgid generated'); |
my $stamp = time; |
|
my $msgcount = &Apache::lonmsg::get_uniq(); |
|
my $context = &Apache::lonmsg::get_course_context(); |
|
&Apache::lonmsg::process_sent_mail($msgsubj,$subj_prefix, |
|
$numsent,$stamp,$env{'user.name'}, |
|
$env{'user.domain'},$msgcount,$context, |
|
$$,$savemsg,\@recusers,\@recudoms); |
} |
} |
} |
} |
} else { |
if (!$env{'form.multiforward'}) { |
&printheader($r,'','No messages sent.'); |
if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) { |
} |
$r->print('<br /><span class="LC_success">'.&mt('Completed.'). |
if (!$env{'form.multiforward'}) { |
'</span>'); |
if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) { |
if ($env{'form.displayedcrit'}) { |
$r->print('<br /><span class="LC_success">'.&mt('Completed.'). |
&discrit($r); |
'</span>'); |
} |
if ($env{'form.displayedcrit'}) { |
if ($group ne '') { |
&discrit($r); |
$r->print(&groupmail_sent($group,$cdom,$cnum)); |
|
} else { |
|
&Apache::loncommunicate::menu($r); |
|
} |
|
} else { |
|
$r->print('<p><span class="LC_error">'.&mt('Could not deliver message').'</span> '. |
|
&mt('Please use the browser "Back" button and correct the recipient addresses '."($sendstatus)").'</p>'); |
} |
} |
if ($group ne '') { |
|
$r->print(&groupmail_sent($group,$cdom,$cnum)); |
|
} else { |
|
&Apache::loncommunicate::menu($r); |
|
} |
|
} else { |
|
$r->print('<p><span class="LC_error">'.&mt('Could not deliver message').'</span> '. |
|
&mt('Please use the browser "Back" button and correct the recipient addresses '."($sendstatus)").'</p>'); |
|
} |
} |
} |
} |
return $sendstatus; |
return $sendstatus; |