Diff for /loncom/interface/lonmodifycourse.pm between versions 1.48 and 1.49

version 1.48, 2009/11/09 03:50:27 version 1.49, 2009/11/23 21:45:18
Line 55  sub autoenroll_keys { Line 55  sub autoenroll_keys {
 }  }
   
 sub catalog_settable {  sub catalog_settable {
     my ($confhash) = @_;      my ($confhash,$type) = @_;
     my @settable;      my @settable;
     if (ref($confhash) eq 'HASH') {      if (ref($confhash) eq 'HASH') {
         if ($confhash->{'togglecats'} ne 'crs') {          if ($type eq 'Community') {
             push(@settable,'togglecats');              if ($confhash->{'togglecatscomm'} ne 'comm') {
         }                  push(@settable,'togglecats');
         if ($confhash->{'categorize'} ne 'crs') {              }
             push(@settable,'categorize');              if ($confhash->{'categorizecomm'} ne 'comm') {
                   push(@settable,'categorize');
               }
           } else {
               if ($confhash->{'togglecats'} ne 'crs') {
                   push(@settable,'togglecats');
               }
               if ($confhash->{'categorize'} ne 'crs') {
                   push(@settable,'categorize');
               }
         }          }
     } else {      } else {
         push(@settable,('togglecats','categorize'));          push(@settable,('togglecats','categorize'));
Line 224  sub print_modification_menu { Line 233  sub print_modification_menu {
           }            }
     );      );
     my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);      my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);
     my @additional_params = &catalog_settable($domconf{'coursecategories'});      my @additional_params = &catalog_settable($domconf{'coursecategories'},$type);
     if (@additional_params > 0) {      if (@additional_params > 0) {
         push (@menu, { text => $cat_text,          push (@menu, { text => $cat_text,
                        phase => 'catsettings',                         phase => 'catsettings',
Line 399  sub print_catsettings { Line 408  sub print_catsettings {
         $lt{'catset'} = &mt('Catalog Settings for Community');          $lt{'catset'} = &mt('Catalog Settings for Community');
         $lt{'exclude'} = &mt('Exclude from course catalog');          $lt{'exclude'} = &mt('Exclude from course catalog');
         $lt{'categ'} = &mt('Categorize Community');          $lt{'categ'} = &mt('Categorize Community');
         $lt{'assi'} = &mt('Assign one or more categories and/or subcategories to this community.');          $lt{'assi'} = &mt('Assign one or more subcategories to this community.');
     }      }
     $r->print('<form action="/adm/modifycourse" method="post" name="catsettings">'.      $r->print('<form action="/adm/modifycourse" method="post" name="catsettings">'.
               '<h3>'.$lt{'catset'}.' <span class="LC_nobreak">'.$cdesc.'</span></h3>');                '<h3>'.$lt{'catset'}.' <span class="LC_nobreak">'.$cdesc.'</span></h3>');
     my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);      my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
     my @cat_params = &catalog_settable($domconf{'coursecategories'});      my @cat_params = &catalog_settable($domconf{'coursecategories'},$type);
     if (@cat_params > 0) {      if (@cat_params > 0) {
         my %currsettings =           my %currsettings = 
             &Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum);              &Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum);
Line 434  sub print_catsettings { Line 443  sub print_catsettings {
                 if (ref($cathash) eq 'HASH') {                  if (ref($cathash) eq 'HASH') {
                     $r->print($lt{'assi'}.'<br /><br />'.                      $r->print($lt{'assi'}.'<br /><br />'.
                               &Apache::loncommon::assign_categories_table($cathash,                                &Apache::loncommon::assign_categories_table($cathash,
                                                      $currsettings{'categories'}));                                                       $currsettings{'categories'},$type));
                 } else {                  } else {
                     $r->print(&mt('No categories defined for this domain'));                      $r->print(&mt('No categories defined for this domain'));
                 }                  }
Line 933  sub modify_catsettings { Line 942  sub modify_catsettings {
 <form action="/adm/modifycourse" method="post" name="processcat">  <form action="/adm/modifycourse" method="post" name="processcat">
 <h3>'.&mt('Category settings').'</h3>');  <h3>'.&mt('Category settings').'</h3>');
     my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);      my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
     my @cat_params = &catalog_settable($domconf{'coursecategories'});      my @cat_params = &catalog_settable($domconf{'coursecategories'},$type);
     if (@cat_params > 0) {      if (@cat_params > 0) {
         my (%cenv,@changes,@nochanges);          my (%cenv,@changes,@nochanges);
         my %currsettings =          my %currsettings =

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


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