version 1.197, 2006/05/09 15:09:27
|
version 1.198, 2006/05/09 20:00:44
|
Line 726 ENDDISCUSS
|
Line 726 ENDDISCUSS
|
if ($outputtarget ne 'tex') { |
if ($outputtarget ne 'tex') { |
$discussion.=&generate_attachments_button('',$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,'',$mode); |
$discussion.=&generate_attachments_button('',$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,'',$mode); |
if (@currnewattach > 0) { |
if (@currnewattach > 0) { |
$newattachmsg .= '<b>New attachments</b><br />'; |
$newattachmsg .= '<br /><b>New attachments</b><br />'; |
if (@currnewattach > 1) { |
if (@currnewattach > 1) { |
$newattachmsg .= '<ol>'; |
$newattachmsg .= '<ol>'; |
foreach my $item (@currnewattach) { |
foreach my $item (@currnewattach) { |
Line 1328 sub mail_screen {
|
Line 1328 sub mail_screen {
|
my $attachnum = 0; |
my $attachnum = 0; |
my $anonchk = (<<END); |
my $anonchk = (<<END); |
function anonchk() { |
function anonchk() { |
if (document.mailform.anondiscuss.checked == true) { |
if (document.mailform.discuss[0].checked) { |
document.attachment.anondiscuss.value = '1' |
document.attachment.discuss.value = 'nonanon'; |
} |
} |
if (document.mailform.discuss.checked == true) { |
if (document.mailform.discuss[1].checked) { |
document.attachment.discuss.value = '1' |
document.attachment.discuss.value = 'anon'; |
} |
} |
|
if (document.mailform.blog.checked) { |
|
document.attachment.blog.value = 1; |
|
} |
return |
return |
} |
} |
END |
END |
Line 1341 END
|
Line 1344 END
|
if (exists($env{'form.origpage'})) { |
if (exists($env{'form.origpage'})) { |
$anonscript = (<<END); |
$anonscript = (<<END); |
function setposttype() { |
function setposttype() { |
var anondisc = $env{'form.anondiscuss'}; |
var disc = "$env{'form.discuss'}"; |
var disc = $env{'form.discuss'}; |
if (disc == 'nonanon') { |
if (anondisc == 1) { |
document.mailform.discuss[0].checked=1; |
document.mailform.anondiscuss.checked = true |
} |
} |
if (disc == 'anon') { |
if (disc == 1) { |
document.mailform.discuss[1].checked=1; |
document.mailform.discuss.checked = true |
} |
|
var blog = "$env{'form.blog'}"; |
|
if (blog == 1) { |
|
document.mailform.blog.checked=1; |
} |
} |
return |
return |
} |
} |
Line 1422 END
|
Line 1428 END
|
function setposttype () { |
function setposttype () { |
var currtype = $anonflag |
var currtype = $anonflag |
if (currtype == 1) { |
if (currtype == 1) { |
document.mailform.elements.discuss.checked = false |
document.mailform.elements.discuss.value = 'anon' |
document.mailform.elements.anondiscuss.checked = true |
|
} |
} |
if (currtype == 0) { |
if (currtype == 0) { |
document.mailform.elements.anondiscuss.checked = false |
document.mailform.elements.discuss.value = 'nonanon' |
document.mailform.elements.discuss.checked = true |
|
} |
} |
return |
return |
} |
} |
Line 1473 END
|
Line 1477 END
|
} |
} |
} |
} |
if (typeof(document.mailform.elements.discuss)!="undefined") { |
if (typeof(document.mailform.elements.discuss)!="undefined") { |
if (document.mailform.elements.discuss.checked) { |
// anon versus nonanon discussion |
rec=1; |
if (document.mailform.elements.discuss[0].checked |
} |
|| document.mailform.elements.discuss[1].checked) { |
} |
|
if (typeof(document.mailform.elements.anondiscuss)!="undefined") { |
|
if (document.mailform.elements.anondiscuss.checked) { |
|
rec=1; |
rec=1; |
} |
} |
} |
} |
Line 1494 END
|
Line 1495 END
|
} |
} |
document.mailform.submit(); |
document.mailform.submit(); |
} else { |
} else { |
alert('Please check a feedback type.'); |
alert('Please select a feedback type.'); |
} |
} |
} |
} |
$anonchk |
$anonchk |
Line 1583 END
|
Line 1584 END
|
$r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver)); |
$r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver)); |
if ($attachnum > 0) { |
if ($attachnum > 0) { |
if (@currnewattach > 0) { |
if (@currnewattach > 0) { |
$newattachmsg .= '<b>New attachments</b><br />'; |
$newattachmsg .= '<br /><b>New attachments</b><br />'; |
if (@currnewattach > 1) { |
if (@currnewattach > 1) { |
$newattachmsg .= '<ol>'; |
$newattachmsg .= '<ol>'; |
foreach my $item (@currnewattach) { |
foreach my $item (@currnewattach) { |
Line 2292 sub screen_header {
|
Line 2293 sub screen_header {
|
&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'}:''))) { |
$discussoptions='<label><input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '. |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
($env{'form.replydisc'}?' checked="1"':'').' /> '. |
|
&mt('Contribution to course discussion of resource'); |
&mt('Contribution to course discussion of resource'); |
$discussoptions.='</label><br /><label><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
$discussoptions.='</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
&mt('Anonymous contribution to course discussion of resource'). |
&mt('Anonymous contribution to course discussion of resource'). |
' <i>('.&mt('name only visible to course faculty').')</i></label> '. |
' <i>('.&mt('name only visible to course faculty').')</i></label> '. |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
Line 2694 END
|
Line 2694 END
|
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
|
|
$r->print(<<END); |
$r->print(<<END); |
|
$start_page |
<form name="modattachments" method="post" enctype="multipart/form-data" action="/adm/feedback?attach=$symb"> |
<form name="modattachments" method="post" enctype="multipart/form-data" action="/adm/feedback?attach=$symb"> |
<table border="2"> |
<table border="2"> |
<tr> |
<tr> |
Line 2733 END
|
Line 2734 END
|
<input type="hidden" name="idx" value="$env{'form.idx'}" /> |
<input type="hidden" name="idx" value="$env{'form.idx'}" /> |
<input type="hidden" name="numoldver" value="$env{'form.numoldver'}" /> |
<input type="hidden" name="numoldver" value="$env{'form.numoldver'}" /> |
<input type="hidden" name="origpage" value="$env{'form.origpage'}" /> |
<input type="hidden" name="origpage" value="$env{'form.origpage'}" /> |
<input type="hidden" name="anondiscuss" value="$env{'form.anondiscuss'}" /> |
|
<input type="hidden" name="blog" value="$env{'form.blog'}" /> |
<input type="hidden" name="blog" value="$env{'form.blog'}" /> |
<input type="hidden" name="discuss" value="$env{'form.discuss'}" /> |
<input type="hidden" name="discuss" value="$env{'form.discuss'}" /> |
END |
END |
Line 2799 this.form.submit();" />
|
Line 2799 this.form.submit();" />
|
<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="anondiscuss" 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 |
Line 3250 ENDREDIR
|
Line 3249 ENDREDIR
|
# -------------------------------------------------------- Work on attachments |
# -------------------------------------------------------- Work on attachments |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']); |
my (@currnewattach,@currdelold,@keepold); |
my (@currnewattach,@currdelold,@keepold); |
&process_attachments(\@currnewattach,\@currdelold,\@keepold); |
&process_attachments(\@currnewattach,\@currdelold,\@keepold); |
if (exists($env{'form.addnewattach.filename'})) { |
if (exists($env{'form.addnewattach.filename'})) { |
Line 3417 ENDREDIR
|
Line 3416 ENDREDIR
|
# Discussion? Store that. |
# Discussion? Store that. |
|
|
my $numpost=0; |
my $numpost=0; |
if ($env{'form.discuss'} || $env{'form.anondiscuss'}) { |
if ($env{'form.discuss'}) { |
my $subject = &clear_out_html($env{'form.subject'},undef,1); |
my $subject = &clear_out_html($env{'form.subject'},undef,1); |
my $anonmode=(defined($env{'form.anondiscuss'})); |
my $anonmode=($env{'form.discuss'} eq 'anon'); |
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, |
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, |
$subject); |
$subject); |
$numpost++; |
$numpost++; |