Diff for /loncom/interface/portfolio.pm between versions 1.114 and 1.115

version 1.114, 2006/06/22 17:56:06 version 1.115, 2006/06/22 18:33:58
Line 1012  function getIndex(name,value) { Line 1012  function getIndex(name,value) {
   
 sub course_row {  sub course_row {
     my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_;      my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_;
     my %content;      my $content;
     my $defdom = $env{'user.domain'};      my $defdom = $env{'user.domain'};
     if ($status eq 'old') {      if ($status eq 'old') {
         $defdom =  $$access_controls{$item}{'domain'};           $content = $$access_controls{$item}; 
           $defdom =  $content->{'domain'};
     }      }
     my $js = &Apache::loncommon::coursebrowser_javascript($defdom)      my $js = &Apache::loncommon::coursebrowser_javascript($defdom)
  .&course_js();   .&course_js();
Line 1027  sub course_row { Line 1028  sub course_row {
                                                     $type);                                                      $type);
     $r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>');      $r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>');
     if ($status eq 'old') {      if ($status eq 'old') {
         my $cid = $content{'domain'}.'_'.$content{'number'};          my $cid = $content->{'domain'}.'_'.$content->{'number'};
         my %course_description = &Apache::lonnet::coursedescription($cid);          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') {      } elsif ($status eq 'new') {
         my $uctype = $type;          my $uctype = $type;
         $uctype =~ s/^(\w)/uc($1)/e;          $uctype =~ s/^(\w)/uc($1)/e;
Line 1042  sub course_row { Line 1043  sub course_row {
               &mt($crsgrptext).'</th></tr>');                &mt($crsgrptext).'</th></tr>');
     if ($status eq 'old') {      if ($status eq 'old') {
         my $max_id = 0;          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) {              if ($role_id > $max_id) {
                 $max_id = $role_id;                  $max_id = $role_id;
             }              }
             $max_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('<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') {      } elsif ($status eq 'new') {
         my $role_id = 1;          my $role_id = 1;
         my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display');          my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display');

Removed from v.1.114  
changed lines
  Added in v.1.115


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