[vhffs-dev] [1487] Added source information about history event on remaining history screens

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


Revision: 1487
Author:   beuss
Date:     2009-07-30 23:07:09 +0200 (Thu, 30 Jul 2009)

Log Message:
-----------
Added source information about history event on remaining history screens

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Object.pm
    trunk/vhffs-api/src/Vhffs/Panel/Object.pm
    trunk/vhffs-panel/history.pl
    trunk/vhffs-panel/templates/misc/history_part.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2009-07-30 21:01:03 UTC (rev 1486)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2009-07-30 21:07:09 UTC (rev 1487)
@@ -367,7 +367,7 @@
 	my $self = shift;
 
     my $dbh = $self->get_db_object;
-    my $sql = 'SELECT history_id, message, date FROM vhffs_history WHERE object_id = ? ORDER BY date DESC';
+    my $sql = 'SELECT history_id, message, date, source.username as source FROM vhffs_history h LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE h.object_id = ? ORDER BY date DESC';
     return $dbh->selectall_arrayref($sql, {Slice => {}}, $self->{object_id});
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2009-07-30 21:01:03 UTC (rev 1486)
+++ trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2009-07-30 21:07:09 UTC (rev 1487)
@@ -212,6 +212,8 @@
             my $dt = DateTime->from_epoch( epoch => $_->{date}, locale => $user->get_lang);
             $history_tmpl->param( DATE => $dt->strftime($loc->medium_date_format().' '.$loc->long_time_format() ) );
             $history_tmpl->param( EVENT => $_->{message} );
+            $history_tmpl->param( SOURCE => $_->{source} );
+            $history_tmpl->param( MODERATOR => $user->is_admin || $user->is_moderator );
             $output .= $history_tmpl->output;
         }
         $template->param( HISTORY_PART => $output );

Modified: trunk/vhffs-panel/history.pl
===================================================================
--- trunk/vhffs-panel/history.pl	2009-07-30 21:01:03 UTC (rev 1486)
+++ trunk/vhffs-panel/history.pl	2009-07-30 21:07:09 UTC (rev 1487)
@@ -112,6 +112,8 @@
             my $dt = DateTime->from_epoch( epoch => $_->{date}, locale => $user->get_lang);
             $history_tmpl->param( DATE => $dt->strftime($loc->medium_date_format().' '.$loc->long_time_format()));
             $history_tmpl->param( EVENT => $_->{message} );
+            $history_tmpl->param( MODERATOR => $user->is_admin || $user->is_moderator );
+            $history_tmpl->param( SOURCE => $_->{source} );
             $output .= $history_tmpl->output;
         }
         $template->param( HISTORY_PART => $output );

Modified: trunk/vhffs-panel/templates/misc/history_part.tmpl
===================================================================
--- trunk/vhffs-panel/templates/misc/history_part.tmpl	2009-07-30 21:01:03 UTC (rev 1486)
+++ trunk/vhffs-panel/templates/misc/history_part.tmpl	2009-07-30 21:07:09 UTC (rev 1487)
@@ -5,4 +5,13 @@
 		<td>
 			<TMPL_VAR ESCAPE=1 NAME="EVENT">
 		</td>
+<TMPL_IF NAME="MODERATOR">
+		<td>
+<TMPL_IF NAME="SOURCE">
+			<TMPL_VAR ESCAPE=1 NAME="SOURCE">
+<TMPL_ELSE>
+			N/A
+</TMPL_IF>
+		</td>
+</TMPL_IF>
 	</tr>


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