Diff for /loncom/interface/lonfeedback.pm between versions 1.127 and 1.131

version 1.127, 2004/09/21 20:44:16 version 1.131, 2004/11/12 16:22:48
Line 36  use Apache::loncommon(); Line 36  use Apache::loncommon();
 use Apache::lontexconvert();  use Apache::lontexconvert();
 use Apache::lonlocal; # must not have ()  use Apache::lonlocal; # must not have ()
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
   use Apache::lonnavmaps;
   use Apache::lonenc();
 use HTML::LCParser();  use HTML::LCParser();
 use Apache::lonspeller();  use Apache::lonspeller();
 use Cwd;  use Cwd;
Line 98  sub list_discussion { Line 100  sub list_discussion {
             $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;              $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
         }          }
     }      }
       $ressymb=&Apache::lonenc::check_encrypt($ressymb);
 # Get discussion display settings for this discussion  # Get discussion display settings for this discussion
     my $lastkey = $ressymb.'_lastread';      my $lastkey = $ressymb.'_lastread';
     my $showkey = $ressymb.'_showonlyunread';      my $showkey = $ressymb.'_showonlyunread';
Line 359  imscp_v1p1.xsd http://www.imsglobal.org/ Line 361  imscp_v1p1.xsd http://www.imsglobal.org/
    }     }
 </script>  </script>
             |;              |;
     $discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$symb.'"><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';      $discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'"><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
     $discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.      $discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
  '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';   '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
     if ($visible>2) {      if ($visible>2) {
Line 677  ENDDISCUSS Line 679  ENDDISCUSS
  ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {   ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
     if ($outputtarget ne 'tex') {      if ($outputtarget ne 'tex') {
  $discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='.   $discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='.
     $symb.':::" '.$target.'>'.      $ressymb.':::" '.$target.'>'.
     '<img src="/adm/lonMisc/chat.gif" border="0" />'.      '<img src="/adm/lonMisc/chat.gif" border="0" />'.
     &mt('Post Discussion').'</a></td></tr></table>';      &mt('Post Discussion').'</a></td></tr></table>';
     }      }
Line 2048  sub redirect_back { Line 2050  sub redirect_back {
           $sectag = '<input type="hidden" name="sectionpick" value="'.$secpick.'" />';            $sectag = '<input type="hidden" name="sectionpick" value="'.$secpick.'" />';
       }        }
   }    }
     $feedurl=&Apache::lonenc::check_encrypt($feedurl);
   $r->print (<<ENDREDIR);    $r->print (<<ENDREDIR);
 <html>  <html>
 <head>  <head>
Line 2085  sub no_redirect_back { Line 2088  sub no_redirect_back {
 ENDNOREDIR  ENDNOREDIR
   
   if ($feedurl!~/^\/adm\/feedback/) {     if ($feedurl!~/^\/adm\/feedback/) { 
     $r->print('<meta HTTP-EQUIV="Refresh" CONTENT="2; url='.$feedurl.'">');        $r->print('<meta HTTP-EQUIV="Refresh" CONTENT="2; url='.
    &Apache::lonenc::check_encrypt($feedurl).'">');
   }    }
       $feedurl=&Apache::lonenc::check_encrypt($feedurl);
   $r->print (<<ENDNOREDIRTWO);    $r->print (<<ENDNOREDIRTWO);
 </head>  </head>
 <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { self.close(); }'>  <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { self.close(); }'>
Line 2185  sub clear_out_html { Line 2189  sub clear_out_html {
 sub assemble_email {  sub assemble_email {
   my ($feedurl,$message,$prevattempts,$usersaw,$useranswer)=@_;    my ($feedurl,$message,$prevattempts,$usersaw,$useranswer)=@_;
   my $email=<<"ENDEMAIL";    my $email=<<"ENDEMAIL";
 Refers to <a href="$feedurl">$feedurl</a>  
   
 $message  $message
 ENDEMAIL  ENDEMAIL
     my $citations=<<"ENDCITE";      my $citations=<<"ENDCITE";
Line 2716  sub construct_attachmenturl { Line 2718  sub construct_attachmenturl {
     }      }
     return $newattachmenturl;       return $newattachmenturl; 
 }  }
   
   sub has_discussion {
       my $resourcesref = shift;
       my $navmap = Apache::lonnavmaps::navmap->new();
       my @allres=$navmap->retrieveResources();
       foreach my $resource (@allres) {
           if ($resource->hasDiscussion()) {
               my $ressymb;
               if ($resource->symb() =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) {
                   $ressymb = 'bulletin___'.$2.$1.'/'.$2.'/bulletinboard';
               } else {
                   $ressymb = $resource->symb();
               }
               push @{$resourcesref}, $ressymb;
           }
       }
       return;
   } 
       
 sub handler {  sub handler {
   my $r = shift;    my $r = shift;
Line 2728  sub handler { Line 2748  sub handler {
 # --------------------------- Get query string for limited number of parameters  # --------------------------- Get query string for limited number of parameters
   
   &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
          ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','threadedon','threadedoff','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navmaps','navurl','navtime','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']);           ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','threadedon','threadedoff','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']);
   if ($ENV{'form.discsymb'}) {    if ($ENV{'form.discsymb'}) {
       my $symb = $ENV{'form.discsymb'};        my $symb = $ENV{'form.discsymb'};
       my $readkey = $symb.'_read';        my $readkey = $symb.'_read';
Line 2875  END Line 2895  END
       }        }
       &print_sortfilter_options($r,$symb,$previous,$feedurl);        &print_sortfilter_options($r,$symb,$previous,$feedurl);
       return OK;        return OK;
   } elsif ($ENV{'form.navmaps'}) {    } elsif ($ENV{'form.navtime'}) {
       my %discinfo = ();        my %discinfo = ();
       my @resources = ();        my @resources = ();
       if ($ENV{'form.navmaps'} =~ /:/) {        if (defined($ENV{'form.navmaps'})) {
           @resources = split/:/,$ENV{'form.navmaps'};            if ($ENV{'form.navmaps'} =~ /:/) {
                 @resources = split/:/,$ENV{'form.navmaps'};
             } else {
                 @resources = ("$ENV{'form.navmaps'}");
             }
       } else {        } else {
           @resources = ("$ENV{'form.navmaps'}");            &has_discussion(\@resources);
       }        }
       my $numitems = @resources;        my $numitems = @resources;
       my $feedurl = '/adm/navmaps';        my $feedurl = '/adm/navmaps';
Line 2890  END Line 2914  END
       }        }
       my %lt = &Apache::lonlocal::texthash(        my %lt = &Apache::lonlocal::texthash(
           'mnpa' => 'Marked "New" posts as read in a total of',            'mnpa' => 'Marked "New" posts as read in a total of',
           'robb' => 'resources/bulletin boards.'            'robb' => 'resources/bulletin boards.',
             'twnp' => 'There are currently no resources or bulletin boards with unread discussion postings.'
       );               );       
       foreach (@resources) {        foreach (@resources) {
 # backward compatibility (bulletin boards used to be 'wrapped')  # backward compatibility (bulletin boards used to be 'wrapped')
Line 2903  END Line 2928  END
           my $lastkey = $ressymb.'_lastread';            my $lastkey = $ressymb.'_lastread';
           $discinfo{$lastkey} = $ENV{'form.navtime'};            $discinfo{$lastkey} = $ENV{'form.navtime'};
       }        }
       &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});        my $textline = "<b>$lt{'mnpa'} $numitems $lt{'robb'}</b>";
         if ($numitems > 0) {
             &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
         } else {
             $textline = "<b>$lt{'twnp'}</b>";
         }
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
       $r->print (<<ENDREDIR);        $r->print (<<ENDREDIR);
Line 2915  END Line 2945  END
 </head>  </head>
 <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>  <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>
 <img align="right" src="/adm/lonIcons/lonlogos.gif" />  <img align="right" src="/adm/lonIcons/lonlogos.gif" />
 <b>$lt{'mnpa'} $numitems $lt{'robb'}</b>  $textline
 <form name="reldt" action="$feedurl" target="loncapaclient">  <form name="reldt" action="$feedurl" target="loncapaclient">
 </form>  </form>
 <br /><a href="$feedurl">Continue</a>  <br /><a href="$feedurl">Continue</a>

Removed from v.1.127  
changed lines
  Added in v.1.131


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>