[vhffs-dev] [785] Added display of the type and the name of objects in group complete history

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


Revision: 785
Author:   gradator
Date:     2007-08-28 17:14:58 +0000 (Tue, 28 Aug 2007)

Log Message:
-----------
Added display of the type and the name of objects in group complete history

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Group.pm
    trunk/vhffs-api/src/Vhffs/User.pm
    trunk/vhffs-panel/group/history.pl


Modified: trunk/vhffs-api/src/Vhffs/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Group.pm	2007-08-28 15:28:04 UTC (rev 784)
+++ trunk/vhffs-api/src/Vhffs/Group.pm	2007-08-28 17:14:58 UTC (rev 785)
@@ -372,6 +372,12 @@
     return $self->{'groupname'};
 }
 
+sub get_title
+{
+    my $self = shift;
+    return $self->{'groupname'};
+}
+
 sub get_gid
 {
     my $self = shift;
@@ -677,7 +683,7 @@
 {
 	my $self = shift;
 
-	my $query = 'SELECT o.object_id,\'\' AS name,o.type,h.history_id,h.date,h.message FROM vhffs_history h INNER JOIN vhffs_object o ON o.object_id=h.object_id WHERE o.owner_gid=?';
+	my $query = 'SELECT o.object_id,o.type,h.history_id,h.date,h.message FROM vhffs_history h INNER JOIN vhffs_object o ON o.object_id=h.object_id WHERE o.owner_gid=?';
 	my $request = $self->{'db'}->prepare( $query );
 	return undef unless( $request->execute( $self->{'gid'} ) );
 

Modified: trunk/vhffs-api/src/Vhffs/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/User.pm	2007-08-28 15:28:04 UTC (rev 784)
+++ trunk/vhffs-api/src/Vhffs/User.pm	2007-08-28 17:14:58 UTC (rev 785)
@@ -407,6 +407,12 @@
     return $self->{'username'};
 }
 
+sub get_title
+{
+    my $self = shift;
+    return $self->{'username'};
+}
+
 sub get_firstname
 {
     my $self = shift;

Modified: trunk/vhffs-panel/group/history.pl
===================================================================
--- trunk/vhffs-panel/group/history.pl	2007-08-28 15:28:04 UTC (rev 784)
+++ trunk/vhffs-panel/group/history.pl	2007-08-28 17:14:58 UTC (rev 785)
@@ -45,6 +45,7 @@
 use Vhffs::Panel::Main;
 use Vhffs::Panel::Group;
 use Vhffs::Functions;
+use Vhffs::ObjectFactory;
 
 my $panel = new Vhffs::Panel::Main();
 exit 0 unless $panel;
@@ -104,8 +105,9 @@
 				$datestr = gettext("no information about date");
 			}
 			$subtemplate->param( DATE => $datestr );
-			$subtemplate->param( TYPE => $history->{$_}{type} );
-			$subtemplate->param( NAME => $history->{$_}{name} );
+			$subtemplate->param( TYPE => Vhffs::Functions::type_string_from_type_id( $history->{$_}{type} ) );
+			my $object = Vhffs::ObjectFactory::fetch_object( $vhffs , $history->{$_}{object_id} );
+			$subtemplate->param( NAME => $object->get_title );
 			$subtemplate->param( EVENT => $history->{$_}{message} );
 			$output .= $subtemplate->output;
 		}


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