Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.134 and 1.139.2.1

version 1.134, 2009/09/08 22:08:20 version 1.139.2.1, 2010/01/06 18:25:38
Line 509  sub movemsg { Line 509  sub movemsg {
 sub discourse {  sub discourse {
     my ($statushash) = @_;      my ($statushash) = @_;
     my ($result,$active,$previous,$future);      my ($result,$active,$previous,$future);
       my $crstype = &Apache::loncommon::course_type();
     my ($course_personnel,      my ($course_personnel,
  $current_members,   $current_members,
  $expired_members,   $expired_members,
Line 524  sub discourse { Line 525  sub discourse {
                                                                \%defaultUsers,                                                                 \%defaultUsers,
                                                                1,"selectedusers",1,'email')                                                                 1,"selectedusers",1,'email')
        ) {         ) {
          my $bcc_curr_hdr;
          if ($crstype eq 'Community') {
              $bcc_curr_hdr = &mt('Bcc: community participants with current access');
          } else {
              $bcc_curr_hdr = &mt('Bcc: course members with current access');
          }
        $result .= '<fieldset id="LC_activeusers"><legend>'         $result .= '<fieldset id="LC_activeusers"><legend>'
                  .&mt('Bcc: course members with current access')                   .$bcc_curr_hdr
                  .'</legend>'                   .'</legend>'
                  .'<form name="activeusers">';                   .'<form name="activeusers">';
        $result .= $tmptext.'</form></fieldset><br />';         $result .= $tmptext.'</form></fieldset><br />';
Line 539  sub discourse { Line 546  sub discourse {
                                                                \%defaultUsers,                                                                 \%defaultUsers,
                                                                1, "selectedusers",0,'email')                                                                 1, "selectedusers",0,'email')
        ) {         ) {
          my $bcc_prev_hdr;
          if ($crstype eq 'Community') {
              $bcc_prev_hdr = &mt('Bcc: community participants with expired access');
          } else {
              $bcc_prev_hdr = &mt('Bcc: course members with expired access');
          }
        $result .= '<fieldset id="LC_previoususers"><legend>'         $result .= '<fieldset id="LC_previoususers"><legend>'
                  .&mt('Bcc: course members with expired access')                   .$bcc_prev_hdr
                  .'</legend>'                   .'</legend>'
                  .'<form name="previoususers">';                   .'<form name="previoususers">';
        $result .= $tmptext.'</form></fieldset><br />';         $result .= $tmptext.'</form></fieldset><br />';
Line 555  sub discourse { Line 568  sub discourse {
                                                                \%defaultUsers,                                                                 \%defaultUsers,
                                                                1, "selectedusers",0,'email')                                                                 1, "selectedusers",0,'email')
        ) {         ) {
          my $bcc_future_hdr;
          if ($crstype eq 'Community') {
              $bcc_future_hdr = &mt('Bcc: community participants with future access');
          } else {
              $bcc_future_hdr = &mt('Bcc: course members with future access');
          }
   
        $result .= '<fieldset id="LC_futureusers"><legend>'         $result .= '<fieldset id="LC_futureusers"><legend>'
                  .&mt('Bcc: course members with future access')                   .$bcc_future_hdr
                  .'</legend>'                   .'</legend>'
                  .'<form name="futureusers">';                   .'<form name="futureusers">';
        $result .= $tmptext.'</form></fieldset>';         $result .= $tmptext.'</form></fieldset>';
Line 730  sub groupmail_header { Line 750  sub groupmail_header {
     }      }
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     if ($refarg) {      if ($refarg) {
           my $brtitle;
           if (&Apache::loncommon::course_type() eq 'Community') {
               $brtitle = 'View community groups';  
           } else {
               $brtitle = 'View course groups';
           }  
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>"/adm/coursegroups",              ({href=>"/adm/coursegroups",
               text=>"Groups",                text=>"Groups",
               title=>"View course groups"});                title=>$brtitle});
     }      }
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg",          ({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg",
Line 1268  sub compout { Line 1294  sub compout {
         &printheader($r,'/adm/email?compose=multiforward',          &printheader($r,'/adm/email?compose=multiforward',
              'Forwarding Multiple Messages');               'Forwarding Multiple Messages');
         if ($multiforward > 1) {          if ($multiforward > 1) {
             $r->print(&mt('Each of the <b>[quant,_1,message]</b> you checked'              $r->print(&mt('Each of the [quant,_1,message] you checked'
                          .' will be forwarded to the recipient(s) you select below.',$multiforward)                           .' will be forwarded to the recipient(s) you select below.'
                            ,'<b>'.$multiforward.'</b>')
                     .'<br />');                      .'<br />');
         } else {          } else {
             $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'<br />');              $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'<br />');
Line 1314  sub compout { Line 1341  sub compout {
     if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})      if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
  || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.   || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
     '/'.$env{'request.course.sec'})) {      '/'.$env{'request.course.sec'})) {
            my $crstype = &Apache::loncommon::course_type();
  my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");   my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
            my $rsstxt;
            if (&Apache::loncommon::course_type() eq 'Community') {
                $rsstxt = &mt('Include in community RSS newsfeed');
            } else {
                $rsstxt = &mt('Include in course RSS newsfeed');
            }
          $dispcrit=           $dispcrit=
  '<span class="LC_nobreak"><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'.</label>'.$crithelp.'&nbsp;&nbsp;'.&mt('Require return receipt?').'<label><input type="radio" name="sendbck" value="1" />'.&mt('Yes').'</label>&nbsp;&nbsp;<label><input type="radio" name="sendbck" value="" checked="checked" />'.&mt('No').'</label></span><br />'.   '<span class="LC_nobreak"><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'.</label>'.$crithelp.'&nbsp;&nbsp;'.&mt('Require return receipt?').'<label><input type="radio" name="sendbck" value="1" />'.&mt('Yes').'</label>&nbsp;&nbsp;<label><input type="radio" name="sendbck" value="" checked="checked" />'.&mt('No').'</label></span><br />'.
  '<label><input type="checkbox" name="permanent" /> '.   '<label><input type="checkbox" name="permanent" /> '.
 &mt('Send copy to permanent e-mail address (if known)').'</label><br />'.  &mt('Send copy to permanent e-mail address (if known)').'</label><br />'.
 '<label><input type="checkbox" name="rsspost" /> '.  '<label><input type="checkbox" name="rsspost" /> '.
   &mt('Include in course RSS newsfeed').'</label><br />';    $rsstxt.'</label><br />';
     }      }
     if ($broadcast ne 'group') {      if ($broadcast ne 'group') {
         if (&Apache::lonnet::allowed('dff',$env{'request.course.id'}) ||          if (&Apache::lonnet::allowed('dff',$env{'request.course.id'}) ||
             &Apache::lonnet::allowed('dff',$env{'request.course.id'}.              &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
                                      '/'.$env{'request.course.sec'})) {                                       '/'.$env{'request.course.sec'})) {
   
               my $rectxt;
               if (&Apache::loncommon::course_type() eq 'Community') {
                   $rectxt = &mt("Include in community's 'User records' for recipient(s)");
               } else {
                   $rectxt = &mt("Include in course's 'User records' for recipient(s)");
               }
   
             $dispcrit.='<label>'.              $dispcrit.='<label>'.
                        '<input type="checkbox" name="courserecord" value="1" /> '.                         '<input type="checkbox" name="courserecord" value="1" /> '.
                        &mt("Include in course's 'User records' for recipient(s)").                         $rectxt.
                        '</label><br />';                         '</label><br />';
         }          }
     }      }
Line 1785  sub retrieve_instructor_comments { Line 1826  sub retrieve_instructor_comments {
 }  }
   
 sub disfacetoface {  sub disfacetoface {
     my ($r,$user,$domain)=@_;      my ($r,$user,$domain,$target)=@_;
     my $target=$env{'form.grade_target'};   if ($target eq '') {
       my $target=$env{'form.grade_target'};
    }
     unless ($env{'request.course.id'}) { return; }      unless ($env{'request.course.id'}) { return; }
     if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})      if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
  && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.   && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
Line 1798  sub disfacetoface { Line 1841  sub disfacetoface {
  $env{'course.'.$env{'request.course.id'}.'.domain'},   $env{'course.'.$env{'request.course.id'}.'.domain'},
  $env{'course.'.$env{'request.course.id'}.'.num'},   $env{'course.'.$env{'request.course.id'}.'.num'},
                          '%255b'.$user.'%253a'.$domain.'%255d');                           '%255b'.$user.'%253a'.$domain.'%255d');
     my $result='';      my $result='<div>';
     foreach my $key (sort(keys(%records))) {      foreach my $key (sort(keys(%records))) {
         my %content=&Apache::lonmsg::unpackagemsg($records{$key});          my %content=&Apache::lonmsg::unpackagemsg($records{$key});
         next if ($content{'senderdomain'} eq '');          next if ($content{'senderdomain'} eq '');
  &Apache::lonfeedback::newline_to_br(\$content{'message'});      if (!&Apache::lonfeedback::contains_block_html($content{'message'})) {
    &Apache::lonfeedback::newline_to_br(\$content{'message'});
    }
         if ($content{'subject'}=~/^Record/) {          if ($content{'subject'}=~/^Record/) {
     $result.='<h3>'.&mt('Record').'</h3>';      $result.='<h3>'.&mt('Record').'</h3>';
         } elsif ($content{'subject'}=~/^Broadcast/) {          } elsif ($content{'subject'}=~/^Broadcast/) {
Line 1862  $content{'sendername'}.':'. Line 1907  $content{'sendername'}.':'.
  } else {   } else {
     $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');      $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');
  }   }
       } elsif ($target ne 'tex') {
          $r->print($result.'</div>');
     } else {      } else {
        $r->print($result);   $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result));
     }   }
 }  }
   
 sub general_message {  sub general_message {
Line 1977  sub examblock { Line 2024  sub examblock {
  $r->print('Not allowed');   $r->print('Not allowed');
  return;   return;
     }      }
     my $usertype = (&Apache::loncommon::course_type() eq 'Community') ? 'members'      my $usertype;
                                                               : 'students';      my $crstype = &Apache::loncommon::course_type();
       if ($crstype eq 'Community') {
           $usertype = 'members';
       } else {
    $usertype = 'students';
       }
       my $lctype = lc($crstype);
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
             'comb' => 'Communication Blocking',              'comb' => 'Communication Blocking',
             'cbds' => 'Communication blocking during scheduled exams',              'cbds' => 'Communication blocking during scheduled exams',
             'desc' => "You can use communication blocking to prevent $usertype enrolled in this course from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",              'desc' => "You can use communication blocking to prevent $usertype enrolled in this $lctype from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course or community, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",
              'mecb' => 'Modify existing communication blocking periods',               'mecb' => 'Modify existing communication blocking periods',
              'ncbc' => 'No communication blocks currently saved',               'ncbc' => 'No communication blocks currently saved',
              'stor' => 'Save',               'stor' => 'Save',
Line 2789  ENDJS Line 2842  ENDJS
 # =========================================================== Show the citation  # =========================================================== Show the citation
   
 sub displayresource {  sub displayresource {
       if (&Apache::loncommon::needs_gci_custom()) {
           return '';
       }
     my %content=@_;      my %content=@_;
 #  #
 # If the recipient is in the same course that the message was sent from and  # If the recipient is in the same course that the message was sent from and
Line 2834  sub header { Line 2890  sub header {
     if ($baseurl) {      if ($baseurl) {
  $extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />";   $extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />";
     }      }
     $r->print(&Apache::loncommon::start_page('Communication',      $r->print(&Apache::loncommon::start_page('Messages',
   $extra));    $extra));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs      $r->print(&Apache::lonhtmlcommon::breadcrumbs
       (($title?$title:'Send and Receive Messages')));        (($title?$title:'Send and display messages')));
 }  }
   
 # ---------------------------------------------------------------- Print header  # ---------------------------------------------------------------- Print header
Line 3247  sub handler { Line 3303  sub handler {
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"/adm/communicate",          ({href=>"/adm/communicate",
           text=>"Communication/Messages",            text=>"Messages",
           faq=>12,bug=>'Communication Tools',});            faq=>12,bug=>'Communication Tools',});
   
 # ------------------------------------------------------------------ Get Folder  # ------------------------------------------------------------------ Get Folder
Line 3352  sub handler { Line 3408  sub handler {
             $total ++;              $total ++;
         }          }
         &printheader($r,'','Marked Messages Read');          &printheader($r,'','Marked Messages Read');
         $r->print(&mt('Marked [_1] message(s) read',$total).'<p>');          $r->print(&mt('Marked [quant,_1,message] read',$total).'<p>');
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);          &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedunread') {      } elsif ($env{'form.markedaction'} eq 'markedunread') {
Line 3363  sub handler { Line 3419  sub handler {
             $total ++;              $total ++;
         }          }
         &printheader($r,'','Marked Messages Unread');          &printheader($r,'','Marked Messages Unread');
         $r->print(&mt('Marked [_1] message(s) unread',$total).'<p>');          $r->print(&mt('Marked [quant,_1,message] unread',$total).'<p>');
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);          &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedmove') {      } elsif ($env{'form.markedaction'} eq 'markedmove') {
Line 3387  sub handler { Line 3443  sub handler {
         }          }
     }      }
     if ($failed) {      if ($failed) {
         $r->print('<p class="LC_error">                  $r->print('<p class="LC_error">'
                           '.&mt('Failed to move [_1] message(s)',$failed).                           .&mt('Failed to move [quant,_1,message]',$failed)
       '</p>');                           .'</p>');
         $r->print('<p class="LC_error">'.          $r->print('<p class="LC_error">'.
             join("</p>\n<p class=\"LC_error\">",@failed_msg).              join("</p>\n<p class=\"LC_error\">",@failed_msg).
           "</p>\n");            "</p>\n");
     }      }
     $r->print(&mt('Moved [_1] message(s)',$total).'<p>');              $r->print('<p class="LC_success">'
                        .&mt('Moved [quant,_1,message]',$total)
                        .'</p>'
                        .'<p>');
         }          }
  &Apache::loncommunicate::menu($r);   &Apache::loncommunicate::menu($r);
  &disall($r,($folder?$folder:$dismode),$msgstatus);   &disall($r,($folder?$folder:$dismode),$msgstatus);
