[vhffs-dev] [872] move user/projects.pl to group/index.pl, replaced panel.pl?project= xx by group/view.pl?project=xx

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


Revision: 872
Author:   gradator
Date:     2007-09-08 00:07:13 +0000 (Sat, 08 Sep 2007)

Log Message:
-----------
move user/projects.pl to group/index.pl, replaced panel.pl?project=xx by group/view.pl?project=xx

Modified Paths:
--------------
    trunk/vhffs-panel/Makefile.am
    trunk/vhffs-panel/group/create.pl
    trunk/vhffs-panel/panel.pl
    trunk/vhffs-panel/templates/Makefile.am
    trunk/vhffs-panel/templates/menu/main.tmpl

Added Paths:
-----------
    trunk/vhffs-panel/group/index.pl
    trunk/vhffs-panel/group/view.pl
    trunk/vhffs-panel/templates/group/index.tmpl

Removed Paths:
-------------
    trunk/vhffs-panel/templates/user/projects.tmpl
    trunk/vhffs-panel/user/projects.pl


Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/Makefile.am	2007-09-08 00:07:13 UTC (rev 872)
@@ -105,6 +105,8 @@
 	group/delete.pl \
 	group/prefs.pl \
 	group/history.pl \
+	group/index.pl \
+	group/view.pl \
 	js/prototype.js \
 	js/commons.js \
 	js/tooltip.js \
@@ -153,7 +155,6 @@
 	svn/prefs.pl \
 	user/delete.pl \
 	user/prefs.pl \
-	user/projects.pl \
 	web/create.pl \
 	web/delete.pl \
 	web/index.pl \

Modified: trunk/vhffs-panel/group/create.pl
===================================================================
--- trunk/vhffs-panel/group/create.pl	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/group/create.pl	2007-09-08 00:07:13 UTC (rev 872)
@@ -69,7 +69,7 @@
     } elsif( ! defined(my $group = Vhffs::Panel::Group::create_group( $groupname , $user , $vhffs, $description ) ) ) {
         $panel->add_error( gettext('Error creating group (maybe a group with the same name already exists)') );
     } else {
-        my $url = '/user/projects.pl?msg='.gettext('Project Successfully created !');
+        my $url = '/group/index.pl?msg='.gettext('Project Successfully created !');
         $panel->redirect($url);
     }
 }

Copied: trunk/vhffs-panel/group/index.pl (from rev 871, trunk/vhffs-panel/user/projects.pl)
===================================================================
--- trunk/vhffs-panel/group/index.pl	                        (rev 0)
+++ trunk/vhffs-panel/group/index.pl	2007-09-08 00:07:13 UTC (rev 872)
@@ -0,0 +1,65 @@
+#!%PERL% -w
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright 
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in 
+#   the documentation and/or other materials provided with the 
+#   distribution.
+#3. Neither the name of vhffs nor the names of its contributors 
+#   may be used to endorse or promote products derived from this 
+#   software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+
+
+use POSIX qw(locale_h);
+use HTML::Template;
+use locale;
+use Locale::gettext;
+use strict;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Panel::Main;
+use Vhffs::Panel::User;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+my $cgi = $panel->{cgi};
+my $vhffs = $panel->{vhffs};
+my $user = $panel->{user};
+my $templatedir = $panel->{templatedir};
+
+$panel->set_title( gettext('My Projects') );
+my $template = new HTML::Template( filename => $templatedir.'/panel/group/index.tmpl' );
+
+my $groups = Vhffs::Panel::User::get_groups($user, $Vhffs::Panel::User::RELATION_OWNER);
+$template->param( OWNED_PROJECTS => $groups );
+$groups = Vhffs::Panel::User::get_groups($user, $Vhffs::Panel::User::RELATION_CONTRIB);
+$template->param( CONTRIBUTED_PROJECTS => $groups );
+$template->param( OWNED_PROJECTS_TEXT => gettext('Your projects') );
+$template->param( CONTRIBUTED_PROJECTS_TEXT => gettext('Projects you contribute to') );
+$template->param( NEW_PROJECT_TEXT => gettext('Create new project') );
+
+$panel->build( $template );
+$panel->display;

