Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.124 and 1.138

version 1.124, 2009/05/11 16:51:27 version 1.138, 2009/11/04 18:30:17
Line 113  use lib '/home/httpd/lib/perl/'; Line 113  use lib '/home/httpd/lib/perl/';
 use LONCAPA;  use LONCAPA;
   
 # Querystring component with sorting type  # Querystring component with sorting type
 my $sqs;  my $sqs='';
 my $startdis;  my $startdis='';
   
 # ============================================================ List all folders  # ============================================================ List all folders
   
Line 173  sub folderlist { Line 173  sub folderlist {
   
     $formhash{'select_form_order'} = ['','critical',@userorder,'sent','trash'];      $formhash{'select_form_order'} = ['','critical',@userorder,'sent','trash'];
     my $output = qq|<script type="text/javascript">      my $output = qq|<script type="text/javascript">
   // <![CDATA[
 function folder_choice(targetform,caller) {  function folder_choice(targetform,caller) {
     var permfolders_keys = new Array('$permlistkeys');      var permfolders_keys = new Array('$permlistkeys');
     var permfolders_vals = new Array('$permlistvals');      var permfolders_vals = new Array('$permlistvals');
Line 214  function folder_choice(targetform,caller Line 215  function folder_choice(targetform,caller
         }          }
     }      }
 }  }
   // ]]>
 </script>|;  </script>|;
     my %show = ('select_form_order' => [10,20,50,100,200],      my %show = ('select_form_order' => [10,20,50,100,200],
  map {$_=>$_} (10,20,50,100,200));   map {$_=>$_} (10,20,50,100,200));
