version 1.89, 2004/06/03 20:06:15
|
version 1.94, 2004/06/12 01:07:10
|
Line 37 use Apache::lontexconvert();
|
Line 37 use Apache::lontexconvert();
|
use Apache::lonlocal; # must not have () |
use Apache::lonlocal; # must not have () |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
|
|
sub list_discussion { |
sub discussion_open { |
my ($mode,$status,$symb)=@_; |
my ($status)=@_; |
|
if (defined($status) && |
if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' |
!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' |
|| $status eq 'OPEN')) { |
|| $status eq 'OPEN')) { |
return ''; |
return 0; |
} |
} |
my $close=&Apache::lonnet::EXT('resource.0.discussend'); |
my $close=&Apache::lonnet::EXT('resource.0.discussend'); |
if (defined($close) && $close ne '' && $close < time) { |
if (defined($close) && $close ne '' && $close < time) { |
return '' |
return 0; |
|
} |
|
return 1; |
|
} |
|
|
|
sub discussion_visible { |
|
my ($status)=@_; |
|
if (not &discussion_open($status)) { |
|
my $hidden=&Apache::lonnet::EXT('resource.0.discusshide'); |
|
if (lc($hidden) eq 'yes' or $hidden eq '' or !defined($hidden)) { |
|
return 0; |
|
} |
} |
} |
|
return 1; |
|
} |
|
|
|
sub list_discussion { |
|
my ($mode,$status,$symb)=@_; |
|
|
|
if (not &discussion_visible($status)) { return ''; } |
my @bgcols = ("#cccccc","#eeeeee"); |
my @bgcols = ("#cccccc","#eeeeee"); |
my $discussiononly=0; |
my $discussiononly=0; |
if ($mode eq 'board') { $discussiononly=1; } |
if ($mode eq 'board') { $discussiononly=1; } |
Line 252 sub list_discussion {
|
Line 269 sub list_discussion {
|
$sender='<i>'.$screenname.'</i>'; |
$sender='<i>'.$screenname.'</i>'; |
} |
} |
} |
} |
if (&Apache::lonnet::allowed('pch', |
if (&discussion_open($status) && |
|
&Apache::lonnet::allowed('pch', |
$ENV{'request.course.id'}. |
$ENV{'request.course.id'}. |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
$sender.=' <a href="/adm/feedback?replydisc='. |
$sender.=' <a href="/adm/feedback?replydisc='. |
Line 416 sub list_discussion {
|
Line 434 sub list_discussion {
|
<font size="1">Note: in anonymous discussion, your name is visible only to |
<font size="1">Note: in anonymous discussion, your name is visible only to |
course faculty</font><br /> |
course faculty</font><br /> |
<b>Title:</b> <input type="text" name="subject" value="" size="30" /><br /><br /> |
<b>Title:</b> <input type="text" name="subject" value="" size="30" /><br /><br /> |
<textarea name="comment" cols="60" rows="12" wrap="hard"></textarea> |
<textarea name="comment" cols="80" rows="14" wrap="hard"></textarea> |
<p> |
<p> |
Attachment (128 KB max size): <input type="file" name="attachment" /> |
Attachment (128 KB max size): <input type="file" name="attachment" /> |
</p> |
</p> |
Line 424 Attachment (128 KB max size): <input typ
|
Line 442 Attachment (128 KB max size): <input typ
|
ENDDISCUSS |
ENDDISCUSS |
$discussion.=&generate_preview_button(); |
$discussion.=&generate_preview_button(); |
} else { |
} else { |
if (&Apache::lonnet::allowed('pch', |
if (&discussion_open($status) && |
|
&Apache::lonnet::allowed('pch', |
$ENV{'request.course.id'}. |
$ENV{'request.course.id'}. |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
Line 464 sub mail_screen {
|
Line 483 sub mail_screen {
|
} |
} |
my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); |
my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); |
my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders(); |
my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders(); |
|
my $onsubmit=''; |
|
if ((&Apache::lonhtmlcommon::htmlareabrowser()) && |
|
(!&Apache::lonhtmlcommon::htmlareablocked())) { |
|
$onsubmit='document.mailform.onsubmit();'; |
|
} |
my $send=&mt('Send'); |
my $send=&mt('Send'); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
<html> |
Line 507 $htmlheader
|
Line 531 $htmlheader
|
} |
} |
|
|
if (rec) { |
if (rec) { |
document.mailform.onsubmit(); |
$onsubmit |
document.mailform.submit(); |
document.mailform.submit(); |
} else { |
} else { |
alert('Please check a feedback type.'); |
alert('Please check a feedback type.'); |
Line 531 $quote
|
Line 555 $quote
|
$latexHelp |
$latexHelp |
Title: <input type="text" name="subject" size="30" value="$subject" /></p> |
Title: <input type="text" name="subject" size="30" value="$subject" /></p> |
<p> |
<p> |
<textarea name="comment" cols="60" rows="10" wrap="hard"> |
<textarea name="comment" id="comment" cols="60" rows="10" wrap="hard"> |
</textarea></p> |
</textarea></p> |
<p> |
<p> |
Attachment (128 KB max size): <input type="file" name="attachment" /> |
Attachment (128 KB max size): <input type="file" name="attachment" /> |
Line 543 Attachment (128 KB max size): <input typ
|
Line 567 Attachment (128 KB max size): <input typ
|
</form> |
</form> |
ENDDOCUMENT |
ENDDOCUMENT |
$r->print(&generate_preview_button(). |
$r->print(&generate_preview_button(). |
&Apache::lonhtmlcommon::htmlareaactive(). |
&Apache::lonhtmlcommon::htmlareaselectactive('comment'). |
'</body></html>'); |
'</body></html>'); |
} |
} |
|
|
Line 647 sub screen_header {
|
Line 671 sub screen_header {
|
} |
} |
} |
} |
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
if (&Apache::lonnet::allowed('pch', |
if (&discussion_open() && |
|
&Apache::lonnet::allowed('pch', |
$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='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '. |
$discussoptions='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '. |
Line 823 sub send_msg {
|
Line 848 sub send_msg {
|
sub adddiscuss { |
sub adddiscuss { |
my ($symb,$email,$anon,$attachmenturl,$subject)=@_; |
my ($symb,$email,$anon,$attachmenturl,$subject)=@_; |
my $status=''; |
my $status=''; |
if (&Apache::lonnet::allowed('pch',$ENV{'request.course.id'}. |
if (&discussion_open() && |
|
&Apache::lonnet::allowed('pch',$ENV{'request.course.id'}. |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
|
|
my %contrib=('message' => $email, |
my %contrib=('message' => $email, |