[vhffs-dev] [777] Moderators won again the full moderation panel, moderators can now see in which groups a user is contributing.

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


Revision: 777
Author:   gradator
Date:     2007-08-27 14:48:57 +0000 (Mon, 27 Aug 2007)

Log Message:
-----------
Moderators won again the full moderation panel, moderators can now see in which groups a user is contributing.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
    trunk/vhffs-panel/admin/index.pl
    trunk/vhffs-panel/admin/user/list.pl
    trunk/vhffs-panel/admin/user/show.pl
    trunk/vhffs-panel/templates/Makefile.am
    trunk/vhffs-panel/templates/admin/user/show.tmpl

Added Paths:
-----------
    trunk/vhffs-panel/templates/admin/user/group-part-show.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Admin.pm	2007-08-27 14:00:59 UTC (rev 776)
+++ trunk/vhffs-api/src/Vhffs/Panel/Admin.pm	2007-08-27 14:48:57 UTC (rev 777)
@@ -78,16 +78,16 @@
     return { CATNAME => gettext( 'General' ),   ITEMS => $items, CATTYPE => 'general' };
 }
 
-=head2 get_general_category
+=head2 get_admin_category
 
-    Vhffs::Panel::Admin::get_general_category;
+    Vhffs::Panel::Admin::get_admin_category;
 
 Returns a hashref (CATNAME, ITEMS) containing general administration
 items.
 
 =cut
 
