Diff for /loncom/interface/loncreateuser.pm between versions 1.139 and 1.144

version 1.139, 2006/11/23 01:41:37 version 1.144, 2007/01/16 19:56:41
Line 358  sub print_user_modification_page { Line 358  sub print_user_modification_page {
         }          }
         return -1;          return -1;
     }      }
   
     function setType() {  
         var crstype = document.cu.crstype.options[document.cu.crstype.selectedIndex].value;  
         rolevals = new Array("$rolevalslist");  
         if (crstype == 'Group') {  
             if (document.cu.currsec.options[0].text == "$pickcrsfirst") {  
                 document.cu.currsec.options[0].text = "$pickgrpfirst";  
             }   
             grprolenames = new Array("$grprolenameslist");  
             for (var i=0; i<rolevals.length; i++) {  
                 if (document.cu.role.selectedIndex == i) {  
                     document.cu.role.options[i] = new Option(grprolenames[i],rolevals[i],true,false);  
                 } else {  
                     document.cu.role.options[i] = new Option(grprolenames[i],rolevals[i],false,false);  
                 }  
             }  
         } else {  
             if (document.cu.currsec.options[0].text == "$pickgrpfirst") {  
                 document.cu.currsec.options[0].text = "$pickcrsfirst";  
             }  
             crsrolenames = new Array("$crsrolenameslist");  
             for (var i=0; i<rolevals.length; i++) {  
                 if (document.cu.role.selectedIndex == i) {  
                     document.cu.role.options[i] = new Option(crsrolenames[i],rolevals[i],true,false);  
                 } else {  
                     document.cu.role.options[i] = new Option(crsrolenames[i],rolevals[i],false,false);  
                 }  
             }  
         }  
     }  
 ENDSCRIPT  ENDSCRIPT
     } else {      } else {
         $nondc_setsection_code = <<"ENDSECCODE";          $nondc_setsection_code = <<"ENDSECCODE";
Line 624  END Line 594  END
                my $delallowed=0;                 my $delallowed=0;
        my $sortkey=$role_code;         my $sortkey=$role_code;
        my $class='Unknown';         my $class='Unknown';
                if ($area =~ m{^/($match_domain)/($match_username)} ) {                 if ($area =~ m{^/($match_domain)/($match_courseid)} ) {
    $class='Course';     $class='Course';
                    my ($coursedom,$coursedir) = ($1,$2);                     my ($coursedom,$coursedir) = ($1,$2);
    $sortkey.="\0$coursedom";     $sortkey.="\0$coursedom";
Line 660  END Line 630  END
        }         }
    }     }
                    # Compute the background color based on $area                     # Compute the background color based on $area
                    if ($area=~m{^/($match_domain)/($match_username)/(\w+)}) {                     if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) {
                        $carea.='<br />Section: '.$3;                         $carea.='<br />Section: '.$3;
        $sortkey.="\0$3";         $sortkey.="\0$3";
                    }                     }
