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

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 22 Jun 2006 18:33:59 -0000


raeburn		Thu Jun 22 14:33:59 2006 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  Need to include $content =  $$access_controls{$item} if you're going to eliminate the call to lonnet::parse_access_controls() -- see rev 1.109.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.114 loncom/interface/portfolio.pm:1.115
--- loncom/interface/portfolio.pm:1.114	Thu Jun 22 13:56:06 2006
+++ loncom/interface/portfolio.pm	Thu Jun 22 14:33:58 2006
@@ -1012,10 +1012,11 @@
 
 sub course_row {
     my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_;
-    my %content;
+    my $content;
     my $defdom = $env{'user.domain'};
     if ($status eq 'old') {
-        $defdom =  $$access_controls{$item}{'domain'}; 
+        $content = $$access_controls{$item}; 
+        $defdom =  $content->{'domain'};
     }
     my $js = &Apache::loncommon::coursebrowser_javascript($defdom)
 	.&course_js();
@@ -1027,9 +1028,9 @@
                                                     $type);
     $r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>');
     if ($status eq 'old') {
-        my $cid = $content{'domain'}.'_'.$content{'number'};
+        my $cid = $content->{'domain'}.'_'.$content->{'number'};
         my %course_description = &Apache::lonnet::coursedescription($cid);
-        $r->print('<td><input type="hidden" name="crsdom_'.$num.'" value="'.$content{'domain'}.'" /><input type="hidden" name="crsnum_'.$num.'" value="'.$content{'number'}.'" />'.$course_description{'description'}.'</td>');
+        $r->print('<td><input type="hidden" name="crsdom_'.$num.'" value="'.$content->{'domain'}.'" /><input type="hidden" name="crsnum_'.$num.'" value="'.$content->{'number'}.'" />'.$course_description{'description'}.'</td>');
     } elsif ($status eq 'new') {
         my $uctype = $type;
         $uctype =~ s/^(\w)/uc($1)/e;
@@ -1042,15 +1043,15 @@
               &mt($crsgrptext).'</th></tr>');
     if ($status eq 'old') {
         my $max_id = 0;
-        foreach my $role_id (sort(keys(%{$content{'roles'}}))) {
+        foreach my $role_id (sort(keys(%{$content->{'roles'}}))) {
             if ($role_id > $max_id) {
                 $max_id = $role_id;
             }
             $max_id ++;
-            my $role_selects = &role_selectors($num,$role_id,$status,$type,\%content,'display');
+            my $role_selects = &role_selectors($num,$role_id,$status,$type,$content,'display');
             $r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>');
         }
-        $r->print('</table><br />'.&mt('Add a roles-based condition').'&nbsp;<input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content{domain}','$content{number}','Course'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>');
+        $r->print('</table><br />'.&mt('Add a roles-based condition').'&nbsp;<input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content->{'domain'}','$content->{'number'}','Course'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>');
     } elsif ($status eq 'new') {
         my $role_id = 1;
         my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display');