version 1.35.2.2, 2006/06/30 02:06:15
|
version 1.43, 2006/11/29 05:54:34
|
Line 270 sub discourse {
|
Line 270 sub discourse {
|
&Apache::lonselstudent::get_people_in_class($env{'request.course.sec'}); |
&Apache::lonselstudent::get_people_in_class($env{'request.course.sec'}); |
unshift @$current_members, (@$course_personnel); |
unshift @$current_members, (@$course_personnel); |
my %defaultUsers; |
my %defaultUsers; |
|
|
|
$result .= '<input type="hidden" name="sendmode" value="group" />'."\n"; |
|
|
$result = &Apache::lonselstudent::render_student_list($current_members, |
$result .= &Apache::lonselstudent::render_student_list($current_members, |
"compemail", |
"compemail", |
"current", |
"current", |
\%defaultUsers, |
\%defaultUsers, |
1,"selectedusers",1); |
1,"selectedusers",1); |
|
|
$result .= &Apache::lonselstudent::render_student_list($expired_members, |
$result .= &Apache::lonselstudent::render_student_list($expired_members, |
"compemail", |
"compemail", |
Line 290 sub discourse {
|
Line 292 sub discourse {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub disgroup { |
|
my ($cdom,$cnum,$group,$viewgrps,$editgrps) = @_; |
|
my $result; |
|
# Needs to be in a course |
|
if (!($env{'request.course.fn'})) { |
|
$result = &mt('Error: you must have a course role selected to be able to send a broadcast message to a group in the course.'); |
|
return $result; |
|
} |
|
if ($cdom eq '' || $cnum eq '') { |
|
$result = &mt('Error: could not determine domain or number of course'); |
|
return $result; |
|
} |
|
my ($memberinfo,$numitems) = |
|
&Apache::longroup::group_memberlist($cdom,$cnum,$group,{},[]); |
|
my @statustypes = ('active'); |
|
if ($viewgrps || $editgrps) { |
|
push(@statustypes,('future','previous')); |
|
} |
|
if (keys(%{$memberinfo}) == 0) { |
|
$result = &mt('As this group has no members, there are no '. |
|
'recipients to select.'); |
|
return $result; |
|
} else { |
|
$result = &mt('Select message recipients from the group members listed below.<br />'); |
|
my %Sortby = ( |
|
active => {}, |
|
previous => {}, |
|
future => {}, |
|
); |
|
my %lt = &Apache::lonlocal::texthash( |
|
'name' => 'Name', |
|
'usnm' => 'Username', |
|
'doma' => 'Domain', |
|
'active' => 'Active Members', |
|
'previous' => 'Former Members', |
|
'future' => 'Future Members', |
|
); |
|
foreach my $user (sort(keys(%{$memberinfo}))) { |
|
my $status = $$memberinfo{$user}{status}; |
|
if ($env{'form.'.$status.'.sortby'} eq 'fullname') { |
|
push(@{$Sortby{$status}{$$memberinfo{$user}{fullname}}},$user); |
|
} elsif ($env{'form.'.$status.'.sortby'} eq 'username') { |
|
push(@{$Sortby{$status}{$$memberinfo{$user}{uname}}},$user); |
|
} elsif ($env{'form.'.$status.'.sortby'} eq 'domain') { |
|
push(@{$Sortby{$status}{$$memberinfo{$user}{udom}}},$user); |
|
} else { |
|
push(@{$Sortby{$status}{$$memberinfo{$user}{fullname}}},$user); |
|
} |
|
} |
|
$result .= &group_check_uncheck(); |
|
$result .= '<table border="0" cellspacing="8" cellpadding="2">'. |
|
'<tr>'; |
|
foreach my $status (@statustypes) { |
|
if (ref($numitems) eq 'HASH') { |
|
if ((defined($$numitems{$status})) && ($$numitems{$status})) { |
|
$result.='<td valign="top">'. |
|
'<fieldset><legend><b>'.$lt{$status}. |
|
'</b></legend><nobr>'. |
|
'<input type="button" value="check all" '. |
|
'onclick="javascript:toggleAll('."'".$status."','check'".')" />'. |
|
' '. |
|
'<input type="button" value="uncheck all" '. |
|
'onclick="javascript:toggleAll('."'".$status."','uncheck'".')" />'. |
|
'</nobr></fieldset><br />'. |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(); |
|
$result .= "<th>$lt{'name'}</a></th>". |
|
"<th>$lt{'usnm'}</a></th>". |
|
"<th>$lt{'doma'}</a></th>". |
|
&Apache::loncommon::end_data_table_header_row(); |
|
foreach my $key (sort(keys(%{$Sortby{$status}}))) { |
|
foreach my $user (@{$Sortby{$status}{$key}}) { |
|
$result .= |
|
&Apache::loncommon::start_data_table_row(). |
|
'<td><input type="checkbox" '. |
|
'name="selectedusers_forminput" value="'. |
|
$user.':'.$status.'" />'. |
|
$$memberinfo{$user}{'fullname'}.'</td>'. |
|
'<td>'.$$memberinfo{$user}{'uname'}.'</td>'. |
|
'<td>'.$$memberinfo{$user}{'udom'}.'</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
|
} |
|
} |
|
$result .= &Apache::loncommon::end_data_table(); |
|
} |
|
} |
|
$result .= '</td><td> </td>'; |
|
} |
|
$result .= '</tr></table>'; |
|
} |
|
return $result; |
|
} |
|
|
|
sub group_check_uncheck { |
|
my $output = qq| |
|
<script type="text/javascript"> |
|
function toggleAll(caller,action) { |
|
var pattern = new RegExp(":"+caller+"\$"); |
|
if (typeof(document.compemail.selectedusers_forminput.length)=="undefined") { |
|
if (document.compemail.selectedusers_forminput.value.match(pattern)) { |
|
if (action == 'check') { |
|
document.groupmail.selectedusers_forminput.checked = true; |
|
} else { |
|
document.groupmail.selectedusers_forminput.checked = false; |
|
} |
|
} |
|
} else { |
|
for (var i=0; i<document.compemail.selectedusers_forminput.length; i++) { |
|
if (document.compemail.selectedusers_forminput[i].value.match(pattern)) { |
|
if (action == 'check') { |
|
document.compemail.selectedusers_forminput[i].checked = true; |
|
} else { |
|
document.compemail.selectedusers_forminput[i].checked = false; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
</script> |
|
|; |
|
} |
|
|
|
sub groupmail_header { |
|
my ($action,$group,$cdom,$cnum) = @_; |
|
my ($description,$refarg); |
|
if (!$cdom || !$cnum) { |
|
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
} |
|
if (exists($env{'form.ref'})) { |
|
$refarg = 'ref='.$env{'form.ref'}; |
|
} |
|
if (!$group) { |
|
$group = $env{'form.group'}; |
|
} |
|
if ($group eq '') { |
|
return ''; |
|
} else { |
|
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum,$group); |
|
if (defined($curr_groups{$group})) { |
|
my %groupinfo = |
|
&Apache::longroup::get_group_settings($curr_groups{$group}); |
|
$description = &unescape($groupinfo{'description'}); |
|
} |
|
} |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
if ($refarg) { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/coursegroups", |
|
text=>"Groups", |
|
title=>"View course groups"}); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg", |
|
text=>"Group: $description", |
|
title=>"Go to group's home page"}, |
|
{href=>"/adm/email?compose=group&group=". |
|
"$env{'form.group'}&$refarg", |
|
text=>"Send a Message in a Group", |
|
title=>"Compose Group Email Message"},); |
|
if ($action eq 'sending') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({text=>"Messages being sent.", |
|
title=>"Messages sent"},); |
|
} |
|
my $groupheader = &Apache::loncommon::start_page('Group Email'); |
|
$groupheader .= &Apache::lonhtmlcommon::breadcrumbs |
|
('Group - '.$env{'form.group'}.' Email'); |
|
return $groupheader; |
|
} |
|
|
|
sub groupmail_sent { |
|
my ($group,$cdom,$cnum) = @_; |
|
my $refarg; |
|
if (exists($env{'form.ref'})) { |
|
$refarg = 'ref='.$env{'form.ref'}; |
|
} |
|
my $output .= '<br /><br /><a href="/adm/email?compose=group&group='. |
|
$group.'&'.$refarg.'">'. |
|
&mt('Send another group email').'</a>'.' '. |
|
'<a href="/adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg?'. |
|
$refarg.'">'. &mt('Return to group page').'</a>'; |
|
return $output; |
|
} |
|
|
# ==================================================== Display Critical Message |
# ==================================================== Display Critical Message |
|
|
sub discrit { |
sub discrit { |
Line 299 sub discrit {
|
Line 486 sub discrit {
|
'<input type="hidden" name="confirm" value="true" />'; |
'<input type="hidden" name="confirm" value="true" />'; |
my %what=&Apache::lonnet::dump('critical'); |
my %what=&Apache::lonnet::dump('critical'); |
my $result = ''; |
my $result = ''; |
foreach (sort keys %what) { |
foreach my $key (sort(keys(%what))) { |
my %content=&Apache::lonmsg::unpackagemsg($what{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($what{$key}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
$result.='<hr />'.&mt('From').': <b>'. |
$result.='<hr />'.&mt('From').': <b>'. |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::aboutmewrapper( |
Line 313 $content{'sendername'}.':'.
|
Line 500 $content{'sendername'}.':'.
|
'</pre><small>'. |
'</pre><small>'. |
&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox'). |
&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox'). |
'</small><br />'. |
'</small><br />'. |
'<input type="submit" name="rec_'.$_.'" value="'.&mt('Confirm Receipt').'" />'. |
'<input type="submit" name="rec_'.$key.'" value="'.&mt('Confirm Receipt').'" />'. |
'<input type="submit" name="reprec_'.$_.'" '. |
'<input type="submit" name="reprec_'.$key.'" '. |
'value="'.&mt('Confirm Receipt and Reply').'" />'; |
'value="'.&mt('Confirm Receipt and Reply').'" />'; |
} |
} |
# Check to see if there were any messages. |
# Check to see if there were any messages. |
if ($result eq '') { |
if ($result eq '') { |
$result = "<h2>".&mt('You have no critical messages.')."</h2>". |
$result = "<h2>".&mt('You have no critical messages.')."</h2>". |
'<a href="/adm/roles">'.&mt('Select a course or group').'</a><br />'. |
'<a href="/adm/roles">'.&mt('Select a course').'</a><br />'. |
'<a href="/adm/email">'.&mt('Communicate').'</a>'; |
'<a href="/adm/email">'.&mt('Communicate').'</a>'; |
} else { |
} else { |
$r->print($header); |
$r->print($header); |
Line 453 sub disnew {
|
Line 640 sub disnew {
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'nm' => 'New Messages', |
'nm' => 'New Messages', |
'su' => 'Subject', |
'su' => 'Subject', |
'co' => 'Course', |
'co' => 'Course/Group', |
'da' => 'Date', |
'da' => 'Date', |
'us' => 'Username', |
'us' => 'Username', |
'op' => 'Open', |
'op' => 'Open', |
Line 471 sub disnew {
|
Line 658 sub disnew {
|
my %status_cache = |
my %status_cache = |
&Apache::lonnet::get('email_status',\@msgids); |
&Apache::lonnet::get('email_status',\@msgids); |
my %descriptions; |
my %descriptions; |
foreach (@msgids) { |
foreach my $id (@msgids) { |
my $msgid=&escape($_); |
my $msgid=&escape($id); |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= |
&Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache); |
&Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache); |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
Line 481 sub disnew {
|
Line 668 sub disnew {
|
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
if ($status eq 'new') { |
if ($status eq 'new') { |
if ($numsendtime >= $startblock && ($numsendtime <= $endblock && $endblock > 0) ) { |
if ($numsendtime >= $startblock && ($numsendtime <= $endblock && $endblock > 0) ) { |
$blocked{$_} = 'ON'; |
$blocked{$id} = 'ON'; |
$numblocked ++; |
$numblocked ++; |
} else { |
} else { |
push @newmsgs, { |
push @newmsgs, { |
Line 507 TABLEHEAD
|
Line 694 TABLEHEAD
|
<tr class="LC_mail_new"> |
<tr class="LC_mail_new"> |
<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','course') { |
foreach my $item ('sendtime','from','fromdom','shortsub','course') { |
$r->print("<td>$msg->{$_}</td>"); |
$r->print("<td>$msg->{$item}</td>"); |
} |
} |
$r->print("</td></tr>"); |
$r->print("</td></tr>"); |
} |
} |
Line 579 sub disfolder {
|
Line 766 sub disfolder {
|
</script> |
</script> |
ENDDISHEADER |
ENDDISHEADER |
my $fsqs='&folder='.$folder; |
my $fsqs='&folder='.$folder; |
my @temp=sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder); |
my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder); |
my $totalnumber=$#temp+1; |
my $totalnumber=$#temp+1; |
unless ($totalnumber>0) { |
unless ($totalnumber>0) { |
$r->print('<h2>'.&mt('Empty Folder').'</h2>'); |
$r->print('<h2>'.&mt('Empty Folder').'</h2>'); |
Line 622 ENDDISHEADER
|
Line 809 ENDDISHEADER
|
} |
} |
$r->print('</th><th>'); |
$r->print('</th><th>'); |
if ($env{'form.sortedby'} eq "revcourse") { |
if ($env{'form.sortedby'} eq "revcourse") { |
$r->print('<a href = "?sortedby=course'.$fsqs.'">'.&mt('Course').'</a>'); |
$r->print('<a href = "?sortedby=course'.$fsqs.'">'.&mt('Course/Group').'</a>'); |
} else { |
} else { |
$r->print('<a href = "?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>'); |
$r->print('<a href = "?sortedby=revcourse'.$fsqs.'">'.&mt('Course/Group').'</a>'); |
} |
} |
$r->print('</th><th>'); |
$r->print('</th><th>'); |
if ($env{'form.sortedby'} eq "revstatus") { |
if ($env{'form.sortedby'} eq "revstatus") { |
Line 709 ENDDISHEADER
|
Line 896 ENDDISHEADER
|
sub compout { |
sub compout { |
my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder,$dismode)=@_; |
my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder,$dismode)=@_; |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
|
my ($cdom,$cnum,$group,$refarg); |
if ($broadcast eq 'individual') { |
if (exists($env{'form.group'})) { |
|
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
$group = $env{'form.group'}; |
|
my $action = 'composing'; |
|
$r->print(&groupmail_header($action,$group,$cdom,$cnum)); |
|
} elsif ($broadcast eq 'individual') { |
&printheader($r,'/adm/email?compose=individual', |
&printheader($r,'/adm/email?compose=individual', |
'Send a Message'); |
'Send a Message'); |
} elsif ($broadcast) { |
} elsif ($broadcast) { |
Line 802 sub compout {
|
Line 995 sub compout {
|
} |
} |
} |
} |
my $citation=&displayresource(%content); |
my $citation=&displayresource(%content); |
|
my ($can_grp_broadcast,$viewgrps,$editgrps); |
if ($env{'form.recdom'}) { $defdom=$env{'form.recdom'}; } |
if ($env{'form.recdom'}) { $defdom=$env{'form.recdom'}; } |
if ($env{'form.text'}) { $dismsg=$env{'form.text'}; } |
if ($env{'form.text'}) { $dismsg=$env{'form.text'}; } |
if ($env{'form.subject'}) { $dissub=$env{'form.subject'}; } |
if ($env{'form.subject'}) { $dissub=$env{'form.subject'}; } |
$r->print( |
$r->print( |
'<form action="/adm/email" name="compemail" method="post"'. |
'<form action="/adm/email" name="compemail" method="post"'. |
' enctype="multipart/form-data">'."\n". |
' enctype="multipart/form-data">'."\n". |
'<input type="hidden" name="sendmail" value="on" />'."\n". |
'<input type="hidden" name="sendmail" value="on" />'."\n"); |
'<table>'); |
if ($broadcast eq 'group' && $env{'form.group'} ne '') { |
unless (($broadcast eq 'group') || ($broadcast eq 'upload')) { |
$can_grp_broadcast = |
|
&Apache::lonnet::allowed('sgb',$env{'request.course.id'}.'/'. |
|
$group); |
|
$viewgrps = |
|
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}. |
|
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
|
$editgrps = |
|
&Apache::lonnet::allowed('mdg',$env{'request.course.id'}. |
|
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
|
if ($viewgrps || $editgrps || $can_grp_broadcast) { |
|
$r->print(&disgroup($cdom,$cnum,$group,$viewgrps,$editgrps)); |
|
} |
|
} |
|
$r->print('<table>'); |
|
if (($broadcast eq 'group') && ($group ne '') && |
|
(!$can_grp_broadcast && !$viewgrps && !$editgrps)) { |
|
$r->print(&recipient_input_row($cdom,%lt)); |
|
} |
|
if (($broadcast ne 'group') && ($broadcast ne 'upload')) { |
if ($replying) { |
if ($replying) { |
$r->print('<tr><td colspan="2">'.&mt('Replying to').' '. |
$r->print('<tr><td colspan="2">'.&mt('Replying to').' '. |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::aboutmewrapper( |
Line 821 sub compout {
|
Line 1033 sub compout {
|
'<input type="hidden" name="recdomain" value="'.$content{'senderdomain'}.'" />'. |
'<input type="hidden" name="recdomain" value="'.$content{'senderdomain'}.'" />'. |
'</td></tr>'); |
'</td></tr>'); |
} else { |
} else { |
my $domform = &Apache::loncommon::select_dom_form($defdom,'recdomain'); |
$r->print(&recipient_input_row($defdom,%lt)); |
my $selectlink=&Apache::loncommon::selectstudent_link |
|
('compemail','recuname','recdomain'); |
|
$r->print(<<"ENDREC"); |
|
<tr><td>$lt{'us'}:</td><td><input type="text" size="12" name="recuname" value="$env{'form.recname'}" /></td><td rowspan="2">$selectlink</td></tr> |
|
<tr><td>$lt{'do'}:</td> |
|
<td>$domform</td></tr> |
|
ENDREC |
|
} |
} |
} |
} |
my $latexHelp = Apache::loncommon::helpLatexCheatsheet(); |
my $latexHelp = Apache::loncommon::helpLatexCheatsheet(); |
if ($broadcast ne 'upload') { |
if ($broadcast ne 'upload') { |
$r->print(<<"ENDCOMP"); |
$r->print(<<"ENDCOMP"); |
<tr><td>$lt{'ad'}<br /><tt>username\@domain,username\@domain, ... |
<tr><td>$lt{'ad'}<br /><tt>username:domain,username:domain, ... |
</tt></td><td> |
</tt></td><td> |
<input type="text" size="50" name="additionalrec" /></td></tr> |
<input type="text" size="50" name="additionalrec" /></td></tr> |
<tr><td>$lt{'sb'}:</td><td><input type="text" size="50" name="subject" value="$dissub" /> |
<tr><td>$lt{'sb'}:</td><td><input type="text" size="50" name="subject" value="$dissub" /> |
Line 850 $disbase
|
Line 1055 $disbase
|
<input type="submit" name="cancel" value="$lt{'ca'}" /><hr /> |
<input type="submit" name="cancel" value="$lt{'ca'}" /><hr /> |
$citation |
$citation |
ENDCOMP |
ENDCOMP |
|
if (exists($env{'form.ref'})) { |
|
$r->print('<input type="hidden" name="ref" value="'. |
|
$env{'form.ref'}.'" />'); |
|
} |
|
if (exists($env{'form.group'})) { |
|
$r->print('<input type="hidden" name="group" value="'. |
|
$env{'form.group'}.'" />'); |
|
} |
} else { # $broadcast is 'upload' |
} else { # $broadcast is 'upload' |
$r->print(<<ENDUPLOAD); |
$r->print(<<ENDUPLOAD); |
<input type="hidden" name="sendmode" value="upload" /> |
<input type="hidden" name="sendmode" value="upload" /> |
Line 864 Subject: <input type="text" size="50" na
|
Line 1077 Subject: <input type="text" size="50" na
|
<p> |
<p> |
The file format for the uploaded portion of the message is: |
The file format for the uploaded portion of the message is: |
<pre> |
<pre> |
username1\@domain1: text |
username1:domain1: text |
username2\@domain2: text |
username2:domain2: text |
username3\@domain1: text |
username3:domain1: text |
</pre> |
</pre> |
</p> |
</p> |
<p> |
<p> |
The messages will be assembled from all lines with the respective |
The messages will be assembled from all lines with the respective |
<tt>username\@domain</tt>, and appended to the general message text.</p> |
<tt>username:domain</tt>, and appended to the general message text.</p> |
<p> |
<p> |
<input type="file" name="upfile" size="40" /></p><p> |
<input type="file" name="upfile" size="40" /></p><p> |
$dispcrit |
$dispcrit |
Line 879 $dispcrit
|
Line 1092 $dispcrit
|
ENDUPLOAD |
ENDUPLOAD |
} |
} |
if ($broadcast eq 'group') { |
if ($broadcast eq 'group') { |
&discourse($r); |
if ($group eq '') { |
my $studentsel = &discourse(); |
my $studentsel = &discourse(); |
$r->print($studentsel); |
$r->print($studentsel); |
|
} |
} |
} |
if ($env{'form.displayedcrit'}) { |
if ($env{'form.displayedcrit'}) { |
$r->print('<input type="hidden" name="displayedcrit" value="true" />'); |
$r->print('<input type="hidden" name="displayedcrit" value="true" />'); |
Line 893 ENDUPLOAD
|
Line 1107 ENDUPLOAD
|
|
|
# ---------------------------------------------------- Display all face to face |
# ---------------------------------------------------- Display all face to face |
|
|
|
sub recipient_input_row { |
|
my ($dom,%lt) = @_; |
|
my $domform = &Apache::loncommon::select_dom_form($dom,'recdomain'); |
|
my $selectlink= |
|
&Apache::loncommon::selectstudent_link('compemail','recuname', |
|
'recdomain'); |
|
my $output = <<"ENDREC"; |
|
<tr><td>$lt{'us'}:</td><td><input type="text" size="12" name="recuname" value="$env{'form.recname'}" /></td><td rowspan="2">$selectlink</td></tr> |
|
<tr><td>$lt{'do'}:</td> |
|
<td>$domform</td></tr> |
|
ENDREC |
|
return $output; |
|
} |
|
|
sub retrieve_instructor_comments { |
sub retrieve_instructor_comments { |
my ($user,$domain)=@_; |
my ($user,$domain)=@_; |
my $target=$env{'form.grade_target'}; |
my $target=$env{'form.grade_target'}; |
Line 907 sub retrieve_instructor_comments {
|
Line 1135 sub retrieve_instructor_comments {
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
'%255b'.$user.'%253a'.$domain.'%255d'); |
'%255b'.$user.'%253a'.$domain.'%255d'); |
my $result=''; |
my $result=''; |
foreach (sort(keys(%records))) { |
foreach my $key (sort(keys(%records))) { |
my %content=&Apache::lonmsg::unpackagemsg($records{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($records{$key}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'subject'} !~ /^Record/); |
next if ($content{'subject'} !~ /^Record/); |
# &Apache::lonfeedback::newline_to_br(\$content{'message'}); |
# &Apache::lonfeedback::newline_to_br(\$content{'message'}); |
Line 935 sub disfacetoface {
|
Line 1163 sub disfacetoface {
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
'%255b'.$user.'%253a'.$domain.'%255d'); |
'%255b'.$user.'%253a'.$domain.'%255d'); |
my $result=''; |
my $result=''; |
foreach (sort keys %records) { |
foreach my $key (sort(keys(%records))) { |
my %content=&Apache::lonmsg::unpackagemsg($records{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($records{$key}); |
next if ($content{'senderdomain'} eq ''); |
next if ($content{'senderdomain'} eq ''); |
&Apache::lonfeedback::newline_to_br(\$content{'message'}); |
&Apache::lonfeedback::newline_to_br(\$content{'message'}); |
if ($content{'subject'}=~/^Record/) { |
if ($content{'subject'}=~/^Record/) { |
Line 1159 sub blockstore {
|
Line 1387 sub blockstore {
|
my $addtotal = 0; |
my $addtotal = 0; |
my %blocking = (); |
my %blocking = (); |
$r->print('<h3>'.$lt{'head'}.'</h3>'); |
$r->print('<h3>'.$lt{'head'}.'</h3>'); |
foreach (keys %env) { |
foreach my $envkey (keys(%env)) { |
if ($_ =~ m/^form\.modify_(\w+)$/) { |
if ($envkey =~ m/^form\.modify_(\w+)$/) { |
$adds{$1} = $1; |
$adds{$1} = $1; |
$removals{$1} = $1; |
$removals{$1} = $1; |
$modtotal ++; |
$modtotal ++; |
} elsif ($_ =~ m/^form\.cancel_(\d+)$/) { |
} elsif ($envkey =~ m/^form\.cancel_(\d+)$/) { |
$cancels{$1} = $1; |
$cancels{$1} = $1; |
unless ( defined($removals{$1}) ) { |
unless ( defined($removals{$1}) ) { |
$removals{$1} = $1; |
$removals{$1} = $1; |
$canceltotal ++; |
$canceltotal ++; |
} |
} |
} elsif ($_ =~ m/^form\.add_(\d+)$/) { |
} elsif ($envkey =~ m/^form\.add_(\d+)$/) { |
$adds{$1} = $1; |
$adds{$1} = $1; |
$addtotal ++; |
$addtotal ++; |
} |
} |
} |
} |
|
|
foreach (keys %removals) { |
foreach my $key (keys(%removals)) { |
my $hashkey = $env{'form.key_'.$_}; |
my $hashkey = $env{'form.key_'.$key}; |
&Apache::lonnet::del('comm_block',["$hashkey"], |
&Apache::lonnet::del('comm_block',["$hashkey"], |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'} |
$env{'course.'.$env{'request.course.id'}.'.num'} |
); |
); |
} |
} |
foreach (keys %adds) { |
foreach my $key (keys(%adds)) { |
unless ( defined($cancels{$_}) ) { |
unless ( defined($cancels{$key}) ) { |
my ($newstart,$newend) = &get_dates_from_form($_); |
my ($newstart,$newend) = &get_dates_from_form($key); |
my $newkey = $newstart.'____'.$newend; |
my $newkey = $newstart.'____'.$newend; |
$blocking{$newkey} = $env{'user.name'}.':'.$env{'user.domain'}.':'.$env{'form.title_'.$_}; |
$blocking{$newkey} = $env{'user.name'}.':'.$env{'user.domain'}.':'.$env{'form.title_'.$key}; |
} |
} |
} |
} |
if ($addtotal + $modtotal > 0) { |
if ($addtotal + $modtotal > 0) { |
Line 1360 sub blockcheck {
|
Line 1588 sub blockcheck {
|
$setters->{$course}{'staff'} = []; |
$setters->{$course}{'staff'} = []; |
$setters->{$course}{'times'} = []; |
$setters->{$course}{'times'} = []; |
my %records = &Apache::lonnet::dump('comm_block',$cdom,$cnum); |
my %records = &Apache::lonnet::dump('comm_block',$cdom,$cnum); |
foreach my $record (keys %records) { |
foreach my $record (keys(%records)) { |
my ($start,$end) = ($record =~ m/^(\d+)____(\d+)$/); |
my ($start,$end) = ($record =~ m/^(\d+)____(\d+)$/); |
if ($start <= time && $end >= time) { |
if ($start <= time && $end >= time) { |
my ($staff_name,$staff_dom,$title) = |
my ($staff_name,$staff_dom,$title) = |
Line 1382 sub build_block_table {
|
Line 1610 sub build_block_table {
|
my ($r,$startblock,$endblock,$setters) = @_; |
my ($r,$startblock,$endblock,$setters) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'cacb' => 'Currently active communication blocks', |
'cacb' => 'Currently active communication blocks', |
'cour' => 'Course', |
'cour' => 'Course/Group', |
'dura' => 'Duration', |
'dura' => 'Duration', |
'blse' => 'Block set by' |
'blse' => 'Block set by' |
); |
); |
Line 1562 sub header {
|
Line 1790 sub header {
|
|
|
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
if ($baseurl) { |
if ($baseurl) { |
$extra .= "<base href=\"http://$ENV{'SERVER_NAME'}/$baseurl\" />"; |
$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />"; |
} |
} |
$r->print(&Apache::loncommon::start_page('Communication and Messages', |
$r->print(&Apache::loncommon::start_page('Communication and Messages', |
$extra)); |
$extra)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
(($title?$title:'Communication and Messages'))); |
(($title?$title:'Communication and Messages'))); |
|
|
} |
} |
|
|
# ---------------------------------------------------------------- Print header |
# ---------------------------------------------------------------- Print header |
Line 1587 sub storecomment {
|
Line 1814 sub storecomment {
|
my ($r)=@_; |
my ($r)=@_; |
my $msgtxt=&Apache::lonfeedback::clear_out_html($env{'form.message'}); |
my $msgtxt=&Apache::lonfeedback::clear_out_html($env{'form.message'}); |
my $cleanmsgtxt=''; |
my $cleanmsgtxt=''; |
foreach (split(/[\n\r]/,$msgtxt)) { |
foreach my $line (split(/[\n\r]/,$msgtxt)) { |
unless ($_=~/^\s*(\>|\>\;)/) { |
unless ($line=~/^\s*(\>|\>\;)/) { |
$cleanmsgtxt.=$_."\n"; |
$cleanmsgtxt.=$line."\n"; |
} |
} |
} |
} |
my $key=&escape($env{'form.baseurl'}).'___'.time; |
my $key=&escape($env{'form.baseurl'}).'___'.time; |
Line 1606 sub storedcommentlisting {
|
Line 1833 sub storedcommentlisting {
|
$r->print(&mt('No stored comments yet.')); |
$r->print(&mt('No stored comments yet.')); |
} else { |
} else { |
my $found=0; |
my $found=0; |
foreach (sort keys %msgs) { |
foreach my $key (sort(keys(%msgs))) { |
$r->print("\n".$msgs{$_}."<hr />"); |
$r->print("\n".$msgs{$key}."<hr />"); |
$found=1; |
$found=1; |
} |
} |
unless ($found) { |
unless ($found) { |
Line 1624 sub sendoffmail {
|
Line 1851 sub sendoffmail {
|
my $sendstatus=''; |
my $sendstatus=''; |
my %specialmsg_status; |
my %specialmsg_status; |
my $numspecial = 0; |
my $numspecial = 0; |
|
my ($cdom,$cnum,$group); |
|
if (exists($env{'form.group'})) { |
|
$group = $env{'form.group'}; |
|
} |
|
if (exists($env{'request.course.id'})) { |
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
} |
if ($env{'form.send'}) { |
if ($env{'form.send'}) { |
&printheader($r,'','Messages being sent.'); |
if ($group eq '') { |
|
&printheader($r,'','Messages being sent.'); |
|
} else { |
|
$r->print(&groupmail_header('sending',$group)); |
|
} |
$r->rflush(); |
$r->rflush(); |
my %content=(); |
my %content=(); |
undef %content; |
undef %content; |
Line 1645 sub sendoffmail {
|
Line 1884 sub sendoffmail {
|
} |
} |
|
|
my @to = |
my @to = |
&Apache::loncommon::get_env_multiple('form.selectedusers.forminput'); |
&Apache::loncommon::get_env_multiple('form.selectedusers_forminput'); |
my $mode = $env{'form.sendmode'}; |
my $mode = $env{'form.sendmode'}; |
|
|
my %toaddr; |
my %toaddr; |
Line 1667 sub sendoffmail {
|
Line 1906 sub sendoffmail {
|
} |
} |
} elsif ($env{'form.sendmode'} eq 'upload') { |
} elsif ($env{'form.sendmode'} eq 'upload') { |
foreach my $line (split(/[\n\r\f]+/,$env{'form.upfile'})) { |
foreach my $line (split(/[\n\r\f]+/,$env{'form.upfile'})) { |
my ($rec,$txt)=split(/\s*\:\s*/,$line); |
my ($rec,$txt) = ($line =~ /^([^:]+:[^:]+):(.*)$/); |
if ($txt) { |
if ($txt) { |
$rec=~s/\@/\:/; |
$rec =~ s/^\s+//; |
|
$rec =~ ~s/\s+$//; |
$toaddr{$rec}.=$txt."\n"; |
$toaddr{$rec}.=$txt."\n"; |
} |
} |
} |
} |
Line 1679 sub sendoffmail {
|
Line 1919 sub sendoffmail {
|
} |
} |
} |
} |
if ($env{'form.additionalrec'}) { |
if ($env{'form.additionalrec'}) { |
foreach (split(/\,/,$env{'form.additionalrec'})) { |
foreach my $rec (split(/\,/,$env{'form.additionalrec'})) { |
my ($auname,$audom)=split(/\@/,$_); |
my ($auname,$audom)=split(/:/,$rec); |
if (($auname ne "") && ($audom ne "")) { |
if (($auname ne "") && ($audom ne "")) { |
$toaddr{$auname.':'.$audom}=''; |
$toaddr{$auname.':'.$audom}=''; |
} |
} |
Line 1750 sub sendoffmail {
|
Line 1990 sub sendoffmail {
|
$subj_prefix = 'Broadcast.'; |
$subj_prefix = 'Broadcast.'; |
} |
} |
my ($specialmsgid,$specialresult); |
my ($specialmsgid,$specialresult); |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $course_str = &escape('['.$cnum.':'.$cdom.']'); |
my $course_str = &escape('['.$cnum.':'.$cdom.']'); |
|
|
if ($numspecial) { |
if ($numspecial) { |
Line 1807 sub sendoffmail {
|
Line 2045 sub sendoffmail {
|
$r->print('<br /><span class="LC_success">'.&mt('Completed.').'</span>'); |
$r->print('<br /><span class="LC_success">'.&mt('Completed.').'</span>'); |
if ($env{'form.displayedcrit'}) { |
if ($env{'form.displayedcrit'}) { |
&discrit($r); |
&discrit($r); |
|
} |
|
if ($group ne '') { |
|
$r->print(&groupmail_sent($group,$cdom,$cnum)); |
} else { |
} else { |
&Apache::loncommunicate::menu($r); |
&Apache::loncommunicate::menu($r); |
} |
} |
Line 1833 sub handler {
|
Line 2074 sub handler {
|
['display','replyto','forward','markread','markdel','markunread', |
['display','replyto','forward','markread','markdel','markunread', |
'sendreply','compose','sendmail','critical','recname','recdom', |
'sendreply','compose','sendmail','critical','recname','recdom', |
'recordftf','sortedby','block','folder','startdis','interdis', |
'recordftf','sortedby','block','folder','startdis','interdis', |
'showcommentbaseurl','dismode','group','subject','text']); |
'showcommentbaseurl','dismode','group','subject','text','ref']); |
$sqs='&sortedby='.$env{'form.sortedby'}; |
$sqs='&sortedby='.$env{'form.sortedby'}; |
|
|
# ------------------------------------------------------ They checked for email |
# ------------------------------------------------------ They checked for email |
Line 1900 sub handler {
|
Line 2141 sub handler {
|
} elsif ($env{'form.confirm'}) { |
} elsif ($env{'form.confirm'}) { |
&printheader($r,'','Confirmed Receipt'); |
&printheader($r,'','Confirmed Receipt'); |
my $replying = 0; |
my $replying = 0; |
foreach (keys %env) { |
foreach my $envkey (keys(%env)) { |
if ($_=~/^form\.rec\_(.*)$/) { |
if ($envkey=~/^form\.rec\_(.*)$/) { |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
&Apache::lonmsg::user_crit_received($1).'<br>'); |
&Apache::lonmsg::user_crit_received($1).'<br>'); |
} |
} |
if ($_=~/^form\.reprec\_(.*)$/) { |
if ($envkey=~/^form\.reprec\_(.*)$/) { |
my $msgid=$1; |
my $msgid=$1; |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
&Apache::lonmsg::user_crit_received($msgid).'<br>'); |
&Apache::lonmsg::user_crit_received($msgid).'<br>'); |
Line 2001 sub handler {
|
Line 2242 sub handler {
|
&sendoffmail($r,$folder); |
&sendoffmail($r,$folder); |
if ($env{'form.storebasecomment'}) { |
if ($env{'form.storebasecomment'}) { |
&storecomment($r); |
&storecomment($r); |
} |
} |
if (($env{'form.rsspost'}) && ($env{'request.course.id'})) { |
if (($env{'form.rsspost'}) && ($env{'request.course.id'})) { |
&Apache::lonrss::addentry($env{'course.'.$env{'request.course.id'}.'.num'}, |
&Apache::lonrss::addentry($env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
'Course_Announcements', |
'Course_Announcements', |
$env{'form.subject'}, |
$env{'form.subject'}, |
$env{'form.message'},'/adm/communicate','public'); |
$env{'form.message'},'/adm/communicate','public'); |
} |
} |
if (!$env{'form.displayedcrit'}) { |
if ((!exists($env{'form.group'})) && (!$env{'form.displayedcrit'})) { |
&disall($r,($folder?$folder:$dismode)); |
&disall($r,($folder?$folder:$dismode)); |
} |
} |
} elsif ($env{'form.newfolder'}) { |
} elsif ($env{'form.newfolder'}) { |
Line 2039 sub handler {
|
Line 2280 sub handler {
|
|
|
__END__ |
__END__ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|