Line 1174  ENDMODIFYUSERHEAD Line 1144  ENDMODIFYUSERHEAD
                 }                  }
             }              }
         } else {          } else {
             $oldportfolioquota = &default_quota($env{'form.ccdomain'});              $oldportfolioquota = 
                     &Apache::loncommon::default_quota($env{'form.ccdomain'});
         }          }
         if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}) &&           if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}) && 
             ($env{'form.cfirstname'}  ne $userenv{'firstname'}  ||              ($env{'form.cfirstname'}  ne $userenv{'firstname'}  ||
Line 1273  END Line 1244  END
                      &Apache::lonnet::revokerole($env{'form.ccdomain'},                       &Apache::lonnet::revokerole($env{'form.ccdomain'},
                      $env{'form.ccuname'},$1,$2).'</b><br />');                       $env{'form.ccuname'},$1,$2).'</b><br />');
  if ($2 eq 'st') {   if ($2 eq 'st') {
     $1=~m{^/($match_domain)/($match_username)};      $1=~m{^/($match_domain)/($match_courseid)};
     my $cid=$1.'_'.$2;      my $cid=$1.'_'.$2;
     $r->print(&mt('Drop from classlist').': <b>'.      $r->print(&mt('Drop from classlist').': <b>'.
  &Apache::lonnet::critical('put:'.   &Apache::lonnet::critical('put:'.
Line 1300  END Line 1271  END
                      &Apache::lonnet::assignrole($env{'form.ccdomain'},                       &Apache::lonnet::assignrole($env{'form.ccdomain'},
                      $env{'form.ccuname'},$1,$2,$now,0,1).'<br />');                       $env{'form.ccuname'},$1,$2,$now,0,1).'<br />');
  if ($2 eq 'st') {   if ($2 eq 'st') {
     $1=~m{^/($match_domain)/($match_username)};      $1=~m{^/($match_domain)/($match_courseid)};
     my $cid=$1.'_'.$2;      my $cid=$1.'_'.$2;
     $r->print(&mt('Drop from classlist').': <b>'.      $r->print(&mt('Drop from classlist').': <b>'.
  &Apache::lonnet::critical('put:'.   &Apache::lonnet::critical('put:'.
Line 1331  END Line 1302  END
                 my $logmsg;                  my $logmsg;
                 my $output;                  my $output;
                 if ($role eq 'st') {                  if ($role eq 'st') {
                     if ($url =~ m-^/($match_domain)/($match_username)/?(\w*)$-) {                      if ($url =~ m-^/($match_domain)/($match_courseid)/?(\w*)$-) {
                         my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);                          my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);
                         if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {                          if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {
                             $output = "Error: $result\n";                              $output = "Error: $result\n";
Line 1362  END Line 1333  END
  } elsif ($key=~/^form\.act/) {   } elsif ($key=~/^form\.act/) {
             my $udom = $env{'form.ccdomain'};              my $udom = $env{'form.ccdomain'};
             my $uname = $env{'form.ccuname'};              my $uname = $env{'form.ccuname'};
     if ($key=~/^form\.act\_($match_domain)\_($match_username)\_cr_cr_($match_domain)_($match_username)_([^\_]+)$/) {      if ($key=~/^form\.act\_($match_domain)\_($match_courseid)\_cr_cr_($match_domain)_($match_username)_([^\_]+)$/) {
                 # Activate a custom role                  # Activate a custom role
  my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);   my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);
  my $url='/'.$one.'/'.$two;   my $url='/'.$one.'/'.$two;
Line 1393  END Line 1364  END
         $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));          $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));
                     }                      }
                 }                  }
     } elsif ($key=~/^form\.act\_($match_domain)\_($match_username)\_([^\_]+)$/) {      } elsif ($key=~/^form\.act\_($match_domain)\_($match_name)\_([^\_]+)$/) {
  # Activate roles for sections with 3 id numbers   # Activate roles for sections with 3 id numbers
  # set start, end times, and the url for the class   # set start, end times, and the url for the class
  my ($one,$two,$three)=($1,$2,$3);   my ($one,$two,$three)=($1,$2,$3);
Line 1867  sub course_sections { Line 1838  sub course_sections {
         $output = '<select name="currsec_'.$role.'" ';          $output = '<select name="currsec_'.$role.'" ';
         my $multiple = 4;          my $multiple = 4;
         if (scalar(@sections) < 4) { $multiple = scalar(@sections); }          if (scalar(@sections) < 4) { $multiple = scalar(@sections); }
         $output .= '"multiple" size="'.$multiple.'">'."\n";          $output .= 'multiple size="'.$multiple.'">'."\n";
         foreach my $sec (@sections) {          foreach my $sec (@sections) {
             $output .= '<option value="'.$sec.'">'.$sec."</option>\n";              $output .= '<option value="'.$sec.'">'.$sec."</option>\n";
         }          }
Line 1886  sub course_level_dc { Line 1857  sub course_level_dc {
             ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Course').'</b>';              ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Course').'</b>';
     my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($dcdom,'currsec','cu');      my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($dcdom,'currsec','cu');
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
                     'typ' => "Type",  
                     'rol'  => "Role",                      'rol'  => "Role",
                     'grs'  => "Section",                      'grs'  => "Section",
                     'exs'  => "Existing sections",                      'exs'  => "Existing sections",
Line 1899  sub course_level_dc { Line 1869  sub course_level_dc {
     my $header = '<h4>'.&mt('Course Level').'</h4>'.      my $header = '<h4>'.&mt('Course Level').'</h4>'.
                  &Apache::loncommon::start_data_table().                   &Apache::loncommon::start_data_table().
                  &Apache::loncommon::start_data_table_header_row().                   &Apache::loncommon::start_data_table_header_row().
                  '<th>'.$lt{'typ'}.'</th><th>'.$courseform.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'.                   '<th>'.$courseform.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'.
                  &Apache::loncommon::end_data_table_header_row();                   &Apache::loncommon::end_data_table_header_row();
     my $otheritems = &Apache::loncommon::start_data_table_row().      my $otheritems = &Apache::loncommon::start_data_table_row()."\n".
                      '<td><select name="crstype" onChange="javascript:setType();">'."\n".  
                      ' <option value="">'.&mt('Please select')."\n".  
                      ' <option value="Course">'.&mt('Course')."\n".  
                      ' <option value="Non-standard course">'.&mt('Non-standard course')."\n".  
                      '</select>'."\n".  
                      '<td><input type="text" name="coursedesc" value="" onFocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc',''".')" /></td>'."\n".                       '<td><input type="text" name="coursedesc" value="" onFocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc',''".')" /></td>'."\n".
                      '<td><select name="role">'."\n";                       '<td><select name="role">'."\n";
     foreach  my $role ('st','ta','ep','in','cc') {      foreach  my $role ('st','ta','ep','in','cc') {

Removed from v.1.139  
changed lines
  Added in v.1.144


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