version 1.90, 2004/06/03 20:28:22
|
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 discussion_closed { |
sub discussion_open { |
my ($status)=@_; |
my ($status)=@_; |
if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' |
if (defined($status) && |
|
!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' |
|| $status eq 'OPEN')) { |
|| $status eq 'OPEN')) { |
return '1'; |
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 '1' |
return 0; |
} |
} |
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 { |
sub list_discussion { |
my ($mode,$status,$symb)=@_; |
my ($mode,$status,$symb)=@_; |
|
|
if (&discussion_closed($status)) { |
if (not &discussion_visible($status)) { return ''; } |
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 259 sub list_discussion {
|
Line 269 sub list_discussion {
|
$sender='<i>'.$screenname.'</i>'; |
$sender='<i>'.$screenname.'</i>'; |
} |
} |
} |
} |
if (!&discusion_closed($status) && |
if (&discussion_open($status) && |
&Apache::lonnet::allowed('pch', |
&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'}:''))) { |
Line 424 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 432 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 (!&discussion_closed($status) && |
if (&discussion_open($status) && |
&Apache::lonnet::allowed('pch', |
&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'}:''))) { |
Line 473 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 516 $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 540 $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 552 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 656 sub screen_header {
|
Line 671 sub screen_header {
|
} |
} |
} |
} |
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
if (not &discussion_closed() && |
if (&discussion_open() && |
&Apache::lonnet::allowed('pch', |
&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'}:''))) { |
Line 833 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 (not &discussion_closed() && |
if (&discussion_open() && |
&Apache::lonnet::allowed('pch',$ENV{'request.course.id'}. |
&Apache::lonnet::allowed('pch',$ENV{'request.course.id'}. |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
|
|