Diff for /loncom/interface/lonfeedback.pm between versions 1.370.2.1 and 1.370.2.1.2.1

version 1.370.2.1, 2017/05/30 02:17:45 version 1.370.2.1.2.1, 2017/11/16 16:02:58
Line 44  use HTML::LCParser(); Line 44  use HTML::LCParser();
 #use HTML::Tidy::libXML;  #use HTML::Tidy::libXML;
 use Apache::lonspeller();  use Apache::lonspeller();
 use Apache::longroup;  use Apache::longroup;
 use Cwd;  use Archive::Zip qw( :ERROR_CODES );
 use LONCAPA;  use LONCAPA qw(:DEFAULT :match);
   
 sub discussion_open {  sub discussion_open {
     my ($status,$symb)=@_;      my ($status,$symb)=@_;
Line 696  END Line 696  END
   
 #Create zip file in prtspool  #Create zip file in prtspool
   
                     my $imszipfile = '/prtspool/'.                      if (($env{'user.name'} =~ /^$match_username$/)
                     $env{'user.name'}.'_'.$env{'user.domain'}.'_'.                          && ($env{'user.domain'} =~ /^$match_domain$/)) {
                          time.'_'.rand(1000000000).'.zip';                          my $now = time();
                     my $cwd = &getcwd();                           my $imszipfile = '/prtspool/'.
                     my $imszip = '/home/httpd/'.$imszipfile;                                        join('_',$env{'user.name'},$env{'user.domain'},$now).
                     chdir $tempexport;                                        '_'.rand(1000000000).'.zip';
                     open(OUTPUT, "zip -r $imszip *  2> /dev/null |");                          my $zip = Archive::Zip->new();
                     close(OUTPUT);                          $zip->addTree($tempexport);
                     chdir $cwd;                          my $imszip = '/home/httpd/'.$imszipfile;
                     $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]',                          if ($zip->writeToFileNamed($imszip) == AZ_OK) {
                               $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]',
                                            '<a href="'.$imszipfile.'">','</a>').'<br />';                                             '<a href="'.$imszipfile.'">','</a>').'<br />';
                     if ($copyresult) {                          } else {
                         $discussion .= '<span class="LC_error">'.                              $discussion .=  &mt('Failed to create zip file').'<br />';
                                        &mt('The following errors occurred during export:').                          }
                                        '</span><br />'.$copyresult;                          if ($copyresult) {
                               $discussion .= '<span class="LC_error">'.
                                              &mt('The following errors occurred during export:').
                                              '</span><br />'.$copyresult;
                           }
                       } else {
                           $discussion .= '<p class="LC_error">'.
                                          &mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating the zip file.').'</p>';
                     }                      }
                 }                  }
             } else {              } else {
Line 847  sub send_feedback_link { Line 855  sub send_feedback_link {
                  &discussion_link($ressymb,                   &discussion_link($ressymb,
                     '<img alt="" class="LC_noBorder" src="'.                      '<img alt="" class="LC_noBorder" src="'.
                     &Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').                      &Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').
                     '" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span>',                      '" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span>',
                     'replydisc').                      'replydisc').
            '</span>';             '</span>';
 }  }
Line 858  sub send_message_link { Line 866  sub send_message_link {
                  &discussion_link($ressymb,                   &discussion_link($ressymb,
                     '<img alt="" class="LC_noBorder" src="'.                      '<img alt="" class="LC_noBorder" src="'.
                     &Apache::loncommon::lonhttpdurl('/res/adm/pages/feedback.png').                      &Apache::loncommon::lonhttpdurl('/res/adm/pages/feedback.png').
                     '" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Send Feedback').'</span>',                      '" /><span class="LC_menubuttons_inline_text">'.&mt('Send Feedback').'</span>',
                     'sendmessageonly').                      'sendmessageonly').
                  '</span>';                   '</span>';
     return $output;      return $output;
Line 933  sub postingform_display { Line 941  sub postingform_display {
         $currnewattach,$currdelold,$group,$crstype) = @_;          $currnewattach,$currdelold,$group,$crstype) = @_;
     my $newattachmsg;      my $newattachmsg;
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
               'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',               'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
              'title' => 'Title',               'title' => 'Title',
              'podi' => 'Post Discussion',               'podi' => 'Post Discussion',
              'poan' => 'Post Anonymous Discussion',               'poan' => 'Post Anonymous Discussion',

Removed from v.1.370.2.1  
changed lines
  Added in v.1.370.2.1.2.1


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