[vhffs-dev] [svn] commit: r148 - in /trunk: vhffs-api/src/Vhffs/Services/LargeFile.pm vhffs-panel/public/group.pl vhffs-panel/templates/public/group.tmpl vhffs-robots/src/delete_web.pl

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Author: soda
Date: Mon Jan 30 23:30:48 2006
New Revision: 148

Log:
Add public section for largefile
Fix svnweb url in public section


Modified:
    trunk/vhffs-api/src/Vhffs/Services/LargeFile.pm
    trunk/vhffs-panel/public/group.pl
    trunk/vhffs-panel/templates/public/group.tmpl
    trunk/vhffs-robots/src/delete_web.pl

Modified: trunk/vhffs-api/src/Vhffs/Services/LargeFile.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Services/LargeFile.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Services/LargeFile.pm Mon Jan 30 23:30:48 2006
@@ -384,6 +384,44 @@
 }
 
 
+
+sub getall_by_group
+{
+    my $vhffs = shift;
+    my $group = shift;
+
+    my $query;
+    my $request;
+
+    my $objs;
+    my $result;
+    my $tmp;
+
+    return undef if( $group->fetch < 1 );
+     
+    $query = "SELECT lf.filename, lf.object_id FROM  vhffs_largefile lf, vhffs_object o WHERE lf.object_id = o.object_id AND lf.owner_gid='".$group->get_gid."'";
+    
+    $request = $vhffs->{'db'}->{'DB_READ'}->prepare( $query );
+    my $rows = $request->execute;
+
+    return undef if( $rows == 0);
+
+    $result = $request->fetchall_hashref( 'filename' );
+
+    foreach( keys %{$result} )
+    {
+        $tmp = new Vhffs::Services::LargeFile( $vhffs , $_  , undef , $group);
+        if( ( defined ( $tmp ) ) && ( $tmp->fetch > 0 ) )
+        {
+            push @{$objs} , $tmp;
+        }
+    }
+    return $objs;
+}
+
+
+
+
 sub set_user
 {
 	my ( $self , $user ) = @_;

Modified: trunk/vhffs-panel/public/group.pl
==============================================================================
--- trunk/vhffs-panel/public/group.pl (original)
+++ trunk/vhffs-panel/public/group.pl Mon Jan 30 23:30:48 2006
@@ -22,6 +22,7 @@
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $cgi = new CGI;
 my $repos;
+my $files;
 
 my $name = $cgi->param("name");
 $name = Vhffs::Functions::check_arg( $name );
@@ -125,6 +126,9 @@
 			$template->param( CVS_VALUE => gettext("No cvs repository available for this group") );
 		    }
 		}
+
+
+
 		if( $vhffs->get_config->use_svn == 1 )
 		{
 		    use Vhffs::Services::Svn;
@@ -138,7 +142,7 @@
 			   	 	$subtemplate = new HTML::Template( filename => $templatedir."/public/misc/svn-part.tmpl" );
 			    	$subtemplate->param( SVNROOT => $_->get_reponame );
 			    	$subtemplate->param( DESCRIPTION => $_->get_description );
-			    	$subtemplate->param( SVNURL  => $vhffs->get_config->get_svnweburl . "/" . $group->get_groupname . "/" . $_->get_reponame );
+			    	$subtemplate->param( SVNURL  => $vhffs->get_config->get_svnweburl . "/listing.php?repname=".$_->get_reponame."+(".$group->get_groupname.")" );
 			    	$output .= $subtemplate->output;
 				}
 
@@ -150,6 +154,35 @@
 	    	}
 		}
 
+
+
+		if( $vhffs->get_config->use_largefile == 1 )
+		{
+		    use Vhffs::Services::LargeFile;
+		    $files = Vhffs::Services::LargeFile::getall_by_group( $vhffs , $group );
+		    $output = "";
+		    $template->param( LARGEFILE_TITLE => gettext("Hosted files for this group"));
+		    if( defined $files )
+		    {
+				foreach(  @{$files} )
+				{
+			   	 	$subtemplate = new HTML::Template( filename => $templatedir."/public/misc/largefile-part.tmpl" );
+			    	$subtemplate->param( FILENAME => $_->get_filename );
+			    	$subtemplate->param( TYPE => $_->get_type );
+			    	$subtemplate->param( LICENCE => $_->get_description );
+			    	$subtemplate->param( DOWNLOAD  => "" );
+			    	$output .= $subtemplate->output;
+				}
+
+				$template->param( LARGEFILE_VALUE => $output );
+		    }
+	    	else
+	    	{
+				$template->param( LARGEFILE_VALUE => gettext("No file available for this group") );
+	    	}
+		}
+
+
 	}
 }
 print "Content-Type: text/html; charset=utf-8\n\n" . $template->output;

Modified: trunk/vhffs-panel/templates/public/group.tmpl
==============================================================================
--- trunk/vhffs-panel/templates/public/group.tmpl (original)
+++ trunk/vhffs-panel/templates/public/group.tmpl Mon Jan 30 23:30:48 2006
@@ -44,5 +44,12 @@
 			</ul>
 		</p>
 
+		<p>
+			<h2><tmpl_var name="LARGEFILE_TITLE"></h2>
+			<ul>
+				<tmpl_var name="LARGEFILE_VALUE">
+			</ul>
+		</p>
+
 </body>
 </html>

Modified: trunk/vhffs-robots/src/delete_web.pl
==============================================================================
--- trunk/vhffs-robots/src/delete_web.pl (original)
+++ trunk/vhffs-robots/src/delete_web.pl Mon Jan 30 23:30:48 2006
@@ -15,8 +15,6 @@
 
 foreach $web ( @{$webs} )
 {
-	x
-	x
 	if( Vhffs::Robots::Web::delete( $main , $web ) < 0 )
 	{
 		Vhffs::Robots::vhffs_log( sprintf( "Cannot delete web %s" , $web->get_servername ) );




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/