[vhffs-dev] [1847] Removed Vhffs::Panel::admin_part

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


Revision: 1847
Author:   beuss
Date:     2011-06-03 00:03:53 +0200 (Fri, 03 Jun 2011)
Log Message:
-----------
Removed Vhffs::Panel::admin_part

The cleanup with a spoon...

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Object.pm
    trunk/vhffs-panel/templates/Makefile.am

Removed Paths:
-------------
    trunk/vhffs-panel/templates/misc/history_part.tmpl

Modified: trunk/vhffs-api/src/Vhffs/Panel/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2011-06-02 22:03:43 UTC (rev 1846)
+++ trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2011-06-02 22:03:53 UTC (rev 1847)
@@ -67,155 +67,4 @@
     return $dbh->selectall_arrayref($sql, { Slice => {} }, @params);
 }
 
-
-sub admin_part
-{
-    use DateTime;
-    use DateTime::Locale;
-	my $panel = shift;
-	my $object = shift;
-
-	return undef unless defined $object;
-
-	my $vhffs = $panel->{vhffs};
-	my $templatedir = $panel->{templatedir};
-	my $user = $panel->{user};
-	
-    return undef if( $user->is_admin != 1 );
-
-    my $loc = DateTime::Locale->load($user->get_lang);
-
-	my $template = new HTML::Template( filename => $templatedir.'/panel/admin/object/editembedded.tmpl' );
-
-	$template->param( TITLE => gettext("Admin part") );
-
-	$template->param( TEXT_OID => gettext("Object id") );
-	$template->param( TEXT_UID => gettext("UID of owner") );
-	$template->param( TEXT_DATE => gettext("Date of creation") );
-	$template->param( TEXT_STATUS => gettext("Status") );
-	$template->param( TEXT_DESCRIPTION => gettext("Description") );
-	$template->param( SEND => gettext("Send") );
-	
-
-	$template->param( VALUE_DESCRIPTION => $object->get_description );
-	$template->param( VALUE_OID => $object->get_oid );
-	$template->param( VALUE_UID => $object->get_owner_uid );
-	$template->param( VALUE_USERNAME => Vhffs::User::get_name_by_uid( $vhffs , $object->get_owner_uid ));
-
-	if( defined $object->get_date )
-	{
-        my $dt = DateTime->from_epoch( epoch => $object->get_date, locale => $user->get_lang);
-        $template->param( VALUE_DATE => $dt->strftime($loc->full_date_format.' '.$loc->full_time_format) );
-	}
-	else
-	{
-		$template->param( VALUE_DATE => gettext("no date") );
-	}
-
-	$template->param( TEXT_STATUS_WAITING_FOR_VALIDATION => gettext("Waiting for validation") );
-	$template->param( TEXT_STATUS_VALIDATION_REFUSED => gettext("Validation refused") );
-	$template->param( TEXT_STATUS_WAITING_FOR_CREATION => gettext("Waiting for creation") );
-	$template->param( TEXT_STATUS_CREATING_ERROR => gettext("Creating error") );
-	$template->param( TEXT_STATUS_ACTIVATED => gettext("Activated") );
-	$template->param( TEXT_STATUS_CREATED => gettext("Created") );
-	$template->param( TEXT_STATUS_SUSPEND_PENDING => gettext("Waiting for suspension") );
-	$template->param( TEXT_STATUS_SUSPENDED => gettext("Suspended") );
-	$template->param( TEXT_STATUS_WAITING_FOR_MODIFICATION => gettext("Waiting for modification") );
-	$template->param( TEXT_STATUS_MODIFICATION_ERROR => gettext("Modification error") );
-	$template->param( TEXT_STATUS_MODIFICATION_APPLIED => gettext("Modification applied") );
-	$template->param( TEXT_STATUS_TO_DELETE => gettext("Will be deleted") );
-
-	$template->param( VALUE_STATUS_WAITING_FOR_VALIDATION => Vhffs::Constants::WAITING_FOR_VALIDATION );
-	$template->param( VALUE_STATUS_VALIDATION_REFUSED => Vhffs::Constants::VALIDATION_REFUSED );
-	$template->param( VALUE_STATUS_WAITING_FOR_CREATION => Vhffs::Constants::WAITING_FOR_CREATION );
-	$template->param( VALUE_STATUS_CREATING_ERROR => Vhffs::Constants::CREATING_ERROR );
-	$template->param( VALUE_STATUS_ACTIVATED => Vhffs::Constants::ACTIVATED );
-	$template->param( VALUE_STATUS_CREATED => Vhffs::Constants::CREATED );
-	$template->param( VALUE_STATUS_SUSPEND_PENDING => Vhffs::Constants::SUSPEND_PENDING );
-	$template->param( VALUE_STATUS_SUSPENDED => Vhffs::Constants::SUSPENDED );
-	$template->param( VALUE_STATUS_WAITING_FOR_MODIFICATION => Vhffs::Constants::WAITING_FOR_MODIFICATION );
-	$template->param( VALUE_STATUS_MODIFICATION_ERROR => Vhffs::Constants::MODIFICATION_ERROR );
-	$template->param( VALUE_STATUS_MODIFICATION_APPLIED => Vhffs::Constants::MODIFICATION_APPLIED );
-	$template->param( VALUE_STATUS_TO_DELETE => Vhffs::Constants::TO_DELETE );
-
-	my $status = $object->get_status;
-
-	if( $status == Vhffs::Constants::WAITING_FOR_VALIDATION )
-	{
-		$template->param( SELECTED_STATUS_WAITING_FOR_VALIDATION => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::VALIDATION_REFUSED )
-	{
-		$template->param( SELECTED_STATUS_VALIDATION_REFUSED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::WAITING_FOR_CREATION )
-	{
-		$template->param( SELECTED_STATUS_WAITING_FOR_CREATION => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::CREATING_ERROR )
-	{
-		$template->param( SELECTED_STATUS_CREATING_ERROR => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::CREATED )
-	{
-		$template->param( SELECTED_STATUS_CREATED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::ACTIVATED )
-	{
-		$template->param( SELECTED_STATUS_ACTIVATED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::SUSPEND_PENDING )
-	{
-		$template->param( SELECTED_STATUS_SUSPEND_PENDING => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::SUSPENDED )
-	{
-		$template->param( SELECTED_STATUS_SUSPENDED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::WAITING_FOR_MODIFICATION )
-	{
-		$template->param( SELECTED_STATUS_WAITING_FOR_MODIFICATION => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::MODIFICATION_ERROR )
-	{
-		$template->param( SELECTED_STATUS_MODIFICATION_ERROR => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::MODIFICATION_APPLIED )
-	{
-		$template->param( SELECTED_STATUS_MODIFICATION_APPLIED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::TO_DELETE )
-	{
-		$template->param( SELECTED_STATUS_TO_DELETE => "selected" );
-	}
-
-
-	$template->param( AVATAR_TITLE => gettext( "Avatar management" ) );
-	$template->param( DELETE_AVATAR => gettext( "Delete avatar for this object" ) );
-
-	# Print history
-	$template->param( HISTORY_TITLE => gettext("History of this object") );
-	my $string;
-	my $history = $object->get_history;
-
-    unless( @{$history} ) {
-        $template->param( HISTORY_PART => gettext('No event about this object') );
-    } else {
-        my $output = '';
-        my $history_tmpl = new HTML::Template( filename => $templatedir.'/panel/misc/history_part.tmpl' );
-        foreach (@{$history}) {
-            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 );
-    }
-
-	return $template;
-}
-
-
 1;

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2011-06-02 22:03:43 UTC (rev 1846)
+++ trunk/vhffs-panel/templates/Makefile.am	2011-06-02 22:03:53 UTC (rev 1847)
@@ -13,7 +13,6 @@
 	menu/main.tmpl \
 	menu/user.tmpl \
 	misc/group_service.tmpl \
-	misc/history_part.tmpl \
 	acl/form.tt \
 	acl/view.tt \
 	admin/broadcast/create.tt \

Deleted: trunk/vhffs-panel/templates/misc/history_part.tmpl
===================================================================
--- trunk/vhffs-panel/templates/misc/history_part.tmpl	2011-06-02 22:03:43 UTC (rev 1846)
+++ trunk/vhffs-panel/templates/misc/history_part.tmpl	2011-06-02 22:03:53 UTC (rev 1847)
@@ -1,17 +0,0 @@
-	<tr>
-		<td>
-			<TMPL_VAR ESCAPE=1 NAME="DATE">
-		</td>
-		<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/