version 1.97, 2008/11/23 15:48:27
|
version 1.120, 2009/03/31 21:04:12
|
Line 136 sub folderlist {
|
Line 136 sub folderlist {
|
|
|
); |
); |
|
|
|
# set se lastvisit for the new mail check in the toplevel menu |
|
&Apache::lonnet::appenv({'user.mailcheck.lastvisit'=>time}); |
|
|
my %actions = &Apache::lonlocal::texthash( |
my %actions = &Apache::lonlocal::texthash( |
view => 'View Folder', |
view => 'View Folder', |
rename => 'Rename Folder', |
rename => 'Rename Folder', |
Line 243 function folder_choice(targetform,caller
|
Line 246 function folder_choice(targetform,caller
|
</td><td> </td><td> </td><td> </td><td> </td> |
</td><td> </td><td> </td><td> </td><td> </td> |
<td align="right"> |
<td align="right"> |
<table><tr><td><br /> |
<table><tr><td><br /> |
<input type="button" value="'.&mt('Make New Folder'). |
<input type="button" value="'.&mt('New Folder'). |
'" onClick="javascript:folder_choice(this.form,'."'new'".');" /></td>'. |
'" onClick="javascript:folder_choice(this.form,'."'new'".');" /></td>'. |
'<td align="center"><b>'.&mt('New Folder').'</b><br />'. |
'<td align="center"><b>'.&mt('Name').'</b><br />'. |
'<input type="text" size="15" name="newfolder" value="" /> |
'<input type="text" size="15" name="newfolder" value="" /> |
</td></tr></table> |
</td></tr></table> |
</td> |
</td> |
Line 353 sub makefolder {
|
Line 356 sub makefolder {
|
} |
} |
} else { |
} else { |
$outcome = |
$outcome = |
&mt('Error - could not obtain lock on email folders record.'); |
&mt('Error - could not obtain lock on message folders record.'); |
} |
} |
return ($outcome,$warning); |
return ($outcome,$warning); |
} |
} |
Line 555 sub discourse {
|
Line 558 sub discourse {
|
} |
} |
|
|
sub disgroup { |
sub disgroup { |
my ($cdom,$cnum,$group,$access_status) = @_; |
my ($r,$cdom,$cnum,$group,$access_status) = @_; |
my $result; |
my $hasfloat; |
# Needs to be in a course |
# Needs to be in a course |
if (!($env{'request.course.fn'})) { |
if (!($env{'request.course.fn'})) { |
$result = &mt('Error: you must have a course role selected to be able to send a broadcast |
$r->print('<span class="LC_error">'.&mt('Error: you must have a course role selected to be able to send a broadcast message to a group in the course.').'</span>'); |
e-mail to a group in the course.'); |
return; |
return $result; |
|
} |
} |
if ($cdom eq '' || $cnum eq '') { |
if ($cdom eq '' || $cnum eq '') { |
$result = &mt('Error: could not determine domain or number of course'); |
$r->print('<span class="LC_error">'.&mt('Error: could not determine domain or number of course').'</span>'); |
return $result; |
return; |
} |
} |
my ($memberinfo,$numitems) = |
my ($memberinfo,$numitems) = |
&Apache::longroup::group_memberlist($cdom,$cnum,$group,{},[]); |
&Apache::longroup::group_memberlist($cdom,$cnum,$group,{},[]); |
Line 578 e-mail to a group in the course.');
|
Line 580 e-mail to a group in the course.');
|
push(@statustypes,('future','previous')); |
push(@statustypes,('future','previous')); |
} |
} |
if (keys(%{$memberinfo}) == 0) { |
if (keys(%{$memberinfo}) == 0) { |
$result = &mt('As this group has no members, there are no '. |
$r->print('<span class="LC_warning">'. |
'recipients to select.'); |
&mt('As this group has no members, there are no recipients to select'). |
return $result; |
'</span>'); |
|
return; |
} else { |
} else { |
|
$hasfloat = 1; |
|
unless($env{'environment.wysiwygeditor'} eq 'on') { |
|
$r->print('<div class="LC_left_float">'); |
|
} |
my %Sortby = ( |
my %Sortby = ( |
active => {}, |
active => {}, |
previous => {}, |
previous => {}, |
Line 607 e-mail to a group in the course.');
|
Line 614 e-mail to a group in the course.');
|
push(@{$Sortby{$status}{$$memberinfo{$user}{fullname}}},$user); |
push(@{$Sortby{$status}{$$memberinfo{$user}{fullname}}},$user); |
} |
} |
} |
} |
$result .= &group_check_uncheck(); |
$r->print(&group_check_uncheck()); |
foreach my $status (@statustypes) { |
foreach my $status (@statustypes) { |
if (ref($numitems) eq 'HASH') { |
if (ref($numitems) eq 'HASH') { |
if ((defined($$numitems{$status})) && ($$numitems{$status})) { |
if ((defined($$numitems{$status})) && ($$numitems{$status})) { |
Line 615 e-mail to a group in the course.');
|
Line 622 e-mail to a group in the course.');
|
if (ref($access_status) eq 'HASH') { |
if (ref($access_status) eq 'HASH') { |
$access_status->{$status} = $$numitems{$status}; |
$access_status->{$status} = $$numitems{$status}; |
} |
} |
$result.='<fieldset><legend><b>'.$lt{$status}. |
$r->print('<fieldset><legend><b>'.$lt{$status}. |
'</b></legend><form name="'.$formname.'">'. |
'</b></legend><form name="'.$formname.'">'. |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<input type="button" value="'.&mt('Check All').'" '. |
'<input type="button" value="'.&mt('Check All').'" '. |
'onclick="javascript:toggleAll('."this.form,'check'".')" />'. |
'onclick="javascript:toggleAll('."this.form,'check'".')" />'. |
' '. |
' '. |
'<input type="button" value="'.&mt('Uncheck All').'" '. |
'<input type="button" value="'.&mt('Uncheck All').'" '. |
'onclick="javascript:toggleAll('."this.form,'uncheck'".')" />'. |
'onclick="javascript:toggleAll('."this.form,'uncheck'".')" />'. |
'</span>'; |
'</span>'); |
if ($status eq 'active') { |
if ($status eq 'active') { |
$result .= ' <select name="groupmail">'. |
$r->print((' 'x3).'<select name="groupmail">'. |
'<option value="bcc" selected="selected">'.&mt('Bcc').'</option>'. |
'<option value="bcc" selected="selected">'.&mt('Bcc').'</option>'. |
'<option value="cc">'.&mt('Cc').'</option>'. |
'<option value="cc">'.&mt('Cc').'</option>'. |
'</select>'; |
'</select>'); |
} |
} |
$result .= '<br />'.&Apache::loncommon::start_data_table(). |
$r->print('<br />'.&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
"<th>$lt{'name'}</a></th>". |
"<th>$lt{'name'}</th>". |
"<th>$lt{'usnm'}</a></th>". |
"<th>$lt{'usnm'}</th>". |
"<th>$lt{'doma'}</a></th>". |
"<th>$lt{'doma'}</th>". |
&Apache::loncommon::end_data_table_header_row(); |
&Apache::loncommon::end_data_table_header_row()); |
foreach my $key (sort(keys(%{$Sortby{$status}}))) { |
foreach my $key (sort(keys(%{$Sortby{$status}}))) { |
foreach my $user (@{$Sortby{$status}{$key}}) { |
foreach my $user (@{$Sortby{$status}{$key}}) { |
$result .= |
$r->print(&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><span class="LC_nobreak"><input type="checkbox" '. |
'<td><input type="checkbox" '. |
|
'name="selectedusers_forminput" value="'. |
'name="selectedusers_forminput" value="'. |
$user.':'.$status.'" />'. |
$user.':'.$status.'" />'. |
$$memberinfo{$user}{'fullname'}.'</td>'. |
$$memberinfo{$user}{'fullname'}.'</span></td>'. |
'<td>'.$$memberinfo{$user}{'uname'}.'</td>'. |
'<td>'.$$memberinfo{$user}{'uname'}.'</td>'. |
'<td>'.$$memberinfo{$user}{'udom'}.'</td>'. |
'<td>'.$$memberinfo{$user}{'udom'}.'</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
$result .= &Apache::loncommon::end_data_table().'</form></fieldset><br />'; |
$r->print(&Apache::loncommon::end_data_table().'</form>'. |
|
'</fieldset><br />'); |
} |
} |
} |
} |
} |
} |
|
unless($env{'environment.wysiwygeditor'} eq 'on') { |
|
$r->print('</div>'); |
|
} |
} |
} |
return $result; |
return $hasfloat; |
} |
} |
|
|
sub group_check_uncheck { |
sub group_check_uncheck { |
Line 718 sub groupmail_header {
|
Line 728 sub groupmail_header {
|
{href=>"/adm/email?compose=group&group=". |
{href=>"/adm/email?compose=group&group=". |
"$env{'form.group'}&$refarg", |
"$env{'form.group'}&$refarg", |
text=>"Send a Message in a Group", |
text=>"Send a Message in a Group", |
title=>"Compose Group E-mail"},); |
title=>"Compose Group Message"},); |
if ($action eq 'sending') { |
if ($action eq 'sending') { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({text=>"E-mails being sent.", |
({text=>"Messages being sent.", |
title=>"E-mails sent"},); |
title=>"E-mails sent"},); |
} |
} |
my $groupheader = &Apache::loncommon::start_page('Group Email'); |
my $groupheader = &Apache::loncommon::start_page('Group Message'); |
$groupheader .= &Apache::lonhtmlcommon::breadcrumbs |
$groupheader .= &Apache::lonhtmlcommon::breadcrumbs |
('Group - '.$env{'form.group'}.' Email'); |
('Group - '.$env{'form.group'}.' Email'); |
return $groupheader; |
return $groupheader; |
Line 738 sub groupmail_sent {
|
Line 748 sub groupmail_sent {
|
} |
} |
my $output .= '<br /><br /><a href="/adm/email?compose=group&group='. |
my $output .= '<br /><br /><a href="/adm/email?compose=group&group='. |
$group.'&'.$refarg.'">'. |
$group.'&'.$refarg.'">'. |
&mt('Send another group email').'</a>'.' '. |
&mt('Send another group message').'</a>'.' '. |
'<a href="/adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg?'. |
'<a href="/adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg?'. |
$refarg.'">'. &mt('Return to group page').'</a>'; |
$refarg.'">'. &mt('Return to group page').'</a>'; |
return $output; |
return $output; |
Line 831 sub sortedmessages {
|
Line 841 sub sortedmessages {
|
} |
} |
|
|
foreach my $msgid (@messages) { |
foreach my $msgid (@messages) { |
|
next if ($msgid eq ''); |
my $esc_msgid=&escape($msgid); |
my $esc_msgid=&escape($msgid); |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,$processid,$symb,$error) = |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,$processid,$symb,$error) = |
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef, |
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef, |
Line 1071 ENDDISHEADER
|
Line 1082 ENDDISHEADER
|
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
|
|
my $suffix = &Apache::lonmsg::foldersuffix($folder); |
my $suffix = &Apache::lonmsg::foldersuffix($folder); |
|
my $count = 0; |
for (my $n=$firstdis;$n<=$lastdis;$n++) { |
for (my $n=$firstdis;$n<=$lastdis;$n++) { |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID, |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID, |
$description,$recv_name,$recv_domain)= |
$description,$recv_name,$recv_domain)= |
@{$temp[$n]}; |
@{$temp[$n]}; |
if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { |
if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { |
|
$count ++; |
if ($status eq 'new') { |
if ($status eq 'new') { |
$r->print('<tr class="LC_mail_new">'); |
$r->print('<tr class="LC_mail_new">'); |
} elsif ($status eq 'read') { |
} elsif ($status eq 'read') { |
Line 1107 ENDDISHEADER
|
Line 1120 ENDDISHEADER
|
} |
} |
} |
} |
my $localsenttime = &Apache::lonlocal::locallocaltime($sendtime); |
my $localsenttime = &Apache::lonlocal::locallocaltime($sendtime); |
my $count = $n +1; |
$r->print('<td align="right"><span class="LC_nobreak">'.(($status eq 'new')?'<b>':''). |
$r->print('<td align="right"><nobr>'.(($status eq 'new')?'<b>':''). |
|
$count.'.'.(($status eq 'new')?'</b>':'').' '. |
$count.'.'.(($status eq 'new')?'</b>':'').' '. |
'<input type="checkbox" name="delmark"'. |
'<input type="checkbox" name="delmark"'. |
' value="'.$origID.'" /></nobr></td>'); |
' value="'.$origID.'" /></span></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.'">'. |
'<a href="/adm/email?display='.$origID.$sqs.'">'. |
Line 1287 sub compout {
|
Line 1299 sub compout {
|
$dispcrit= |
$dispcrit= |
'<span class="LC_nobreak"><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'.</label>'.$crithelp.' '.&mt('Require return receipt?').'<label><input type="radio" name="sendbck" value="1" />'.&mt('Yes').'</label> <label><input type="radio" name="sendbck" value="" checked="checked" />'.&mt('No').'</label></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'.</label>'.$crithelp.' '.&mt('Require return receipt?').'<label><input type="radio" name="sendbck" value="1" />'.&mt('Yes').'</label> <label><input type="radio" name="sendbck" value="" checked="checked" />'.&mt('No').'</label></span><br />'. |
'<label><input type="checkbox" name="permanent" /> '. |
'<label><input type="checkbox" name="permanent" /> '. |
&mt('Send copy to permanent email address (if known)').'</label><br />'. |
&mt('Send copy to permanent e-mail address (if known)').'</label><br />'. |
'<label><input type="checkbox" name="rsspost" /> '. |
'<label><input type="checkbox" name="rsspost" /> '. |
&mt('Include in course RSS newsfeed').'</label><br />'; |
&mt('Include in course RSS newsfeed').'</label><br />'; |
} |
} |
Line 1317 sub compout {
|
Line 1329 sub compout {
|
if ($group eq '') { |
if ($group eq '') { |
my $studentsel = &discourse(\%access_status); |
my $studentsel = &discourse(\%access_status); |
if ($studentsel) { |
if ($studentsel) { |
$r->print('<div class="LC_left_float">'.$studentsel.'</div>'); |
if ($env{'environment.wysiwygeditor'} eq 'on') { |
|
$r->print($studentsel); |
|
} else { |
|
$r->print('<div class="LC_left_float">'.$studentsel.'</div>'); |
|
} |
$hasfloat = 1; |
$hasfloat = 1; |
} |
} |
} else { |
} else { |
$can_grp_broadcast = &check_group_priv($group); |
$can_grp_broadcast = &check_group_priv($group); |
if ($can_grp_broadcast) { |
if ($can_grp_broadcast) { |
$r->print('<div class="LC_left_float">'. |
$hasfloat = &disgroup($r,$cdom,$cnum,$group,\%access_status); |
&disgroup($cdom,$cnum,$group,\%access_status). |
|
'</div>'); |
|
$hasfloat = 1; |
|
} |
} |
} |
} |
if ($hasfloat) { |
if ($hasfloat) { |
Line 1412 ENDREPSCRIPT
|
Line 1425 ENDREPSCRIPT
|
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'}; } |
if ($hasfloat) { |
if ($hasfloat) { |
$r->print($broadcast_js.'<div class="LC_left_float">'); |
if ($env{'environment.wysiwygeditor'} eq 'on') { |
|
$r->print($broadcast_js); |
|
} else { |
|
$r->print($broadcast_js.'<div class="LC_left_float">'); |
|
} |
$onsubmit = ' onsubmit="javascript:courseRecipients();" '; |
$onsubmit = ' onsubmit="javascript:courseRecipients();" '; |
} |
} |
$r->print( |
$r->print( |
Line 1521 ENDREPSCRIPT
|
Line 1538 ENDREPSCRIPT
|
$r->print(&recipient_input_row($defdom,%lt)); |
$r->print(&recipient_input_row($defdom,%lt)); |
} |
} |
} |
} |
my $latexHelp = &Apache::loncommon::helpLatexCheatsheet(); |
my $latexHelp = &Apache::loncommon::helpLatexCheatsheet(undef,undef,1); |
my $wysiwyglink=&Apache::lonhtmlcommon::htmlareaselectactive('message').'<br />'; |
my $wysiwyglink=&Apache::lonhtmlcommon::htmlareaselectactive('message').'<br />'; |
my $subj_size; |
my $subj_size; |
if ($multiforward) { |
if ($multiforward) { |
Line 1564 $wysiwyglink);
|
Line 1581 $wysiwyglink);
|
$r->print(<<"ENDCOMP"); |
$r->print(<<"ENDCOMP"); |
$attachrow |
$attachrow |
</table><br /> |
</table><br /> |
$latexHelp |
$latexHelp<br /> |
<textarea name="message" id="message" cols="80" rows="15" wrap="hard">$dismsg |
<textarea name="message" id="message" cols="80" rows="15" wrap="hard">$dismsg |
</textarea>$wysiwyglink |
</textarea>$wysiwyglink |
$sendmode |
$sendmode |
Line 1618 ENDUPLOAD
|
Line 1635 ENDUPLOAD
|
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
if ($hasfloat) { |
if ($hasfloat) { |
$r->print('</div><div class="LC_clear_float_footer"></div>'); |
unless($env{'environment.wysiwygeditor'} eq 'on') { |
|
$r->print('</div><div class="LC_clear_float_footer"></div>'); |
|
} |
} |
} |
$r->print(&generate_preview_form); |
$r->print(&generate_preview_form); |
} |
} |
Line 1668 sub additional_rec_row {
|
Line 1687 sub additional_rec_row {
|
<tr><td colspan="3"><fieldset id="LC_additionalrecips"><legend><b>$lt->{'ad'}</b> <tt>($exmpl)</tt>:</legend><table> |
<tr><td colspan="3"><fieldset id="LC_additionalrecips"><legend><b>$lt->{'ad'}</b> <tt>($exmpl)</tt>:</legend><table> |
<tr><td> </td><td>$lt->{'to'}</td><td><input type="text" size="50" name="additionalrec_to" /></td></tr> |
<tr><td> </td><td>$lt->{'to'}</td><td><input type="text" size="50" name="additionalrec_to" /></td></tr> |
<tr><td> </td><td>$cc</td><td><input type="text" size="50" name="additionalrec_cc" /></td></tr> |
<tr><td> </td><td>$cc</td><td><input type="text" size="50" name="additionalrec_cc" /></td></tr> |
<tr><td> </td><td>$bcc</td><td><input type="text" size="50" name="additionalrec_bcc" /></td></tr></table></fieldset> |
<tr><td> </td><td>$bcc</td><td><input type="text" size="50" name="additionalrec_bcc" /></td></tr></table></fieldset></td></tr> |
ENDADD |
ENDADD |
return $output; |
return $output; |
} |
} |
Line 1676 ENDADD
|
Line 1695 ENDADD
|
sub submit_button_row { |
sub submit_button_row { |
my ($folder,$dismode,$sendtext,$lt,$is_crsform,$group) = @_; |
my ($folder,$dismode,$sendtext,$lt,$is_crsform,$group) = @_; |
my $pre=&mt("Show Preview and Check Spelling"); |
my $pre=&mt("Show Preview and Check Spelling"); |
|
my $value=&mt('Send'); |
my $prevbutton = '<input type="button" name="preview" value="'.$pre.'" onclick="if (typeof(document.compemail.onsubmit)=='."'function'".') {document.compemail.onsubmit();};document.preview.comment.value=document.compemail.message.value;document.preview.subject.value=document.compemail.subject.value;document.preview.submit();" />'; |
my $prevbutton = '<input type="button" name="preview" value="'.$pre.'" onclick="if (typeof(document.compemail.onsubmit)=='."'function'".') {document.compemail.onsubmit();};document.preview.comment.value=document.compemail.message.value;document.preview.subject.value=document.compemail.subject.value;document.preview.submit();" />'; |
my $output = qq| |
my $output = qq| |
<input type="hidden" name="folder" value="$folder" /> |
<input type="hidden" name="folder" value="$folder" /> |
Line 1688 sub submit_button_row {
|
Line 1708 sub submit_button_row {
|
} |
} |
$output .= qq| |
$output .= qq| |
<table><tr><td align="left"> |
<table><tr><td align="left"> |
<input type="submit" name="send" value="Send" title="$sendtext" /> |
<input type="submit" name="send" value="$value" title="$sendtext" /> |
<input type="submit" name="cancel" value="$lt->{'ca'}" /> |
<input type="submit" name="cancel" value="$lt->{'ca'}" /> |
</td><td width="60"> </td><td align="right">$prevbutton</td></tr></table> |
</td><td width="60"> </td><td align="right">$prevbutton</td></tr></table> |
|; |
|; |
Line 1813 $content{'sendername'}.':'.
|
Line 1833 $content{'sendername'}.':'.
|
} |
} |
# Check to see if there were any messages. |
# Check to see if there were any messages. |
if ($result eq '') { |
if ($result eq '') { |
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = &mt(lc(&Apache::loncommon::course_type())); |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print("<p><b>".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."</b></p>"); |
$r->print("<p><b>".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."</b></p>"); |
} else { |
} else { |
Line 2133 END
|
Line 2153 END
|
foreach my $block (@{$typeorder}) { |
foreach my $block (@{$typeorder}) { |
my $blockstatus = ''; |
my $blockstatus = ''; |
if ($blocks->{$block} eq 'on') { |
if ($blocks->{$block} eq 'on') { |
$blockstatus = 'checked="true"'; |
$blockstatus = 'checked="checked"'; |
} |
} |
$r->print('<label><input type="checkbox" name="'.$block.'_'.$parmcount.'" '.$blockstatus.' value="1" />'.$types->{$block}.'</label><br />'); |
$r->print('<label><input type="checkbox" name="'.$block.'_'.$parmcount.'" '.$blockstatus.' value="1" />'.$types->{$block}.'</label><br />'); |
} |
} |
Line 2200 END
|
Line 2220 END
|
sub blocktype_text { |
sub blocktype_text { |
my %types = &Apache::lonlocal::texthash( |
my %types = &Apache::lonlocal::texthash( |
'com' => 'Messaging', |
'com' => 'Messaging', |
'chat' => 'Chat', |
'chat' => 'Chat Room', |
'boards' => 'Discussion', |
'boards' => 'Discussion', |
'port' => 'Portfolio', |
'port' => 'Portfolio', |
'groups' => 'Groups', |
'groups' => 'Groups', |
Line 2262 sub displaymessage {
|
Line 2282 sub displaymessage {
|
# start output |
# start output |
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); |
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); |
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); |
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); |
# Functions |
|
$r->print('<table border="2" width="100%"><tr bgcolor="#FFFFAA"><td>'.&mt('Functions').':</td>'); |
# Prepare available functions |
|
my @functionlist; |
if (!$content{'noreplies'}) { |
if (!$content{'noreplies'}) { |
$r->print('<td><a href="/adm/email?replyto='.&escape($msgid).$sqs. |
push(@functionlist,'<a href="/adm/email?replyto='.&escape($msgid).$sqs.'">' |
'"><b>'.&mt('Reply').'</b></a></td>'); |
.&mt('Reply') |
} |
.'</a>'); |
$r->print('<td><a href="/adm/email?forward='.&escape($msgid).$sqs. |
} |
'"><b>'.&mt('Forward').'</b></a></td>'. |
push(@functionlist,'<a href="/adm/email?forward='.&escape($msgid).$sqs.'">' |
'<td><a href="/adm/email?markunread='.&escape($msgid).$sqs. |
.&mt('Forward') |
'"><b>'.&mt('Mark Unread').'</b></a></td>'. |
.'</a>'); |
'<td><a href="/adm/email?markdel='.&escape($msgid).$sqs. |
push(@functionlist,'<a href="/adm/email?markunread='.&escape($msgid).$sqs.'">' |
'"><b>'.&mt('Delete').'</b></a></td>'. |
.&mt('Mark Unread') |
'<td><a href="/adm/email?'.$sqs. |
.'</a>'); |
'"><b>'.&mt('Back to Folder Display').'</b></a></td>'); |
push(@functionlist,'<a href="/adm/email?markdel='.&escape($msgid).$sqs.'">' |
|
.&mt('Delete') |
|
.'</a>'); |
|
push(@functionlist,'<a href="/adm/email?'.$sqs.'">' |
|
.&mt('Back to Folder Display') |
|
.'</a>'); |
if ($counter > 0){ |
if ($counter > 0){ |
$r->print('<td><a href="/adm/email?display='.$messages[$counter-1]->[5].$sqs. |
push(@functionlist,'<a href="/adm/email?display='.$messages[$counter-1]->[5].$sqs.'">' |
'"><b>'.&mt('Previous').'</b></a></td>'); |
.&mt('Previous') |
|
.'</a>'); |
} |
} |
if ($counter < $number_of_messages - 1){ |
if ($counter < $number_of_messages - 1){ |
$r->print('<td><a href="/adm/email?display='.$messages[$counter+1]->[5].$sqs. |
push(@functionlist,'<a href="/adm/email?display='.$messages[$counter+1]->[5].$sqs.'">' |
'"><b>'.&mt('Next').'</b></a></td>'); |
.&mt('Next') |
|
.'</a>'); |
|
} |
|
# Print functions |
|
my $legendtext='<span class="LC_mail_functions">' |
|
.&mt('Functions') |
|
.'</span>'; |
|
$r->print('<div class="LC_left_float">' |
|
.&Apache::lontemplate::start_functionslist($legendtext) |
|
); |
|
foreach my $item (@functionlist) { |
|
$r->print(&Apache::lontemplate::item_functionslist($item)); |
} |
} |
$r->print('</tr></table>'); |
$r->print(&Apache::lontemplate::end_functionslist() |
|
.'</div>' |
|
); |
|
|
|
# Prepare available actions |
my $symb; |
my $symb; |
if (defined($content{'symb'})) { |
if (defined($content{'symb'})) { |
$symb = $content{'symb'}; |
$symb = $content{'symb'}; |
Line 2292 sub displaymessage {
|
Line 2334 sub displaymessage {
|
$symb=&Apache::lonnet::symbread($content{'baseurl'}); |
$symb=&Apache::lonnet::symbread($content{'baseurl'}); |
} |
} |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
my $actionlist=''; |
my @actionlist; |
|
|
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { |
$actionlist.='<td><b>' |
push(@actionlist,&Apache::loncommon::track_student_link( |
.&Apache::loncommon::track_student_link( |
&mt('View recent activity') |
&mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check') |
,$content{'sendername'} |
.'</b></td>'; |
,$content{'senderdomain'} |
|
,'check')); |
} |
} |
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) && $symb) { |
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) && $symb) { |
$actionlist.='<td><b>' |
push(@actionlist,&Apache::loncommon::pprmlink( |
.&Apache::loncommon::pprmlink( |
&mt('Set/Change parameters') |
&mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check') |
,$content{'sendername'} |
.'</b></td>'; |
,$content{'senderdomain'} |
|
,$symb |
|
,'check')); |
} |
} |
if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}) && $symb) { |
if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}) && $symb) { |
$actionlist.='<td><b>' |
push(@actionlist,&Apache::loncommon::pgrdlink( |
.&Apache::loncommon::pgrdlink( |
&mt('Set/Change grades') |
&mt('Set/Change grades'),$content{'sendername'},$content{'senderdomain'},$symb,'check') |
,$content{'sendername'} |
.'</b></td>'; |
,$content{'senderdomain'} |
} |
,$symb |
if ($actionlist) { |
,'check')); |
$r->print('<table border="2" width="100%">' |
} |
.'<tr bgcolor="#FFAAAA"><td>' |
|
.&mt('Currently available actions (will open extra window):') |
# Print actions |
.'</td>' |
if (@actionlist) { |
.$actionlist |
$legendtext=&mt('[_1]Currently available actions[_2] (will open extra window):' |
.'</tr></table>'); |
,'<span class="LC_mail_functions">','</span>'); |
|
$r->print('<div class="LC_left_float">' |
|
.&Apache::lontemplate::start_functionslist($legendtext) |
|
); |
|
foreach my $item (@actionlist) { |
|
$r->print(&Apache::lontemplate::item_functionslist($item)); |
|
} |
|
$r->print(&Apache::lontemplate::end_functionslist() |
|
.'</div>' |
|
); |
} |
} |
} |
} |
|
|
my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients); |
my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients); |
if ($content{'recipid'}) { |
if ($content{'recipid'}) { |
$tonum = &retrieve_recips('display',\%content,\%recipients); |
$tonum = &retrieve_recips('display',\%content,\%recipients); |
Line 2333 sub displaymessage {
|
Line 2389 sub displaymessage {
|
$bcclist = join(', ',@{$recipients{'bcc'}}); |
$bcclist = join(', ',@{$recipients{'bcc'}}); |
} |
} |
} |
} |
if (!$tolist && ref($content{'recuser'}) eq 'ARRAY') { |
|
|
my $broadcast_link; |
|
if (($content{'courseid'}) && ($content{'recipid'} && |
|
(ref($recipients{'course_broadcast'}) eq 'ARRAY') || |
|
(ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') || |
|
(ref($recipients{'group_bcc_broadcast'}) eq 'ARRAY'))) { |
|
$broadcast_link = &recipients_link($r,\%content,\%recipients); |
|
} |
|
|
|
if (((!$tolist) && (!$broadcast_link)) && ref($content{'recuser'}) eq 'ARRAY') { |
my @recipients; |
my @recipients; |
for (my $i=0; $i<@{$content{'recuser'}}; $i++) { |
for (my $i=0; $i<@{$content{'recuser'}}; $i++) { |
$recipients[$i] = &Apache::loncommon::aboutmewrapper( |
$recipients[$i] = &Apache::loncommon::aboutmewrapper( |
Line 2355 sub displaymessage {
|
Line 2420 sub displaymessage {
|
if (defined($content{'baseurl'})) { |
if (defined($content{'baseurl'})) { |
$baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'}); |
$baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'}); |
} |
} |
|
$r->print('<div class="LC_clear_float_footer">'); |
if ($from_student && $see_anonymous ) { |
if ($from_student && $see_anonymous ) { |
$r->print(&Apache::loncommon::student_image_tag($content{'senderdomain'},$content{'sendername'})); |
$r->print(&Apache::loncommon::student_image_tag($content{'senderdomain'},$content{'sendername'}).'</br>'); |
} |
|
|
|
my $broadcast_link; |
|
if (($content{'courseid'}) && ($content{'recipid'} && |
|
(ref($recipients{'course_broadcast'}) eq 'ARRAY') || |
|
(ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') || |
|
(ref($recipients{'group_bcc_broadcast'}) eq 'ARRAY'))) { |
|
$broadcast_link = &recipients_link($r,\%content,\%recipients); |
|
} |
} |
|
|
# Display LON-CAPA Message (Start) |
# Display LON-CAPA Message (Start) |
# Subject |
# Subject |
$r->print('<br />' |
$r->print('</div>' |
.&Apache::lonhtmlcommon::start_pick_box() |
.&Apache::lonhtmlcommon::start_pick_box() |
.&Apache::lonhtmlcommon::row_title(&mt('Subject')) |
.&Apache::lonhtmlcommon::row_title(&mt('Subject')) |
.$content{'subject'} |
.$content{'subject'} |
Line 2377 sub displaymessage {
|
Line 2435 sub displaymessage {
|
); |
); |
if ($folder eq 'sent') { |
if ($folder eq 'sent') { |
# To |
# To |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('To')) |
if ($tolist) { |
.$tolist |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('To')) |
.&Apache::lonhtmlcommon::row_closure() |
.$tolist |
); |
.&Apache::lonhtmlcommon::row_closure() |
|
); |
|
} |
if ($cclist) { |
if ($cclist) { |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Cc')) |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Cc')) |
.$cclist |
.$cclist |
Line 2634 sub recipients_link {
|
Line 2694 sub recipients_link {
|
$nothing=&Apache::lonhtmlcommon::javascript_nothing(); |
$nothing=&Apache::lonhtmlcommon::javascript_nothing(); |
$height = 400; |
$height = 400; |
$width = 600; |
$width = 600; |
my $start_page = |
$start_page = |
&Apache::loncommon::start_page('Broadcast List', undef, |
&Apache::loncommon::start_page('Broadcast List', undef, |
{only_body => 1, |
{only_body => 1, |
js_ready => 1,}); |
js_ready => 1,}); |
my $end_page = &Apache::loncommon::end_page({js_ready => 1,}); |
$end_page = &Apache::loncommon::end_page({js_ready => 1,}); |
my $body = '<h3>'.&mt("Recipients of broadcast message").'</h3>'. |
$body = '<h3>'.&mt("Recipients of broadcast message").'</h3>'. |
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
my $cell = 0; |
my $cell = 0; |
$body .= &Apache::loncommon::start_data_table_row(); |
$body .= &Apache::loncommon::start_data_table_row(); |
foreach my $item (@{$recipients->{$show.'_broadcast'}}) { |
foreach my $item (@{$recipients->{$show.'_broadcast'}}) { |
Line 2737 sub displayresource {
|
Line 2797 sub displayresource {
|
|
|
sub header { |
sub header { |
my ($r,$title,$baseurl)=@_; |
my ($r,$title,$baseurl)=@_; |
|
|
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
my $extra = &Apache::loncommon::studentbrowser_javascript(); |
if ($baseurl) { |
if ($baseurl) { |
$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$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', |
$extra)); |
$extra)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
(($title?$title:'Communication and Messages'))); |
(($title?$title:'Send and Receive Messages'))); |
} |
} |
|
|
# ---------------------------------------------------------------- Print header |
# ---------------------------------------------------------------- Print header |
Line 3420 sub handler {
|
Line 3479 sub handler {
|
my $showfolder = $env{'form.newfolder'}; |
my $showfolder = $env{'form.newfolder'}; |
my ($makeresult,$warning) = &makefolder($env{'form.newfolder'}); |
my ($makeresult,$warning) = &makefolder($env{'form.newfolder'}); |
if ($makeresult eq 'ok') { |
if ($makeresult eq 'ok') { |
$r->print(&mt('Mail folder "[_1]" created.',$showfolder).'<br />'); |
$r->print(&mt('Folder "[_1]" created.',$showfolder).'<br />'); |
} else { |
} else { |
$r->print(&mt('Creation failed.').' '.$makeresult.'<br />'. |
$r->print(&mt('Creation failed.').' '.$makeresult.'<br />'. |
$warning); |
$warning); |
Line 3435 sub handler {
|
Line 3494 sub handler {
|
my $showfolder = ''; |
my $showfolder = ''; |
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('Folder "[_1]" deleted.',$folder).'<br />'); |
$env{'form.folder'} = ''; |
$env{'form.folder'} = ''; |
} else { |
} else { |
$r->print(&mt('Deletion failed.').' '.$delresult.'<br />'); |
$r->print(&mt('Deletion failed.').' '.$delresult.'<br />'); |
Line 3448 sub handler {
|
Line 3507 sub handler {
|
my $showfolder = $env{'form.renamed'}; |
my $showfolder = $env{'form.renamed'}; |
my $renresult = &renamefolder($folder); |
my $renresult = &renamefolder($folder); |
if ($renresult eq 'ok') { |
if ($renresult eq 'ok') { |
$r->print(&mt('Mail folder "[_1]" renamed "[_2]".',$folder,$showfolder).'<br />'); |
$r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'<br />'); |
} else { |
} else { |
$r->print(&mt('Renaming failed.').' '.$renresult.'<br />'); |
$r->print(&mt('Renaming failed.').' '.$renresult.'<br />'); |
$showfolder = $folder; |
$showfolder = $folder; |