[vhffs-dev] [403] Started largefile removing. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 403
Author: beuss
Date: 2007-01-18 21:56:07 +0000 (Thu, 18 Jan 2007)
Log Message:
-----------
Started largefile removing. This early commit aims to fix bug #0000192 (http://bugs.vhffs.org/view.php?id=192)
Modified Paths:
--------------
branches/vhffs_4.1/vhffs-api/src/Vhffs/Stats.pm
branches/vhffs_4.1/vhffs-panel/admin/stats.pl
branches/vhffs_4.1/vhffs-panel/templates/admin/misc/stats.tmpl
branches/vhffs_4.1/vhffs-tests/src/Stats.pl
Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Stats.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Stats.pm 2007-01-18 14:51:18 UTC (rev 402)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Stats.pm 2007-01-18 21:56:07 UTC (rev 403)
@@ -180,19 +180,6 @@
($self->{'lists'}{'totalsubs'}) = @{$self->{'db'}->selectrow_arrayref( $query )};
- $query = 'SELECT COUNT(*) FROM vhffs_largefile lf, vhffs_object o WHERE o.object_id=lf.object_id AND o.state='.Vhffs::Constants::ACTIVATED;
- ($self->{'largefile'}{'activated'}) = @{$self->{'db'}->selectrow_arrayref( $query )};
-
- $query = 'SELECT COUNT(*) FROM vhffs_largefile lf , vhffs_object o WHERE o.object_id=lf.object_id AND o.state='.Vhffs::Constants::WAITING_FOR_VALIDATION;
- ($self->{'largefile'}{'awaiting_validation'}) = @{$self->{'db'}->selectrow_arrayref( $query )};
-
- $query = 'SELECT COUNT(*) FROM vhffs_largefile lf , vhffs_object o WHERE o.object_id=lf.object_id AND o.state='.Vhffs::Constants::WAITING_FOR_CREATION;
- ($self->{'largefile'}{'awaiting_creation'}) = @{$self->{'db'}->selectrow_arrayref( $query )};
-
-
- $query = 'SELECT COUNT(*) FROM vhffs_largefile lf , vhffs_object o WHERE o.object_id=lf.object_id';
- ($self->{'largefile'}{'total'}) = @{$self->{'db'}->selectrow_arrayref( $query )};
-
return 1;
}
@@ -317,31 +304,12 @@
}
-sub get_largefile_in_moderation
-{
- my $self = shift;
- return $self->{'largefile'}{'awaiting_validation'};
-}
-
-sub get_largefile_total
-{
- my $self = shift;
- return $self->{'largefile'}{'total'};
-}
-
sub get_svn_activated
{
my $self = shift;
return $self->{'svn'}{'activated'};
}
-sub get_largefile_activated
-{
- my $self = shift;
- return $self->{'largefile'}{'activated'};
-}
-
-
sub get_mysql_in_moderation
{
my $self = shift;
Modified: branches/vhffs_4.1/vhffs-panel/admin/stats.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/stats.pl 2007-01-18 14:51:18 UTC (rev 402)
+++ branches/vhffs_4.1/vhffs-panel/admin/stats.pl 2007-01-18 21:56:07 UTC (rev 403)
@@ -163,14 +163,6 @@
$template->param( VALUE_TOTAL_LISTS_ACTIVATED => $stats->get_lists_activated );
$template->param( TEXT_TOTAL_SUBS => gettext("Total subscribtion for lists") );
$template->param( VALUE_TOTAL_SUBS => $stats->get_lists_totalsubs );
-
- ##LargeFile part
- $template->param( TEXT_LARGEFILE => gettext("Hosted files stats") );
- $template->param( TEXT_TOTAL_FILES => gettext("Total hoted files") );
- $template->param( TEXT_TOTAL_FILES_ACTIVATED => gettext("Total activated hoted files") );
- $template->param( VALUE_TOTAL_FILES => $stats->get_largefile_total );
- $template->param( VALUE_TOTAL_FILES_ACTIVATED => $stats->get_largefile_activated );
-
}
display Vhffs::Panel::Main($panel, $template->output);
Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/misc/stats.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/misc/stats.tmpl 2007-01-18 14:51:18 UTC (rev 402)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/misc/stats.tmpl 2007-01-18 21:56:07 UTC (rev 403)
@@ -90,11 +90,3 @@
<li><TMPL_VAR NAME="TEXT_TOTAL_SUBS">: <TMPL_VAR NAME="VALUE_TOTAL_SUBS"></li>
</ul>
-
-<h2>
- <TMPL_VAR NAME="TEXT_LARGEFILE">:
-</h2>
-<ul>
- <li><TMPL_VAR NAME="TEXT_TOTAL_FILES">: <TMPL_VAR NAME="VALUE_TOTAL_FILES"></li>
- <li><TMPL_VAR NAME="TEXT_TOTAL_FILES_ACTIVATED">: <TMPL_VAR NAME="VALUE_TOTAL_FILES_ACTIVATED"></li>
-</ul>
Modified: branches/vhffs_4.1/vhffs-tests/src/Stats.pl
===================================================================
--- branches/vhffs_4.1/vhffs-tests/src/Stats.pl 2007-01-18 14:51:18 UTC (rev 402)
+++ branches/vhffs_4.1/vhffs-tests/src/Stats.pl 2007-01-18 21:56:07 UTC (rev 403)
@@ -282,44 +282,6 @@
is($stats->get_svn_activated, $i, $i > 1 ? "$i SVN services activated" : "$i SVN service activated");
}
-# Largefile tests
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
- $group = new Vhffs::Group($main, "testgroup0$i", 401);
- $user = new Vhffs::User($main, "testuser0$i", 401);
- $group->fetch;
- $user->fetch;
- $svc = new Vhffs::Services::LargeFile($main, "lftest0$i", $user, $group);
- $svc->set_size(1024 * $i);
- $svc->set_type('dummy');
- $svc->create;
-}
-
-$stats->fetch;
-is($stats->get_largefile_in_moderation, 9, 'All LargeFile services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
- $group = new Vhffs::Group($main, "testgroup0$i", 401);
- $group->fetch;
- $svc = new Vhffs::Services::LargeFile($main, "lftest0$i", undef, $group);
- $svc->fetch;
- $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
- $svc->commit;
- $stats->fetch;
- is($stats->get_largefile_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' LargeFile service waiting for moderation' : ' LargeFile services waiting for moderation'));
- is($stats->get_largefile_activated, 0, 'No LargeFile service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
- $group = new Vhffs::Group($main, "testgroup0$i", 401);
- $group->fetch;
- $svc = new Vhffs::Services::LargeFile($main, "lftest0$i", undef, $group);
- $svc->fetch;
- $svc->set_status(Vhffs::Constants::ACTIVATED);
- $svc->commit;
- $stats->fetch;
- is($stats->get_largefile_activated, $i, $i > 1 ? "$i LargeFile services activated" : "$i LargeFile service activated");
-}
-
# Mail tests
for(my $i = 1 ; $i < 10 ; ++$i) {