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

www lon-capa-cvs@mail.lon-capa.org
Fri, 18 Jul 2003 20:53:06 -0000


www		Fri Jul 18 16:53:06 2003 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  Work on Bug #795
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.61 loncom/interface/loncreateuser.pm:1.62
--- loncom/interface/loncreateuser.pm:1.61	Fri Jul 18 15:50:28 2003
+++ loncom/interface/loncreateuser.pm	Fri Jul 18 16:53:06 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.61 2003/07/18 19:50:28 www Exp $
+# $Id: loncreateuser.pm,v 1.62 2003/07/18 20:53:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -314,8 +314,8 @@
                    }
                    # Compute the background color based on $area
                    $bgcol=$1.'_'.$2;
-                   $bgcol=~s/[^8-9b-e]//g;
-                   $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6);
+                   $bgcol=~s/[^7-9a-e]//g;
+                   $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
                    if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) {
                        $carea.='<br>Section/Group: '.$3;
                    }
@@ -347,7 +347,7 @@
                    }
                }
                my $row = '';
-               $row.='<tr bgcolor=#"'.$bgcol.'"><td>';
+               $row.='<tr bgcolor="#'.$bgcol.'"><td>';
                my $active=1;
                $active=0 if (($role_end_time) && ($now>$role_end_time));
                if (($active) && ($allowed)) {
@@ -861,7 +861,6 @@
 	$r->print('Existing Role "');
 # ------------------------------------------------- Get current role privileges
 	($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef);
-	$r->print($syspriv.' '.$dompriv.' '.$coursepriv);
     } else {
 	$r->print('New Role "');
 	$roledef='';
@@ -1026,6 +1025,10 @@
 sub course_level_table {
     my %inccourses = @_;
     my $table = '';
+# Custom Roles?
+
+    my %customroles=&my_custom_roles();
+
     foreach (sort( keys(%inccourses))) {
 	my $thiscourse=$_;
 	my $protectedcourse=$_;
@@ -1034,8 +1037,8 @@
 	my $area=$coursedata{'description'};
 	if (!defined($area)) { $area='Unavailable course: '.$_; }
 	my $bgcol=$thiscourse;
-	$bgcol=~s/[^8-9b-e]//g;
-	$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6);
+	$bgcol=~s/[^7-9a-e]//g;
+	$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
 	foreach  ('st','ta','ep','ad','in','cc') {
 	    if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {
 		my $plrole=&Apache::lonnet::plaintext($_);
@@ -1065,6 +1068,22 @@
                 $table.= "</tr>\n";
             }
         }
+        foreach (sort keys %customroles) {
+	    my $plrole=$_;
+	    $table .= <<ENDENTRY;
+<tr bgcolor="#$bgcol">
+<td><input type="checkbox" name="act_$protectedcourse\_$_"></td>
+<td>$plrole</td>
+<td>$area</td>
+<td><input type="text" size="5" name="sec_$protectedcourse\_$_"></td>
+<td><input type=hidden name="start_$protectedcourse\_$_" value=''>
+<a href=
+"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date</a></td>
+<td><input type=hidden name="end_$protectedcourse\_$_" value=''>
+<a href=
+"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date</a></td></tr>
+ENDENTRY
+	}
     }
     return '' if ($table eq ''); # return nothing if there is nothing 
                                  # in the table