Added: trunk/vhffs-panel/group/view.pl
===================================================================
--- trunk/vhffs-panel/group/view.pl	                        (rev 0)
+++ trunk/vhffs-panel/group/view.pl	2007-09-08 00:07:13 UTC (rev 872)
@@ -0,0 +1,62 @@
+#!%PERL% -w
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright 
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in 
+#   the documentation and/or other materials provided with the 
+#   distribution.
+#3. Neither the name of vhffs nor the names of its contributors 
+#   may be used to endorse or promote products derived from this 
+#   software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+
+
+use POSIX qw(locale_h);
+use HTML::Template;
+use locale;
+use Locale::gettext;
+use strict;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Panel::Main;
+use Vhffs::Panel::User;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+my $templatedir = $panel->{templatedir};
+my $groupname = $panel->{groupname};
+
+unless( defined $groupname )
+{
+	my $template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
+	$template->param( MESSAGE => gettext( 'You must specify a project name' ) );
+	$panel->build( $template );
+}
+else
+{
+	$panel->build( $panel->project_info );
+}
+
+$panel->display;


Property changes on: trunk/vhffs-panel/group/view.pl
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/vhffs-panel/panel.pl
===================================================================
--- trunk/vhffs-panel/panel.pl	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/panel.pl	2007-09-08 00:07:13 UTC (rev 872)
@@ -50,19 +50,17 @@
 exit 0 unless $session;
 
 my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
 my $user = $panel->{'user'};
 my $cgi = $panel->{'cgi'};
-my $groupname = $panel->{'groupname'};
+my $templatedir = $panel->{'templatedir'};
+
 my $su_user = $cgi->param('su_user');
-my $message;
 
-my $template;
-my $templatedir = $vhffs->get_config->get_templatedir;
-
 #We try to know if an admin want to su
 if( defined $su_user )
 {
+	my $message = "";
+
 	if( $user->is_admin == 1 )
 	{
 		my $user_bis = Vhffs::User::get_by_username( $vhffs , $su_user );
@@ -87,26 +85,14 @@
 	{
 		$message = gettext( "You're not an administrator" );
 	}
-}
 
-
-
-if( defined $su_user )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
+	my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
 	$template->param( MESSAGE => $message );
+	$panel->build( $template );
 }
 else
 {
-	if( defined $groupname )
-	{
-		$template = $panel->project_info;
-	}
-	else
-	{
-		$template = $panel->welcome;
-	}
+	$panel->build( $panel->welcome );
 }
 
-$panel->build( $template );
 $panel->display;

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/templates/Makefile.am	2007-09-08 00:07:13 UTC (rev 872)
@@ -95,6 +95,7 @@
 	group/prefs_avatar.tmpl \
 	group/history.tmpl \
 	group/history_part.tmpl \
+	group/index.tmpl \
 	mail/create.tmpl \
 	mailinglist/create.tmpl \
 	mailinglist/list_part.tmpl \
@@ -140,7 +141,6 @@
 	user/mailuservirus.tmpl \
 	user/prefs_avatar.tmpl \
 	user/prefs.tmpl \
-	user/projects.tmpl \
 	web/create.tmpl \
 	web/mailuser.tmpl \
 	web/prefs.tmpl

Copied: trunk/vhffs-panel/templates/group/index.tmpl (from rev 871, trunk/vhffs-panel/templates/user/projects.tmpl)
===================================================================
--- trunk/vhffs-panel/templates/group/index.tmpl	                        (rev 0)
+++ trunk/vhffs-panel/templates/group/index.tmpl	2007-09-08 00:07:13 UTC (rev 872)
@@ -0,0 +1,29 @@
+<tmpl_if name="OWNED_PROJECTS">
+<div id="ownedProjects">
+<h2><tmpl_var name="OWNED_PROJECTS_TEXT"></h2>
+<ul>
+<tmpl_loop name="OWNED_PROJECTS">
+<tmpl_if name="ACTIVE">
+    <li><a href="/group/view.pl?project=<tmpl_var name="PROJECT">"><tmpl_var name="PROJECT"></a></li>
+<tmpl_else>
+    <li><tmpl_var name="PROJECT">&nbsp;&mdash;&nbsp;<tmpl_var name="STATE"></li>
+</tmpl_if>
+</tmpl_loop>
+</ul>
+</div>
+</tmpl_if>
+<tmpl_if name="CONTRIBUTED_PROJECTS">
+<div id="contribProjects">
+<h2><tmpl_var name="CONTRIBUTED_PROJECTS_TEXT"></h2>
+<ul>
+<tmpl_loop name="CONTRIBUTED_PROJECTS">
+<tmpl_if name="ACTIVE">
+    <li><a href="/group/view.pl?project=<tmpl_var name="PROJECT">"><tmpl_var name="PROJECT"></a></li>
+<tmpl_else>
+    <li><tmpl_var name="PROJECT">&nbsp;&mdash;&nbsp;<tmpl_var name="STATE"></li>
+</tmpl_if>
+</tmpl_loop>
+</ul>
+</div>
+</tmpl_if>
+<a href="/group/create.pl"><tmpl_var name="NEW_PROJECT_TEXT"></a>

