[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm

raeburn raeburn at source.lon-capa.org
Fri Jun 13 07:22:41 EDT 2014


raeburn		Fri Jun 13 11:22:41 2014 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - Textbox to set credits when assigning a student role only available
    where default credits defined in domain configuration.
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.401 loncom/interface/loncreateuser.pm:1.402
--- loncom/interface/loncreateuser.pm:1.401	Sat May 31 15:55:18 2014
+++ loncom/interface/loncreateuser.pm	Fri Jun 13 11:22:41 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.401 2014/05/31 15:55:18 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.402 2014/06/13 11:22:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7310,13 +7310,13 @@
                 ((($role eq 'cc') || ($role eq 'co')) && ($isowner))) {
                 $table .= &course_level_row($protectedcourse,$role,$area,$domain,
                                             $plrole,\%sections_count,\%lt,
-                                            $defaultcredits,$crstype);
+                                            $showcredits,$defaultcredits,$crstype);
             } elsif ($env{'request.course.sec'} ne '') {
                 if (&Apache::lonnet::allowed('c'.$role,$thiscourse.'/'.
                                              $env{'request.course.sec'})) {
                     $table .= &course_level_row($protectedcourse,$role,$area,$domain,
                                                 $plrole,\%sections_count,\%lt,
-                                                $defaultcredits,$crstype);
+                                                $showcredits,$defaultcredits,$crstype);
                 }
             }
         }
@@ -7325,7 +7325,8 @@
                 next if ($crstype eq 'Community' && $customroles{$cust} =~ /bre\&S/);
                 my $role = 'cr_cr_'.$env{'user.domain'}.'_'.$env{'user.name'}.'_'.$cust;
                 $table .= &course_level_row($protectedcourse,$role,$area,$domain,
-                                            $cust,\%sections_count,\%lt);
+                                            $cust,\%sections_count,\%lt,
+                                            $showcredits,$defaultcredits,$crstype);
             }
 	}
     }
@@ -7339,7 +7340,11 @@
 &Apache::loncommon::start_data_table().
 &Apache::loncommon::start_data_table_header_row().
 '<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th>'."\n".
-'<th>'.$lt{'ext'}.'</th><th>'.$lt{'crd'}.'</th>'."\n".
+'<th>'.$lt{'ext'}.'</th><th>'."\n";
+    if ($showcredits) {
+        $result .= $lt{'crd'}.'</th>';
+    }
+    $result .=
 '<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th>'."\n".
 '<th>'.$lt{'end'}.'</th>'.
 &Apache::loncommon::end_data_table_header_row().
@@ -7350,14 +7355,14 @@
 
 sub course_level_row {
     my ($protectedcourse,$role,$area,$domain,$plrole,$sections_count,
-        $lt,$defaultcredits,$crstype) = @_;
+        $lt,$showcredits,$defaultcredits,$crstype) = @_;
     my $creditem;
     my $row = &Apache::loncommon::start_data_table_row().
               ' <td><input type="checkbox" name="act_'.
               $protectedcourse.'_'.$role.'" /></td>'."\n".
               ' <td>'.$plrole.'</td>'."\n".
               ' <td>'.$area.'<br />Domain: '.$domain.'</td>'."\n";
-    if (($role eq 'st') && ($crstype eq 'Course')) {
+    if (($showcredits) && ($role eq 'st') && ($crstype eq 'Course')) {
         $row .= 
             '<td><input type="text" name="credits_'.$protectedcourse.'_'.
             $role.'" size="3" value="'.$defaultcredits.'" /></td>';




More information about the LON-CAPA-cvs mailing list