[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

www www at source.lon-capa.org
Fri Dec 9 20:45:36 EST 2011


www		Sat Dec 10 01:45:36 2011 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  Saving my work: Bug 2359
  
  
-------------- next part --------------
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.305 loncom/interface/lonfeedback.pm:1.306
--- loncom/interface/lonfeedback.pm:1.305	Mon Nov  7 20:05:55 2011
+++ loncom/interface/lonfeedback.pm	Sat Dec 10 01:45:36 2011
@@ -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 @@
     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 @@
             &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 @@
 }
 
 sub send_feedback_link {
-    my ($ressymb,$target) = @_;
+    my ($ressymb) = @_;
     my $output = '<span class="LC_feedback_link">'.
-                 ' <a href="/adm/feedback?replydisc='.
-                 &escape($ressymb).':::" '.$target.'>'.
-                 '<img alt="" class="LC_noBorder" src="'.
-                 &Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').
-                 '" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span></a></span>';
+                 &Apache::loncommon::modal_link(
+                    '/adm/feedback?inhibitmenu=yes&modal=yes&replydisc='.&escape($ressymb).':::',
+                    '<img alt="" class="LC_noBorder" src="'.
+                    &Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').
+                    '" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span>',
+                    600,400).
+                 '</span>';
     return $output;
 }
 
@@ -922,7 +923,7 @@
 }
 
 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 @@
                                             $sender .= '&previous='.$prevread;
                                         }
 				        $sender .= &group_args($group);
-                                        $sender .= '" '.$target.'>'.&mt('Edit').'</a>';
+                                        $sender .= '">'.&mt('Edit').'</a>';
                                     
                                         unless ($seeid) {
                                             my $grpargs = &group_args($group);
@@ -1171,7 +1172,7 @@
                                         $sender .= '&previous='.$prevread;
                                     }
                                     $sender .= &group_args($group);
-                                    $sender .= '" '.$target.'>'.&mt('Reply').'</a>';
+                                    $sender .= '">'.&mt('Reply').'</a>';
                                 } elsif (&Apache::lonnet::allowed('pch', 
 				     $env{'request.course.id'}.
 				     ($env{'request.course.sec'}?'/'.
@@ -1181,7 +1182,7 @@
                                     if ($$newpostsflag) {
                                         $sender .= '&previous='.$prevread;
                                     }
-                                    $sender .= '" '.$target.'>'.&mt('Reply').'</a>';
+                                    $sender .= '">'.&mt('Reply').'</a>';
                                 }
                             }
 		            if ($viewgrades) {
@@ -1728,10 +1729,10 @@
                  '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 @@
 enctype="multipart/form-data">
 $prevtag
 <input type="hidden" name="postdata" value="$feedurl" />
+<input type="hidden" name="modal" value="$env{'form.modal'}" />
 END
   if ($env{'form.replydisc'}) {
       $r->print(<<END);
@@ -2570,12 +2572,14 @@
   } 
   &Apache::lonenc::check_encrypt(\$feedurl);
   my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
-  my %onload;
+  my %parms=('only_body'   => 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(<<ENDREDIR);
 $start_page
@@ -3105,9 +3109,11 @@
     # Breadcrumbs
     my $brcrum = [{'href' => '',
                    '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 @@
 # --------------------------- 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 @@
       # 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'}) {


More information about the LON-CAPA-cvs mailing list