version 1.264, 2009/02/10 09:30:16
|
version 1.278, 2009/11/04 17:45:49
|
Line 91 sub list_discussion {
|
Line 91 sub list_discussion {
|
if (not &discussion_visible($status)) { |
if (not &discussion_visible($status)) { |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
&Apache::lonenc::check_encrypt(\$ressymb); |
&Apache::lonenc::check_encrypt(\$ressymb); |
return '<br />'.&send_message_link($ressymb); |
return '<br /><div class="LC_feedback_link">'.&send_message_link($ressymb)."</div>"; |
} |
} |
} |
} |
if ($group ne '' && $mode eq 'board') { |
if ($group ne '' && $mode eq 'board') { |
Line 103 sub list_discussion {
|
Line 103 sub list_discussion {
|
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('boards'); |
&Apache::loncommon::blocking_status('boards'); |
if ($blocked) { |
if ($blocked) { |
|
$blocktext = '<br /><div class="LC_feedback_link"><span class="LC_feedback_link">'.$blocktext."</span>"; |
&Apache::lonenc::check_encrypt(\$ressymb); |
&Apache::lonenc::check_encrypt(\$ressymb); |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
$blocktext.='<br />'.&send_message_link($ressymb); |
$blocktext.=&send_message_link($ressymb).'</div>'; |
|
}else{ |
|
$blocktext.="</div>"; |
} |
} |
return $blocktext; |
return $blocktext; |
} |
} |
|
|
my @bgcols = ("#cccccc","#eeeeee"); |
my @bgcols = ("LC_disc_old_item","LC_disc_new_item"); |
my $discussiononly=0; |
my $discussiononly=0; |
if ($mode eq 'board') { $discussiononly=1; } |
if ($mode eq 'board') { $discussiononly=1; } |
unless ($env{'request.course.id'}) { return ''; } |
unless ($env{'request.course.id'}) { return ''; } |
Line 169 sub list_discussion {
|
Line 172 sub list_discussion {
|
|
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
|
my $crstype = &Apache::loncommon::course_type(); |
|
|
# Get information about students and non-students in course for filtering display of posts |
# Get information about students and non-students in course for filtering display of posts |
my %roleshash = (); |
my %roleshash = (); |
Line 434 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 438 imscp_v1p1.xsd http://www.imsglobal.org/
|
} |
} |
</script> |
</script> |
|; |
|; |
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" >'. |
|
"\n".'<table class="LC_discussion">'; |
$discussion .= &action_links_bar($colspan,$ressymb,$visible, |
$discussion .= &action_links_bar($colspan,$ressymb,$visible, |
$newpostsflag,$group, |
$newpostsflag,$group, |
$prevread,$markondisp); |
$prevread,$markondisp); |
Line 547 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 552 imscp_v1p1.xsd http://www.imsglobal.org/
|
} |
} |
$copyresult.=&replicate_attachments($imsitems{$alldiscussion{$post}}{'allattachments'},$tempexport); |
$copyresult.=&replicate_attachments($imsitems{$alldiscussion{$post}}{'allattachments'},$tempexport); |
} else { |
} else { |
$discussion.='<td bgcolor="'.$bgcols[$newitem{$alldiscussion{$post}}]. |
$discussion.='<td class="'.$bgcols[$newitem{$alldiscussion{$post}}]. |
'" colspan="'.$colspan.'">'. $discussionitems[$alldiscussion{$post}]. |
'" colspan="'.$colspan.'">'. $discussionitems[$alldiscussion{$post}]. |
'</td></tr>'; |
'</td></tr>'; |
} |
} |
Line 557 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 562 imscp_v1p1.xsd http://www.imsglobal.org/
|
my $colspan=$maxdepth+1; |
my $colspan=$maxdepth+1; |
$discussion .= <<END; |
$discussion .= <<END; |
<tr bgcolor="#FFFFFF"> |
<tr bgcolor="#FFFFFF"> |
<td colspan="$colspan" valign="top"> |
<td colspan="$colspan" class="LC_disc_action_links_bar"> |
<table border="0" bgcolor="#FFFFFF" width="100%" cellspacing="2" cellpadding="2"> |
<table class="LC_disc_action_table"> |
<tr> |
<tr> |
<td align="left"> |
<td align="left"> |
<table border="0" cellpadding="0" cellspacing="4"> |
<table border="0" cellpadding="0" cellspacing="4"> |
Line 596 END
|
Line 601 END
|
my %sort_types = (); |
my %sort_types = (); |
my %role_types = (); |
my %role_types = (); |
my %status_types = (); |
my %status_types = (); |
&sort_filter_names(\%sort_types,\%role_types,\%status_types); |
&sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype); |
|
|
$discussion .= '<td><font size="-1"><b>'.&mt('Sorted by').'</b>: '.$sort_types{$sortposts}.'<br />'; |
$discussion .= '<td><font size="-1"><b>'.&mt('Sorted by').'</b>: '.$sort_types{$sortposts}.'<br />'; |
if (defined($env{'form.totposters'})) { |
if (defined($env{'form.totposters'})) { |
Line 639 END
|
Line 644 END
|
if ($dischash{$toggkey}) { |
if ($dischash{$toggkey}) { |
my $storebutton = &mt('Save read/unread changes'); |
my $storebutton = &mt('Save read/unread changes'); |
$discussion.='<td align="right">'. |
$discussion.='<td align="right">'. |
'<input type="hidden" name="discsymb" value="'.$ressymb.'">'."\n". |
'<input type="hidden" name="discsymb" value="'.$ressymb.'" />'."\n". |
'<input type="button" name="readoptions" value="'.$storebutton.'"'. |
'<input type="button" name="readoptions" value="'.$storebutton.'"'. |
' onClick="this.form.submit();">'."\n". |
' onClick="this.form.submit();" />'."\n". |
'</td>'; |
'</td>'; |
} |
} |
$discussion .= (<<END); |
$discussion .= (<<END); |
Line 722 END
|
Line 727 END
|
&postingform_display($mode,$ressymb,$now,$subject, |
&postingform_display($mode,$ressymb,$now,$subject, |
$comment,$outputtarget,$attachnum, |
$comment,$outputtarget,$attachnum, |
$currnewattach,$currdelold, |
$currnewattach,$currdelold, |
$group); |
$group,$crstype); |
} |
} |
} else { |
} else { |
$discussion.= |
$discussion.= |
&postingform_display($mode,$ressymb,$now,$subject, |
&postingform_display($mode,$ressymb,$now,$subject, |
$comment,$outputtarget,$attachnum, |
$comment,$outputtarget,$attachnum, |
$currnewattach,$currdelold); |
$currnewattach,$currdelold,'',$crstype); |
} |
} |
} |
} |
} else { |
} else { |
Line 754 sub send_feedback_link {
|
Line 759 sub send_feedback_link {
|
my $output = '<span class="LC_feedback_link">'. |
my $output = '<span class="LC_feedback_link">'. |
' <a href="/adm/feedback?replydisc='. |
' <a href="/adm/feedback?replydisc='. |
&escape($ressymb).':::" '.$target.'>'. |
&escape($ressymb).':::" '.$target.'>'. |
'<img alt="" src="'. |
'<img alt="" class="LC_noBorder" src="'. |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif'). |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif'). |
'" border="0" />'.&mt('Post Discussion').'</a></span>'; |
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span></a></span>'; |
return $output; |
return $output; |
} |
} |
|
|
Line 764 sub send_message_link {
|
Line 769 sub send_message_link {
|
my ($ressymb) = @_; |
my ($ressymb) = @_; |
my $output = '<span class="LC_message_link">'. |
my $output = '<span class="LC_message_link">'. |
' <a href="/adm/feedback?sendmessageonly=1&symb='. |
' <a href="/adm/feedback?sendmessageonly=1&symb='. |
&escape($ressymb).'"><img alt="" src="'. |
&escape($ressymb).'"><img alt="" class="LC_noBorder" src="'. |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif'). |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/com.png'). |
'" border="0" />'.&mt('Send Message').'</a></span>'; |
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Send Feedback').'</span></a></span>'; |
return $output; |
return $output; |
} |
} |
|
|
sub action_links_bar { |
sub action_links_bar { |
my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_; |
my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_; |
my $discussion = '<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'. |
my $discussion = '<tr><td class="LC_disc_action_links_bar" colspan="'.$colspan.'">'. |
'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>'; |
'<table width="100%" class="LC_disc_action_table"><tr>'. |
|
'<td class="LC_disc_action_left">'; |
my $escsymb=&escape($ressymb); |
my $escsymb=&escape($ressymb); |
if ($visible>2) { |
if ($visible>2) { |
$discussion .= '<td align="left">'. |
$discussion .= '<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
'<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
|
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
Line 789 sub action_links_bar {
|
Line 794 sub action_links_bar {
|
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .='">'.&mt('Chronological View').'</a> |
$discussion .='">'.&mt('Chronological View').'</a> |
<a href= "/adm/feedback?cmd=sortfilter&symb='.$escsymb; |
<a href="/adm/feedback?cmd=sortfilter&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .='">'.&mt('Sorting/Filtering options').'</a>'.(' ' x2); |
$discussion .='">'.&mt('Sorting/Filtering options').'</a>'.(' ' x2); |
} else { |
|
$discussion .= '<td align="left">'; |
|
} |
} |
$discussion .='<a href= "/adm/feedback?export='.$escsymb; |
$discussion .='<a href="/adm/feedback?export='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
Line 806 sub action_links_bar {
|
Line 809 sub action_links_bar {
|
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
if ($newpostsflag) { |
if ($newpostsflag) { |
if (!$markondisp) { |
if (!$markondisp) { |
$discussion .='<td align="right"><a href="/adm/preferences?action=changediscussions'; |
$discussion .='<td class="LC_disc_action_right"><a href="/adm/preferences?action=changediscussions'; |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .= '">'. |
$discussion .= '">'. |
&mt('Preferences on what is marked as NEW'). |
&mt('Preferences on what is marked as NEW'). |
Line 825 sub action_links_bar {
|
Line 828 sub action_links_bar {
|
|
|
sub postingform_display { |
sub postingform_display { |
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, |
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, |
$currnewattach,$currdelold,$group) = @_; |
$currnewattach,$currdelold,$group,$crstype) = @_; |
my $newattachmsg; |
my $newattachmsg; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', |
'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', |
Line 834 sub postingform_display {
|
Line 837 sub postingform_display {
|
'poan' => 'Post Anonymous Discussion', |
'poan' => 'Post Anonymous Discussion', |
'newa' => 'New attachments', |
'newa' => 'New attachments', |
); |
); |
|
if ($crstype eq 'Community') { |
|
$lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators'); |
|
} |
my $postingform = (<<ENDDISCUSS); |
my $postingform = (<<ENDDISCUSS); |
<form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" /> |
<form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" /> |
<input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" /> |
<input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" /> |
Line 861 ENDDISCUSS
|
Line 867 ENDDISCUSS
|
} |
} |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
if (!$blockblog) { |
if (!$blockblog) { |
$postingform .= &add_blog_checkbox(); |
$postingform .= &add_blog_checkbox($crstype); |
} |
} |
$postingform .= "</form>\n"; |
$postingform .= "</form>\n"; |
if ($outputtarget ne 'tex') { |
if ($outputtarget ne 'tex') { |
Line 1166 sub build_posting_display {
|
Line 1172 sub build_posting_display {
|
$$imsitems{$idx}{'attach'}=$attachtxt{$numoldver}; |
$$imsitems{$idx}{'attach'}=$attachtxt{$numoldver}; |
$$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'}; |
$$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'}; |
$$imsitems{$idx}{'sender'}=$plainname.' ('. |
$$imsitems{$idx}{'sender'}=$plainname.' ('. |
$contrib{$idx.':sendername'}.' at '. |
$contrib{$idx.':sendername'}.':'. |
$contrib{$idx.':senderdomain'}.')'; |
$contrib{$idx.':senderdomain'}.')'; |
$$imsitems{$idx}{'isanonymous'}='false'; |
$$imsitems{$idx}{'isanonymous'}='false'; |
if ($contrib{$idx.':anonymous'}) { |
if ($contrib{$idx.':anonymous'}) { |
Line 1247 sub build_posting_display {
|
Line 1253 sub build_posting_display {
|
<p><table border="0" width="100%"> |
<p><table border="0" width="100%"> |
<tr><td align="left"> </td>'; |
<tr><td align="left"> </td>'; |
} |
} |
$$discussionitems[$idx] .= '<td align ="left"> '. |
$$discussionitems[$idx] .= '<td align="left"> '. |
'<b>'.$subject.'</b> '. |
'<b>'.$subject.'</b> '. |
$sender.'</b> '.$vgrlink.' ('. |
$sender.'</b> '.$vgrlink.' ('. |
&Apache::lonlocal::locallocaltime($posttime).')</td>'; |
&Apache::lonlocal::locallocaltime($posttime).')</td>'; |
Line 1363 sub get_post_contents {
|
Line 1369 sub get_post_contents {
|
$$plainname, |
$$plainname, |
$$contrib{$idx.':sendername'}, |
$$contrib{$idx.':sendername'}, |
$$contrib{$idx.':senderdomain'}).' ('. |
$$contrib{$idx.':senderdomain'}).' ('. |
$$contrib{$idx.':sendername'}.' at '. |
$$contrib{$idx.':sendername'}.':'. |
$$contrib{$idx.':senderdomain'}.')'; |
$$contrib{$idx.':senderdomain'}.')'; |
my $attachmenturls = $$contrib{$idx.':attachmenturl'}; |
my $attachmenturls = $$contrib{$idx.':attachmenturl'}; |
my @postversions = (); |
my @postversions = (); |
Line 1660 END
|
Line 1666 END
|
</script> |
</script> |
END |
END |
|
|
|
# Breadcrumbs |
|
my $brcrum = [{'href' => '', |
|
'text' => 'Resource Feedback and Discussion'}]; |
|
|
my %onload = ('onload' => 'window.focus();setposttype();'); |
my %onload = ('onload' => 'window.focus();setposttype();'); |
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js, |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js, |
{'add_entries' => \%onload}); |
{'add_entries' => \%onload, |
|
'bread_crumbs' => $brcrum,}); |
|
|
if ($quote ne '') { |
if ($quote ne '') { |
&newline_to_br(\$quote); |
&newline_to_br(\$quote); |
Line 1684 END
|
Line 1695 END
|
END |
END |
} elsif ($env{'form.editdisc'}) { |
} elsif ($env{'form.editdisc'}) { |
$r->print(<<END); |
$r->print(<<END); |
<input type="hidden" name="editdisc" value ="$env{'form.editdisc'}" /> |
<input type="hidden" name="editdisc" value="$env{'form.editdisc'}" /> |
<input type="hidden" name="parentmsg" value ="$parentmsg" /> |
<input type="hidden" name="parentmsg" value="$parentmsg" /> |
END |
END |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
Line 1695 $quote
|
Line 1706 $quote
|
<p>$lt{'myqu'}</p> |
<p>$lt{'myqu'}</p> |
<p> |
<p> |
$latexHelp |
$latexHelp |
|
</p> |
|
<p> |
$lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p> |
$lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p> |
<p> |
<p> |
<textarea name="comment" id="comment" cols="60" rows="10" wrap="hard">$comment |
<textarea name="comment" id="comment" cols="60" rows="10" wrap="hard">$comment |
Line 1925 END
|
Line 1938 END
|
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
$r->print(<<END); |
$r->print(<<END); |
$start_page |
$start_page |
<form name="modifydisp" method="POST" action="/adm/feedback"> |
<form name="modifydisp" method="post" action="/adm/feedback"> |
$lt{'sdpf'}<br/> $lt{'prca'} <ol><li>$lt{'whpo'}</li><li>$lt{'unwh'}</li><li>$lt{'wipa'}</li></ol> |
$lt{'sdpf'}<br/> $lt{'prca'} <ol><li>$lt{'whpo'}</li><li>$lt{'unwh'}</li><li>$lt{'wipa'}</li></ol> |
<br /> |
<br /> |
END |
END |
Line 1968 END
|
Line 1981 END
|
<br /> |
<br /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="$dispchgA" value=""/> |
<input type="hidden" name="$dispchgA" value="" /> |
<input type="hidden" name="$dispchgB" value=""/> |
<input type="hidden" name="$dispchgB" value="" /> |
<input type="hidden" name="$markchg" value=""/> |
<input type="hidden" name="$markchg" value="" /> |
<input type="hidden" name="$toggchg" value="" /> |
<input type="hidden" name="$toggchg" value="" /> |
<input type="button" name="sub" value="$save" onClick="javascript:setDisp()" /> |
<input type="button" name="sub" value="$save" onClick="javascript:setDisp()" /> |
END |
END |
Line 2003 sub print_sortfilter_options {
|
Line 2016 sub print_sortfilter_options {
|
my $group_sel = ''; |
my $group_sel = ''; |
my $numgroupvis = 5; |
my $numgroupvis = 5; |
my %sectioncount = &Apache::loncommon::get_sections(); |
my %sectioncount = &Apache::loncommon::get_sections(); |
|
my @courseroles = qw(st ad ep ta in); |
|
my $crstype = &Apache::loncommon::course_type(); |
|
my $ccrole = 'cc'; |
|
if ($crstype eq 'Community') { |
|
$ccrole = 'co'; |
|
} |
|
push(@courseroles,$ccrole); |
|
|
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section |
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section |
@sections = ('all',$env{'request.course.sec'}); |
@sections = ('all',$env{'request.course.sec'}); |
$numvisible = 2; |
$numvisible = 2; |
Line 2066 sub print_sortfilter_options {
|
Line 2086 sub print_sortfilter_options {
|
my %sort_types = (); |
my %sort_types = (); |
my %role_types = (); |
my %role_types = (); |
my %status_types = (); |
my %status_types = (); |
&sort_filter_names(\%sort_types,\%role_types,\%status_types); |
&sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype); |
|
|
my $js = <<END; |
my $js = <<END; |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 2113 END
|
Line 2133 END
|
|
|
$r->print(<<END); |
$r->print(<<END); |
$start_page |
$start_page |
<form name="modifyshown" method="POST" action="/adm/feedback"> |
<form name="modifyshown" method="post" action="/adm/feedback"> |
<b>$lt{'diso'}</b><br/> $lt{'prca'} |
<b>$lt{'diso'}</b><br/> $lt{'prca'} |
<br /><br /> |
<br /><br /> |
<table border="0"> |
<table border="0"> |
Line 2155 $start_page
|
Line 2175 $start_page
|
<select name="rolefilter" multiple="multiple" size="5"> |
<select name="rolefilter" multiple="multiple" size="5"> |
<option value="all">$role_types{'all'}</option> |
<option value="all">$role_types{'all'}</option> |
<option value="st">$role_types{'st'}</option> |
<option value="st">$role_types{'st'}</option> |
<option value="cc">$role_types{'cc'}</option> |
<option value="$ccrole">$role_types{$ccrole}</option> |
<option value="in">$role_types{'in'}</option> |
<option value="in">$role_types{'in'}</option> |
<option value="ta">$role_types{'ta'}</option> |
<option value="ta">$role_types{'ta'}</option> |
<option value="ep">$role_types{'ep'}</option> |
<option value="ep">$role_types{'ep'}</option> |
|
<option value="ad">$role_types{'ad'}</option> |
<option value="cr">$role_types{'cr'}</option> |
<option value="cr">$role_types{'cr'}</option> |
</select> |
</select> |
</td> |
</td> |
Line 2475 sub redirect_back {
|
Line 2496 sub redirect_back {
|
} |
} |
my $grouptag; |
my $grouptag; |
if ($group ne '') { |
if ($group ne '') { |
$grouptag = '<input type="hidden" name="group" value="'.$group.'" />'; my $refarg; |
$grouptag = '<input type="hidden" name="group" value="'.$group.'" />'; |
|
my $refarg; |
if (exists($env{'form.ref'})) { |
if (exists($env{'form.ref'})) { |
$refarg = '&ref='.$env{'form.ref'}; |
$refarg = '&ref='.$env{'form.ref'}; |
$grouptag .= '<input type="hidden" name="ref" value="'.$env{'form.ref'}.'" />'; |
$grouptag .= '<input type="hidden" name="ref" value="'.$env{'form.ref'}.'" />'; |
Line 2557 ENDNOREDIRTWO
|
Line 2579 ENDNOREDIRTWO
|
|
|
sub screen_header { |
sub screen_header { |
my ($feedurl,$symb) = @_; |
my ($feedurl,$symb) = @_; |
|
my $crscontent = &mt('Question/Comment/Feedback about course content'); |
|
my $crspolicy = &mt('Question/Comment/Feedback about course policy'); |
|
my $contribdisc = &mt('Contribution to course discussion of resource'); |
|
my $anoncontrib = &mt('Anonymous contribution to course discussion of resource'); |
|
my $namevis = &mt('name only visible to course faculty'); |
|
my $crstype; |
|
if ($env{'request.course.id'}) { |
|
$crstype = &Apache::loncommon::course_type(); |
|
if ($crstype eq 'Community') { |
|
$crscontent = &mt('Question/Comment/Feedback about community content'); |
|
$crspolicy = &mt('Question/Comment/Feedback about community policy'); |
|
$contribdisc = &mt('Contribution to community discussion of resource'); |
|
$anoncontrib = &mt('Anonymous contribution to community discussion of resource'); |
|
$namevis = &mt('name only visible to community facilitators'); |
|
} |
|
} |
my $msgoptions=''; |
my $msgoptions=''; |
my $discussoptions=''; |
my $discussoptions=''; |
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { |
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { |
Line 2577 sub screen_header {
|
Line 2615 sub screen_header {
|
if (&feedback_available(0,1)) { |
if (&feedback_available(0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
($optionhash{'comment'}?$optionhash{'comment'}:&mt('Question/Comment/Feedback about course content')). |
($optionhash{'comment'}?$optionhash{'comment'}:$crscontent). |
'</label></p>'; |
'</label></p>'; |
} |
} |
if (&feedback_available(0,0,1)) { |
if (&feedback_available(0,0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
($optionhash{'policy'}?$optionhash{'policy'}:&mt('Question/Comment/Feedback about course policy')). |
($optionhash{'policy'}?$optionhash{'policy'}:$crspolicy). |
'</label></p>'; |
'</label></p>'; |
} |
} |
} |
} |
Line 2594 sub screen_header {
|
Line 2632 sub screen_header {
|
$env{'request.course.id'}. |
$env{'request.course.id'}. |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
&mt('Contribution to course discussion of resource'); |
$contribdisc. |
$discussoptions.='</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
'</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
&mt('Anonymous contribution to course discussion of resource'). |
$anoncontrib. |
' <i>('.&mt('name only visible to course faculty').')</i></label> '. |
' <i>('.$namevis.')</i></label> '. |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
if (!$blockblog) { |
if (!$blockblog) { |
$discussoptions.= &add_blog_checkbox(); |
$discussoptions.= &add_blog_checkbox($crstype); |
} |
} |
} |
} |
} |
} |
if ($msgoptions) { $msgoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" />'.&mt('Sending Messages').'</h2>'.$msgoptions; } |
if ($msgoptions) { |
|
$msgoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/com.png').'" />' |
|
.' '.&mt('Send Feedback').'</h2>' |
|
.$msgoptions; |
|
} |
if ($discussoptions) { |
if ($discussoptions) { |
$discussoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" />'.&mt('Discussion Contributions').'</h2>'.$discussoptions; } |
$discussoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" />' |
|
.' '.&mt('Discussion Contributions').'</h2>' |
|
.$discussoptions; |
|
} |
return $msgoptions.$discussoptions; |
return $msgoptions.$discussoptions; |
} |
} |
|
|
Line 2657 sub assemble_email {
|
Line 2702 sub assemble_email {
|
'orig' => 'Original screen output (if applicable)', |
'orig' => 'Original screen output (if applicable)', |
'corr' => 'Correct Answer(s) (if applicable)', |
'corr' => 'Correct Answer(s) (if applicable)', |
); |
); |
|
if (&Apache::loncommon::course_type() eq 'Community') { |
|
$lt{'prev'} = &mt('Previous attempts of member (if applicable)'); |
|
} |
my $email=<<"ENDEMAIL"; |
my $email=<<"ENDEMAIL"; |
$message |
$message |
ENDEMAIL |
ENDEMAIL |
Line 2933 sub generate_preview_button {
|
Line 2981 sub generate_preview_button {
|
return(<<ENDPREVIEW); |
return(<<ENDPREVIEW); |
<br /> |
<br /> |
<form name="preview" action="/adm/feedback?preview=1" method="post" target="preview"> |
<form name="preview" action="/adm/feedback?preview=1" method="post" target="preview"> |
<input type="hidden" name="subject"> |
<input type="hidden" name="subject" /> |
<input type="hidden" name="comment" /> |
<input type="hidden" name="comment" /> |
<input type="button" value="$pre" |
<input type="button" value="$pre" |
onClick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" /> |
onClick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" /> |
Line 2962 sub modify_attachments {
|
Line 3010 sub modify_attachments {
|
</script> |
</script> |
END |
END |
|
|
|
# Breadcrumbs |
|
my $brcrum = [{'href' => '', |
|
'text' => 'Discussion Post Attachments'}]; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Discussion Post Attachments',$js); |
&Apache::loncommon::start_page('Discussion Post Attachments',$js, |
|
{'bread_crumbs' => $brcrum,}); |
|
|
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); |
Line 3042 END
|
Line 3094 END
|
$r->print('<input type="hidden" name="deloldattach" value="'.$item.'" />'."\n"); |
$r->print('<input type="hidden" name="deloldattach" value="'.$item.'" />'."\n"); |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
<input type="button" name="rtntoedit" value="$lt{'stch'}" onClick="setAction()"/> |
<input type="button" name="rtntoedit" value="$lt{'stch'}" onClick="setAction()" /> |
</form> |
</form> |
$end_page |
$end_page |
END |
END |
Line 3104 this.form.submit();" />
|
Line 3156 this.form.submit();" />
|
<input type="hidden" name="timestamp" value="$now" /> |
<input type="hidden" name="timestamp" value="$now" /> |
<input type="hidden" name="subject" /> |
<input type="hidden" name="subject" /> |
<input type="hidden" name="comment" /> |
<input type="hidden" name="comment" /> |
<input type="hidden" name="blog" value = "0" /> |
<input type="hidden" name="blog" value="0" /> |
<input type="hidden" name="discuss" value = "0" /> |
<input type="hidden" name="discuss" value="0" /> |
<input type="hidden" name="numoldver" value="$numoldver" /> |
<input type="hidden" name="numoldver" value="$numoldver" /> |
ENDATTACH |
ENDATTACH |
if (defined($deloldattach)) { |
if (defined($deloldattach)) { |
Line 3234 sub construct_attachmenturl {
|
Line 3286 sub construct_attachmenturl {
|
} |
} |
|
|
sub add_blog_checkbox { |
sub add_blog_checkbox { |
my ($checkstatus); |
my ($crstype) = @_; |
|
my $checkstatus; |
if ($env{'form.blog'}) { |
if ($env{'form.blog'}) { |
$checkstatus = 'checked="checked"'; |
$checkstatus = 'checked="checked"'; |
} |
} |
Line 3248 function setblogvalue() {
|
Line 3301 function setblogvalue() {
|
} |
} |
} |
} |
</script><br /> |
</script><br /> |
<label><input type="checkbox" name="blog" '.$checkstatus.' /> '. |
<label><input type="checkbox" name="blog" '.$checkstatus.' /> '; |
&mt('Add to my public course blog').'</label><br />'."\n"; |
if ($crstype eq 'Community') { |
|
$output .= &mt('Add to my public community blog'); |
|
} else { |
|
$output .= &mt('Add to my public course blog'); |
|
} |
|
$output .= '</label><br />'."\n"; |
return $output; |
return $output; |
} |
} |
|
|
Line 3273 sub has_discussion {
|
Line 3331 sub has_discussion {
|
} |
} |
|
|
sub sort_filter_names { |
sub sort_filter_names { |
my ($sort_types,$role_types,$status_types) = @_; |
my ($sort_types,$role_types,$status_types,$crstype) = @_; |
%{$sort_types} = ( |
if (ref($sort_types) eq 'HASH') { |
|
%{$sort_types} = ( |
ascdate => 'Date order - oldest first', |
ascdate => 'Date order - oldest first', |
descdate => 'Date order - newest first', |
descdate => 'Date order - newest first', |
thread => 'Threaded', |
thread => 'Threaded', |
Line 3282 sub sort_filter_names {
|
Line 3341 sub sort_filter_names {
|
username => 'By domain and username', |
username => 'By domain and username', |
lastfirst => 'By last name, first name' |
lastfirst => 'By last name, first name' |
); |
); |
%{$role_types} = ( |
} |
all => 'All roles', |
my @courseroles = qw(st in ta ep ad); |
st => 'Students', |
if ($crstype eq 'Community') { |
cc => 'Course Coordinators', |
push(@courseroles,'co'); |
in => 'Instructors', |
} else { |
ta => 'TAs', |
push(@courseroles,'cc'); |
ep => 'Exam proctors', |
} |
ad => 'Administrators', |
if (ref($role_types) eq 'HASH') { |
cr => 'Custom roles' |
foreach my $role (@courseroles) { |
); |
$role_types->{$role} = &Apache::lonnet::plaintext($role,$crstype); |
%{$status_types} = ( |
} |
|
$role_types->{'all'} = 'All roles'; |
|
$role_types->{'cr'} = 'Custom role'; |
|
} |
|
if (ref($status_types) eq 'HASH') { |
|
%{$status_types} = ( |
all => 'Roles of any status', |
all => 'Roles of any status', |
Active => 'Only active roles', |
Active => 'Only active roles', |
Expired => 'Only past roles', |
Expired => 'Only past roles', |
Future => 'Only future roles', |
Future => 'Only future roles', |
); |
); |
|
} |
} |
} |
|
|
sub handler { |
sub handler { |
Line 3314 sub handler {
|
Line 3379 sub handler {
|
['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','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']); |
['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','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']); |
my $group = $env{'form.group'}; |
my $group = $env{'form.group'}; |
my %attachmax = ( |
my %attachmax = ( |
text => '(128 KB max size)', |
text => &mt('(128 KB max size)'), |
num => 131072, |
num => 131072, |
); |
); |
if ($env{'form.editdisc'}) { |
if ($env{'form.editdisc'}) { |
Line 3359 sub handler {
|
Line 3424 sub handler {
|
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
|
|
$r->print(&Apache::loncommon::start_page('Discussion Post Versions')); |
# Breadcrumbs |
|
my $brcrum = [{'href' => '', |
|
'text' => 'Discussion Post Versions'}]; |
|
|
|
$r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef, |
|
{'bread_crumbs' => $brcrum,}) |
|
); |
|
|
my $crs='/'.$env{'request.course.id'}; |
my $crs='/'.$env{'request.course.id'}; |
if ($env{'request.course.sec'}) { |
if ($env{'request.course.sec'}) { |
Line 3590 ENDREDIR
|
Line 3661 ENDREDIR
|
&Apache::lonnet::appenv({'environment.threadeddiscussion' => 'on'}); |
&Apache::lonnet::appenv({'environment.threadeddiscussion' => 'on'}); |
} else { |
} else { |
&Apache::lonnet::del('environment',['threadeddiscussion']); |
&Apache::lonnet::del('environment',['threadeddiscussion']); |
&Apache::lonnet::delenv('environment\.threadeddiscussion'); |
&Apache::lonnet::delenv('environment.threadeddiscussion'); |
} |
} |
&redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />', |
&redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />', |
'0','0','','',$env{'form.previous'},undef,undef,undef, |
'0','0','','',$env{'form.previous'},undef,undef,undef, |
Line 3825 ENDREDIR
|
Line 3896 ENDREDIR
|
$env{'user.domain'}, |
$env{'user.domain'}, |
'CourseBlog_'.$env{'request.course.id'}, |
'CourseBlog_'.$env{'request.course.id'}, |
$subject,$message,$feedurl,'public'); |
$subject,$message,$feedurl,'public'); |
$blog='<br />'.&mt('Added to my course blog').'<br />'; |
if (&Apache::loncommon::course_type() eq 'Community') { |
|
$blog='<br />'.&mt('Added to my community blog').'<br />'; |
|
} else { |
|
$blog='<br />'.&mt('Added to my course blog').'<br />'; |
|
} |
} |
} |
|
|
# Receipt screen and redirect back to where came from |
# Receipt screen and redirect back to where came from |