-sub get_general_category {
+sub get_admin_category {
     my $items = [
         { LINK => '/admin/stats.pl',            LABEL => gettext( 'Get Statistics' ) },
         { LINK => '/admin/su.pl',               LABEL => gettext( 'Change user-id' ) },
@@ -293,21 +293,21 @@
 }
 
 
-=head2 get_all_categories
+=head2 get_all_admin_categories
 
-    Vhffs::Panel::Admin::get_all_categories($vhffs);
+    Vhffs::Panel::Admin::get_all_admin_categories($vhffs);
 
 Return an arrayref of hashrefs (CATNAME, ITEM) containing all administration
 categories and items based on configuration of $vhffs.
 
 =cut
 
-sub get_all_categories($) {
+sub get_all_admin_categories($) {
     my $vhffs = shift;
     my $config = $vhffs->get_config;
     my $categories = [];
 
-    push @$categories, get_general_category;
+    push @$categories, get_admin_category;
     push @$categories, get_user_category;
     push @$categories, get_group_category;
     push @$categories, get_web_category     if($config->use_web);
@@ -324,4 +324,36 @@
     return $categories;
 }
 
+
+=head2 get_all_modo_categories
+
+    Vhffs::Panel::Admin::get_all_modo_categories($vhffs);
+
+Return an arrayref of hashrefs (CATNAME, ITEM) containing all administration
+categories and items based on configuration of $vhffs.
+
+=cut
+
+sub get_all_modo_categories($) {
+    my $vhffs = shift;
+    my $config = $vhffs->get_config;
+    my $categories = [];
+
+    push @$categories, get_modo_category;
+    push @$categories, get_user_category;
+    push @$categories, get_group_category;
+    push @$categories, get_web_category     if($config->use_web);
+    push @$categories, get_mysql_category   if($config->use_mysql);
+    push @$categories, get_pgsql_category   if($config->use_postgres);
+    push @$categories, get_cvs_category     if($config->use_cvs);
+    push @$categories, get_svn_category     if($config->use_svn);
+    push @$categories, get_dns_category     if($config->use_dns);
+    push @$categories, get_mail_category    if($config->use_mail);
+    push @$categories, get_mailing_category if($config->use_mailing);
+    push @$categories, get_repo_category    if($config->use_repository);
+
+
+    return $categories;
+}
+
 1;

Modified: trunk/vhffs-panel/admin/index.pl
===================================================================
--- trunk/vhffs-panel/admin/index.pl	2007-08-27 14:00:59 UTC (rev 776)
+++ trunk/vhffs-panel/admin/index.pl	2007-08-27 14:48:57 UTC (rev 777)
@@ -55,10 +55,11 @@
 my $categories = [];
 my $items;
 my $c;
-if( $user->is_moderator ) {
-    push @$categories, Vhffs::Panel::Admin::get_modo_category;
+if( $user->is_moderator ) { 
+#    push @$categories, Vhffs::Panel::Admin::get_modo_category;
+    $categories = Vhffs::Panel::Admin::get_all_modo_categories($panel->{vhffs});
 } else {
-    $categories = Vhffs::Panel::Admin::get_all_categories($panel->{vhffs});
+    $categories = Vhffs::Panel::Admin::get_all_admin_categories($panel->{vhffs});
 }
 
 $template->param( CATEGORIES => $categories );

Modified: trunk/vhffs-panel/admin/user/list.pl
===================================================================
--- trunk/vhffs-panel/admin/user/list.pl	2007-08-27 14:00:59 UTC (rev 776)
+++ trunk/vhffs-panel/admin/user/list.pl	2007-08-27 14:48:57 UTC (rev 777)
@@ -87,19 +87,16 @@
 		my $subtemplate;
 
 		if( $user->is_admin == 1 )  {
-			$subtemplate = new HTML::Template( filename => $templatedir.'/panel/admin/user/part.tmpl', 
-                global_vars => 1, die_on_bad_params => 0 );
-            $subtemplate->param( SEND => gettext('Modify this user') );
-		}  else  {
-			$subtemplate = new HTML::Template( filename => $templatedir.'/panel/admin/user/part-modo.tmpl', global_vars => 1 );
-            $subtemplate->param( SEND => gettext('Show this user'), die_on_bad_params => 0);
+			$subtemplate = new HTML::Template( filename => $templatedir.'/panel/admin/user/part.tmpl', global_vars => 1, die_on_bad_params => 0 );
+			$subtemplate->param( SEND => gettext('Modify this user') );
+		} else {
+			$subtemplate = new HTML::Template( filename => $templatedir.'/panel/admin/user/part-modo.tmpl', global_vars => 1 , die_on_bad_params => 0);
+			$subtemplate->param( SEND => gettext('Show this user') );
 		}
 
         $subtemplate->param( USERS => $users );
 		$template->param( LIST => $subtemplate->output );
 	}
-	
-
 }
 
 display Vhffs::Panel::Main($panel, $template->output);

Modified: trunk/vhffs-panel/admin/user/show.pl
===================================================================
--- trunk/vhffs-panel/admin/user/show.pl	2007-08-27 14:00:59 UTC (rev 776)
+++ trunk/vhffs-panel/admin/user/show.pl	2007-08-27 14:48:57 UTC (rev 777)
@@ -139,6 +139,20 @@
 	{
 		$template->param( VALUE_ADMIN => gettext("Hosted") );
 	}
+
+	my $tmp = "";
+	my $groups = Vhffs::Group::getall_by_user( $vhffs , undef , $object );
+	foreach my $group ( @{$groups} )  {
+		my $subtemplate = new HTML::Template( filename => $templatedir."/panel/admin/user/group-part-show.tmpl" );
+		$subtemplate->param( GROUPNAME => $group->get_groupname );
+		$subtemplate->param( OWNER_TEXT => gettext("Owner of this group") );
+		$subtemplate->param( OWNER => $group->get_owner_username );
+		$subtemplate->param( STATE => Vhffs::Functions::status_string_from_status_id( $group->get_status) );
+		$tmp .= $subtemplate->output;
+	}
+
+	$template->param( TEXT_GROUPS => gettext("Groups of this user") );
+	$template->param( GROUPS => $tmp );
 }
 
 

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2007-08-27 14:00:59 UTC (rev 776)
+++ trunk/vhffs-panel/templates/Makefile.am	2007-08-27 14:48:57 UTC (rev 777)
@@ -66,6 +66,7 @@
 	admin/user/edit-note.tmpl \
 	admin/user/edit.tmpl \
 	admin/user/group-part.tmpl \
+	admin/user/group-part-show.tmpl \
 	admin/user/part-modo.tmpl \
 	admin/user/part.tmpl \
 	admin/user/search.tmpl \

Added: trunk/vhffs-panel/templates/admin/user/group-part-show.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/user/group-part-show.tmpl	                        (rev 0)
+++ trunk/vhffs-panel/templates/admin/user/group-part-show.tmpl	2007-08-27 14:48:57 UTC (rev 777)
@@ -0,0 +1,6 @@
+
+<li>	
+	<a href="../group/show.pl?NAME=<TMPL_VAR NAME="GROUPNAME">"><TMPL_VAR NAME="GROUPNAME"></a>
+	( <TMPL_VAR NAME="OWNER_TEXT">: <a href="show.pl?NAME=<TMPL_VAR NAME="OWNER">"><TMPL_VAR NAME="OWNER"></a> )
+	: <TMPL_VAR NAME="STATE"> 
+</li>

Modified: trunk/vhffs-panel/templates/admin/user/show.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/user/show.tmpl	2007-08-27 14:00:59 UTC (rev 776)
+++ trunk/vhffs-panel/templates/admin/user/show.tmpl	2007-08-27 14:48:57 UTC (rev 777)
@@ -127,7 +127,7 @@
 		<br/>
 	</p>
 	<p>
-		<label for="STATUS">				
+		<label for="STATUS">
 			<TMPL_VAR NAME="TEXT_STATUS">
 		</label>
 		<label for="STATUS">				
@@ -140,3 +140,11 @@
 			<a href="<TMPL_VAR NAME="VALUE_HISTORY">"><TMPL_VAR NAME="TEXT_HISTORY"></a>
 		</label>
 	</p>
+	<p>
+		<h2><TMPL_VAR NAME="TEXT_GROUPS"></h2>
+		<label for="GROUPS">
+		<ul>
+		<TMPL_VAR NAME="GROUPS">
+		</ul>
+		</label>
+	</p>


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