--- loncom/interface/portfolio.pm 2006/11/05 21:08:53 1.170 +++ loncom/interface/portfolio.pm 2006/11/22 03:56:36 1.174 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.170 2006/11/05 21:08:53 raeburn Exp $ +# $Id: portfolio.pm,v 1.174 2006/11/22 03:56:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -101,7 +101,6 @@ sub display_common { # FIXME: This line should be deleted once Portfolio uses breadcrumbs $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio')); - $r->print(<<"TABLE"); @@ -270,7 +269,9 @@ sub display_directory { $r->print(&Apache::loncommon::help_open_topic('Portfolio FileList', 'Using the portfolio file list')); $r->print('
'. - '
Actions  Name'. + '
Actions'. + &Apache::loncommon::help_open_topic('Portfolio FileAction'). + '  Name'. &Apache::loncommon::help_open_topic('Portfolio OpenFile'). 'SizeLast ModifiedCurrent Access Status'. &Apache::loncommon::help_open_topic('Portfolio ShareFile'). @@ -760,9 +761,16 @@ sub display_access { $info .= '
  • '.&mt('Public files are available to anyone without the need for login.'); $info .= '
  • '.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.'); $info .= '
  • '.&explain_conditionals(); - $info .= '
'; + $info .= ''. + &mt('A listing of files viewable without log-in is available at: ')."http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio.
"; if ($group eq '') { - $info .= (&mt("A listing of files viewable without log-in is available at: http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio.
For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:
http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme
")); + $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:"); + } else { + $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on the course information page:"); + } + $info .= "
http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme
"; + if ($group ne '') { + $info .= &mt("Users with privileges to edit course contents may add a course information page to a course using the 'Course Info' button in DOCS").'
'; } } else { $header = '

'.&mt('Conditional access controls for file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'

'. @@ -872,7 +880,7 @@ sub build_access_summary { if ($scope eq 'guest') { $r->print(&mt('Passphrase').': '.$content->{'password'}); } elsif ($scope eq 'course') { - $r->print(''); + $r->print('
'); $r->print(''); @@ -1334,7 +1342,7 @@ sub display_access_row { $r->print(&Apache::loncommon::start_data_table_header_row()); $r->print(''); - if ($type eq 'course') { + if ($type eq 'course' && $status eq 'old') { $r->print(''); $colspan ++; @@ -1371,34 +1379,37 @@ sub display_access_row { sub course_js { return qq| END_SCRIPT $r->print(&mt('Select roles, course status, section(s) and group(s) for users who will be able to access the portfolio file.')); @@ -1714,15 +1754,7 @@ sub upload { my ($r,$url,$group)=@_; my $fname=$env{'form.uploaddoc.filename'}; my $filesize = (length($env{'form.uploaddoc'})) / 1000; #express in k (1024?) - my $disk_quota = 20000; # expressed in k - if (defined($group)) { - my $grp_quota = &get_group_quota($group); # quota expressed in k - if ($grp_quota ne '') { - $disk_quota = $grp_quota; - } else { - $disk_quota = 0; - } - } + my $disk_quota = &get_quota($group); $fname=&Apache::lonnet::clean_filename($fname); my $portfolio_root=&get_portfolio_root(); @@ -1988,6 +2020,24 @@ sub coursegrp_portfolio_header { return $output; } +sub get_quota { + my ($group) = @_; + my $disk_quota; + if (defined($group)) { + my $grp_quota = &get_group_quota($group); # quota expressed in k + if ($grp_quota ne '') { + $disk_quota = $grp_quota; + } else { + $disk_quota = 0; + } + } else { + $disk_quota = &Apache::loncommon::get_user_quota($env{'user.name'}, + $env{'user.domain'}); #expressed in Mb + $disk_quota = 1000 * $disk_quota; # convert from Mb to kb + } + return $disk_quota; +} + sub handler { # this handles file management
'.&mt('Roles').''. &mt('Access').''. &mt('Sections').''.&mt('Action?').''.&mt($uctype).''. &mt('Dates available').''.&mt('Allowed [_1] member affiliations',$type). '