Diff for /loncom/interface/lonconfigsettings.pm between versions 1.21.4.9.2.1 and 1.21.4.9.6.2

version 1.21.4.9.2.1, 2017/08/15 23:41:34 version 1.21.4.9.6.2, 2020/05/22 22:38:55
Line 39  use Apache::courseclassifier(); Line 39  use Apache::courseclassifier();
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
   
 sub print_header {  sub print_header {
     my ($r,$phase,$context,$jscript,$container,$instcode,$dom) = @_;      my ($r,$phase,$context,$jscript,$container,$instcode,$dom,$values) = @_;
     my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check,      my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check,
         $crstype,@actions,@code_order);          $crstype,@actions,@code_order);
     if ($phase eq 'display') {      if ($phase eq 'display') {
Line 178  $jscript Line 178  $jscript
         if ($context eq 'domain') {          if ($context eq 'domain') {
             my $onload;              my $onload;
             if (grep(/^coursedefaults$/,@actions)) {              if (grep(/^coursedefaults$/,@actions)) {
                 $onload = "toggleDisplay(document.display,'cloneinstcode');".                  $onload = "toggleDisplay(document.display,'cloneinstcode');".     
                           "toggleDisplay(document.display,'credits');".                            "toggleDisplay(document.display,'credits');".
                           "toggleDisplay(document.display,'studentsubmission');";                            "toggleDisplay(document.display,'studentsubmission');";
             }              }
             if (grep(/^selfcreation$/,@actions)) {              if (grep(/^ltitools$/,@actions)) {
                 my $prefix = 'cancreate_emailverified';                  $onload .= "toggleLTITools(document.display,'user','add');";
                 my $customclass = 'LC_selfcreate_email';                  if (ref($values) eq 'HASH') {
                 my $classprefix = 'LC_canmodify_emailusername_';                      if (ref($values->{'ltitools'}) eq 'HASH') {
                 my $optionsprefix = 'LC_options_emailusername_';                          my $numltitools = scalar(keys(%{$values->{'ltitools'}}));
                 $onload .= "toggleRows(document.display,'cancreate_email','selfassign','$customclass','$classprefix','$optionsprefix');";                          for (my $i=0; $i<$numltitools; $i++) {
                 my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);                              $onload .= "toggleLTITools(document.display,'user','$i');";
                 my $hascustom;                          }
                 my ($emailrules,$emailruleorder) = &Apache::lonnet::inst_userrules($dom,'email');  
                 if (ref($emailrules) eq 'HASH') {  
                     if (keys(%{$emailrules}) > 0) {  
                         $hascustom = 'cancreate_emailrule';  
                     }  
                 }  
                 my @posstypes;  
                 if (ref($types) eq 'ARRAY') {  
                     @posstypes = @{$types};  
                     push(@posstypes,'default');  
                     foreach my $type (@posstypes) {  
                         $onload .= "toggleEmailOptions(document.display,'cancreate_emailoptions','$hascustom',".  
                                                                "'cancreate_emaildomain','$type');";  
                     }                      }
                 } else {  
                     $onload .= "toggleEmailOptions(document.display,'cancreate_emailoptions','$hascustom',".  
                                                        "'cancreate_emaildomain','default');";  
                 }                  }
             }              }
             if ($onload) {              if ($onload) {
Line 366  sub display_settings { Line 350  sub display_settings {
     if (ref($values) eq 'HASH') {      if (ref($values) eq 'HASH') {
         $instcode = $values->{'internal.coursecode'};          $instcode = $values->{'internal.coursecode'};
     }      }
     &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom);      &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom,$values);
     my $divwidth = 900;      my $divwidth = 900;
     if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) {       if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { 
         if (@actions > 0) {          if (@actions > 0) {

Removed from v.1.21.4.9.2.1  
changed lines
  Added in v.1.21.4.9.6.2


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