--- loncom/interface/lonfeedback.pm 2011/11/07 20:05:55 1.305 +++ loncom/interface/lonfeedback.pm 2011/12/10 01:45:36 1.306 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.305 2011/11/07 20:05:55 www Exp $ +# $Id: lonfeedback.pm,v 1.306 2011/12/10 01:45:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -281,13 +281,12 @@ sub list_discussion { my $maxdepth=0; my %anonhash=(); my $anoncnt=0; - my $target=''; my $now = time; $discinfo{$visitkey} = $visit; &Apache::lonnet::put('nohist_'.$cid.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'}); - &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,\@grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,\%anonhash,$anoncnt,$group); + &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,\@grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,\%anonhash,$anoncnt,$group); my $discussion=''; my $manifestfile; @@ -756,7 +755,7 @@ END &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - $discussion.= &send_feedback_link($ressymb,$target); + $discussion.= &send_feedback_link($ressymb); if ($env{'request.role.adv'}) { my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb); if (defined($close) && $close ne '' && $close < time) { @@ -773,13 +772,15 @@ END } sub send_feedback_link { - my ($ressymb,$target) = @_; + my ($ressymb) = @_; my $output = ''. - ' '. - ''.&mt('Post Discussion').''; + &Apache::loncommon::modal_link( + '/adm/feedback?inhibitmenu=yes&modal=yes&replydisc='.&escape($ressymb).':::', + ''.&mt('Post Discussion').'', + 600,400). + ''; return $output; } @@ -922,7 +923,7 @@ ENDDISCUSS } sub build_posting_display { - my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_; + my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_; my @original=(); my @index=(); my $skip_group_check = 0; @@ -1101,7 +1102,7 @@ sub build_posting_display { $sender .= '&previous='.$prevread; } $sender .= &group_args($group); - $sender .= '" '.$target.'>'.&mt('Edit').''; + $sender .= '">'.&mt('Edit').''; unless ($seeid) { my $grpargs = &group_args($group); @@ -1171,7 +1172,7 @@ sub build_posting_display { $sender .= '&previous='.$prevread; } $sender .= &group_args($group); - $sender .= '" '.$target.'>'.&mt('Reply').''; + $sender .= '">'.&mt('Reply').''; } elsif (&Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'. @@ -1181,7 +1182,7 @@ sub build_posting_display { if ($$newpostsflag) { $sender .= '&previous='.$prevread; } - $sender .= '" '.$target.'>'.&mt('Reply').''; + $sender .= '">'.&mt('Reply').''; } } if ($viewgrades) { @@ -1728,10 +1729,10 @@ END 'text' => 'Resource Feedback and Discussion'}]; my %onload = ('onload' => 'window.focus();setposttype();'); + my %parms=('add_entries' => \%onload); + if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum } my $start_page= - &Apache::loncommon::start_page('Resource Feedback and Discussion',$js, - {'add_entries' => \%onload, - 'bread_crumbs' => $brcrum,}); + &Apache::loncommon::start_page('Resource Feedback and Discussion',$js,\%parms); if ($quote ne '') { $quote = &HTML::Entities::decode($quote); @@ -1748,6 +1749,7 @@ $start_page enctype="multipart/form-data"> $prevtag + END if ($env{'form.replydisc'}) { $r->print(< 1); + if ($env{'form.modal'}) { + $parms{'add_entries'}={'onLoad' => 'document.forms.reldt.submit()'}; + } else { + $parms{'redirect'}=[0,$feedurl]; + } my $start_page= - &Apache::loncommon::start_page('Feedback sent',undef, - {'redirect' => [0,$feedurl], - 'only_body' => 1, - 'add_entries' => \%onload}); + &Apache::loncommon::start_page('Feedback sent',undef,\%parms); my $end_page = &Apache::loncommon::end_page(); $r->print(< '', 'text' => 'Discussion Post Attachments'}]; + my %parms=(); + if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum } + my $start_page = - &Apache::loncommon::start_page('Discussion Post Attachments',$js, - {'bread_crumbs' => $brcrum,}); + &Apache::loncommon::start_page('Discussion Post Attachments',$js,\%parms); my $orig_subject = &unescape($env{'form.subject'}); my $subject=&clear_out_html($orig_subject); @@ -3468,7 +3474,7 @@ sub handler { # --------------------------- Get query string for limited number of parameters &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['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']); + ['modal','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 %attachmax = ( text => &mt('(128 KB max size)'), @@ -3519,10 +3525,11 @@ sub handler { # Breadcrumbs my $brcrum = [{'href' => '', 'text' => 'Discussion Post Versions'}]; + + my %parms=(); + if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum } - $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef, - {'bread_crumbs' => $brcrum,}) - ); + $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,\%parms)); my $crs='/'.$env{'request.course.id'}; if ($env{'request.course.sec'}) {