Line 3413  sub handler { Line 3472  sub handler {
  }   }
  &printheader($r,'','Deleted Messages');   &printheader($r,'','Deleted Messages');
  if ($failed) {   if ($failed) {
     $r->print('<p class="LC_error">              $r->print('<p class="LC_error">'
                           '.&mt('Failed to delete [_1] message(s)',$failed).                       .&mt('Failed to delete [quant,_1,message]',$failed)
       '</p>');                       .'</p>');
     $r->print('<p class="LC_error">'.      $r->print('<p class="LC_error">'.
       join("</p>\n<p class=\"LC_error\">",@failed_msg).        join("</p>\n<p class=\"LC_error\">",@failed_msg).
       "</p>\n");        "</p>\n");
  }   }
  $r->print(&mt('Deleted [_1] message(s)',$total).'<p>');          $r->print('<p class="LC_success">'
                    .&mt('Deleted [quant,_1,message]',$total)
                    .'</p>'
                    .'<p>');
  &Apache::loncommunicate::menu($r);   &Apache::loncommunicate::menu($r);
  &disall($r,($folder?$folder:$dismode),$msgstatus);   &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markunread'}) {      } elsif ($env{'form.markunread'}) {
Line 3512  sub handler { Line 3574  sub handler {
         my $showfolder = $env{'form.newfolder'};          my $showfolder = $env{'form.newfolder'};
  my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});   my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
         if ($makeresult eq 'ok') {          if ($makeresult eq 'ok') {
             $r->print(&mt('Folder "[_1]" created.',$showfolder).'<br />');              $r->print('<p class="LC_success">'
                        .&mt('Folder "[_1]" created.',$showfolder)
                        .'</p>');
         } else {          } else {
             $r->print(&mt('Creation failed.').' '.$makeresult.'<br />'.              $r->print('<p class="LC_warning">'
                       $warning);                       .&mt('Creation failed.').' '.$makeresult.'<br />'
                        .$warning
                        .'</p>');
             $showfolder = $folder;              $showfolder = $folder;
         }          }
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
Line 3527  sub handler { Line 3593  sub handler {
         my $showfolder = '';          my $showfolder = '';
         my $delresult = &deletefolder($folder);          my $delresult = &deletefolder($folder);
         if ($delresult eq 'ok') {          if ($delresult eq 'ok') {
             $r->print(&mt('Folder "[_1]" deleted.',$folder).'<br />');              $r->print('<p class="LC_success">'
                        .&mt('Folder "[_1]" deleted.',$folder)
                        .'</p>');
             $env{'form.folder'} = '';              $env{'form.folder'} = '';
         } else {          } else {
             $r->print(&mt('Deletion failed.').' '.$delresult.'<br />');              $r->print('<p class="LC_warning">'
                        .&mt('Deletion failed.').' '.$delresult
                        .'</p>');
             $showfolder = $folder;              $showfolder = $folder;
         }          }
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
Line 3540  sub handler { Line 3610  sub handler {
         my $showfolder = $env{'form.renamed'};          my $showfolder = $env{'form.renamed'};
         my $renresult = &renamefolder($folder);          my $renresult = &renamefolder($folder);
         if ($renresult eq 'ok') {          if ($renresult eq 'ok') {
             $r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'<br />');              $r->print('<p class="LC_success">'
                        .&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder)
                        .'</p>');
         } else {          } else {
             $r->print(&mt('Renaming failed.').' '.$renresult.'<br />');              $r->print('<p class="LC_warning">'
                        .&mt('Renaming failed.').' '.$renresult
                        .'</p>');
             $showfolder = $folder;              $showfolder = $folder;
         }          }
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);

Removed from v.1.134  
changed lines
  Added in v.1.139.2.1


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