Line 239  function folder_choice(targetform,caller Line 241  function folder_choice(targetform,caller
      <td align="center"><b>'.$lt{'actn'}.'</b><br />'.       <td align="center"><b>'.$lt{'actn'}.'</b><br />'.
          &Apache::loncommon::select_form('view','folderaction',%actions).'           &Apache::loncommon::select_form('view','folderaction',%actions).'
      </td><td><br />'.       </td><td><br />'.
     '<input type="button" value="'.$lt{'go'}.'" onClick="javascript:folder_choice(this.form,'."'change'".');" />      '<input type="button" value="'.$lt{'go'}.'" onclick="javascript:folder_choice(this.form,'."'change'".');" />
      </td>       </td>
     </tr>      </tr>
    </table>     </table>
Line 247  function folder_choice(targetform,caller Line 249  function folder_choice(targetform,caller
   <td align="right">    <td align="right">
    <table><tr><td><br />     <table><tr><td><br />
     <input type="button" value="'.&mt('New Folder').      <input type="button" value="'.&mt('New Folder').
     '" onClick="javascript:folder_choice(this.form,'."'new'".');" /></td>'.      '" onclick="javascript:folder_choice(this.form,'."'new'".');" /></td>'.
     '<td align="center"><b>'.&mt('Name').'</b><br />'.      '<td align="center"><b>'.&mt('Name').'</b><br />'.
     '<input type="text" size="15" name="newfolder" value="" />      '<input type="text" size="15" name="newfolder" value="" />
     </td></tr></table>      </td></tr></table>
Line 295  sub scrollbuttons { Line 297  sub scrollbuttons {
     }      }
     return      return
    '<b>'.&mt('Page').'</b>: '.      '<b>'.&mt('Page').'</b>: '. 
    '<input type="submit" name="firstview" value="'.&mt('First').'" />'.     '<input type="submit" name="firstview" value="|&lt;" />'.
    '<input type="submit" name="prevview" value="'.&mt('Previous').'" />'.     '<input type="submit" name="prevview" value="&lt;" />'.
    '<input type="text" size="5" name="startdis" value="'.$start.'" onChange="this.form.submit()" /> of '.$maxdis.     ' <input type="text" size="5" name="startdis" value="'.$start.'" onchange="this.form.submit()" /> / '.$maxdis.' '.
    '<input type="submit" name="nextview" value="'.&mt('Next').'" />'.     '<input type="submit" name="nextview" value="&gt;" />'.
    '<input type="submit" name="lastview" value="'.&mt('Last').'" /><br />'.     '<input type="submit" name="lastview" value="&gt;|" /><br />'.
    &mt('<b>[_1] messages</b>: showing messages [_2] through [_3] of [_4].',$status,$first,$finish,$total).'</form>';     &mt('<b>[_1] messages</b>: showing messages [_2] through [_3] of [_4].',$status,$first,$finish,$total).'</form>';
 }  }
 # =============================================================== Status Change  # =============================================================== Status Change
Line 507  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 522  sub discourse { Line 525  sub discourse {
                                                                \%defaultUsers,                                                                 \%defaultUsers,
                                                                1,"selectedusers",1,'email')                                                                 1,"selectedusers",1,'email')
        ) {         ) {
        $result .= '<fieldset id="LC_activeusers"><legend><b>'.&mt('Bcc: course members with current access').'</b></legend><form name="activeusers">';         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>'
                    .$bcc_curr_hdr
                    .'</legend>'
                    .'<form name="activeusers">';
        $result .= $tmptext.'</form></fieldset><br />';         $result .= $tmptext.'</form></fieldset><br />';
        if (ref($statushash) eq 'HASH') {         if (ref($statushash) eq 'HASH') {
            $statushash->{'active'} = 1;             $statushash->{'active'} = 1;
Line 534  sub discourse { Line 546  sub discourse {
                                                                \%defaultUsers,                                                                 \%defaultUsers,
                                                                1, "selectedusers",0,'email')                                                                 1, "selectedusers",0,'email')
        ) {         ) {
        $result .= '<fieldset id="LC_previoususers"><legend><b>'.&mt('Bcc: course members with expired access').'</b></legend><form name="previoususers">';         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>'
                    .$bcc_prev_hdr
                    .'</legend>'
                    .'<form name="previoususers">';
        $result .= $tmptext.'</form></fieldset><br />';         $result .= $tmptext.'</form></fieldset><br />';
        if (ref($statushash) eq 'HASH') {         if (ref($statushash) eq 'HASH') {
            $statushash->{'previous'} = 1;             $statushash->{'previous'} = 1;
Line 547  sub discourse { Line 568  sub discourse {
                                                                \%defaultUsers,                                                                 \%defaultUsers,
                                                                1, "selectedusers",0,'email')                                                                 1, "selectedusers",0,'email')
        ) {         ) {
        $result .= '<fieldset id="LC_futureusers"><legend><b>'.&mt('Bcc: course members with future access').'</b></legend><form name="previoususers">';         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>'
                    .$bcc_future_hdr
                    .'</legend>'
                    .'<form name="futureusers">';
        $result .= $tmptext.'</form></fieldset>';         $result .= $tmptext.'</form></fieldset>';
        if (ref($statushash) eq 'HASH') {         if (ref($statushash) eq 'HASH') {
            $statushash->{'future'} = 1;             $statushash->{'future'} = 1;
Line 622  sub disgroup { Line 653  sub disgroup {
                     if (ref($access_status) eq 'HASH') {                      if (ref($access_status) eq 'HASH') {
                         $access_status->{$status} = $$numitems{$status};                          $access_status->{$status} = $$numitems{$status};
                     }                      }
                     $r->print('<fieldset><legend><b>'.$lt{$status}.                      $r->print('<fieldset>'.
                               '</b></legend><form name="'.$formname.'">'.                                '<legend>'.$lt{$status}.'</legend>'.
                                 '<form name="'.$formname.'">'.
                               '<span class="LC_nobreak">'.                                '<span class="LC_nobreak">'.
                               '<input type="button" value="'.&mt('Check All').'" '.                                '<input type="button" value="'.&mt('Check All').'" '.
                               'onclick="javascript:toggleAll('."this.form,'check'".')" />'.                                'onclick="javascript:toggleAll('."this.form,'check'".')" />'.
Line 670  sub disgroup { Line 702  sub disgroup {
 sub group_check_uncheck {  sub group_check_uncheck {
     my $output = qq|      my $output = qq|
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 function toggleAll(form,action) {  function toggleAll(form,action) {
     if (typeof(form.selectedusers_forminput.length)=="undefined") {      if (typeof(form.selectedusers_forminput.length)=="undefined") {
          if (action == 'check') {           if (action == 'check') {
Line 687  function toggleAll(form,action) { Line 720  function toggleAll(form,action) {
         }          }
     }      }
 }  }
   // ]]>
 </script>  </script>
     |;      |;
 }  }
Line 716  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 981  sub disfolder { Line 1021  sub disfolder {
     my $jscript = &Apache::loncommon::check_uncheck_jscript();      my $jscript = &Apache::loncommon::check_uncheck_jscript();
     $r->print(<<ENDDISHEADER);      $r->print(<<ENDDISHEADER);
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
     $jscript      $jscript
   
     function validate_checkedaction() {      function validate_checkedaction() {
Line 1009  sub disfolder { Line 1050  sub disfolder {
         }          }
         document.disall.submit();          document.disall.submit();
     }      }
   // ]]>
 </script>  </script>
 ENDDISHEADER  ENDDISHEADER
   
     my $fsqs='&folder='.$folder;      my $fsqs='&amp;folder='.$folder;
     my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);      my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
     my $totalnumber=$#temp+1;      my $totalnumber=$#temp+1;
     if ($totalnumber < 1) {      if ($totalnumber < 1) {
Line 1045  ENDDISHEADER Line 1086  ENDDISHEADER
     $r->print('<form method="post" name="disall" action="/adm/email">'.      $r->print('<form method="post" name="disall" action="/adm/email">'.
       '<table class="LC_mail_list"><tr><th colspan="1">&nbsp;</th><th>');        '<table class="LC_mail_list"><tr><th colspan="1">&nbsp;</th><th>');
     if ($env{'form.sortedby'} eq "revdate") {      if ($env{'form.sortedby'} eq "revdate") {
  $r->print('<a href = "?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');
     } else {      } else {
  $r->print('<a href = "?sortedby=revdate'.$fsqs.'">'.&mt('Date').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=revdate'.$fsqs.'">'.&mt('Date').'</a></th>');
     }      }
     $r->print('<th>');      $r->print('<th>');
     if ($env{'form.sortedby'} eq "revuser") {      if ($env{'form.sortedby'} eq "revuser") {
  $r->print('<a href = "?sortedby=user'.$fsqs.'">'.&mt('Username').'</a>');   $r->print('<a href = "/adm/email?sortedby=user'.$fsqs.'">'.&mt('Username').'</a>');
     } else {      } else {
  $r->print('<a href = "?sortedby=revuser'.$fsqs.'">'.&mt('Username').'</a>');   $r->print('<a href = "/adm/email?sortedby=revuser'.$fsqs.'">'.&mt('Username').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revdomain") {      if ($env{'form.sortedby'} eq "revdomain") {
  $r->print('<a href = "?sortedby=domain'.$fsqs.'">'.&mt('Domain').'</a>');   $r->print('<a href = "/adm/email?sortedby=domain'.$fsqs.'">'.&mt('Domain').'</a>');
     } else {      } else {
  $r->print('<a href = "?sortedby=revdomain'.$fsqs.'">'.&mt('Domain').'</a>');   $r->print('<a href = "/adm/email?sortedby=revdomain'.$fsqs.'">'.&mt('Domain').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revsubject") {      if ($env{'form.sortedby'} eq "revsubject") {
  $r->print('<a href = "?sortedby=subject'.$fsqs.'">'.&mt('Subject').'</a>');   $r->print('<a href = "/adm/email?sortedby=subject'.$fsqs.'">'.&mt('Subject').'</a>');
     } else {      } else {
     $r->print('<a href = "?sortedby=revsubject'.$fsqs.'">'.&mt('Subject').'</a>');      $r->print('<a href = "/adm/email?sortedby=revsubject'.$fsqs.'">'.&mt('Subject').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revcourse") {      if ($env{'form.sortedby'} eq "revcourse") {
         $r->print('<a href = "?sortedby=course'.$fsqs.'">'.&mt('Course').'</a>');          $r->print('<a href = "/adm/email?sortedby=course'.$fsqs.'">'.&mt('Course').'</a>');
     } else {      } else {
         $r->print('<a href = "?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>');          $r->print('<a href = "/adm/email?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revstatus") {      if ($env{'form.sortedby'} eq "revstatus") {
  $r->print('<a href = "?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');
     } else {      } else {
       $r->print('<a href = "?sortedby=revstatus'.$fsqs.'">'.&mt('Status').'</a></th>');        $r->print('<a href = "/adm/email?sortedby=revstatus'.$fsqs.'">'.&mt('Status').'</a></th>');
     }      }
     $r->print("</tr>\n");      $r->print("</tr>\n");
   
     my $suffix = &Apache::lonmsg::foldersuffix($folder);      my $suffix = &Apache::lonmsg::foldersuffix($folder);
     my $count = 0;      my $count = $firstdis;
     for (my $n=$firstdis;$n<=$lastdis;$n++) {      for (my $n=$firstdis;$n<=$lastdis;$n++) {
  my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,   my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,
     $description,$recv_name,$recv_domain)=       $description,$recv_name,$recv_domain)= 
Line 1127  ENDDISHEADER Line 1168  ENDDISHEADER
             foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {              foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {
                 $r->print('<td>'.(($status eq 'new')?'<b>':'').                  $r->print('<td>'.(($status eq 'new')?'<b>':'').
                           '<a href="/adm/email?display='.$origID.$sqs.'">'.                            '<a href="/adm/email?display='.$origID.$sqs.'">'.
                           $item.(($status eq 'new')?'</b>':'').'</td>');                            $item.(($status eq 'new')?'</b>':'').'</a></td>');
             }              }
             my $showstatus;              my $showstatus;
             my %statushash = &get_msgstatus_types();              my %statushash = &get_msgstatus_types();
Line 1203  sub blocked_in_folder { Line 1244  sub blocked_in_folder {
     my $finishblock = &Apache::lonlocal::locallocaltime($endblock);      my $finishblock = &Apache::lonlocal::locallocaltime($endblock);
     my $output = '<br /><br />'.      my $output = '<br /><br />'.
                   &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock);                    &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock);
     $output .= &Apache::loncommon::build_block_table($startblock,$endblock,      #$output .= &Apache::loncommon::build_block_table($startblock,$endblock,
                                                      $setters);      #                                                 $setters);
       
       my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
       $output .="<br /><br />".$blocktext;
   
     return $output;      return $output;
 }  }
   
Line 1249  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 1295  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 1346  sub compout { Line 1406  sub compout {
             $sendmode = '<input type="hidden" name="sendmode" value="group" />'."\n";              $sendmode = '<input type="hidden" name="sendmode" value="group" />'."\n";
             $broadcast_js = qq|              $broadcast_js = qq|
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 function courseRecipients() {  function courseRecipients() {
 |;  |;
         foreach my $type (keys(%access_status)) {          foreach my $type (keys(%access_status)) {
Line 1372  function courseRecipients() { Line 1433  function courseRecipients() {
         $broadcast_js .= qq|          $broadcast_js .= qq|
     return;      return;
 }  }
   // ]]>
 </script>  </script>
   
 |;  |;
Line 1415  function courseRecipients() { Line 1477  function courseRecipients() {
         my $jscript = &Apache::loncommon::check_uncheck_jscript();          my $jscript = &Apache::loncommon::check_uncheck_jscript();
         $r->print(<<"ENDREPSCRIPT");          $r->print(<<"ENDREPSCRIPT");
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 $jscript  $jscript
   // ]]>
 </script>  </script>
 ENDREPSCRIPT  ENDREPSCRIPT
     }      }
Line 1684  sub additional_rec_row { Line 1748  sub additional_rec_row {
     my $bcc = &mt('Bcc:');      my $bcc = &mt('Bcc:');
     my $exmpl = &mt('username:domain,username:domain,...');       my $exmpl = &mt('username:domain,username:domain,...'); 
     my $output = <<"ENDADD";      my $output = <<"ENDADD";
 <tr><td colspan="3"><fieldset id="LC_additionalrecips"><legend><b>$lt->{'ad'}</b> <tt>($exmpl)</tt>:</legend><table>  <tr><td colspan="3"><fieldset id="LC_additionalrecips"><legend>$lt->{'ad'} <tt>($exmpl)</tt></legend><table>
 <tr><td>&nbsp;</td><td>$lt->{'to'}</td><td><input type="text" size="50" name="additionalrec_to" /></td></tr>  <tr><td>&nbsp;</td><td>$lt->{'to'}</td><td><input type="text" size="50" name="additionalrec_to" /></td></tr>
 <tr><td>&nbsp;</td><td>$cc</td><td><input type="text" size="50" name="additionalrec_cc" /></td></tr>   <tr><td>&nbsp;</td><td>$cc</td><td><input type="text" size="50" name="additionalrec_cc" /></td></tr> 
 <tr><td>&nbsp;</td><td>$bcc</td><td><input type="text" size="50" name="additionalrec_bcc" /></td></tr></table></fieldset></td></tr>  <tr><td>&nbsp;</td><td>$bcc</td><td><input type="text" size="50" name="additionalrec_bcc" /></td></tr></table></fieldset></td></tr>
Line 1762  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 1775  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 '');
Line 1839  $content{'sendername'}.':'. Line 1905  $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 1867  sub facetoface { Line 1935  sub facetoface {
  return;   return;
     }      }
     my $crstype = &Apache::loncommon::course_type();      my $crstype = &Apache::loncommon::course_type();
     my $leaders = ($crstype eq 'Group') ? 'coordinators and leaders'      my $leaders = ($crstype eq 'Community') ? 'coordinators and leaders'
                                         : 'faculty and staff';                                              : 'faculty and staff';
     &printheader($r,      &printheader($r,
  '/adm/email?recordftf=query',   '/adm/email?recordftf=query',
  "User Notes, Face-to-Face, Critical Messages, Broadcast Messages, Archived Messages");   "User Notes, Face-to-Face, Critical Messages, Broadcast Messages, Archived Messages");
Line 1954  sub examblock { Line 2022  sub examblock {
  $r->print('Not allowed');   $r->print('Not allowed');
  return;   return;
     }      }
     my $usertype = (&Apache::loncommon::course_type() eq 'Group') ? '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 2256  sub displaymessage { Line 2330  sub displaymessage {
     my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);      my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
     if ( $blocked{$msgid} eq 'ON' ) {      if ( $blocked{$msgid} eq 'ON' ) {
         &printheader($r,'/adm/email',&mt('Display a Message'));          &printheader($r,'/adm/email',&mt('Display a Message'));
         $r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.'));          #$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.'));
         &build_block_table($r,$startblock,$endblock,\%setters);          #&build_block_table($r,$startblock,$endblock,\%setters);
           my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
           $r->print("<br />".$blocktext);
         return;          return;
     }      }
     if ($msgstatus eq '') {      if ($msgstatus eq '') {
Line 2323  sub displaymessage { Line 2399  sub displaymessage {
                           .&mt('Next')                            .&mt('Next')
                           .'</a>');                            .'</a>');
     }      }
 # Print functions  
     my $legendtext='<span class="LC_mail_functions">'  
                    .&mt('Functions')  
                    .'</span>';  
     $r->print('<div class="LC_left_float">'  
                      .&Apache::lontemplate::start_functionslist($legendtext)  
     );  
     foreach my $item (@functionlist) {  
         $r->print(&Apache::lontemplate::item_functionslist($item));  
     }  
     $r->print(&Apache::lontemplate::end_functionslist()  
              .'</div>'  
     );  
   
 # Prepare available actions  # Prepare available actions
     my $symb;      my $symb;
Line 2344  sub displaymessage { Line 2407  sub displaymessage {
     } elsif (defined($content{'baseurl'})) {      } elsif (defined($content{'baseurl'})) {
         $symb=&Apache::lonnet::symbread($content{'baseurl'});          $symb=&Apache::lonnet::symbread($content{'baseurl'});
     }      }
     if ($env{'user.adv'}) {  
         my @actionlist;          my @actionlist;
       if ($env{'user.adv'}) {
   
  if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {   if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
  push(@actionlist,&Apache::loncommon::track_student_link(   push(@actionlist,&Apache::loncommon::track_student_link(
Line 2370  sub displaymessage { Line 2433  sub displaymessage {
                                      ,$symb                                       ,$symb
                                      ,'check'));                                       ,'check'));
  }   }
       }
   
 # Print actions  # Print functionlist and actionlist in page header
           my $functions='<div class="LC_columnSection">';
   
           # Functionlist
           $functions.=&Apache::lonhtmlcommon::start_funclist();
           foreach my $item (@functionlist) {
               $functions.=&Apache::lonhtmlcommon::add_item_funclist($item);
           }
           $functions .= &Apache::lonhtmlcommon::end_funclist();
   
           # Actionlist
         if (@actionlist) {          if (@actionlist) {
             $legendtext=&mt('[_1]Currently available actions[_2] (will open extra window):'              my $legendtext=&mt('Currently available actions (will open extra window)');
                            ,'<span class="LC_mail_functions">','</span>');              $functions.=&Apache::lonhtmlcommon::start_funclist($legendtext);
             $r->print('<div class="LC_left_float">'  
                      .&Apache::lontemplate::start_functionslist($legendtext)  
             );  
             foreach my $item (@actionlist) {              foreach my $item (@actionlist) {
                 $r->print(&Apache::lontemplate::item_functionslist($item));                  $functions.=&Apache::lonhtmlcommon::add_item_funclist($item);
             }              }
             $r->print(&Apache::lontemplate::end_functionslist()              $functions.=&Apache::lonhtmlcommon::end_funclist();
                      .'</div>'  
             );  
         }          }
     }  
           $functions.='</div>';
           $r->print(&Apache::loncommon::head_subbox($functions));
   
   
     my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients);      my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients);
     if ($content{'recipid'}) {      if ($content{'recipid'}) {
Line 2732  sub recipients_link { Line 2804  sub recipients_link {
             $body =~ s{\n}{}g;              $body =~ s{\n}{}g;
             $r->print(<<ENDJS);              $r->print(<<ENDJS);
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 function showBroadcastList() {  function showBroadcastList() {
     var caller = this;      var caller = this;
     var newWindow = null;      var newWindow = null;
Line 2754  function writeWin(caller) { Line 2827  function writeWin(caller) {
     caller.document.close();      caller.document.close();
     caller.focus();      caller.focus();
 }  }
   // ]]>
 </script>  </script>
   
 ENDJS  ENDJS
Line 2812  sub header { Line 2885  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 3213  sub handler { Line 3286  sub handler {
          'recordftf','sortedby','block','folder','startdis','interdis',           'recordftf','sortedby','block','folder','startdis','interdis',
  'showcommentbaseurl','dismode','group','subject','text','ref',   'showcommentbaseurl','dismode','group','subject','text','ref',
          'msgstatus']);           'msgstatus']);
     $sqs='&sortedby='.$env{'form.sortedby'};      $sqs='&amp;sortedby='.$env{'form.sortedby'};
   
 # ------------------------------------------------------ They checked for email  # ------------------------------------------------------ They checked for email
     unless ($env{'form.block'}) {      unless ($env{'form.block'}) {
Line 3225  sub handler { Line 3298  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 3234  sub handler { Line 3307  sub handler {
     unless ($folder) {       unless ($folder) { 
  $folder='';    $folder=''; 
     } else {      } else {
  $sqs.='&folder='.&escape($folder);   $sqs.='&amp;folder='.&escape($folder);
     }      }
 # ------------------------------------------------------------ Get Display Mode  # ------------------------------------------------------------ Get Display Mode
   
Line 3266  sub handler { Line 3339  sub handler {
  $startdis++;   $startdis++;
     }      }
     my $postedstartdis=$startdis+1;      my $postedstartdis=$startdis+1;
     $sqs.='&startdis='.$postedstartdis;      $sqs.='&amp;startdis='.$postedstartdis;
   
 # --------------------------------------------------------------- Render Output  # --------------------------------------------------------------- Render Output
   
Line 3330  sub handler { Line 3403  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 3341  sub handler { Line 3414  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 3365  sub handler { Line 3438  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 3391  sub handler { Line 3467  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 3490  sub handler { Line 3569  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 3505  sub handler { Line 3588  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 3518  sub handler { Line 3605  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.124  
changed lines
  Added in v.1.138


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