Modified: trunk/vhffs-panel/templates/menu/main.tmpl
===================================================================
--- trunk/vhffs-panel/templates/menu/main.tmpl	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/templates/menu/main.tmpl	2007-09-08 00:07:13 UTC (rev 872)
@@ -12,7 +12,7 @@
                 " onmouseover="javascript:this.timer=helpTimeout('user_admin');" onmouseout="javascript:window.clearTimeout(this.timer);"/>
             </a>
             </tmpl_if>
-            <a href="/user/projects.pl" title="<tmpl_var name="TEXT_PROJECTS">">
+            <a href="/group/index.pl" title="<tmpl_var name="TEXT_PROJECTS">">
                 <img src="/themes/<tmpl_var name="THEME">/images/projects.png" title="<tmpl_var name="TEXT_PROJECTS">" alt="<tmpl_var name="TEXT_PROJECTS">" onmouseover="javascript:this.timer=helpTimeout('user_projects');" onmouseout="javascript:window.clearTimeout(this.timer);"/>
             </a>
             <a  href="/user/prefs.pl" title="<tmpl_var name="TEXT_PREFS">">

Deleted: trunk/vhffs-panel/templates/user/projects.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/projects.tmpl	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/templates/user/projects.tmpl	2007-09-08 00:07:13 UTC (rev 872)
@@ -1,29 +0,0 @@
-<tmpl_if name="OWNED_PROJECTS">
-<div id="ownedProjects">
-<h2><tmpl_var name="OWNED_PROJECTS_TEXT"></h2>
-<ul>
-<tmpl_loop name="OWNED_PROJECTS">
-<tmpl_if name="ACTIVE">
-    <li><a href="/panel.pl?project=<tmpl_var name="PROJECT">"><tmpl_var name="PROJECT"></a></li>
-<tmpl_else>
-    <li><tmpl_var name="PROJECT">&nbsp;&mdash;&nbsp;<tmpl_var name="STATE"></li>
-</tmpl_if>
-</tmpl_loop>
-</ul>
-</div>
-</tmpl_if>
-<tmpl_if name="CONTRIBUTED_PROJECTS">
-<div id="contribProjects">
-<h2><tmpl_var name="CONTRIBUTED_PROJECTS_TEXT"></h2>
-<ul>
-<tmpl_loop name="CONTRIBUTED_PROJECTS">
-<tmpl_if name="ACTIVE">
-    <li><a href="/panel.pl?project=<tmpl_var name="PROJECT">"><tmpl_var name="PROJECT"></a></li>
-<tmpl_else>
-    <li><tmpl_var name="PROJECT">&nbsp;&mdash;&nbsp;<tmpl_var name="STATE"></li>
-</tmpl_if>
-</tmpl_loop>
-</ul>
-</div>
-</tmpl_if>
-<a href="/group/create.pl"><tmpl_var name="NEW_PROJECT_TEXT"></a>

Deleted: trunk/vhffs-panel/user/projects.pl
===================================================================
--- trunk/vhffs-panel/user/projects.pl	2007-09-07 00:34:22 UTC (rev 871)
+++ trunk/vhffs-panel/user/projects.pl	2007-09-08 00:07:13 UTC (rev 872)
@@ -1,65 +0,0 @@
-#!%PERL% -w
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-use POSIX qw(locale_h);
-use HTML::Template;
-use locale;
-use Locale::gettext;
-use strict;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
-use Vhffs::Panel::User;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
-
-my $cgi = $panel->{cgi};
-my $vhffs = $panel->{vhffs};
-my $user = $panel->{user};
-my $templatedir = $vhffs->get_config->get_templatedir;
-
-$panel->set_title( gettext('My Projects') );
-my $template = new HTML::Template( filename => $templatedir.'/panel/user/projects.tmpl' );
-
-my $groups = Vhffs::Panel::User::get_groups($user, $Vhffs::Panel::User::RELATION_OWNER);
-$template->param( OWNED_PROJECTS => $groups );
-$groups = Vhffs::Panel::User::get_groups($user, $Vhffs::Panel::User::RELATION_CONTRIB);
-$template->param( CONTRIBUTED_PROJECTS => $groups );
-$template->param( OWNED_PROJECTS_TEXT => gettext('Your projects') );
-$template->param( CONTRIBUTED_PROJECTS_TEXT => gettext('Projects you contribute to') );
-$template->param( NEW_PROJECT_TEXT => gettext('Create new project') );
-
-$panel->build( $template );
-$panel->display;


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