version 1.211, 2006/07/18 17:42:15
|
version 1.218, 2006/11/28 21:44:37
|
Line 186 sub list_discussion {
|
Line 186 sub list_discussion {
|
push @{$roleinfo{$student}}, 'st:'.$section.':'.$status; |
push @{$roleinfo{$student}}, 'st:'.$section.':'.$status; |
} |
} |
($classgroups,$studentgroups) = |
($classgroups,$studentgroups) = |
&Apache::loncoursedata::get_group_memberships($classlist,$keylist, |
&Apache::loncoursedata::get_group_memberships($classlist,$keylist, |
$cdom,$cnum); |
$cdom,$cnum); |
} |
} |
|
|
# Get discussion display default settings for user |
# Get discussion display default settings for user |
Line 713 END
|
Line 713 END
|
if ($discussiononly) { |
if ($discussiononly) { |
my $now = time; |
my $now = time; |
my $attachnum = 0; |
my $attachnum = 0; |
my $currnewattach; |
my $currnewattach = []; |
my $currdelold; |
my $currdelold = []; |
my $comment = ''; |
my $comment = ''; |
my $subject = ''; |
my $subject = ''; |
if ($env{'form.origpage'}) { |
if ($env{'form.origpage'}) { |
Line 752 END
|
Line 752 END
|
if ($outputtarget ne 'tex') { |
if ($outputtarget ne 'tex') { |
$discussion.='<a href="/adm/feedback?replydisc='. |
$discussion.='<a href="/adm/feedback?replydisc='. |
&escape($ressymb).':::" '.$target.'>'. |
&escape($ressymb).':::" '.$target.'>'. |
'<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'. |
'<img alt="" src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'. |
&mt('Post Discussion').'</a><br />'; |
&mt('Post Discussion').'</a><br />'; |
} |
} |
} |
} |
$discussion.='<a href="/adm/feedback?sendmessageonly=1&symb='. |
$discussion.='<a href="/adm/feedback?sendmessageonly=1&symb='. |
&escape($ressymb). |
&escape($ressymb). |
'"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'. |
'"><img alt="" src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'. |
&mt('Send Message').'</a></td></tr></table>'; |
&mt('Send Message').'</a></td></tr></table>'; |
} |
} |
return $discussion; |
return $discussion; |
Line 1486 END
|
Line 1486 END
|
$numoldver = 1; |
$numoldver = 1; |
} |
} |
} |
} |
my $message; |
|
if ($idx > 0) { |
if ($idx > 0) { |
my %msgversions = (); |
my %msgversions = (); |
&get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver); |
&get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver); |
$message = $msgversions{$numoldver}; |
$quote = $msgversions{$numoldver}; |
} |
} |
&newline_to_br(\$message); |
|
$quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($message).'</blockquote>'; |
|
if ($idx > 0) { |
if ($idx > 0) { |
my %subversions = (); |
my %subversions = (); |
&get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); |
&get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); |
Line 1588 END
|
Line 1585 END
|
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js, |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js, |
{'add_entries' => \%onload}); |
{'add_entries' => \%onload}); |
|
|
|
if ($quote ne '') { |
|
&newline_to_br(\$quote); |
|
$quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($quote).'</blockquote>'; |
|
} |
|
|
$r->print(<<END); |
$r->print(<<END); |
$start_page |
$start_page |
<h2><tt>$title</tt></h2> |
<h2><tt>$title</tt></h2> |
Line 1683 END
|
Line 1685 END
|
} |
} |
} |
} |
if ($attachmsg) { |
if ($attachmsg) { |
$r->print("<b>Retained attachments</b>:$attachmsg<br />\n"); |
$r->print("<br /><b>Retained attachments</b>:$attachmsg<br />\n"); |
} |
} |
if ($newattachmsg) { |
if ($newattachmsg) { |
$r->print("$newattachmsg<br />"); |
$r->print("$newattachmsg<br />"); |
Line 1930 sub print_sortfilter_options {
|
Line 1932 sub print_sortfilter_options {
|
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
|
|
} |
} |
foreach (@sections) { |
foreach my $sec (@sections) { |
$section_sel .= " <option value=\"$_\" />$_\n"; |
$section_sel .= " <option value=\"$sec\">$sec</option>\n"; |
} |
} |
|
|
if (&check_group_priv() eq 'ok') { |
if (&check_group_priv() eq 'ok') { |
Line 1956 sub print_sortfilter_options {
|
Line 1958 sub print_sortfilter_options {
|
$numgroupvis = 1; |
$numgroupvis = 1; |
} |
} |
} |
} |
foreach (@groups) { |
foreach my $group (@groups) { |
$group_sel .= " <option value=\"$_\" />$_\n"; |
$group_sel .= " <option value=\"$group\">$group</option>\n"; |
} |
} |
|
|
my $function = &Apache::loncommon::get_users_function(); |
my $function = &Apache::loncommon::get_users_function(); |
Line 2047 $start_page
|
Line 2049 $start_page
|
<tr> |
<tr> |
<td align="center" valign="top"> |
<td align="center" valign="top"> |
<select name="sortposts"> |
<select name="sortposts"> |
<option value="ascdate" selected="selected" />$sort_types{'ascdate'} |
<option value="ascdate" selected="selected">$sort_types{'ascdate'}</option> |
<option value="descdate" />$sort_types{'descdate'} |
<option value="descdate">$sort_types{'descdate'}</option> |
<option value="thread" />$sort_types{'thread'} |
<option value="thread">$sort_types{'thread'}</option> |
<option value="subject" />$sort_types{'subject'} |
<option value="subject">$sort_types{'subject'}</option> |
<option value="username" />$sort_types{'username'} |
<option value="username">$sort_types{'username'}</option> |
<option value="lastfirst" />$sort_types{'lastfirst'} |
<option value="lastfirst">$sort_types{'lastfirst'}</option> |
</select> |
</select> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td align="center" valign="top"> |
<td align="center" valign="top"> |
<select name="statusfilter"> |
<select name="statusfilter"> |
<option value="all" selected="selected" />$status_types{'all'} |
<option value="all" selected="selected">$status_types{'all'}</option> |
<option value="Active" />$status_types{'Active'} |
<option value="Active">$status_types{'Active'}</option> |
<option value="Expired" />$status_types{'Expired'} |
<option value="Expired">$status_types{'Expired'}</option> |
|
<option value="Future">$status_types{'Future'}</option> |
</select> |
</select> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td align="center" valign="top"> |
<td align="center" valign="top"> |
<select name="rolefilter" multiple="true" size="5"> |
<select name="rolefilter" multiple="true" size="5"> |
<option value="all" />$role_types{'all'} |
<option value="all">$role_types{'all'}</option> |
<option value="st" />$role_types{'st'} |
<option value="st">$role_types{'st'}</option> |
<option value="cc" />$role_types{'cc'} |
<option value="cc">$role_types{'cc'}</option> |
<option value="in" />$role_types{'in'} |
<option value="in">$role_types{'in'}</option> |
<option value="ta" />$role_types{'ta'} |
<option value="ta">$role_types{'ta'}</option> |
<option value="ep" />$role_types{'ep'} |
<option value="ep">$role_types{'ep'}</option> |
<option value="cr" />$role_types{'cr'} |
<option value="cr">$role_types{'cr'}</option> |
</select> |
</select> |
</td> |
</td> |
<td> </td> |
<td> </td> |
Line 2545 sub clear_out_html {
|
Line 2548 sub clear_out_html {
|
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); |
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); |
} |
} |
# Do the substitution of everything that is not explicitly allowed |
# Do the substitution of everything that is not explicitly allowed |
$message =~ s/\<(\/?\s*(\w*)[^\>\<]*)/ |
$message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ |
{($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge; |
{($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge; |
$message =~ s/(\<?\s*(\w*)[^\<\>]*)\>/ |
$message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/ |
{($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge; |
{($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge; |
return $message; |
return $message; |
} |
} |
Line 2812 sub show_preview {
|
Line 2815 sub show_preview {
|
my ($r) = @_; |
my ($r) = @_; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
my $start_page= |
|
&Apache::loncommon::start_page('Preview',undef, |
|
{'only_body' => 1,}); |
|
|
my $message=&clear_out_html($env{'form.comment'}); |
my $message=&clear_out_html($env{'form.comment'}); |
&newline_to_br(\$message); |
&newline_to_br(\$message); |
$message=&Apache::lonspeller::markeduptext($message); |
$message=&Apache::lonspeller::markeduptext($message); |
Line 2819 sub show_preview {
|
Line 2826 sub show_preview {
|
my $subject=&clear_out_html($env{'form.subject'},undef,1); |
my $subject=&clear_out_html($env{'form.subject'},undef,1); |
$subject=~s/\n/\<br \/\>/g; |
$subject=~s/\n/\<br \/\>/g; |
$subject=&Apache::lontexconvert::msgtexconverted($subject); |
$subject=&Apache::lontexconvert::msgtexconverted($subject); |
my $start_page= |
|
&Apache::loncommon::start_page('Preview',undef, |
|
{'only_body' => 1,}); |
|
|
|
my $end_page = &Apache::loncommon::end_page(); |
my $end_page = &Apache::loncommon::end_page(); |
|
|
Line 2870 ENDPREVIEW
|
Line 2874 ENDPREVIEW
|
|
|
sub modify_attachments { |
sub modify_attachments { |
my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_; |
my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_; |
|
|
|
my $js = <<END; |
|
<script type="text/javascript"> |
|
function setAction () { |
|
document.modattachments.action = document.modattachments.origpage.value; |
|
document.modattachments.submit(); |
|
} |
|
</script> |
|
END |
|
|
|
my $start_page = |
|
&Apache::loncommon::start_page('Discussion Post Attachments',$js); |
|
|
my $orig_subject = &unescape($env{'form.subject'}); |
my $orig_subject = &unescape($env{'form.subject'}); |
my $subject=&clear_out_html($orig_subject,undef,1); |
my $subject=&clear_out_html($orig_subject,undef,1); |
$subject=~s/\n/\<br \/\>/g; |
$subject=~s/\n/\<br \/\>/g; |
Line 2884 sub modify_attachments {
|
Line 2901 sub modify_attachments {
|
&extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold); |
&extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold); |
} |
} |
&Apache::lonenc::check_encrypt(\$symb); |
&Apache::lonenc::check_encrypt(\$symb); |
my $js = <<END; |
|
<script type="text/javascript"> |
|
function setAction () { |
|
document.modattachments.action = document.modattachments.origpage.value; |
|
document.modattachments.submit(); |
|
} |
|
</script> |
|
END |
|
|
|
my $start_page = |
|
&Apache::loncommon::start_page('Discussion Post Attachments',$js); |
|
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
|
|
Line 2920 END
|
Line 2927 END
|
} |
} |
} |
} |
} |
} |
if (@{$currnewattach} > 0) { |
if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) { |
$r->print("The following attachments have been uploaded for inclusion with this posting.<br />Check the checkboxes for any you wish to remove<br />\n"); |
$r->print("The following attachments have been uploaded for inclusion with this posting.<br />Check the checkboxes for any you wish to remove<br />\n"); |
foreach (@{$currnewattach}) { |
foreach (@{$currnewattach}) { |
$_ =~ m#/([^/]+)$#; |
$_ =~ m#/([^/]+)$#; |
Line 3168 sub sort_filter_names {
|
Line 3175 sub sort_filter_names {
|
); |
); |
%{$status_types} = ( |
%{$status_types} = ( |
all => 'Roles of any status', |
all => 'Roles of any status', |
Active => 'Only active roles', |
Active => 'Only active roles', |
Expired => 'Only inactive roles' |
Expired => 'Only past roles', |
|
Future => 'Only future roles', |
); |
); |
} |
} |
|
|