[vhffs-dev] [743] Display group owner in object list, allow find on groupname on objects.

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


Revision: 743
Author:   gradator
Date:     2007-08-01 19:29:17 +0000 (Wed, 01 Aug 2007)

Log Message:
-----------
Display group owner in object list, allow find on groupname on objects.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Object.pm
    trunk/vhffs-api/src/Vhffs/Panel/Object.pm
    trunk/vhffs-panel/admin/object/list.pl
    trunk/vhffs-panel/templates/admin/misc/list.tmpl
    trunk/vhffs-panel/templates/admin/object/part.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2007-08-01 01:33:47 UTC (rev 742)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2007-08-01 19:29:17 UTC (rev 743)
@@ -403,10 +403,10 @@
 	if( defined $name )
 	{
         $name = '%'.$name.'%';
-        $query = 'SELECT o.object_id, o.owner_uid, o.owner_gid, o.date_creation , o.description, o.state, o.type FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid WHERE ( o.description LIKE ? ) OR ( o.object_id LIKE ? ) OR ( o.owner_uid LIKE ? ) OR ( state LIKE ? ) OR ( u.username LIKE ? ) ORDER BY object_id';
+        $query = 'SELECT o.object_id, o.owner_uid, o.owner_gid, o.date_creation , o.description, o.state, o.type FROM vhffs_object o INNER JOIN vhffs_users u  ON o.owner_uid = u.uid INNER JOIN vhffs_groups g ON o.owner_gid = g.gid WHERE ( o.description LIKE ? ) OR ( o.object_id LIKE ? ) OR ( o.owner_uid LIKE ? ) OR ( state LIKE ? ) OR ( u.username LIKE ? ) OR ( g.groupname LIKE ? ) ORDER BY object_id';
         $request = $vhffs->get_db_object->prepare( $query ) or return -1;
 
-        return undef if ( !$request->execute( $name, $name, $name, $name, $name ));
+        return undef if ( !$request->execute( $name, $name, $name, $name, $name , $name ));
 	}
 	else
 	{

Modified: trunk/vhffs-api/src/Vhffs/Panel/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2007-08-01 01:33:47 UTC (rev 742)
+++ trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2007-08-01 19:29:17 UTC (rev 743)
@@ -55,11 +55,11 @@
     my $objs = [];
 
     if( defined $name ) {
-        $sql = 'SELECT o.object_id AS oid, u.username, o.type, o.state FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid WHERE ( o.description LIKE ? ) OR ( o.object_id LIKE ? ) OR ( o.owner_uid LIKE ? ) OR ( state LIKE ? ) OR ( u.username LIKE ? ) OR ( o.type LIKE ?) ORDER BY o.object_id';
+        $sql = 'SELECT o.object_id AS oid, u.username, g.groupname, o.type, o.state FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid INNER JOIN vhffs_groups g ON o.owner_gid = g.gid WHERE ( o.description LIKE ? ) OR ( o.object_id LIKE ? ) OR ( o.owner_uid LIKE ? ) OR ( state LIKE ? ) OR ( u.username LIKE ? ) OR ( o.type LIKE ?) OR ( g.groupname LIKE ? ) ORDER BY o.object_id';
         my $p = '%'.$name.'%';
-        push(@params, $p, $p, $p, $p, $p, $p);
+        push(@params, $p, $p, $p, $p, $p, $p, $p);
     } else {
-        $sql = 'SELECT o.object_id AS oid, u.username, o.type, o.state FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid ORDER BY o.object_id';
+        $sql = 'SELECT o.object_id AS oid, u.username, g.groupname, o.type, o.state FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid INNER JOIN vhffs_groups g ON o.owner_gid = g.gid ORDER BY o.object_id';
     }
     my $dbh = $main->get_db_object();
     my $sth = $dbh->prepare($sql) or return undef;

Modified: trunk/vhffs-panel/admin/object/list.pl
===================================================================
--- trunk/vhffs-panel/admin/object/list.pl	2007-08-01 01:33:47 UTC (rev 742)
+++ trunk/vhffs-panel/admin/object/list.pl	2007-08-01 19:29:17 UTC (rev 743)
@@ -49,9 +49,7 @@
 use Vhffs::Stats;
 use Vhffs::Constants;
 my $panel = new Vhffs::Panel::Main();
-if(!$panel)  {
-        exit 0;
-}
+exit 0 unless $panel;
 
 my $vhffs = $panel->{'vhffs'};
 my $session = $panel->{'session'};
@@ -85,9 +83,10 @@
 	}
 
     $template->param( TEXT_TITLE1 => gettext('Object ID') );
-    $template->param( TEXT_TITLE2 => gettext('Owner') );
-    $template->param( TEXT_TITLE3 => gettext('State') );
-    $template->param( TEXT_TITLE4 => gettext('History') );
+    $template->param( TEXT_TITLE2 => gettext('Owner user') );
+    $template->param( TEXT_TITLE3 => gettext('Owner group') );
+    $template->param( TEXT_TITLE4 => gettext('State') );
+    $template->param( TEXT_TITLE5 => gettext('History') );
 
 	my $objs = Vhffs::Panel::Object::search( $vhffs , $name );
 

Modified: trunk/vhffs-panel/templates/admin/misc/list.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/misc/list.tmpl	2007-08-01 01:33:47 UTC (rev 742)
+++ trunk/vhffs-panel/templates/admin/misc/list.tmpl	2007-08-01 19:29:17 UTC (rev 743)
@@ -6,6 +6,7 @@
 			<th><TMPL_VAR NAME="TEXT_TITLE2"></th>
 			<th><TMPL_VAR NAME="TEXT_TITLE3"></th>
 			<th><TMPL_VAR NAME="TEXT_TITLE4"></th>
+			<th><TMPL_VAR NAME="TEXT_TITLE5"></th>
 		</tr>
 		<TMPL_VAR NAME="LIST">
 </table>

Modified: trunk/vhffs-panel/templates/admin/object/part.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/object/part.tmpl	2007-08-01 01:33:47 UTC (rev 742)
+++ trunk/vhffs-panel/templates/admin/object/part.tmpl	2007-08-01 19:29:17 UTC (rev 743)
@@ -7,6 +7,9 @@
 		<TMPL_VAR NAME="USERNAME"> 
 	</td>
 	<td>
+		<TMPL_VAR NAME="GROUPNAME"> 
+	</td>
+	<td>
 		<TMPL_VAR NAME="STATE"> 
 	</td>
 	<td>


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