'
.'
");
}
+sub display_usage {
+ my ($group) = @_;
+ my $disk_quota = &get_quota($group);
+ my $getpropath = 1;
+ my $portfolio_root = &get_portfolio_root();
+ my ($uname,$udom) = &get_name_dom($group);
+ my $current_disk_usage =
+ &Apache::lonnet::diskusage($udom,$uname,$portfolio_root,$getpropath);
+ my $usage = $current_disk_usage/1000;
+ my $quota = $disk_quota/1000;
+ my $percent;
+ if ($disk_quota == 0) {
+ $percent = 100.0;
+ } else {
+ $percent = 100*($current_disk_usage/$disk_quota);
+ }
+ $usage = sprintf("%.2f",$usage);
+ $quota = sprintf("%.2f",$quota);
+ $percent = sprintf("%.0f",$percent);
+ my ($color,$cssclass);
+ if ($percent <= 60) {
+ $color = '#00A000';
+ } elsif ($percent > 60 && $percent < 90) {
+ $color = '#FFD300';
+ $cssclass = 'class="LC_warning"';
+ } elsif( $percent >= 90) {
+ $color = '#FF0000';
+ $cssclass = 'class="LC_error"';
+ }
+ my $prog_width = $percent;
+ if ($prog_width > 100) {
+ $prog_width = 100;
+ }
+ my $disk_meter = '
+
'.&mt('Currently using [_1] of the [_2] available.',$usage.' MB
('.$percent.'%) ',$quota.' MB')."\n".
+'
'."\n".
+'
';
+ return $disk_meter;
+}
+
sub display_directory_line {
my ($r,$select_mode, $filename, $mtime, $size, $css_class,
$line, $access_controls, $curr_access, $now, $version_flag,
@@ -195,7 +235,7 @@ sub display_directory_line {
$r->print($line); # contains first two cells of table
my $lock_info;
if ($version_flag) { # versioned can't be versioned, so TRUE when root file
- $r->print('
');
+ $r->print('
');
$r->print('
'.$version_flag.' ');
} else { # this is a graded or handed back file
my ($user,$domain) = &get_name_dom($env{'form.group'});
@@ -373,7 +413,7 @@ sub display_directory {
$colspan_fill=' colspan="4"';
}
$r->print('
');
- $r->print(' '
+ $r->print(' '
.''.&mt('Go to ...').' ');
my %anchor_fields = (
'selectfile' => $filename.'/',
@@ -412,8 +452,8 @@ sub display_directory {
$line .= ' ';
}
if ($can_modify) {
- my $cat=' ';
+ my $cat=' ';
+# src="'.#&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />';
my %anchor_fields = (
'rename' => $filename,
currentpath => $current_path
@@ -694,7 +734,7 @@ sub rename {
} else {
&open_form($r,$url);
$r->print(''.&mt('Rename [_1] to [_2]?', &display_file()
- , ' ').'
');
+ , ' ').'');
&close_form($r,$url);
}
}
@@ -801,13 +841,13 @@ sub display_access {
$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 .= ' '.
- &mt('A listing of files viewable without log-in is available at: ')."http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio . ";
+ &mt('A listing of files viewable without log-in is available at: ')."".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme/portfolio . ";
if ($group eq '') {
$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 ";
+ $info .= "".&Apache::lonnet::absolute_url($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").' ';
}
@@ -1500,7 +1540,7 @@ sub course_row {
}
$max_id ++;
my $role_selects = &role_selectors($num,$role_id,$type,$content,'display');
- $r->print(' '.&mt('Delete').' '.$role_selects.'');
+ $r->print('
'.&mt('Delete').' '.$role_selects.'');
}
$r->print('');
}
@@ -1532,7 +1572,7 @@ sub domains_row {
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_;
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then,
'domains');
- my $dom_select = '
'.
+ my $dom_select = ''.
' '.&mt('Please select').' ';
if ($status eq 'old') {
my $content = $$access_controls{$item};
@@ -1575,7 +1615,7 @@ sub additional_item {
sub actionbox {
my ($status,$num,$scope) = @_;
- my $output = '';
+ my $output = '';
if ($status eq 'new') {
my $checkstate;
if ($scope eq 'domains' || $scope eq 'users' || $scope eq 'course') {
@@ -1586,7 +1626,7 @@ sub actionbox {
&mt('Activate');
} else {
$output .= ' '.&mt('Delete').' '.
+ '" />'.&mt('Delete').' '.
' '.&mt('Update');
}
@@ -1605,7 +1645,7 @@ sub dateboxes {
undef,undef,1);
my $enddate = &Apache::lonhtmlcommon::date_setter('portform',
'enddate_'.$num,$end,undef,undef,undef,1,undef,
- undef,undef,1). ' '.
+ undef,undef,1). ' '.
' '.&mt('No end date').
' ';
@@ -1676,7 +1716,7 @@ sub role_selectors {
'group' => $groups,
);
foreach my $item ('role','access','section','group') {
- $output .= ''."\n";
+ $output .= ''."\n";
foreach my $entry (@{$allitems{$item}}) {
if ($caller eq 'display') {
if ((@{$$content{'roles'}{$role_id}{$item}} > 0) &&
@@ -2097,7 +2137,7 @@ sub missing_priv {
$r->print(&mt('You do not have sufficient privileges to [_1] ',
$longtext->{$priv}));
if (defined($env{'form.group'})) {
- $r->print(&mt("in the group's file repository."));
+ $r->print(&mt("in the group's group portfolio."));
$rtnlink .= &group_args()
} else {
$r->print(&mt('in this portfolio.'));
@@ -2205,7 +2245,7 @@ sub handler {
$r->print(&mt('Not a valid group for this course'));
$earlyout = 1;
}
- $title = &mt('Group files for [_1]', $group);
+ $title = &mt('Group portfolio for [_1]', $group);
} else {
$r->print(&mt('Invalid group'));
$earlyout = 1;
@@ -2233,7 +2273,7 @@ sub handler {
} else {
($uname,$udom) = &get_name_dom();
$portfolio_root = &get_portfolio_root();
- $title = &mt('Portfolio Manager');
+ $title = &mt('My Space');
$can_modify = 1;
$can_delete = 1;
$can_upload = 1;
@@ -2245,14 +2285,28 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
# Give the LON-CAPA page header
+ my $brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}];
+
if ($env{"form.mode"} eq 'selectfile'){
$r->print(&Apache::loncommon::start_page($title,undef,
{'only_body' => 1}));
} elsif ($env{'form.action'} eq 'rolepicker') {
$r->print(&Apache::loncommon::start_page('New role-based condition',undef,
{'no_nav_bar' => 1, }));
- } else {
+ } elsif ($caller eq 'coursegrp_portfolio') {
$r->print(&Apache::loncommon::start_page($title));
+ } else {
+ $r->print(&Apache::loncommon::start_page($title,undef,
+ {'bread_crumbs' => $brcrum}));
+ if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {
+ $r->print(''.&mt('No user portfolio available') .' '.
+ &mt('This is a result of one of the following:').''.
+ ''.&mt('The administrator of this domain has disabled portfolio functionality for this specific user.').' '.
+ ''.&mt('The domain has been configured to disable, by default, portfolio functionality for all users in the domain.').' '.
+ ' ');
+ $r->print(&Apache::loncommon::end_page());
+ return OK;
+ }
}
$r->rflush();
my ($blocked,$blocktext) =
@@ -2390,7 +2444,7 @@ sub handler {
# need to know if directory is empty so it can be removed if desired
my $is_empty=(@dir_list == 2);
&display_common($r,$url,$current_path,$is_empty,\@dir_list,
- $can_upload);
+ $can_upload,$group);
&display_directory($r,$url,$current_path,$is_empty,\@dir_list,$group,
$can_upload,$can_modify,$can_delete,$can_setacl);
$r->print(&Apache::loncommon::end_page());