Diff for /loncom/interface/lonpopulate.pm between versions 1.45 and 1.48

version 1.45, 2006/07/28 01:04:45 version 1.48, 2006/08/10 22:05:18
Line 113  function process(calling,numauto,nummanu Line 113  function process(calling,numauto,nummanu
  }   }
  if (calling == "notify") {   if (calling == "notify") {
      var totalnote = 0;       var totalnote = 0;
      if (formName.notify[1].checked = true) {       for (var i=0; i<formName.elements.length; i++) {
          for (var i=0; i<formName.elements.length; i++) {   var elementname = formName.elements[i].name;
              var elementname = formName.elements[i].name;   var check_name = elementname.match($notify_check);
              var check_name = elementname.match($notify_check);   if (check_name != null) {
              if (check_name != null) {       if (formName.elements[i].checked) {
                  if (formName.elements[i].checked) {   totalnote ++;
                      totalnote ++;       }
                  }   } 
              }        }
          }       if (totalnote > 0) {
          if (totalnote > 0) {   if (formName.notify[1].checked == true) {
              if (formName.notify[1].checked = true) {       if (confirm("You have indicated that you do not want notification of roster changes messages to be sent, but "+totalnote+" have been checked as recipients.\\nClick 'OK' to erase all recipients, or 'Cancel'.")) {
                  if (confirm("You have indicated that you do not want notification of roster changes messages to be sent, but "+totalnote+" have been checked as recipients.\\nClick 'OK' to erase all recipients, or 'Cancel'.")) {   checker  = 1;
                      checker  = 1;       } else {
                  } else {   checker = 0;
                      checker = 0;       }
                  }   }
              }       } else {
          } else {   if (formName.notify[0].checked == true) {
              if (formName.notify[0].checked = true) {       alert("You have indicated that you want notification of roster changes messages to be sent, but you have not selected any recipients.");
                  alert("You have indicated that you want notification of roster changes messages to be sent, but you have not selected any recipients.");       checker = 0;
                  checker = 0;   }
              }  
          }  
      }       }
  }   }
  if (calling == "viewclass") {   if (calling == "viewclass") {
Line 947  your changes.</td> Line 945  your changes.</td>
       my ($result,$perm_reqd)=&Apache::lonnet::auto_photo_permission($crs,$dom);        my ($result,$perm_reqd)=&Apache::lonnet::auto_photo_permission($crs,$dom);
       my $can_enable = 1;        my $can_enable = 1;
       my $institution = $Apache::lonnet::domaindescription{$dom};        my $institution = $Apache::lonnet::domaindescription{$dom};
       my $user;  
       if ($enrollvar{'courseowner'} =~ /^[^:]+:[^:]+$/) {  
           $user = $env{'user.name'}.':'.$env{'user.domain'};  
       } else {  
           $user = $env{'user.name'};  
       }  
       if ($result eq 'ok') {        if ($result eq 'ok') {
           if ($perm_reqd eq 'yes') {            if ($perm_reqd eq 'yes') {
               if (!($enrollvar{'photopermission'} eq 'yes')) {                if (!($enrollvar{'photopermission'} eq 'yes')) {
                   $can_enable = 0;                    $can_enable = 0;
               } else {                } else {
                   if ($user eq $enrollvar{'courseowner'}) {                    if (&user_is_courseowner($enrollvar{'courseowner'})) {
                       $r->print('                        $r->print('
                     <tr>                      <tr>
                      <td>'.                       <td>'.
Line 991  your changes.</td> Line 983  your changes.</td>
                     </tr>                      </tr>
 ');  ');
       } else {        } else {
           if ($user eq $enrollvar{'courseowner'}) {            if (&user_is_courseowner($enrollvar{'courseowner'})) {
               $r->print('                $r->print('
                     <tr>                      <tr>
                      <td>'.                       <td>'.
Line 1125  onclick="javascript:document.photoupdate Line 1117  onclick="javascript:document.photoupdate
       if (! exists($env{'form.sortby'})) {        if (! exists($env{'form.sortby'})) {
           $env{'form.sortby'} = 'username';            $env{'form.sortby'} = 'username';
       }        }
       if ($env{'form.Status'} !~ /^(Any|Expired|Active)$/) {        if ($env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) {
           $env{'form.Status'} = 'Active';            $env{'form.Status'} = 'Active';
       }        }
       my $status_select = &Apache::lonhtmlcommon::StatusOptions($env{'form.Status'});        my $status_select = &Apache::lonhtmlcommon::StatusOptions($env{'form.Status'});
Line 1795  sub print_crosslistings_menu () { Line 1787  sub print_crosslistings_menu () {
  if ($numcross > 0) {   if ($numcross > 0) {
     my @bgcolors=("#eeeeee","#cccccc");      my @bgcolors=("#eeeeee","#cccccc");
     $response .= qq(You indicated that you wish to add an additional $numcross crosslisting(s).  For each new crosslisting enter the insititutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section. The LON-CAPA section ID can be left blank, if you do not wish to tie a section ID to this crosslisting.  The institutional course section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course codes (and section numbers) to your institution's student information system.<br/><br/>      $response .= qq(You indicated that you wish to add an additional $numcross crosslisting(s).  For each new crosslisting enter the insititutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section. The LON-CAPA section ID can be left blank, if you do not wish to tie a section ID to this crosslisting.  The institutional course section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course codes (and section numbers) to your institution's student information system.<br/><br/>
            <form name="enter" method="post">);             <form name="enter" method="post">); #' stupid emacs
            $response .= &Apache::loncommon::start_data_table();             $response .= &Apache::loncommon::start_data_table();
            $response .= &Apache::loncommon::start_data_table_row();             $response .= &Apache::loncommon::start_data_table_row();
            $response .= qq(             $response .= qq(
Line 2285  sub photo_permission { Line 2277  sub photo_permission {
  $dom,$crs);   $dom,$crs);
     my ($showphotos,$response);      my ($showphotos,$response);
     if (exists($env{'form.cancel_agreement'})) {      if (exists($env{'form.cancel_agreement'})) {
         if ($env{'user.name'} eq $settings{'internal.courseowner'}) {          if (&user_is_courseowner($settings{'internal.courseowner'})) {
             my %cenv = (              my %cenv = (
                 'internal.photopermission' => 'no',                  'internal.photopermission' => 'no',
             );              );
Line 2355  sub print_photo_agreement { Line 2347  sub print_photo_agreement {
     my ($r,$realm,$dom,$crs,$action,$tasktitleref,$conditions,$courseowner)=@_;      my ($r,$realm,$dom,$crs,$action,$tasktitleref,$conditions,$courseowner)=@_;
     my $response;      my $response;
     my $institution = $Apache::lonnet::domaindescription{$dom};      my $institution = $Apache::lonnet::domaindescription{$dom};
     if ($env{'user.name'} eq $courseowner) {      if (&user_is_courseowner($courseowner)) {
         $response = '          $response = '
 <script type="text/javascript">  <script type="text/javascript">
 function agreement_result(caller) {  function agreement_result(caller) {
Line 2986  sub validate_lcsec { Line 2978  sub validate_lcsec {
     return 'ok';      return 'ok';
 }  }
   
   sub user_is_courseowner {
       my ($courseowner) = @_;
       my $user;
       if ($courseowner =~ /^[^:]+:[^:]+$/) {
    $user = $env{'user.name'}.':'.$env{'user.domain'};
       } else {
    $user = $env{'user.name'};
       }
       return ($user eq $courseowner);
   }
       
 ###################################################################  ###################################################################
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;

Removed from v.1.45  
changed lines
  Added in v.1.48


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