Diff for /loncom/interface/loncreateuser.pm between versions 1.467 and 1.468

version 1.467, 2023/03/29 16:01:13 version 1.468, 2023/06/20 14:03:52
Line 4246  sub update_roles { Line 4246  sub update_roles {
       0 );        0 );
  my $url='/'.$one.'/'.$two;   my $url='/'.$one.'/'.$two;
                 my $id = $url.'_'.$three;                  my $id = $url.'_'.$three;
                 my $type = 'three';  
                 # split multiple sections                  # split multiple sections
                 my %sections = ();                  my %sections = ();
                 my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two.'_'.$three},\%sections,$three);                  my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two.'_'.$three},\%sections,$three);
Line 4330  sub update_roles { Line 4329  sub update_roles {
                 my $two = $2;                  my $two = $2;
  my $url='/'.$one.'/';   my $url='/'.$one.'/';
                 my $id = $url.'_'.$two;                  my $id = $url.'_'.$two;
                   my ($cdom,$cnum) = split(/\//,$one);
                 # split multiple sections                  # split multiple sections
                 my %sections = ();                  my %sections = ();
                 my ($restricted,$numchanges);                  my ($restricted,$numchanges);
Line 4337  sub update_roles { Line 4337  sub update_roles {
                 if ($num_sections == 0) {                  if ($num_sections == 0) {
                     unless ($udom eq $one) {                      unless ($udom eq $one) {
                         $restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom,                          $restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom,
                                           $uname,$two,$start,$end,$one,$two,'','',\%process_by,                                            $uname,$two,$start,$end,$cdom,$cnum,'','',\%process_by,
                                           \%instdoms,\%got_role_approvals,\%got_instdoms,\%reject,                                            \%instdoms,\%got_role_approvals,\%got_instdoms,\%reject,
                                           \%pending,\%notifydc,\%status,\%unauthorized,\%currqueued);                                            \%pending,\%notifydc,\%status,\%unauthorized,\%currqueued);
                         next if ($restricted);                          next if ($restricted);
Line 4353  sub update_roles { Line 4353  sub update_roles {
                             unless ($udom eq $one) {                              unless ($udom eq $one) {
                                 undef($restricted);                                  undef($restricted);
                                 $restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom,                                  $restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom,
                                                   $uname,$two,$start,$end,$one,$two,$sec,'',\%process_by,                                                    $uname,$two,$start,$end,$cdom,$cnum,$sec,'',\%process_by,
                                                   \%instdoms,\%got_role_approvals,\%got_instdoms,\%reject,                                                    \%instdoms,\%got_role_approvals,\%got_instdoms,\%reject,
                                                   \%pending,\%notifydc,\%status,\%unauthorized,\%currqueued);                                                    \%pending,\%notifydc,\%status,\%unauthorized,\%currqueued);
                                 next if ($restricted);                                  next if ($restricted);
Line 4368  sub update_roles { Line 4368  sub update_roles {
                         unless ($udom eq $one) {                          unless ($udom eq $one) {
                             undef($restricted);                              undef($restricted);
                             $restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom,                              $restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom,
                                               $uname,$two,$start,$end,$one,$two,'','',\%process_by,                                                $uname,$two,$start,$end,$cdom,$cnum,'','',\%process_by,
                                               \%instdoms,\%got_role_approvals,\%got_instdoms,\%reject,                                                \%instdoms,\%got_role_approvals,\%got_instdoms,\%reject,
                                               \%pending,\%notifydc,\%status,\%unauthorized,\%currqueued);                                                \%pending,\%notifydc,\%status,\%unauthorized,\%currqueued);
                             next if ($restricted);                              next if ($restricted);
Line 7070  ENDSCRIPT Line 7070  ENDSCRIPT
                      chgcontext         => 'any',                       chgcontext         => 'any',
                      rolelog_start_date => $defstart,                       rolelog_start_date => $defstart,
                      rolelog_end_date   => $now,                       rolelog_end_date   => $now,
                        approvals          => 'any',
                    );                     );
     my $more_records = 0;      my $more_records = 0;
   
     # set current      # set current
     my %curr;      my %curr;
     foreach my $item ('show','page','role','chgcontext') {      foreach my $item ('show','page','role','chgcontext','approvals') {
         $curr{$item} = $env{'form.'.$item};          $curr{$item} = $env{'form.'.$item};
     }      }
     my ($startdate,$enddate) =       my ($startdate,$enddate) = 
Line 7149  ENDSCRIPT Line 7150  ENDSCRIPT
         if (($context eq 'course') && ($viewablesec ne '')) {          if (($context eq 'course') && ($viewablesec ne '')) {
             next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec);              next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec);
         }          }
           if ($curr{'approvals'} eq 'none') {
               next if ($roleslog{$id}{'logentry'}{'approval'});
           } elsif ($curr{'approvals'} ne 'any') { 
               next if ($roleslog{$id}{'logentry'}{'approval'} ne $curr{'approvals'});
           }
         $count ++;          $count ++;
         next if ($count < $minshown);          next if ($count < $minshown);
         unless ($showntableheader) {          unless ($showntableheader) {
Line 7195  ENDSCRIPT Line 7201  ENDSCRIPT
         if ($chgcontext ne '' && $lt{$chgcontext} ne '') {          if ($chgcontext ne '' && $lt{$chgcontext} ne '') {
             $chgcontext = $lt{$chgcontext};              $chgcontext = $lt{$chgcontext};
         }          }
           my ($showreqby,%reqby);
           if (($roleslog{$id}{'logentry'}{'approval'}) &&
               ($roleslog{$id}{'logentry'}{'requester'})) {
               if ($reqby{$roleslog{$id}{'logentry'}{'requester'}} eq '') {
                   my ($requname,$requdom) = split(/:/,$roleslog{$id}{'logentry'}{'requester'});
                   $reqby{$roleslog{$id}{'logentry'}{'requester'}} =
                       &Apache::loncommon::plainname($requname,$requdom);
               }
               $showreqby = &mt('Requester').': <span class="LC_nobreak">'.$reqby{$roleslog{$id}{'logentry'}{'requester'}}.'</span><br />';
               if ($roleslog{$id}{'logentry'}{'approval'} eq 'domain') {
                   $showreqby .= &mt('Adjudicator').': <span class="LC_nobreak">'.
                                 $whodunit{$roleslog{$id}{'exe_uname'}.':'.$roleslog{$id}{'exe_udom'}}.
                                 '</span>';
               } else {
                   $showreqby .= '<span class="LC_nobreak">'.&mt('User approved').'</span>';
               }
           } else {
               $showreqby = $whodunit{$roleslog{$id}{'exe_uname'}.':'.$roleslog{$id}{'exe_udom'}};
           }
         $r->print(          $r->print(
             &Apache::loncommon::start_data_table_row()              &Apache::loncommon::start_data_table_row()
            .'<td>'.$count.'</td>'             .'<td>'.$count.'</td>'
            .'<td>'.&Apache::lonlocal::locallocaltime($roleslog{$id}{'exe_time'}).'</td>'             .'<td>'.&Apache::lonlocal::locallocaltime($roleslog{$id}{'exe_time'}).'</td>'
            .'<td>'.$whodunit{$roleslog{$id}{'exe_uname'}.':'.$roleslog{$id}{'exe_udom'}}.'</td>'             .'<td>'.$showreqby.'</td>'
            .'<td>'.$changed{$roleslog{$id}{'uname'}.':'.$roleslog{$id}{'udom'}}.'</td>'             .'<td>'.$changed{$roleslog{$id}{'uname'}.':'.$roleslog{$id}{'udom'}}.'</td>'
            .'<td>'.&Apache::lonnet::plaintext($roleslog{$id}{'logentry'}{'role'},$crstype).'</td>');             .'<td>'.&Apache::lonnet::plaintext($roleslog{$id}{'logentry'}{'role'},$crstype).'</td>');
         if ($context eq 'course') {           if ($context eq 'course') { 
Line 7688  sub role_display_filter { Line 7713  sub role_display_filter {
                &mt('Context:').'</b><br /><select name="chgcontext">';                 &mt('Context:').'</b><br /><select name="chgcontext">';
     my @posscontexts;      my @posscontexts;
     if ($context eq 'course') {      if ($context eq 'course') {
         @posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses','chgtype');          @posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses','chgtype','ltienroll');
     } elsif ($context eq 'domain') {      } elsif ($context eq 'domain') {
         @posscontexts = ('any','domain','requestauthor','domconfig','server');          @posscontexts = ('any','domain','requestauthor','domconfig','server');
     } else {      } else {
Line 7706  sub role_display_filter { Line 7731  sub role_display_filter {
         }          }
         $output .= '<option value="'.$chgtype.'"'.$selstr.'>'.$lt{$chgtype}.'</option>'."\n";          $output .= '<option value="'.$chgtype.'"'.$selstr.'>'.$lt{$chgtype}.'</option>'."\n";
     }      }
     $output .= '</select></td>'      my @possapprovals = ('any','none','domain','user');
               .'</tr></table>';      my %apptxt = &approval_types();
       $output .= '</select></td>'.
                  '<td>&nbsp;&nbsp;</td>'.
                  '<td valign="top"><b>'.
                  &mt('Approvals:').'</b><br /><select name="approvals">';
       foreach my $approval (@possapprovals) {
           my $selstr = '';
           if ($curr->{'approvals'} eq $approval) {
               $selstr = ' selected="selected"';
           }    
           $output .= '<option value="'.$approval.'"'.$selstr.'>'.$apptxt{$approval}.'</option>';
       }
       $output .= '</select></td></tr></table>';
   
     # Update Display button      # Update Display button
     $output .= '<p>'      $output .= '<p>'
Line 7744  sub rolechg_contexts { Line 7781  sub rolechg_contexts {
                                              domain       => 'User Management in domain',                                               domain       => 'User Management in domain',
                                              selfenroll   => 'Self-enrolled',                                               selfenroll   => 'Self-enrolled',
                                              requestcourses => 'Course Request',                                               requestcourses => 'Course Request',
                                                ltienroll    => 'Enrollment via LTI',
                                          );                                           );
         if ($crstype eq 'Community') {          if ($crstype eq 'Community') {
             $lt{'createcourse'} = &mt('Community Creation');              $lt{'createcourse'} = &mt('Community Creation');
Line 7768  sub rolechg_contexts { Line 7806  sub rolechg_contexts {
     return %lt;      return %lt;
 }  }
   
   sub approval_types {
       return &Apache::lonlocal::texthash (
                                             any => 'Any',
                                             none => 'No approval needed',
                                             user => 'Role recipient approval',
                                             domain => 'Domain coordinator approval',
                                          );
   }
   
 sub print_helpdeskaccess_display {  sub print_helpdeskaccess_display {
     my ($r,$permission,$brcrum) = @_;      my ($r,$permission,$brcrum) = @_;
     my $formname = 'helpdeskaccess';      my $formname = 'helpdeskaccess';

Removed from v.1.467  
changed lines
  Added in v.1.468


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