Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.46 and 1.52

version 1.46, 2006/12/06 23:44:33 version 1.52, 2006/12/17 15:52:37
Line 74  email program, so they have full access Line 74  email program, so they have full access
 interface, or other features they may wish to use in response to the  interface, or other features they may wish to use in response to the
 student's query.  student's query.
   
 =item * B<Blocking>: LON-CAPA can block display of e-mails that are   =item * B<Blocking>: LON-CAPA can block selected communication 
 sent to a student during an online exam. A course coordinator or  features for students during an online exam. A course coordinator or
 instructor can set an open and close date/time for scheduled online  instructor can set an open and close date/time for scheduled online
 exams in a course. If a user uses the LON-CAPA internal messaging   exams in a course. If a user uses the LON-CAPA internal messaging 
 system to display e-mails during the scheduled blocking event,    system to display e-mails during the scheduled blocking event,  
Line 143  sub folderlist { Line 143  sub folderlist {
                 fold => 'Folder',                  fold => 'Folder',
                 show => 'Show',                  show => 'Show',
                 go   => 'Go',                  go   => 'Go',
                   nnff => 'New Name for Folder',
                   newn => 'New Name',
                   thfm => 'The folder may not be renamed',
                   fmnb => 'folder may not be renamed as it is a folder provided by the system.',
                   asth => 'as this name is already in use for a system-provided or user-defined folder.',
                   the => 'The',
                   tnfm => 'The new folder may not be named',
   
     );      );
   
     my %actions = &Apache::lonlocal::texthash(      my %actions = &Apache::lonlocal::texthash(
Line 165  sub folderlist { Line 173  sub folderlist {
     my %userfolders;      my %userfolders;
   
     foreach my $key (keys(%gotfolders)) {      foreach my $key (keys(%gotfolders)) {
           $key =~ s/(['"])/\$1/g;
         $userfolders{$key} = $key;          $userfolders{$key} = $key;
     }      }
     my @userorder = sort(keys(%userfolders));      my @userorder = sort(keys(%userfolders));
Line 182  function folder_choice(targetform,caller Line 191  function folder_choice(targetform,caller
         if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') {          if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') {
             for (var i=0; i<permfolders_keys.length; i++) {              for (var i=0; i<permfolders_keys.length; i++) {
                 if (permfolders_keys[i] == targetform.folder.value) {                  if (permfolders_keys[i] == targetform.folder.value) {
                     alert("The '"+permfolders_vals[i]+"' folder may not be renamed as it is a mail folder provided by the system.");                      alert("$lt{'the'} '"+permfolders_vals[i]+"' $lt{'fmnb'}");
                     return;                      return;
                 }                  }
             }              }
             var foldername=prompt('New Name for Folder','New Name');              var foldername=prompt('$lt{'nnff'}','$lt{'newn'}');
             if (foldername) {              if (foldername) {
                 targetform.renamed.value=foldername;                  targetform.renamed.value=foldername;
                 for (var i=0; i<allfolders.length; i++) {                  for (var i=0; i<allfolders.length; i++) {
                     if (allfolders[i] == foldername) {                      if (allfolders[i] == foldername) {
                         alert("The folder may not be renamed '"+foldername+"' as this name is already in use for a system-provided or user-defined folder.");                          alert("$lt{'thfm'} '"+foldername+"' $lt{'asth'}");
                         return;                          return;
                     }                      }
                 }                  }
Line 207  function folder_choice(targetform,caller Line 216  function folder_choice(targetform,caller
         if (newname) {          if (newname) {
             for (var i=0; i<allfolders.length; i++) {              for (var i=0; i<allfolders.length; i++) {
                 if (allfolders[i] == newname) {                  if (allfolders[i] == newname) {
                     alert("The new folder may not be named '"+newname+"' as this name is already in use for a system-provided or user-defined folder.");                      alert("$lt{'tnfm'} '"+newname+"' $lt{'asth'}");
                     return;                      return;
                 }                  }
             }              }
Line 224  function folder_choice(targetform,caller Line 233  function folder_choice(targetform,caller
    <table border="0" cellspacing="2" cellpadding="2">     <table border="0" cellspacing="2" cellpadding="2">
     <tr>      <tr>
      <td align="center"><b>'.$lt{'fold'}.'</b><br />'."\n".       <td align="center"><b>'.$lt{'fold'}.'</b><br />'."\n".
  &Apache::loncommon::select_form($folder,'folder',%formhash).'           &Apache::loncommon::select_form($folder,'folder',%formhash).'
      </td>       </td>
      <td align="center"><b>'.$lt{'show'}.'</b><br />       <td align="center"><b>'.$lt{'show'}.'</b><br />
       <select name="interdis">'.        <select name="interdis">'.
       join("\n",map { '<option value="'.$_.'"'.            join("\n",map { '<option value="'.$_.'"'.
  ($_==$interdis?' selected="selected"':'').'>'.$_.'</option>' }        ($_==$interdis?' selected="selected"':'').'>'.$_.'</option>' 
    (10,20,50,100,200)).'</select>   }
          (10,20,50,100,200)).'</select>
      </td>       </td>
      <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>
Line 244  function folder_choice(targetform,caller Line 254  function folder_choice(targetform,caller
    <table><tr><td><br />     <table><tr><td><br />
     <input type="button" value="'.&mt('Make New Folder').      <input type="button" value="'.&mt('Make New Folder').
     '" onClick="javascript:folder_choice(this.form,'."'new'".');" /></td>'.      '" onClick="javascript:folder_choice(this.form,'."'new'".');" /></td>'.
     '<td align="center"><b>'.&mt('New Folder').'<br />'.      '<td align="center"><b>'.&mt('New Folder').'</b><br />'.
     '<input type="text" size="15" name="newfolder" value="" />      '<input type="text" size="15" name="newfolder" value="" />
     </td></tr></table>      </td></tr></table>
   </td>    </td>
Line 252  function folder_choice(targetform,caller Line 262  function folder_choice(targetform,caller
 </table>'."\n".  </table>'."\n".
     '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.      '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.
     '<input type="hidden" name="renamed" value="" />'.      '<input type="hidden" name="renamed" value="" />'.
     ($folder=~/^(new|critical)/?'</form>':'');          ($folder=~/^(new|critical)/?'</form>':'');
     return $output;      return $output;
 }  }
   
 sub get_permanent_folders {  sub get_permanent_folders {
     my %permfolders = &Apache::lonlocal::texthash (      my %permfolders = 
                                 ''         => 'INBOX',   &Apache::lonlocal::texthash(''         => 'INBOX',
                                 'trash'    => 'TRASH',      'trash'    => 'TRASH',
                                 'new'      => 'New Messages Only',      'new'      => 'New Messages Only',
                                 'critical' => 'Critical',      'critical' => 'Critical',
                                 'sent'     => 'Sent Messages',      'sent'     => 'Sent Messages',
     );      );
     return %permfolders;      return %permfolders;
 }  }
   
Line 323  sub makefolder { Line 333  sub makefolder {
         while (defined($userfolders{$folder_id})) {          while (defined($userfolders{$folder_id})) {
             $folder_id ++;              $folder_id ++;
         }          }
         my %folderinfo = (          my %folderinfo = ( id      => $folder_id,
                            id => $folder_id,                             created => time, );
                            created => time,  
                          );  
         $outcome =            $outcome =  
         &Apache::lonnet::put('email_folders',{$newfolder => \%folderinfo,      &Apache::lonnet::put('email_folders',{$newfolder => \%folderinfo,
                                              "\0".'idcount' => $folder_id});    "\0".'idcount' => $folder_id});
         my $releaseresult = &release_msgfolder_lock();          my $releaseresult = &release_msgfolder_lock();
         if ($releaseresult ne 'ok') {          if ($releaseresult ne 'ok') {
             $warning = $releaseresult;              $warning = $releaseresult;
         }          }
     } else {      } else {
         $outcome = 'Error - could not obtain lock on email folders record.';          $outcome = 
       &mt('Error - could not obtain lock on email folders record.');
     }      }
     return ($outcome,$warning);      return ($outcome,$warning);
 }  }
Line 386  sub renamefolder { Line 395  sub renamefolder {
     if (ref($userfolders{$folder}) eq 'HASH') {      if (ref($userfolders{$folder}) eq 'HASH') {
         %folderinfo = %{$userfolders{$folder}};          %folderinfo = %{$userfolders{$folder}};
     } else {      } else {
         %folderinfo = (          %folderinfo = ( id      => $folder,
                              id => $folder,                          created => $userfolders{$folder},);
                         created => $userfolders{$folder},  
                       );  
     }      }
     my $outcome =      my $outcome =
      &Apache::lonnet::put('email_folders',{$newname => \%folderinfo});       &Apache::lonnet::put('email_folders',{$newname => \%folderinfo});
Line 401  sub renamefolder { Line 408  sub renamefolder {
   
 sub get_msgfolder_lock {  sub get_msgfolder_lock {
     # get lock for mail folder counter.      # get lock for mail folder counter.
     my $lockhash = {      my $lockhash = { "\0".'lock_counter' => time, };
                   "\0".'lock_counter' => time,  
                    };  
     my $tries = 0;      my $tries = 0;
     my $gotlock = &Apache::lonnet::newput('email_folders',$lockhash);      my $gotlock = &Apache::lonnet::newput('email_folders',$lockhash);
     while (($gotlock ne 'ok') && $tries <3) {      while (($gotlock ne 'ok') && $tries <3) {
         $tries ++;          $tries ++;
         sleep 1;          sleep(1);
         $gotlock = &Apache::lonnet::newput('email_folders',$lockhash);          $gotlock = &Apache::lonnet::newput('email_folders',$lockhash);
     }      }
     return $gotlock;      return $gotlock;
Line 573  sub disgroup { Line 578  sub disgroup {
                     $result.='<td valign="top">'.                      $result.='<td valign="top">'.
                              '<fieldset><legend><b>'.$lt{$status}.                               '<fieldset><legend><b>'.$lt{$status}.
                              '</b></legend><nobr>'.                               '</b></legend><nobr>'.
                              '<input type="button" value="check all" '.                               '<input type="button" value="'.&mt('Check All').'" '.
                              'onclick="javascript:toggleAll('."'".$status."','check'".')" />'.                               'onclick="javascript:toggleAll('."'".$status."','check'".')" />'.
                              '&nbsp;&nbsp;'.                               '&nbsp;&nbsp;'.
                              '<input type="button" value="uncheck all" '.                               '<input type="button" value="'.&mt('Uncheck All').'" '.
                              'onclick="javascript:toggleAll('."'".$status."','uncheck'".')" />'.                               'onclick="javascript:toggleAll('."'".$status."','uncheck'".')" />'.
                              '</nobr></fieldset><br />'.                               '</nobr></fieldset><br />'.
                              &Apache::loncommon::start_data_table().                               &Apache::loncommon::start_data_table().
Line 847  sub get_course_desc { Line 852  sub get_course_desc {
             if (defined($env{'course.'.$fromcid.'.description'})) {              if (defined($env{'course.'.$fromcid.'.description'})) {
                 $description = $env{'course.'.$fromcid.'.description'};                  $description = $env{'course.'.$fromcid.'.description'};
             } else {              } else {
                 my %courseinfo=&Apache::lonnet::coursedescription($fromcid);                $description = $courseinfo{'description'};                  my %courseinfo=&Apache::lonnet::coursedescription($fromcid);
                 $description = $courseinfo{'description'};                  $description = $courseinfo{'description'};
             }              }
             $$descriptions{$fromcid} = $description;              $$descriptions{$fromcid} = $description;
Line 893  sub disnew { Line 898  sub disnew {
                     $blocked{$id} = 'ON';                      $blocked{$id} = 'ON';
                     $numblocked ++;                      $numblocked ++;
                 } else {                  } else {
                     push @newmsgs, {                       push(@newmsgs, { 
                         msgid    => $msgid,                          msgid    => $msgid,
                         sendtime => $sendtime,                          sendtime => $sendtime,
                         shortsub => $shortsubj,                          shortsub => $shortsubj,
                         from     => $fromname,                          from     => $fromname,
                         fromdom  => $fromdom,                          fromdom  => $fromdom,
                         course   => $description                           course   => $description, 
                         }      });
                 }                  }
             }              }
         }          }
Line 908  sub disnew { Line 913  sub disnew {
     if ($#newmsgs >= 0) {      if ($#newmsgs >= 0) {
         $r->print(<<TABLEHEAD);          $r->print(<<TABLEHEAD);
 <h2>$lt{'nm'}</h2>  <h2>$lt{'nm'}</h2>
 <table class="LC_mail_list"><tr><th>&nbsp</th>  <table class="LC_mail_list"><tr><th>&nbsp;</th>
 <th>$lt{'da'}</th><th>$lt{'us'}</th><th>$lt{'do'}</th><th>$lt{'su'}</th><th>$lt{'co'}</th></tr>  <th>$lt{'da'}</th><th>$lt{'us'}</th><th>$lt{'do'}</th><th>$lt{'su'}</th><th>$lt{'co'}</th></tr>
 TABLEHEAD  TABLEHEAD
         foreach my $msg (@newmsgs) {          foreach my $msg (@newmsgs) {
             $r->print(<<"ENDLINK");              $r->print(<<"ENDLINK");
 <tr class="LC_mail_new">  <tr class="LC_mail_new">
 <td><a href="/adm/email?dismode=new&display=$msg->{'msgid'}">$lt{'op'}</a></td>  <td><a href="/adm/email?dismode=new&amp;display=$msg->{'msgid'}">$lt{'op'}</a></td>
 ENDLINK  ENDLINK
             foreach my $item ('sendtime','from','fromdom','shortsub','course') {              foreach my $item ('sendtime','from','fromdom','shortsub','course') {
                 $r->print("<td>$msg->{$item}</td>");                  $r->print("<td>$msg->{$item}</td>");
             }              }
             $r->print("</td></tr>");              $r->print("</tr>");
         }          }
         $r->print('</table>');          $r->print('</table>');
     } elsif ($numblocked == 0) {      } elsif ($numblocked == 0) {
Line 997  ENDDISHEADER Line 1002  ENDDISHEADER
     if ($lastdis>$#temp) { $lastdis=$#temp; }      if ($lastdis>$#temp) { $lastdis=$#temp; }
     $r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber));      $r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber));
     $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="3">&nbsp</th><th>');        '<table class="LC_mail_list"><tr><th colspan="3">&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 = "?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');
     } else {      } else {
Line 1102  ENDDISHEADER Line 1107  ENDDISHEADER
         my $beginblock = &Apache::lonlocal::locallocaltime($startblock);          my $beginblock = &Apache::lonlocal::locallocaltime($startblock);
         my $finishblock = &Apache::lonlocal::locallocaltime($endblock);          my $finishblock = &Apache::lonlocal::locallocaltime($endblock);
         $r->print('<br /><br />'.          $r->print('<br /><br />'.
                   &mt('[_1,quant,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));
         $r->print(&Apache::loncommon::build_block_table($startblock,$endblock,          $r->print(&Apache::loncommon::build_block_table($startblock,$endblock,
                                                         \%setters));                                                          \%setters));
     }      }
Line 1151  sub compout { Line 1156  sub compout {
     my $dismsg='';      my $dismsg='';
     my $disbase='';      my $disbase='';
     my $func=&mt('Send New');      my $func=&mt('Send New');
     my %lt=&Apache::lonlocal::texthash('us' => 'Username',      my %lt=&Apache::lonlocal::texthash('us'  => 'Username',
        'do' => 'Domain',         'do'  => 'Domain',
        'ad' => 'Additional Recipients',         'ad'  => 'Additional Recipients',
        'sb' => 'Subject',         'sb'  => 'Subject',
        'ca' => 'Cancel',         'ca'  => 'Cancel',
        'ma' => 'Mail');         'ma'  => 'Mail',
                                          'gen' => 'Generate messages from a file',
                                          'gmt' => 'General message text',
                                          'tff' => 'The file format for the uploaded portion of the message is',
                                          'uas' => 'Upload and Send',
                                         );
     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'})) {
Line 1256  sub compout { Line 1265  sub compout {
     my $latexHelp = Apache::loncommon::helpLatexCheatsheet();      my $latexHelp = Apache::loncommon::helpLatexCheatsheet();
     if ($broadcast ne 'upload') {      if ($broadcast ne 'upload') {
        $r->print(<<"ENDCOMP");         $r->print(<<"ENDCOMP");
 <tr><td>$lt{'ad'}<br /><tt>username:domain,username:domain, ...  <tr><td>$lt{'ad'}:<br /><tt>username:domain,username:domain, ...
 </tt></td><td>  </tt></td><td>
 <input type="text" size="50" name="additionalrec" /></td></tr>  <input type="text" size="50" name="additionalrec" /></td></tr>
 <tr><td>$lt{'sb'}:</td><td><input type="text" size="50" name="subject" value="$dissub" />  <tr><td>$lt{'sb'}:</td><td><input type="text" size="50" name="subject" value="$dissub" />
Line 1281  ENDCOMP Line 1290  ENDCOMP
                       $env{'form.group'}.'" />');                        $env{'form.group'}.'" />');
         }          }
     } else { # $broadcast is 'upload'      } else { # $broadcast is 'upload'
  $r->print(<<ENDUPLOAD);   $r->print(<<ENDBLOCK);
 <input type="hidden" name="sendmode" value="upload" />  <input type="hidden" name="sendmode" value="upload" />
 <input type="hidden" name="send" value="on" />  <input type="hidden" name="send" value="on" />
 <h3>Generate messages from a file</h3>  <h3>$lt{'gen'}</h3>
 <p>  <p>
 Subject: <input type="text" size="50" name="subject" />  Subject: <input type="text" size="50" name="subject" />
 </p>  </p>
 <p>General message text<br />  <p>$lt{'gmt'}:<br />
 <textarea name="message" id="message" cols="60" rows="10" wrap="hard">$dismsg  <textarea name="message" id="message" cols="60" rows="10" wrap="hard">$dismsg
 </textarea></p>  </textarea></p>
 <p>  <p>
 The file format for the uploaded portion of the message is:  $lt{'tff'}:
 <pre>  ENDBLOCK
 username1:domain1: text         $r->print('
 username2:domain2: text  <pre>'."\n".
 username3:domain1: text  &mt('username1:domain1: text')."\n".
 </pre>  &mt('username2:domain2: text')."\n".
   &mt('username3:domain1: text')."\n".
   '</pre>
 </p>  </p>
 <p>  <p>
 The messages will be assembled from all lines with the respective   '.&mt('The messages will be assembled from all lines with the respective'."\n".'<tt>username:domain</tt>, and appended to the general message text.'));
 <tt>username:domain</tt>, and appended to the general message text.</p>          $r->print(<<ENDUPLOAD);
   </p>
 <p>  <p>
 <input type="file" name="upfile" size="40" /></p><p>  <input type="file" name="upfile" size="40" /></p><p>
 $dispcrit  $dispcrit
 <input type="submit" value="Upload and Send" /></p>  <input type="submit" value="$lt{'uas'}" /></p>
 ENDUPLOAD  ENDUPLOAD
     }      }
     if ($broadcast eq 'group') {      if ($broadcast eq 'group') {
Line 1342  sub retrieve_instructor_comments { Line 1354  sub retrieve_instructor_comments {
     my ($user,$domain)=@_;      my ($user,$domain)=@_;
     my $target=$env{'form.grade_target'};      my $target=$env{'form.grade_target'};
     if (! $env{'request.course.id'}) { return; }      if (! $env{'request.course.id'}) { return; }
     if (! &Apache::lonnet::allowed('srm',$env{'request.course.id'})      if (! &Apache::lonnet::allowed('dff',$env{'request.course.id'})
  && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.   && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
       '/'.$env{'request.course.sec'})) {        '/'.$env{'request.course.sec'})) {
  return;   return;
     }      }
Line 1369  sub disfacetoface { Line 1381  sub disfacetoface {
     my ($r,$user,$domain)=@_;      my ($r,$user,$domain)=@_;
     my $target=$env{'form.grade_target'};      my $target=$env{'form.grade_target'};
     unless ($env{'request.course.id'}) { return; }      unless ($env{'request.course.id'}) { return; }
     if  (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})      if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
  && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.   && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
        '/'.$env{'request.course.sec'})) {         '/'.$env{'request.course.sec'})) {
  $r->print('Not allowed');   $r->print(&mt('Not allowed'));
  return;   return;
     }      }
     my %records=&Apache::lonnet::dump('nohist_email',      my %records=&Apache::lonnet::dump('nohist_email',
Line 1451  sub general_message { Line 1463  sub general_message {
   
 sub facetoface {  sub facetoface {
     my ($r,$stage)=@_;      my ($r,$stage)=@_;
     if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})      if (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
  && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.   && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
       '/'.$env{'request.course.sec'})) {        '/'.$env{'request.course.sec'})) {
  $r->print('Not allowed');   $r->print(&mt('Not allowed'));
  return;   return;
     }      }
     my $crstype = &Apache::loncommon::course_type();      my $crstype = &Apache::loncommon::course_type();
Line 1541  sub examblock { Line 1553  sub examblock {
             '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 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.",
              'mecb' => 'Modify existing communication blocking periods',               'mecb' => 'Modify existing communication blocking periods',
              'ncbc' => 'No communication blocks currently stored'               'ncbc' => 'No communication blocks currently stored',
                'stor' => 'Store',
     );      );
   
     my %ltext = &Apache::lonlocal::texthash(      my %ltext = &Apache::lonlocal::texthash(
Line 1580  sub examblock { Line 1593  sub examblock {
     $r->print(<<"END");      $r->print(<<"END");
 <br />  <br />
 <input type="hidden" name="blocktotal" value="$blockcount" />  <input type="hidden" name="blocktotal" value="$blockcount" />
 <input type ="submit" value="Save Changes" />  <input type ="submit" value="$lt{'stor'}" />
 </form>  </form>
 $end_page  $end_page
 END  END
Line 1591  sub blockstore { Line 1604  sub blockstore {
     my $r = shift;      my $r = shift;
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
             'tfcm' => 'The following changes were made',              'tfcm' => 'The following changes were made',
             'cbps' => 'communication blocking period(s)',  
             'werm' => 'was/were removed',  
             'wemo' => 'was/were modified',  
             'wead' => 'was/were added',  
             'ncwm' => 'No changes were made.'               'ncwm' => 'No changes were made.' 
     );      );
     my %adds = ();      my %adds = ();
Line 1651  sub blockstore { Line 1660  sub blockstore {
     if ($chgestotal > 0) {      if ($chgestotal > 0) {
         $r->print($lt{'tfcm'}.'<ul>');          $r->print($lt{'tfcm'}.'<ul>');
         if ($canceltotal > 0) {          if ($canceltotal > 0) {
             $r->print('<li>'.$canceltotal.' '.$lt{'cbps'},' '.$lt{'werm'}.'</li>');              $r->print('<li>'.&mt('[quant,_1,communication blocking period was,communication blocking periods were] removed.',$canceltotal).'</li>');
         }          }
         if ($modtotal > 0) {          if ($modtotal > 0) {
             $r->print('<li>'.$modtotal.' '.$lt{'cbps'},' '.$lt{'wemo'}.'</li>');              $r->print('<li>'.&mt('[quant,_1,communication blocking period was,communication blocking periods were] modified.',$modtotal).'</li>');
         }          }
         if ($addtotal > 0) {          if ($addtotal > 0) {
             $r->print('<li>'.$addtotal.' '.$lt{'cbps'},' '.$lt{'wead'}.'</li>');              $r->print('<li>'.&mt('[quant,_1,communication blocking period was,communication blocking periods were] added.',$addtotal).'</li>');
         }          }
         $r->print('</ul>');          $r->print('</ul>');
     } else {      } else {
Line 2282  sub handler { Line 2291  sub handler {
     unless ($dismode) {       unless ($dismode) { 
  $dismode='';    $dismode=''; 
     } else {      } else {
  $sqs.='&dismode='.&escape($dismode);   $sqs.='&amp;dismode='.&escape($dismode);
     }      }
   
 # --------------------------------------------------------------------- Display  # --------------------------------------------------------------------- Display

Removed from v.1.46  
changed lines
  Added in v.1.52


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