Diff for /loncom/interface/portfolio.pm between versions 1.254.2.3 and 1.254.2.4

version 1.254.2.3, 2018/09/14 21:01:02 version 1.254.2.4, 2019/08/13 03:09:48
Line 112  sub display_common { Line 112  sub display_common {
 END  END
         }          }
   
           # Find space available before uploading
           my $free_space = &free_space($group);
   
         # Upload File          # Upload File
         $r->print('<div class="LC_left_float">'          $r->print('<div class="LC_left_float">'
                  .'<form method="post" enctype="multipart/form-data" action="'.$escuri.'">'                   .'<form method="post" enctype="multipart/form-data" action="'.$escuri.'">'
                  .'<fieldset>'                   .'<fieldset>'
                  .'<legend>'.$lt{'upload_label'}.'</legend>'                   .'<legend>'.$lt{'upload_label'}.'</legend>'
                  .$groupitem                    .$groupitem 
                  .'<input name="uploaddoc" type="file" />'                   .'<input name="uploaddoc" type="file" class="LC_flUpload" />'
                    .'<input type="hidden" id="LC_free_space" value="'.$free_space.'" />'
                  .'<input type="hidden" name="currentpath" value="'.$current_path.'" />'                   .'<input type="hidden" name="currentpath" value="'.$current_path.'" />'
                  .'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />'                   .'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />'
                  .'<input type="hidden" name="symb" value="'.$env{"form.symb"}.'" />'                   .'<input type="hidden" name="symb" value="'.$env{"form.symb"}.'" />'
Line 2598  STATE Line 2602  STATE
     return $state;      return $state;
 }  }
   
   # Find space available in a user's portfolio (convert to bytes)
   sub free_space {
       my ($group) = @_;
       my $disk_quota = &get_quota($group); # Expressed in kB
       my ($uname,$udom) = &get_name_dom($group);
       my $portfolio_root = &get_portfolio_root();
       my $getpropath = 1;
       my $current_disk_usage = &Apache::lonnet::diskusage($udom, $uname,
                                $portfolio_root, $getpropath); # Expressed in kB
       my $free_space = 1024 * ($disk_quota - $current_disk_usage);
       return $free_space;
   }
   
 sub valid_container {  sub valid_container {
     my ($uname,$udom,$group) = @_;      my ($uname,$udom,$group) = @_;
     my $container_prefix;      my $container_prefix;
Line 2724  sub handler { Line 2741  sub handler {
     # Give the LON-CAPA page header      # Give the LON-CAPA page header
     my $brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}];      my $brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}];
   
       my $js = '<script type="text/javascript"
                   src="/res/adm/includes/file_upload.js"></script>';
   
     if ($env{"form.mode"} eq 'selectfile'){      if ($env{"form.mode"} eq 'selectfile'){
         $r->print(&Apache::loncommon::start_page($title,undef,          $r->print(&Apache::loncommon::start_page($title, $js,
  {'only_body' => 1}));   {'only_body' => 1}));
     } elsif ($env{'form.action'} eq 'rolepicker') {      } elsif ($env{'form.action'} eq 'rolepicker') {
         $r->print(&Apache::loncommon::start_page('New role-based condition',undef,          $r->print(&Apache::loncommon::start_page('New role-based condition', $js,
                                                  {'no_nav_bar'  => 1, }));                                                   {'no_nav_bar'  => 1, }));
     } elsif ($caller eq 'coursegrp_portfolio') {      } elsif ($caller eq 'coursegrp_portfolio') {
         $r->print(&Apache::loncommon::start_page($title));          $r->print(&Apache::loncommon::start_page($title, $js));
     } else {      } else {
         $r->print(&Apache::loncommon::start_page($title,undef,          $r->print(&Apache::loncommon::start_page($title, $js,
                                                  {'bread_crumbs' => $brcrum}));                                                   {'bread_crumbs' => $brcrum}));
         if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {          if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {
             $r->print('<h2>'.&mt('No user portfolio available') .'</h2>'.              $r->print('<h2>'.&mt('No user portfolio available') .'</h2>'.

Removed from v.1.254.2.3  
changed lines
  Added in v.1.254.2.4


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