version 1.141, 2004/11/19 19:11:33
|
version 1.144, 2004/11/21 04:24:49
|
Line 84 sub list_discussion {
|
Line 84 sub list_discussion {
|
my $cid=$ENV{'request.course.id'}; |
my $cid=$ENV{'request.course.id'}; |
if ($ENV{'request.course.sec'}) { |
if ($ENV{'request.course.sec'}) { |
$crs.='_'.$ENV{'request.course.sec'}; |
$crs.='_'.$ENV{'request.course.sec'}; |
} |
} |
$crs=~s/\_/\//g; |
$crs=~s/\_/\//g; |
unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); } |
unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); } |
unless ($ressymb) { return ''; } |
unless ($ressymb) { return ''; } |
Line 122 sub list_discussion {
|
Line 122 sub list_discussion {
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous','sortposts','rolefilter','statusfilter','sectionpick','totposters']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous','sortposts','rolefilter','statusfilter','sectionpick','totposters']); |
my $sortposts = $ENV{'form.sortposts'}; |
my $sortposts = $ENV{'form.sortposts'}; |
my $statusfilter = $ENV{'form.statusfilter'}; |
my $statusfilter = $ENV{'form.statusfilter'}; |
my $sectionpick = $ENV{'form.sectionpick'}; |
my @sectionpick = (); |
|
if ($ENV{'form.sectionpick'} =~ /,/) { |
|
@sectionpick = split/,/,$ENV{'form.sectionpick'}; |
|
} else { |
|
$sectionpick[0] = $ENV{'form.sectionpick'}; |
|
} |
|
my @rolefilter = (); |
|
if ($ENV{'form.rolefilter'} =~ /,/) { |
|
@rolefilter = split/,/,$ENV{'form.rolefilter'}; |
|
} else { |
|
$rolefilter[0] = $ENV{'form.rolefilter'}; |
|
} |
my $totposters = $ENV{'form.totposters'}; |
my $totposters = $ENV{'form.totposters'}; |
$previous = $ENV{'form.previous'}; |
$previous = $ENV{'form.previous'}; |
if ($previous > 0) { |
if ($previous > 0) { |
Line 140 sub list_discussion {
|
Line 151 sub list_discussion {
|
%roleshash = &Apache::lonnet::dump('nohist_userroles',$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
%roleshash = &Apache::lonnet::dump('nohist_userroles',$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
foreach (keys %roleshash) { |
foreach (keys %roleshash) { |
my ($role,$uname,$udom,$sec) = split/:/,$_; |
my ($role,$uname,$udom,$sec) = split/:/,$_; |
|
if ($role =~ /^cr/) { |
|
$role = 'cr'; |
|
} |
my ($end,$start) = split/:/,$roleshash{$_}; |
my ($end,$start) = split/:/,$roleshash{$_}; |
my $now = time; |
my $now = time; |
my $status = 'Active'; |
my $status = 'Active'; |
if (($now < $start) || ($end > 0 && $now > $end)) { |
if (($now < $start) || ($end > 0 && $now > $end)) { |
$status = 'Expired'; |
$status = 'Expired'; |
} |
} |
push @{$roleinfo{$uname.':'.$udom}}, $role.':'.$sec.':'.$status; |
if ($uname && $udom) { |
|
push @{$roleinfo{$uname.':'.$udom}}, $role.':'.$sec.':'.$status; |
|
} |
} |
} |
my ($classlist) = &Apache::loncoursedata::get_classlist( |
my ($classlist) = &Apache::loncoursedata::get_classlist( |
$ENV{'request.course.id'}, |
$ENV{'request.course.id'}, |
Line 224 sub list_discussion {
|
Line 240 sub list_discussion {
|
$discinfo{$visitkey} = $visit; |
$discinfo{$visitkey} = $visit; |
|
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
&build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$ENV{'form.rolefilter'},$sectionpick,$statusfilter,$toggkey,$outputtarget); |
&build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,$statusfilter,$toggkey,$outputtarget); |
|
|
my $discussion=''; |
my $discussion=''; |
my $manifestfile; |
my $manifestfile; |
Line 435 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 451 imscp_v1p1.xsd http://www.imsglobal.org/
|
} |
} |
} |
} |
} else { |
} else { |
$sortposts = 'ascdate'; |
|
@showposts = (sort { $a <=> $b } keys %alldiscussion); |
@showposts = (sort { $a <=> $b } keys %alldiscussion); |
} |
} |
my $currdepth = 0; |
my $currdepth = 0; |
my $firstidx = $alldiscussion{$showposts[0]}; |
my $firstidx = $alldiscussion{$showposts[0]}; |
foreach (@showposts) { |
foreach (@showposts) { |
unless (($sortposts eq 'thread') || ($sortposts eq 'ascdate' && $ENV{'environment.threadeddiscussion'}) || ($outputtarget eq 'export')) { |
unless (($sortposts eq 'thread') || (($sortposts eq '') && ($ENV{'environment.threadeddiscussion'})) || ($outputtarget eq 'export')) { |
$alldiscussion{$_} = $_; |
$alldiscussion{$_} = $_; |
} |
} |
unless ( ($notshown{$alldiscussion{$_}} eq '1') || ($shown{$alldiscussion{$_}} == 0) ) { |
unless ( ($notshown{$alldiscussion{$_}} eq '1') || ($shown{$alldiscussion{$_}} == 0) ) { |
Line 539 END
|
Line 554 END
|
$discussion .= <<END; |
$discussion .= <<END; |
</font></td> |
</font></td> |
<td> </td> |
<td> </td> |
<td> |
<td align="left"> |
<font size="-1"><b><a href="$chglink">$lt{'chgt'}</a>?</font></b> |
<font size="-1"><b><a href="$chglink">$lt{'chgt'}</a>?</font></b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
</td> |
</td> |
END |
END |
|
if ($sortposts) { |
|
my %sort_types = (); |
|
my %role_types = (); |
|
my %status_types = (); |
|
&sort_filter_names(\%sort_types,\%role_types,\%status_types); |
|
|
|
$discussion .= '<td><font size="-1"><b>'.&mt('Sorted by').'</b>: '.$sort_types{$sortposts}.'<br />'; |
|
if (defined($ENV{'form.totposters'})) { |
|
$discussion .= &mt('Posts by').':'; |
|
if ($totposters > 0) { |
|
foreach my $poster (@posters) { |
|
$poster =~ s/:/\@/; |
|
$discussion .= ' '.$poster.','; |
|
} |
|
$discussion =~ s/,$//; |
|
} else { |
|
$discussion .= &mt('None selected'); |
|
} |
|
} else { |
|
my $filterchoice =''; |
|
if (@sectionpick > 0) { |
|
$filterchoice = '<i>'.&mt('sections').'</i>- '.$ENV{'form.sectionpick'}; |
|
$filterchoice .= ' '; |
|
} |
|
if (@rolefilter > 0) { |
|
$filterchoice .= '<i>'.&mt('roles').'</i>-'; |
|
foreach (@rolefilter) { |
|
$filterchoice .= ' '.$role_types{$_}.','; |
|
} |
|
$filterchoice =~ s/,$//; |
|
$filterchoice .= '<br />     '; |
|
} |
|
if ($statusfilter) { |
|
$filterchoice .= '<i>'.&mt('status').'</i>- '.$status_types{$statusfilter}; |
|
} |
|
if ($filterchoice) { |
|
$discussion .= '<b>'.&mt('Filters').'</b>: '.$filterchoice; |
|
} |
|
$discussion .= '</font></td>'; |
|
} |
|
} |
if ($dischash{$toggkey}) { |
if ($dischash{$toggkey}) { |
my $storebutton = &mt('Store read/unread changes'); |
my $storebutton = &mt('Store read/unread changes'); |
$discussion.='<td align="right">'. |
$discussion.='<td align="right">'. |
Line 683 ENDDISCUSS
|
Line 739 ENDDISCUSS
|
|
|
sub build_posting_display { |
sub build_posting_display { |
my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget) = @_; |
my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget) = @_; |
|
|
my @original=(); |
my @original=(); |
my @index=(); |
my @index=(); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
Line 696 sub build_posting_display {
|
Line 751 sub build_posting_display {
|
if ($prevread eq '0') { |
if ($prevread eq '0') { |
$prevread = $oldest-1; |
$prevread = $oldest-1; |
} |
} |
|
my ($skiptest,$rolematch,$roleregexp,$secregexp,$statusregexp); |
|
if ($sortposts) { |
|
($skiptest,$roleregexp,$secregexp,$statusregexp) = &filter_regexp($rolefilter,$sectionpick,$statusfilter); |
|
$rolematch = $roleregexp.':'.$secregexp.':'.$statusregexp; |
|
} |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
my $idx=$id; |
my $idx=$id; |
my $posttime = $contrib{$idx.':timestamp'}; |
my $posttime = $contrib{$idx.':timestamp'}; |
Line 708 sub build_posting_display {
|
Line 768 sub build_posting_display {
|
my $origindex='0.'; |
my $origindex='0.'; |
my $numoldver=0; |
my $numoldver=0; |
if ($contrib{$idx.':replyto'}) { |
if ($contrib{$idx.':replyto'}) { |
if ( (($ENV{'environment.threadeddiscussion'}) && (($sortposts eq '') || ($sortposts eq 'ascdate'))) || ($sortposts eq 'thread') || ($outputtarget eq 'export')) { |
if ( (($ENV{'environment.threadeddiscussion'}) && ($sortposts eq '')) || ($sortposts eq 'thread') || ($outputtarget eq 'export')) { |
# this is a follow-up message |
# this is a follow-up message |
$original[$idx]=$original[$contrib{$idx.':replyto'}]; |
$original[$idx]=$original[$contrib{$idx.':replyto'}]; |
$$depth[$idx]=$$depth[$contrib{$idx.':replyto'}]+1; |
$$depth[$idx]=$$depth[$contrib{$idx.':replyto'}]+1; |
Line 903 sub build_posting_display {
|
Line 963 sub build_posting_display {
|
} |
} |
if ($outputtarget eq 'export' || $message) { |
if ($outputtarget eq 'export' || $message) { |
my $thisindex=$idx; |
my $thisindex=$idx; |
if ( (($ENV{'environment.threadeddiscussion'}) && (($sortposts eq '') || ($sortposts eq 'ascdate'))) || ($sortposts eq 'thread') || ($outputtarget eq 'export')) { |
if ( (($ENV{'environment.threadeddiscussion'}) && ($sortposts eq '')) || ($sortposts eq 'thread') || ($outputtarget eq 'export')) { |
$thisindex=$origindex.substr('00'.$$replies[$$depth[$idx]],-2,2); |
$thisindex=$origindex.substr('00'.$$replies[$$depth[$idx]],-2,2); |
} |
} |
$$alldiscussion{$thisindex}=$idx; |
$$alldiscussion{$thisindex}=$idx; |
Line 944 sub build_posting_display {
|
Line 1004 sub build_posting_display {
|
my $uname = $contrib{$idx.':sendername'}; |
my $uname = $contrib{$idx.':sendername'}; |
my $udom = $contrib{$idx.':senderdomain'}; |
my $udom = $contrib{$idx.':senderdomain'}; |
my $poster = $uname.':'.$udom; |
my $poster = $uname.':'.$udom; |
my $rolematch = ''; |
if (defined($ENV{'form.totposters'})) { |
my $skiptest = 1; |
if ($totposters == 0) { |
if ($totposters > 0) { |
$$shown{$idx} = 0; |
if (grep/^$poster$/,@{$posters}) { |
} elsif ($totposters > 0) { |
$$shown{$idx} = 1; |
if (grep/^$poster$/,@{$posters}) { |
} |
$$shown{$idx} = 1; |
} else { |
|
if ($rolefilter) { |
|
if ($rolefilter eq 'all') { |
|
$rolematch = '([^:]+)'; |
|
} else { |
|
$rolematch = $rolefilter; |
|
$skiptest = 0; |
|
} |
|
} |
|
if ($sectionpick) { |
|
if ($sectionpick eq 'all') { |
|
$rolematch .= ':([^:]*)'; |
|
} else { |
|
$rolematch .= ':'.$sectionpick; |
|
$skiptest = 0; |
|
} |
|
if ($statusfilter) { |
|
if ($statusfilter eq 'all') { |
|
$rolematch .= ':([^:]+)'; |
|
} else { |
|
$rolematch .= ':'.$statusfilter; |
|
$skiptest = 0; |
|
} |
} |
} |
} |
|
} elsif ($sortposts) { |
if ($skiptest) { |
if ($skiptest) { |
$$shown{$idx} = 1; |
$$shown{$idx} = 1; |
} else { |
} else { |
foreach my $role (@{$$roleinfo{$poster}}) { |
foreach my $role (@{$$roleinfo{$poster}}) { |
if ($role =~ m/^$rolematch$/) { |
if ($role =~ /^cc:/) { |
|
my $cc_regexp = $roleregexp.':[^:]*:'.$statusregexp; |
|
if ($role =~ /$cc_regexp/) { |
|
$$shown{$idx} = 1; |
|
last; |
|
} |
|
} elsif ($role =~ /^$rolematch$/) { |
$$shown{$idx} = 1; |
$$shown{$idx} = 1; |
last; |
last; |
} |
} |
} |
} |
} |
} |
|
} else { |
|
$$shown{$idx} = 1; |
} |
} |
} |
} |
unless ($$notshown{$idx} == 1) { |
unless ($$notshown{$idx} == 1) { |
Line 1033 sub build_posting_display {
|
Line 1080 sub build_posting_display {
|
} |
} |
} |
} |
|
|
|
sub filter_regexp { |
|
my ($rolefilter,$sectionpick,$statusfilter) = @_; |
|
my ($roleregexp,$secregexp,$statusregexp); |
|
my $skiptest = 1; |
|
if (@{$rolefilter} > 0) { |
|
my @okrolefilter = (); |
|
foreach (@{$rolefilter}) { |
|
unless ($_ eq '') { |
|
push @okrolefilter, $_; |
|
} |
|
} |
|
if (@okrolefilter > 0) { |
|
if (grep/^all$/,@okrolefilter) { |
|
$roleregexp='[^:]+'; |
|
} else { |
|
if (@okrolefilter == 1) { |
|
$roleregexp=$okrolefilter[0]; |
|
} else { |
|
$roleregexp='('.join('|',@okrolefilter).')'; |
|
} |
|
$skiptest = 0; |
|
} |
|
} |
|
} |
|
if (@{$sectionpick} > 0) { |
|
my @oksectionpick = (); |
|
foreach (@{$sectionpick}) { |
|
unless ($_ eq '') { |
|
push @oksectionpick, $_; |
|
} |
|
} |
|
if ((@oksectionpick > 0) && (!grep/^all$/,@oksectionpick)) { |
|
if (@oksectionpick == 1) { |
|
$secregexp = $oksectionpick[0]; |
|
} else { |
|
$secregexp .= '('.join('|',@oksectionpick).')'; |
|
} |
|
$skiptest = 0; |
|
} else { |
|
$secregexp .= '[^:]*'; |
|
} |
|
} |
|
if (defined($statusfilter) && $statusfilter ne '') { |
|
if ($statusfilter eq 'all') { |
|
$statusregexp = '[^:]+'; |
|
} else { |
|
$statusregexp = $statusfilter; |
|
$skiptest = 0; |
|
} |
|
} |
|
return ($skiptest,$roleregexp,$secregexp,$statusregexp); |
|
} |
|
|
|
|
sub get_post_contents { |
sub get_post_contents { |
my ($contrib,$idx,$seeid,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$numver) = @_; |
my ($contrib,$idx,$seeid,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$numver) = @_; |
my $discussion = ''; |
my $discussion = ''; |
Line 1681 sub print_sortfilter_options {
|
Line 1782 sub print_sortfilter_options {
|
my $section_sel = ''; |
my $section_sel = ''; |
my $numsections = 0; |
my $numsections = 0; |
my $numvisible = 5; |
my $numvisible = 5; |
my ($classlist) = &Apache::loncoursedata::get_classlist( |
|
$ENV{'request.course.id'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
|
|
|
my $sec_index = &Apache::loncoursedata::CL_SECTION(); |
|
my $status_index = &Apache::loncoursedata::CL_STATUS(); |
|
my %sectioncount = (); |
my %sectioncount = (); |
while (my ($student,$data) = each %$classlist) { |
|
my ($section,$status) = ($data->[$sec_index], |
$numsections = &Apache::loncommon::get_sections($ENV{'course.'.$ENV{'request.course.id'}.'.domain'},$ENV{'course.'.$ENV{'request.course.id'}.'.num'},\%sectioncount); |
$data->[$status_index]); |
|
unless ($section eq '' || $section =~ /^\s*$/) { |
if ($ENV{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section |
if (!defined($sectioncount{$section})) { |
@sections = ('all',$ENV{'request.course.sec'}); |
$sectioncount{$section} = 1; |
$numvisible = 2; |
$numsections ++; |
|
} else { |
|
$sectioncount{$section} ++; |
|
} |
|
} |
|
} |
|
|
|
if ($ENV{'request.course.sec'} !~ /^\s*$/) { |
|
@sections = ($ENV{'request.course.sec'}); |
|
$numvisible = 1; |
|
} else { |
} else { |
@sections = sort {$a cmp $b} keys(%sectioncount); |
@sections = sort {$a cmp $b} keys(%sectioncount); |
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
Line 1726 sub print_sortfilter_options {
|
Line 1810 sub print_sortfilter_options {
|
'diop' => 'Display Options', |
'diop' => 'Display Options', |
'curr' => 'Current setting ', |
'curr' => 'Current setting ', |
'actn' => 'Action', |
'actn' => 'Action', |
'prca' => 'Options can be set that control the sort order of the posts, in addition to which posts are displayed.', |
'prca' => 'Set options that control the sort order of posts, and/or which posts are displayed.', |
'soor' => 'Sort order', |
'soor' => 'Sort order', |
'disp' => 'Specific user roles', |
'spur' => 'Specific user roles', |
'actv' => 'Specific role status', |
'sprs' => 'Specific role status', |
'spse' => 'Specific sections', |
'spse' => 'Specific sections', |
'psub' => 'Pick specific users (by name)', |
'psub' => 'Pick specific users (by name)', |
'shal' => 'Show a list of current posters' |
'shal' => 'Show a list of current posters' |
); |
); |
|
|
|
my %sort_types = (); |
|
my %role_types = (); |
|
my %status_types = (); |
|
&sort_filter_names(\%sort_types,\%role_types,\%status_types); |
|
|
$r->print(<<END); |
$r->print(<<END); |
<html> |
<html> |
<head> |
<head> |
<title>$lt{'diso'}</title> |
<title>$lt{'diso'}</title> |
<meta http-equiv="pragma" content="no-cache" /> |
<meta http-equiv="pragma" content="no-cache" /> |
|
<script type="text/javascript"> |
|
function verifyFilter() { |
|
var rolenum = 0 |
|
for (var i=0; i<document.modifyshown.rolefilter.length; i++) { |
|
if (document.modifyshown.rolefilter.options[i].selected == true) { |
|
rolenum ++ |
|
} |
|
} |
|
if (rolenum == 0) { |
|
document.modifyshown.rolefilter.options[0].selected = true |
|
} |
|
|
|
var secnum = 0 |
|
for (var i=0; i<document.modifyshown.sectionpick.length; i++) { |
|
if (document.modifyshown.sectionpick.options[i].selected == true) { |
|
secnum ++ |
|
} |
|
} |
|
if (secnum == 0) { |
|
document.modifyshown.sectionpick.options[0].selected = true |
|
} |
|
document.modifyshown.submit(); |
|
} |
|
</script> |
</head> |
</head> |
$bodytag |
$bodytag |
<form name="modifyshown" method="post" action="/adm/feedback"> |
<form name="modifyshown" method="post" action="/adm/feedback"> |
Line 1748 $bodytag
|
Line 1862 $bodytag
|
<tr> |
<tr> |
<td><b>$lt{'soor'}</b></td> |
<td><b>$lt{'soor'}</b></td> |
<td> </td> |
<td> </td> |
<td><b>$lt{'disp'}</b></td> |
<td><b>$lt{'sprs'}</b></td> |
<td> </td> |
<td> </td> |
<td><b>$lt{'actv'}</b></td> |
<td><b>$lt{'spur'}</b></td> |
<td> </td> |
<td> </td> |
<td><b>$lt{'spse'}</b></td> |
<td><b>$lt{'spse'}</b></td> |
<td> </td> |
<td> </td> |
<td><b>$lt{'psub'}</b></td> |
<td><b>$lt{'psub'}</b></td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td> |
<td align="center"> |
<select name="sortposts"> |
<select name="sortposts"> |
<option value="ascdate" />Date order - oldest first |
<option value="ascdate" selected="selected" />$sort_types{'ascdate'} |
<option value="descdate" />Date order - newest first |
<option value="descdate" />$sort_types{'descdate'} |
<option value="thread" />Threaded |
<option value="thread" />$sort_types{'thread'} |
<option value="subject" />By subject |
<option value="subject" />$sort_types{'subject'} |
<option value="username" />By domain and username |
<option value="username" />$sort_types{'username'} |
<option value="lastfirst" />By last name, first name |
<option value="lastfirst" />$sort_types{'lastfirst'} |
</select> |
</select> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td> |
<td align="center"> |
<select name="rolefilter" multiple="true" size="5"> |
<select name="statusfilter"> |
<option value="all" />All users |
<option value="all" selected="selected" />$status_types{'all'} |
<option value="st" />Students |
<option value="Active" />$status_types{'Active'} |
<option value="cc" />Course Coordinators |
<option value="Expired" />$status_types{'Expired'} |
<option value="in" />Instructors |
|
<option value="ta" />TAs |
|
<option value="pr" />Exam proctors |
|
<option value="cr" />Custom roles |
|
</select> |
</select> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td> |
<td align="center"> |
<select name="statusfilter"> |
<select name="rolefilter" multiple="true" size="5"> |
<option value="all" />Roles of any status |
<option value="all" />$role_types{'all'} |
<option value="Active" />Only active roles |
<option value="st" />$role_types{'st'} |
<option value="Expired" />Only inactive roles |
<option value="cc" />$role_types{'cc'} |
|
<option value="in" />$role_types{'in'} |
|
<option value="ta" />$role_types{'ta'} |
|
<option value="ep" />$role_types{'ep'} |
|
<option value="ad" />$role_types{'ad'} |
|
<option value="cr" />$role_types{'cr'} |
</select> |
</select> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td> |
<td align="center"> |
<select name="sectionpick" multiple="true" size="$numvisible"> |
<select name="sectionpick" multiple="true" size="$numvisible"> |
$section_sel |
$section_sel |
</select> |
</select> |
Line 1801 $bodytag
|
Line 1916 $bodytag
|
<br /> |
<br /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="applysort" value="$symb" /> |
<input type="hidden" name="applysort" value="$symb" /> |
<input type="button" name="sub" value="Store Changes" onClick="javascript:document.modifyshown.submit()" /> |
<input type="button" name="sub" value="Store Changes" onClick="verifyFilter()" /> |
<br /> |
<br /> |
<br /> |
<br /> |
</form> |
</form> |
Line 1989 ENDFAILREDIR
|
Line 2104 ENDFAILREDIR
|
} |
} |
|
|
sub redirect_back { |
sub redirect_back { |
my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$status,$previous,$sort,$rolefilter,$statusfilter,$secpick,$numpicks) = @_; |
my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$status,$previous,$sort,$rolefilter,$statusfilter,$sectionpick,$numpicks) = @_; |
my $sorttag = ''; |
my $sorttag = ''; |
my $roletag = ''; |
my $roletag = ''; |
my $statustag = ''; |
my $statustag = ''; |
Line 2020 sub redirect_back {
|
Line 2135 sub redirect_back {
|
$feedurl .= '?'.$sortqry; |
$feedurl .= '?'.$sortqry; |
} |
} |
$sorttag = '<input type="hidden" name="sortposts" value="'.$sort.'" />'; |
$sorttag = '<input type="hidden" name="sortposts" value="'.$sort.'" />'; |
if ( (defined($numpicks)) && ($numpicks > 0) ) { |
if (defined($numpicks)) { |
my $userpickqry = 'totposters='.$numpicks; |
my $userpickqry = 'totposters='.$numpicks; |
$feedurl .= '&'.$userpickqry; |
$feedurl .= '&'.$userpickqry; |
$userpicktag = '<input type="hidden" name="totposters" value="'.$numpicks.'" />'; |
$userpicktag = '<input type="hidden" name="totposters" value="'.$numpicks.'" />'; |
} else { |
} else { |
my $roleqry = 'rolefilter='.$rolefilter; |
if (ref($sectionpick) eq 'ARRAY') { |
$feedurl .= '&'.$roleqry; |
$feedurl .= '§ionpick='; |
$roletag = '<input type="hidden" name="rolefilter" value="'.$rolefilter.'" />'; |
$sectag .= '<input type="hidden" name="sectionpick" value="'; |
|
foreach (@{$sectionpick}) { |
|
$feedurl .= $_.','; |
|
$sectag .= $_.','; |
|
} |
|
$feedurl =~ s/,$//; |
|
$sectag =~ s/,$//; |
|
$sectag .= '" />'; |
|
} else { |
|
$feedurl .= '§ionpick='.$sectionpick; |
|
$sectag = '<input type="hidden" name="sectionpick" value="'.$sectionpick.'" />'; |
|
} |
|
if (ref($rolefilter) eq 'ARRAY') { |
|
$feedurl .= '&rolefilter='; |
|
$roletag .= '<input type="hidden" name="rolefilter" value="'; |
|
foreach (@{$rolefilter}) { |
|
$feedurl .= $_.','; |
|
$roletag .= $_.','; |
|
} |
|
$feedurl =~ s/,$//; |
|
$roletag =~ s/,$//; |
|
$roletag .= '" />'; |
|
} else { |
|
$feedurl .= '&rolefilter='.$rolefilter; |
|
$roletag = '<input type="hidden" name="rolefilter" value="'.$rolefilter.'" />'; |
|
} |
$feedurl .= '&statusfilter='.$statusfilter; |
$feedurl .= '&statusfilter='.$statusfilter; |
$statustag ='<input type="hidden" name="statusfilter" value="'.$statusfilter.'" />'; |
$statustag ='<input type="hidden" name="statusfilter" value="'.$statusfilter.'" />'; |
$feedurl .= '§ionpick='.$secpick; |
|
$sectag = '<input type="hidden" name="sectionpick" value="'.$secpick.'" />'; |
|
} |
} |
} |
} |
$feedurl=&Apache::lonenc::check_encrypt($feedurl); |
$feedurl=&Apache::lonenc::check_encrypt($feedurl); |
Line 2723 sub has_discussion {
|
Line 2861 sub has_discussion {
|
} |
} |
} |
} |
return; |
return; |
} |
} |
|
|
|
sub sort_filter_names { |
|
my ($sort_types,$role_types,$status_types) = @_; |
|
%{$sort_types} = ( |
|
ascdate => 'Date order - oldest first', |
|
descdate => 'Date order - newest first', |
|
thread => 'Threaded', |
|
subject => 'By subject', |
|
username => 'By domain and username', |
|
lastfirst => 'By last name, first name' |
|
); |
|
%{$role_types} = ( |
|
all => 'All roles', |
|
st => 'Students', |
|
cc => 'Course Coordinators', |
|
in => 'Instructors', |
|
ta => 'TAs', |
|
ep => 'Exam proctors', |
|
ad => 'Administrators', |
|
cr => 'Custom roles' |
|
); |
|
%{$status_types} = ( |
|
all => 'Roles of any status', |
|
Active => 'Only active roles', |
|
Expired => 'Only inactive roles' |
|
); |
|
} |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
Line 2737 sub handler {
|
Line 2902 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']); |
['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']); |
|
|
if ($ENV{'form.discsymb'}) { |
if ($ENV{'form.discsymb'}) { |
my ($symb,$feedurl) = &get_feedurl_and_clean_symb($ENV{'form.discsymb'}); |
my ($symb,$feedurl) = &get_feedurl_and_clean_symb($ENV{'form.discsymb'}); |
my $readkey = $symb.'_read'; |
my $readkey = $symb.'_read'; |
Line 2767 sub handler {
|
Line 2933 sub handler {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
my $bodytag=&Apache::loncommon::bodytag('Discussion Post Versions'); |
my $bodytag=&Apache::loncommon::bodytag('Discussion Post Versions'); |
$r->print (<<END); |
$r->print(<<END); |
<html> |
<html> |
<head> |
<head> |
<title>Post Versions</title> |
<title>Post Versions</title> |
Line 2821 END
|
Line 2987 END
|
&redirect_back($r,$feedurl,&mt('Changed sort/filter').'<br />','0','0', |
&redirect_back($r,$feedurl,&mt('Changed sort/filter').'<br />','0','0', |
'',$ENV{'form.previous'},$ENV{'form.sortposts'}, |
'',$ENV{'form.previous'},$ENV{'form.sortposts'}, |
$ENV{'form.rolefilter'},$ENV{'form.statusfilter'}, |
$ENV{'form.rolefilter'},$ENV{'form.statusfilter'}, |
$ENV{'form.secpick'}); |
$ENV{'form.sectionpick'}); |
return OK; |
return OK; |
} elsif ($ENV{'form.cmd'} eq 'sortfilter') { |
} elsif ($ENV{'form.cmd'} eq 'sortfilter') { |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |