Diff for /loncom/interface/lonpopulate.pm between versions 1.74 and 1.78

version 1.74, 2013/02/11 02:39:11 version 1.78, 2013/08/15 16:51:02
Line 254  sub print_navmenu { Line 254  sub print_navmenu {
     <tr class="LC_pick_box_row">      <tr class="LC_pick_box_row">
       <td valign="top" class="LC_pick_box_title">        <td valign="top" class="LC_pick_box_title">
 ');  ');
     print STDERR "action is ||$action|| and state is ||$state||\n";  
     foreach my $task (@{$tasksref}) {      foreach my $task (@{$tasksref}) {
         if (($task eq $action) && ($state eq 'choose')) {          if (($task eq $action) && ($state eq 'choose')) {
             $r->print('               $r->print(' 
Line 1357  sub print_accessdate_table { Line 1356  sub print_accessdate_table {
          'fnew' => 'for new students added when you update the class roster',           'fnew' => 'for new students added when you update the class roster',
          'ifad'  => 'If automated adds are enabled, then when students are added their student roles will become active on the date set here for first access, and their roles will become inactive on the date set here for last access.  These default access dates will be overridden for specific students if the institutional classlist data supplied to the automatic enrollment process includes entries for the startdate and enddate fields for those students.',           'ifad'  => 'If automated adds are enabled, then when students are added their student roles will become active on the date set here for first access, and their roles will become inactive on the date set here for last access.  These default access dates will be overridden for specific students if the institutional classlist data supplied to the automatic enrollment process includes entries for the startdate and enddate fields for those students.',
     );      );
     $lt{'ncds'} = &mt('changing default start and end access dates will affect [_1]future enrollments[_2] and also [_1]currently inactive[_2] students (i.e., those for whom access will begin in the future).','<b>','</b>');      $lt{'ncds'} = &mt('Changing default start and end access dates will affect [_1]future enrollments[_2] and also [_1]currently inactive[_2] students (i.e., those for whom access will begin in the future).','<b>','</b>');
     $lt{'tcha'} = &mt('To change access dates for [_1]currently active[_2] students, use User Management -> "Manage Course Users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".','<b>','</b>');      $lt{'tcha'} = &mt('To change access dates for [_1]currently active[_2] students, use User Management -> "Manage Course Users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".','<b>','</b>');
     my $dateshow;      my $dateshow;
     if ( ($oldendshow eq '') && ($oldstartshow eq '') ) {      if ( ($oldendshow eq '') && ($oldstartshow eq '') ) {
Line 1707  sub print_setaccess_response { Line 1706  sub print_setaccess_response {
                 '<br />'.                  '<br />'.
                 &mt('Any change in access dates will only apply to students who are not currently active, i.e., those who currently have access start dates in the future, and to those added by future automated enrollment.').                  &mt('Any change in access dates will only apply to students who are not currently active, i.e., those who currently have access start dates in the future, and to those added by future automated enrollment.').
                 '<br /><br />'.                  '<br /><br />'.
                  &mt('To change access dates for any currently active students, use User Management -> "Manage Users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".').                   &mt('To change access dates for [_1]currently active[_2] students, use User Management -> "Manage course users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".','<b>','</b>').
                 '<br />';                  '<br />';
   
 # Generate message in case where old first access date was later than today, but new first access date is now today or earlier.  # Generate message in case where old first access date was later than today, but new first access date is now today or earlier.
Line 2357  sub print_sections_response { Line 2356  sub print_sections_response {
  }   }
     }      }
   
     if ($putreply ne 'ok') {      if ($putreply eq 'ok') {
  $response = &mt('Students enrolling in the sections listed below will be automatically added to the class roster for LON-CAPA course [_1], if you have chosen to enable a nightly automated enrollment update.',   $response = &mt('Students enrolling in the sections listed below will be automatically added to the class roster for LON-CAPA course [_1], if you have chosen to enable a nightly automated enrollment update.',
                         "$realm ($coursecode)").'<br /><ul>'."\n";                          "$realm ($coursecode)").'<br /><ul>'."\n";
  foreach my $section (@allsections) {   foreach my $section (@allsections) {
Line 2727  sub print_update_result { Line 2726  sub print_update_result {
     my %settings =       my %settings = 
         &Apache::lonnet::get('environment',          &Apache::lonnet::get('environment',
             ['internal.coursecode','internal.sectionnums','internal.crosslistings',              ['internal.coursecode','internal.sectionnums','internal.crosslistings',
              'internal.authtype','internal.autharg','internal.showphoto'],               'internal.authtype','internal.autharg','internal.showphoto','internal.defaultcredits'],
             $dom,$crs);              $dom,$crs);
     my $coursecode = $settings{'internal.coursecode'};      my $coursecode = $settings{'internal.coursecode'};
     my $authtype = $settings{'internal.authtype'};      my $authtype = $settings{'internal.authtype'};
     my $autharg = $settings{'internal.autharg'};      my $autharg = $settings{'internal.autharg'};
     my $showphotos = $settings{'internal.showphoto'};      my $showphotos = $settings{'internal.showphoto'};
       my ($showcredits,$defaultcredits);
       my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
       if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'}) {
           $showcredits = 1;
           $defaultcredits = $settings{'internal.defaultcredits'};
           if ($defaultcredits eq '') {
               if ($coursecode ne '') {
                   $defaultcredits = $domdefaults{'officialcredits'};   
               } else {
                   $defaultcredits = $domdefaults{'unofficialcredits'};
               }
           }
       }
     my ($startaccess,$endaccess) = &get_dates_from_form();      my ($startaccess,$endaccess) = &get_dates_from_form();
     if ( exists($env{'form.updateadds'}) ) {      if ( exists($env{'form.updateadds'}) ) {
         $updateadds = $env{'form.updateadds'};          $updateadds = $env{'form.updateadds'};
Line 2767  sub print_update_result { Line 2779  sub print_update_result {
                                  ": ".$outcome);                                   ": ".$outcome);
             }              }
     if ($reply{$crs} > 0) {      if ($reply{$crs} > 0) {
  ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$updateadds,$updatedrops,$startaccess,$endaccess,$authtype,$autharg,\@allcourses,\%LC_code,\$logmsg,\$newusermsg,"updatenow",\%phototypes);   ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$updateadds,$updatedrops,$startaccess,$endaccess,$authtype,$autharg,$showcredits,$defaultcredits,\@allcourses,\%LC_code,\$logmsg,\$newusermsg,"updatenow",\%phototypes);
     } else {      } else {
  $response = &mt('There was a problem retrieving institutional class list data for the course sections and crosslisted courses which contribute enrollment to this course.').' '.   $response = &mt('There was a problem retrieving institutional class list data for the course sections and crosslisted courses which contribute enrollment to this course.').' '.
                             &mt('No updates have been carried out, and the roster remains unchanged.');                              &mt('No updates have been carried out, and the roster remains unchanged.');
Line 2812  sub print_viewclass_response { Line 2824  sub print_viewclass_response {
     my $secidx=&Apache::loncoursedata::CL_SECTION;      my $secidx=&Apache::loncoursedata::CL_SECTION;
     my $typeidx=&Apache::loncoursedata::CL_TYPE;      my $typeidx=&Apache::loncoursedata::CL_TYPE;
     my $lockedidx=&Apache::loncoursedata::CL_LOCKEDTYPE;      my $lockedidx=&Apache::loncoursedata::CL_LOCKEDTYPE;
       my $creditsidx=&Apache::loncoursedata::CL_CREDITS;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                ['chgauto','chgmanual','lockchg','unlockchg']);                                 ['chgauto','chgmanual','lockchg','unlockchg']);
     my @typechglist = (&Apache::loncommon::get_env_multiple('form.chgauto'),      my @typechglist = (&Apache::loncommon::get_env_multiple('form.chgauto'),
Line 2819  sub print_viewclass_response { Line 2832  sub print_viewclass_response {
     my @lockchglist = (&Apache::loncommon::get_env_multiple('form.lockchg'),      my @lockchglist = (&Apache::loncommon::get_env_multiple('form.lockchg'),
        &Apache::loncommon::get_env_multiple('form.unlockchg'));         &Apache::loncommon::get_env_multiple('form.unlockchg'));
   
     foreach my $student (sort @typechglist) {      foreach my $student (sort(@typechglist)) {
         my ($uname,$udom) = split(/:/,$student);          my ($uname,$udom) = split(/:/,$student);
         my $sdata    = $classlist->{$student};          my $sdata    = $classlist->{$student};
         my $section  = $sdata->[$secidx];          my $section  = $sdata->[$secidx];
Line 2828  sub print_viewclass_response { Line 2841  sub print_viewclass_response {
         my $end      = $sdata->[$endidx];          my $end      = $sdata->[$endidx];
         my $type     = $sdata->[$typeidx];          my $type     = $sdata->[$typeidx];
         my $lock   = $sdata->[$lockedidx];          my $lock   = $sdata->[$lockedidx];
           my $credits = $sdata->[$creditsidx];
         my $newlock = $lock;          my $newlock = $lock;
         $chgtotal ++;          $chgtotal ++;
         my $newtype = 'auto';          my $newtype = 'auto';
Line 2844  sub print_viewclass_response { Line 2858  sub print_viewclass_response {
             } elsif ($newtype eq '') {              } elsif ($newtype eq '') {
                 $newlock = '1';                  $newlock = '1';
             }              }
             my $modreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$newtype,$newlock,$cid,'','chgtype');              my $modreply = 
                   &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'',
                                                              '','','',$section,$end,
                                                              $start,$newtype,
                                                              $newlock,$cid,'',
                                                              'chgtype',$credits);
             if ($modreply eq 'ok') {              if ($modreply eq 'ok') {
                 $chgok ++;                  $chgok ++;
                 $chg{$student} = &mt("Changed to $change");                  $chg{$student} = &mt("Changed to $change");
Line 2866  sub print_viewclass_response { Line 2885  sub print_viewclass_response {
         my $end      = $sdata->[$endidx];          my $end      = $sdata->[$endidx];
         my $type     = $sdata->[$typeidx];          my $type     = $sdata->[$typeidx];
         my $lock   = $sdata->[$lockedidx];          my $lock   = $sdata->[$lockedidx];
           my $credits = $sdata->[$creditsidx];
         my $newlock = 1;          my $newlock = 1;
         my $oldlockname = &mt('unlocked');          my $oldlockname = &mt('unlocked');
         my $newlockname = &mt('locked');          my $newlockname = &mt('locked');
Line 2876  sub print_viewclass_response { Line 2896  sub print_viewclass_response {
                 $newlockname = &mt('unlocked');                  $newlockname = &mt('unlocked');
                 $oldlockname = &mt('locked');                   $oldlockname = &mt('locked'); 
             }              }
             my $lockreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$type,$newlock,$cid,'','chgtype');              my $lockreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$type,$newlock,$cid,'','chgtype',$credits);
             if ($lockreply eq 'ok') {              if ($lockreply eq 'ok') {
                 $lockok ++;                  $lockok ++;
                 $lockchg{$student} = &mt('Changed to [_1]',$newlockname);                  $lockchg{$student} = &mt('Changed to [_1]',$newlockname);
Line 3014  sub warning_message { Line 3034  sub warning_message {
     unless ( $caller eq 'chgsettings') {      unless ( $caller eq 'chgsettings') {
         if ( (!$curradds) && (!$currdrops) ) {          if ( (!$curradds) && (!$currdrops) ) {
             $warning .= '<li>'.              $warning .= '<li>'.
                 &mt('You [_1]must[_2] now use [_3]Automated adds/drops[_4] to enable automated adds and/or drops if you want automatic enrollment updates to occur in this course.','<b>','</b>','<a href="/adm/populate?action=chgsettings">').'</li>';                  &mt('You [_1]must[_2] now use [_3]Automated adds/drops[_4] to enable automated adds and/or drops if you want automatic enrollment updates to occur in this course.','<b>','</b>','<a href="/adm/populate?action=chgsettings">','</a>').'</li>';
         }          }
     }      }
     if ($warning) {      if ($warning) {

Removed from v.1.74  
changed lines
  Added in v.1.78


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