--- loncom/interface/lonfeedback.pm 2004/07/05 22:54:33 1.98 +++ loncom/interface/lonfeedback.pm 2004/09/13 18:20:38 1.99.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.98 2004/07/05 22:54:33 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.99.2.6 2004/09/13 18:20:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -127,18 +127,24 @@ sub list_discussion { # Override user's default if user specified display setting for this discussion if (defined($dischash{$ondispkey})) { - $markondisp = $dischash{$ondispkey}; + unless ($dischash{$showkey} eq '') { + $markondisp = $dischash{$ondispkey}; + } } if ($markondisp) { $discinfo{$lastkey} = time; } if (defined($dischash{$showkey})) { - $showonlyunread = $dischash{$showkey}; + unless ($dischash{$showkey} eq '') { + $showonlyunread = $dischash{$showkey}; + } } if (defined($dischash{$visitkey})) { - $visit = $dischash{$visitkey}; + unless ($dischash{$showkey} eq '') { + $visit = $dischash{$visitkey}; + } } $visit ++; @@ -382,7 +388,7 @@ sub list_discussion { $discussion .= '&previous='.$prevread; } $discussion .='">'.&mt('Chronological View').'  '; - } + } if ($newpostsflag) { if (!$markondisp) { $discussion .=''.&mt('Mark new posts as read').'  '; @@ -552,11 +558,6 @@ sub mail_screen { } my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders(); - my $onsubmit=''; - if ((&Apache::lonhtmlcommon::htmlareabrowser()) && - (!&Apache::lonhtmlcommon::htmlareablocked())) { - $onsubmit='document.mailform.onsubmit();'; - } my $send=&mt('Send'); $r->print(< @@ -600,7 +601,9 @@ $htmlheader } if (rec) { - $onsubmit + if (typeof(document.mailform.onsubmit)=='function') { + document.mailform.onsubmit(); + } document.mailform.submit(); } else { alert('Please check a feedback type.'); @@ -782,6 +785,7 @@ sub fail_redirect { Sorry, no recipients ... +
Continue ENDFAILREDIR @@ -821,6 +825,7 @@ $typestyle
$prevtag
+
Continue ENDREDIR @@ -843,6 +848,7 @@ ENDNOREDIR Sorry, no feedback possible on this resource ... +
Continue ENDNOREDIRTWO @@ -1120,7 +1126,7 @@ sub generate_preview_button { +onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" /> ENDPREVIEW } @@ -1136,8 +1142,56 @@ sub handler { # --------------------------- Get query string for limited number of parameters &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['hide','unhide','deldisc','postdata','preview','replydisc','threadedon','threadedoff','onlyunread','allposts','previous','markread','markonread','markondisp','modifydisp','changes']); - if ($ENV{'form.modifydisp'}) { + ['hide','unhide','deldisc','postdata','preview','replydisc','threadedon','threadedoff','onlyunread','allposts','previous','markread','markonread','markondisp','modifydisp','changes','navmaps','navurl']); + if ($ENV{'form.navmaps'}) { + my %discinfo = (); + my @resources = (); + if ($ENV{'form.navmaps'} =~ /:/) { + @resources = split/:/,$ENV{'form.navmaps'}; + } else { + @resources = ("$ENV{'form.navmaps'}"); + } + my $numitems = @resources; + my $feedurl = '/adm/navmaps'; + if ($ENV{'form.navurl'}) { + $feedurl .= '?'.$ENV{'form.navurl'}; + } + my %lt = &Apache::lonlocal::texthash( + 'mnpa' => 'Marked "New" posts as read in a total of', + 'robb' => 'resources/bulletin boards.' + ); + foreach (@resources) { +# backward compatibility (bulletin boards used to be 'wrapped') + my $ressymb=$_; + if ($ressymb =~ m/bulletin___\d+___/) { + unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) { + $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper/|; + } + } + my $lastkey = $ressymb.'_lastread'; + $discinfo{$lastkey} = time; + } + &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + $r->print (< + +New posts marked as read + + + + + +$lt{'mnpa'} $numitems $lt{'robb'} +
+
+
Continue + + +ENDREDIR + return OK; + } elsif ($ENV{'form.modifydisp'}) { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; my $symb=$ENV{'form.modifydisp'};