[vhffs-dev] [905] New moderation process is comming, panel is quite ok and mails are ok

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


Revision: 905
Author:   gradator
Date:     2007-09-11 05:04:48 +0000 (Tue, 11 Sep 2007)

Log Message:
-----------
New moderation process is comming, panel is quite ok and mails are ok

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Makefile.am
    trunk/vhffs-api/src/Vhffs/Object.pm
    trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
    trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
    trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
    trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
    trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
    trunk/vhffs-api/src/Vhffs/Panel/User.pm
    trunk/vhffs-api/src/Vhffs/Panel/Web.pm
    trunk/vhffs-panel/Makefile.am
    trunk/vhffs-panel/cvs/create.pl
    trunk/vhffs-panel/dns/create.pl
    trunk/vhffs-panel/group/index.pl
    trunk/vhffs-panel/mail/create.pl
    trunk/vhffs-panel/mailinglist/create.pl
    trunk/vhffs-panel/mysql/create.pl
    trunk/vhffs-panel/pgsql/create.pl
    trunk/vhffs-panel/repository/create.pl
    trunk/vhffs-panel/repository/prefs_save.pl
    trunk/vhffs-panel/svn/create.pl
    trunk/vhffs-panel/svn/prefs_save.pl
    trunk/vhffs-panel/templates/Makefile.am
    trunk/vhffs-panel/templates/group/index.tmpl
    trunk/vhffs-panel/templates/menu/main.tmpl
    trunk/vhffs-panel/templates/misc/service_index.tmpl
    trunk/vhffs-panel/user/delete.pl
    trunk/vhffs-panel/web/create.pl
    trunk/vhffs-panel/web/delete.pl

Added Paths:
-----------
    trunk/vhffs-panel/object/quickdelete.pl
    trunk/vhffs-panel/object/resubmit.pl
    trunk/vhffs-panel/templates/misc/resubmit.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Makefile.am
===================================================================
--- trunk/vhffs-api/src/Vhffs/Makefile.am	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Makefile.am	2007-09-11 05:04:48 UTC (rev 905)
@@ -35,7 +35,6 @@
 	Panel/Pgsql.pm \
 	Panel/Repository.pm \
 	Panel/Svn.pm \
-	Panel/Template.pm \
 	Panel/User.pm \
 	Panel/Web.pm \
 	Robots/Cvs.pm \

Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -397,7 +397,7 @@
 	$self->set_status( Vhffs::Constants::WAITING_FOR_CREATION );
 
 	my $mail = sprintf(
-		gettext( "Hello,\n\nYour request for a %s (%s) on %s was accepted.\nPlease wait while we are creating your object.\n\nCheers,\n\nThe Moderator and Admin Team\n\n---------\n%s\n%s" ) ,
+		gettext( "Hello,\n\nYour request for a %s (%s) on %s was accepted.\nPlease wait while we are creating your object.\n\nCheers,\nThe moderator team\n\n---------\n%s\n%s" ) ,
 		Vhffs::Functions::type_string_from_type_id( $self->get_type ),
 		$self->get_label,
 		$vhffs->get_config->get_host_name,
@@ -406,7 +406,9 @@
 		);
 
 	my $subject = sprintf(
-		gettext('Your request on %s platform') , 
+		gettext('Your request on for a %s (%s) on %s was accepted'), 
+		Vhffs::Functions::type_string_from_type_id( $self->get_type ),
+		$self->get_label,
 		$vhffs->get_config->get_host_name
 		);
 
@@ -432,8 +434,24 @@
 
 	$self->set_status( Vhffs::Constants::VALIDATION_REFUSED );
 
-	$self->set_description( $reason );
+	my $mail = sprintf(
+		gettext( "Hello,\n\nYour request for a %s (%s) on %s was refused.\n\nThe reason given by moderators is:\n%s\n\nYou can change the description and submit it again for moderation on the\npanel. You can delete this object on the panel if you have made\na mistake. Don't be upset, if you don't understand why your request has\nbeen refused, just reply to this email !\n\nCheers,\nThe moderator team\n\n---------\n%s\n%s" ) ,
+		Vhffs::Functions::type_string_from_type_id( $self->get_type ),
+		$self->get_label,
+		$vhffs->get_config->get_host_name,
+		$vhffs->get_config->get_host_name,
+		$vhffs->get_config->get_panel->{url}
+		);
 
+	my $subject = sprintf(
+		gettext('Your request on for a %s (%s) on %s was refused'),
+		Vhffs::Functions::type_string_from_type_id( $self->get_type ),
+		$self->get_label,
+		$vhffs->get_config->get_host_name
+		);
+
+	Vhffs::Functions::send_mail( $vhffs->get_config->get_moderator_mail , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $mail );
+
 	$user->set_note( $user->get_note -1 );
 	$user->commit;
 
@@ -441,6 +459,20 @@
 }
 
 
+sub resubmit_for_moderation
+{
+	my $self = shift;
+	my $description = shift;
+
+	return -1 unless defined $description;
+	return -1 if( $self->get_status != Vhffs::Constants::VALIDATION_REFUSED );
+
+	$self->set_description( $description );
+	$self->set_status( Vhffs::Constants::WAITING_FOR_VALIDATION );
+	return $self->commit;
+}
+
+
 #Get all objects of the database.
 #If $name is undefined, the functions returns ALL objects.
 #Else, it returns objects like the name. It searchs in oid, user and description
@@ -536,6 +568,8 @@
 sub get_by_oid
 {
     my ($vhffs, $oid) = @_;
+    return undef unless ( $oid =~ /^\d+$/ );
+
     my $query = 'SELECT owner_uid, owner_gid, date_creation, description, state, type FROM vhffs_object WHERE object_id =?';
     my $sth = $vhffs->get_db_object->prepare( $query );
     my $rows = $sth->execute( $oid );

Modified: trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -113,6 +113,7 @@
     my $cvs = [];
     while(my $c = $sth->fetchrow_hashref) {
         $c->{active} = ($c->{state} == Vhffs::Constants::ACTIVATED);
+        $c->{refused} = ($c->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $c->{state} = Vhffs::Functions::status_string_from_status_id($c->{state});
         push @$cvs, $c;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/DNS.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/DNS.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -130,6 +130,7 @@
     my $dns = [];
     while(my $d = $sth->fetchrow_hashref) {
         $d->{active} = ($d->{state} == Vhffs::Constants::ACTIVATED);
+        $d->{refused} = ($d->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $d->{state} = Vhffs::Functions::status_string_from_status_id($d->{state});
         push @$dns, $d;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -94,6 +94,7 @@
     my $mails = [];
     while(my $m = $sth->fetchrow_hashref) {
         $m->{active} = ($m->{state} == Vhffs::Constants::ACTIVATED);
+        $m->{refused} = ($m->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $m->{state} = Vhffs::Functions::status_string_from_status_id($m->{state});
         push @$mails, $m;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -94,6 +94,7 @@
     my $mls = [];
     while(my $l = $sth->fetchrow_hashref) {
         $l->{active} = ($l->{state} == Vhffs::Constants::ACTIVATED);
+        $l->{refused} = ($l->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $l->{state} = Vhffs::Functions::status_string_from_status_id($l->{state});
         push @$mls, $l;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -812,6 +812,8 @@
     $template->param( TEXT_TITLE => sprintf(gettext($format), $group->get_groupname) );
     $template->param( SERVICE => $service );
     $template->param( ADMIN_TEXT => gettext('Go to administration') );
+    $template->param( RESUBMIT_TEXT => gettext('Propose a new description') );
+    $template->param( DELETE_TEXT => gettext('Delete') );
     $template->param( HISTORY_TEXT => gettext('History') );
     $template->param( NEW => gettext('New') );
     $template->param( NO_SERVICE_TEXT => gettext('None') );

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -129,6 +129,7 @@
     my $mysql = [];
     while(my $m = $sth->fetchrow_hashref) {
         $m->{active} = ($m->{state} == Vhffs::Constants::ACTIVATED);
+        $m->{refused} = ($m->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $m->{state} = Vhffs::Functions::status_string_from_status_id($m->{state});
         push @$mysql, $m;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -97,6 +97,7 @@
     my $pgsql = [];
     while(my $p = $sth->fetchrow_hashref) {
         $p->{active} = ($p->{state} == Vhffs::Constants::ACTIVATED);
+        $p->{refused} = ($p->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $p->{state} = Vhffs::Functions::status_string_from_status_id($p->{state});
         push @$pgsql, $p;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Repository.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Repository.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -69,6 +69,7 @@
     my $mysql = [];
     while(my $m = $sth->fetchrow_hashref) {
         $m->{active} = ($m->{state} == Vhffs::Constants::ACTIVATED);
+        $m->{refused} = ($m->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $m->{state} = Vhffs::Functions::status_string_from_status_id($m->{state});
         push @$mysql, $m;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -72,6 +72,7 @@
     my $svn = [];
     while(my $s = $sth->fetchrow_hashref) {
         $s->{active} = ($s->{state} == Vhffs::Constants::ACTIVATED);
+        $s->{refused} = ($s->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $s->{state} = Vhffs::Functions::status_string_from_status_id($s->{state});
         push @$svn, $s;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -215,18 +215,19 @@
     push @params, $user->get_uid;
     if( defined $relation) {
         if( $relation == $RELATION_OWNER ) {
-            $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE o.owner_uid = ? AND g.groupname != ? ORDER BY g.groupname';
+            $sql = 'SELECT g.groupname AS project, o.state , o.object_id AS oid FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE o.owner_uid = ? AND g.groupname != ? ORDER BY g.groupname';
             push @params, $user->get_username;
         } else {
-            $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? AND o.owner_uid != ug.uid ORDER BY g.groupname';
+            $sql = 'SELECT g.groupname AS project, o.state , o.object_id AS oid FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? AND o.owner_uid != ug.uid ORDER BY g.groupname';
         }
     } else {
-        $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? ORDER BY g.groupname';
+        $sql = 'SELECT g.groupname AS project, o.state , o.object_id AS oid FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? ORDER BY g.groupname';
     }
     my $sth = $user->get_db_object->prepare( $sql );
     return undef if( ! $sth->execute(@params) );
     while(my $g = $sth->fetchrow_hashref) {
         $g->{active} = ($g->{state} == Vhffs::Constants::ACTIVATED);
+        $g->{refused} = ($g->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $g->{state} = Vhffs::Functions::status_string_from_status_id($g->{state});
         push @$groups, $g;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Web.pm	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-api/src/Vhffs/Panel/Web.pm	2007-09-11 05:04:48 UTC (rev 905)
@@ -74,6 +74,7 @@
     my $web = [];
     while(my $w = $sth->fetchrow_hashref) {
         $w->{active} = ($w->{state} == Vhffs::Constants::ACTIVATED);
+        $w->{refused} = ($w->{state} == Vhffs::Constants::VALIDATION_REFUSED);
         $w->{state} = Vhffs::Functions::status_string_from_status_id($w->{state});
         push @$web, $w;
     }

Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/Makefile.am	2007-09-11 05:04:48 UTC (rev 905)
@@ -128,6 +128,8 @@
 	mysql/prefs_save.pl \
 	mysql/prefs.pl \
 	object/upavatar.pl \
+	object/resubmit.pl \
+	object/quickdelete.pl \
 	pgsql/create.pl \
 	pgsql/delete.pl \
 	pgsql/index.pl \

Modified: trunk/vhffs-panel/cvs/create.pl
===================================================================
--- trunk/vhffs-panel/cvs/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/cvs/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -78,7 +78,7 @@
         #Create CVS
         my $cvs = Vhffs::Panel::Cvs::create_cvs( $vhffs, $fullreponame, $description, $user , $group );
         if( defined $cvs ) {
-            my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The CVS object was successfully created !');
+            my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The CVS object was successfully created !');
             $panel->redirect($url);
         } else {
             $panel->add_error( gettext( 'An error occured while creating the object.It probably already exists' ) );

Modified: trunk/vhffs-panel/dns/create.pl
===================================================================
--- trunk/vhffs-panel/dns/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/dns/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -43,7 +43,7 @@
     } else {
         my $dns = Vhffs::Panel::DNS::create_dns( $vhffs, $domain_name, $description, $user, $group );
         if( defined $dns ) {
-            my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The DNS object was successfully created !');
+            my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The DNS object was successfully created !');
             $panel->redirect($url);
         } else {
           $panel->add_error( gettext('An error occured while creating the object. The domain is not correct or aleady exists in Vhffs database') );

Modified: trunk/vhffs-panel/group/index.pl
===================================================================
--- trunk/vhffs-panel/group/index.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/group/index.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -60,6 +60,8 @@
 $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') );
+#$template->param( RESUBMIT_TEXT => gettext('Propose a new description') );
+#$template->param( DELETE_TEXT => gettext('Delete') );
 
 $panel->build( $template );
 $panel->display;

Modified: trunk/vhffs-panel/mail/create.pl
===================================================================
--- trunk/vhffs-panel/mail/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/mail/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -67,7 +67,7 @@
     } elsif( !defined(Vhffs::Panel::Mail::create_mail( $vhffs , $domain , $description, $user , $group )) ) {
         $panel->add_error( gettext('An error occured while creating the mail area') );
     } else {
-        my $url = '/panel.pl?project='.$groupname.'&msg='.gettext('Mail domain successfully created !');
+        my $url = '/group/view.pl?project='.$groupname.'&msg='.gettext('Mail domain successfully created !');
         $panel->redirect($url);
     }
 }

Modified: trunk/vhffs-panel/mailinglist/create.pl
===================================================================
--- trunk/vhffs-panel/mailinglist/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/mailinglist/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -80,7 +80,7 @@
     } elsif( !defined(Vhffs::Panel::MailingList::create_list( $vhffs, $localpart, $domain, $description, $user, $group )) ) {
         $panel->add_error( gettext('An error occured while creating the object.It probably already exists') );
     } else {
-        my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The mailing list object was successfully created !');
+        my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The mailing list object was successfully created !');
         $panel->redirect( $url );
     }
 }

Modified: trunk/vhffs-panel/mysql/create.pl
===================================================================
--- trunk/vhffs-panel/mysql/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/mysql/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -79,7 +79,7 @@
     } elsif(!Vhffs::Services::Mysql::check_dbpass($dbpass)) {
         $panel->add_error( gettext('Invalid password. It must be at least 3 characters and contain only letters (lower and uppercase) and numbers') );
     } elsif(defined Vhffs::Panel::Mysql::create_mysql($vhffs, $dbname, $user, $group, $dbuser, $dbpass, $description)) {
-        my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The MySQL DB was successfully created !');
+        my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The MySQL DB was successfully created !');
         $panel->redirect($url);
     } else {
         $panel->add_error( 'An error occured while creating the object.' );

Added: trunk/vhffs-panel/object/quickdelete.pl
===================================================================
--- trunk/vhffs-panel/object/quickdelete.pl	                        (rev 0)
+++ trunk/vhffs-panel/object/quickdelete.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -0,0 +1,105 @@
+#!%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 CGI;
+use CGI::Session;
+use strict;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::User;
+use Vhffs::Main;
+use Vhffs::Panel::Main;
+use Vhffs::Panel::Menu;
+use Vhffs::Panel::Group;
+use Vhffs::Constants;
+use Vhffs::Object;
+use Vhffs::ObjectFactory;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+my $vhffs = $panel->{vhffs};
+my $templatedir = $panel->{templatedir};
+my $user = $panel->{user};
+my $group = $panel->{group};
+my $cgi = $panel->{cgi};
+
+my $oid = $cgi->param('oid');
+$panel->add_error( gettext('CGI error') ) unless defined $oid;
+
+my $object;
+if( defined $oid )  {
+	$object = Vhffs::ObjectFactory::fetch_object( $vhffs , $oid );
+	$panel->add_error( gettext('This object does not exist') ) unless defined $object;
+}
+
+if( defined $object  &&  $object->get_status != Vhffs::Constants::VALIDATION_REFUSED )  {
+	$panel->add_error( gettext('This object is not in refused state') );
+	undef $object;
+}
+
+if( defined $object  &&  $object->get_owner_uid != $user->get_uid )  {
+	$panel->add_error( gettext('You are not allowed to do it, you don\'t own this object') );
+	undef $object;
+}
+
+if( $object ) {
+
+	my $url;
+
+	if( $object->get_type == Vhffs::Constants::TYPE_GROUP ) {
+		$url = '/group/index.pl?msg='.gettext('This object has been deleted');
+	}
+	else {
+		$url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('This object has been deleted');
+	}
+
+	if( $object->delete )  {
+		$panel->redirect( $url );
+	}
+	else {
+		$panel->add_error( gettext('An error occured while deleting this object.') );
+	}
+}
+
+
+if( $panel->has_errors ) {
+
+	$panel->set_title( gettext('Object deletion') );
+	$panel->build;
+	$panel->display;
+}


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

Added: trunk/vhffs-panel/object/resubmit.pl
===================================================================
--- trunk/vhffs-panel/object/resubmit.pl	                        (rev 0)
+++ trunk/vhffs-panel/object/resubmit.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -0,0 +1,132 @@
+#!%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 CGI;
+use CGI::Session;
+use strict;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::User;
+use Vhffs::Main;
+use Vhffs::Panel::Main;
+use Vhffs::Panel::Menu;
+use Vhffs::Panel::Group;
+use Vhffs::Constants;
+use Vhffs::Object;
+use Vhffs::ObjectFactory;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+my $vhffs = $panel->{vhffs};
+my $templatedir = $panel->{templatedir};
+my $user = $panel->{user};
+my $group = $panel->{group};
+my $cgi = $panel->{cgi};
+
+my $oid = $cgi->param('oid');
+$panel->add_error( gettext('CGI error') ) unless defined $oid;
+
+my $object;
+if( defined $oid )  {
+	$object = Vhffs::ObjectFactory::fetch_object( $vhffs , $oid );
+	$panel->add_error( gettext('This object does not exist') ) unless defined $object;
+}
+
+if( defined $object  &&  $object->get_status != Vhffs::Constants::VALIDATION_REFUSED )  {
+	$panel->add_error( gettext('This object is not in refused state') );
+	undef $object;
+}
+
+if( defined $object  &&  $object->get_owner_uid != $user->get_uid )  {
+	$panel->add_error( gettext('You are not allowed to do it, you don\'t own this object') );
+	undef $object;
+}
+
+my $submitted = $cgi->param('submitted');
+
+if( $submitted && $object ) {
+
+	my $description = $cgi->param('description');
+	unless( defined $description ) {
+		$panel->add_error( gettext('CGI error') );
+	}
+	elsif( $description =~ /^\s*$/ ) {
+		$panel->add_error( gettext('You must enter a description') );
+	}
+	elsif ( $object->resubmit_for_moderation( $description ) )  {
+		my $url;
+		if( $object->get_type == Vhffs::Constants::TYPE_GROUP ) {
+			$url = '/group/index.pl?msg='.gettext('The new description has been submitted');
+		}
+		else {
+			$url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The new description has been submitted');
+		}
+		$panel->redirect( $url );
+	}
+	else {
+		$panel->add_error( gettext('An error occured while updating this object.') );
+	}
+}
+
+
+$panel->set_title( gettext('Propose a new description') );
+
+if( $panel->has_errors ) {
+
+	$panel->build;
+	$panel->display;
+}
+elsif( !$submitted ) {
+
+	my $template = new HTML::Template( filename => $templatedir.'/panel/misc/resubmit.tmpl' );
+
+	$template->param( OBJECTTYPE_TEXT => gettext('Object type') );
+	$template->param( OBJECTTYPE => Vhffs::Functions::type_string_from_type_id( $object->get_type ) );
+
+	$template->param( OBJECTNAME_TEXT => gettext('Object name') );
+	$template->param( OBJECTNAME => $object->get_label );
+
+	$template->param( DESCRIPTION_TEXT => gettext('Description') );
+	$template->param( DESCRIPTION => CGI::escapeHTML( $object->get_description ) );
+
+	$template->param( OID => $object->get_oid );
+	$template->param( SEND => gettext('Submit') );
+
+	$panel->build( $template );
+	$panel->display;
+}


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

Modified: trunk/vhffs-panel/pgsql/create.pl
===================================================================
--- trunk/vhffs-panel/pgsql/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/pgsql/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -79,7 +79,7 @@
     } elsif(!Vhffs::Services::Pgsql::check_dbpass($dbpass)) {
         $panel->add_error( gettext('Invalid password. It must be at least 3 characters and contain only letters (lower and uppercase) and numbers') );
     } elsif(defined Vhffs::Panel::Pgsql::create_pgsql($vhffs, $dbname, $user, $group, $dbuser, $dbpass, $description)) {
-        my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The PostgreSQL DB was successfully created !');
+        my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The PostgreSQL DB was successfully created !');
         $panel->redirect($url);
     } else {
         $panel->add_error( 'An error occured while creating the object.' );

Modified: trunk/vhffs-panel/repository/create.pl
===================================================================
--- trunk/vhffs-panel/repository/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/repository/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -69,7 +69,7 @@
     } elsif($description =~ /^\s*$/) {
         $panel->add_error( gettext('You must enter a description') );
     } elsif( defined Vhffs::Panel::Repository::create_repository( $vhffs, $groupname, $user, $group , $description ) ) {
-        my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The repository was successfully created !');
+        my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The repository was successfully created !');
         $panel->redirect($url);
     } else {
         $panel->add_error( gettext('An error occured while creating the object. Check that this group doesn\'t already have a download repository') );

Modified: trunk/vhffs-panel/repository/prefs_save.pl
===================================================================
--- trunk/vhffs-panel/repository/prefs_save.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/repository/prefs_save.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -103,6 +103,6 @@
 my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
 $template->param( MESSAGE => $message );
 
-$panel->set_refresh_url( "/panel.pl?project=".$repo->get_group->get_groupname, 0);
+$panel->set_refresh_url( "/group/view.pl?project=".$repo->get_group->get_groupname, 0);
 $panel->build( $template );
 $panel->display;

Modified: trunk/vhffs-panel/svn/create.pl
===================================================================
--- trunk/vhffs-panel/svn/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/svn/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -73,7 +73,7 @@
     } elsif( $description =~ /^\s*$/) {
         $panel->add_error( gettext('You must enter a description') );
     } elsif( defined Vhffs::Panel::Svn::create_svn( $vhffs, $fullreponame, $description, $user, $group ) ) {
-        my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The SVN object was successfully created !');
+        my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The SVN object was successfully created !');
         $panel->redirect($url);
     } else {
         $panel->add_error( gettext('An error occured while creating the svn repository') );

Modified: trunk/vhffs-panel/svn/prefs_save.pl
===================================================================
--- trunk/vhffs-panel/svn/prefs_save.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/svn/prefs_save.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -137,6 +137,6 @@
 my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
 $template->param( MESSAGE => $message );
 
-$panel->set_refresh_url( "/panel.pl?project=".$svn->get_group->get_groupname, 0);
+$panel->set_refresh_url( "/group/view.pl?project=".$svn->get_group->get_groupname, 0);
 $panel->build( $template );
 $panel->display;

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/templates/Makefile.am	2007-09-11 05:04:48 UTC (rev 905)
@@ -123,6 +123,7 @@
 	misc/service_index.tmpl \
 	misc/simplemsg.tmpl \
 	misc/welcome.tmpl \
+	misc/resubmit.tmpl \
 	mysql/create.tmpl \
 	mysql/prefs.tmpl \
 	pgsql/create.tmpl \

Modified: trunk/vhffs-panel/templates/group/index.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/index.tmpl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/templates/group/index.tmpl	2007-09-11 05:04:48 UTC (rev 905)
@@ -6,7 +6,12 @@
 <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>
+    <li><tmpl_var name="PROJECT">&nbsp;&mdash;&nbsp;<tmpl_var name="STATE">
+    <tmpl_if name="REFUSED">
+       - <a href="/object/resubmit.pl?oid=<tmpl_var name="OID">"><tmpl_var name="RESUBMIT_TEXT">Propose a new description</a>
+       - <a href="/object/quickdelete.pl?oid=<tmpl_var name="OID">"><tmpl_var name="DELETE_TEXT">Delete</a>
+    </tmpl_if>
+    </li>
 </tmpl_if>
 </tmpl_loop>
 </ul>

Modified: trunk/vhffs-panel/templates/menu/main.tmpl
===================================================================
--- trunk/vhffs-panel/templates/menu/main.tmpl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/templates/menu/main.tmpl	2007-09-11 05:04:48 UTC (rev 905)
@@ -1,7 +1,7 @@
 <div id="header">
     <tmpl_if name="GROUPNAME">
     <div id="group_menu">
-        <span id="groupname"><a href="/panel.pl?project=<tmpl_var name="GROUPNAME">"><img src="/themes/<tmpl_var name="THEME">/images/projectcurrent.png" title="<tmpl_var name="PROJECT_HOME_TEXT">" alt="<tmpl_var name="PROJECT_HOME_TEXT">" onmouseover="javascript:this.timer=helpTimeout('user_project');" onmouseout="javascript:window.clearTimeout(this.timer);"/></a>&nbsp;<tmpl_var name="CURRENT_GROUP_TEXT"> <tmpl_var name="GROUPNAME"></span>
+        <span id="groupname"><a href="/group/view.pl?project=<tmpl_var name="GROUPNAME">"><img src="/themes/<tmpl_var name="THEME">/images/projectcurrent.png" title="<tmpl_var name="PROJECT_HOME_TEXT">" alt="<tmpl_var name="PROJECT_HOME_TEXT">" onmouseover="javascript:this.timer=helpTimeout('user_project');" onmouseout="javascript:window.clearTimeout(this.timer);"/></a>&nbsp;<tmpl_var name="CURRENT_GROUP_TEXT"> <tmpl_var name="GROUPNAME"></span>
     </div>
     </tmpl_if>
     <div id="username_menu">

Added: trunk/vhffs-panel/templates/misc/resubmit.tmpl
===================================================================
--- trunk/vhffs-panel/templates/misc/resubmit.tmpl	                        (rev 0)
+++ trunk/vhffs-panel/templates/misc/resubmit.tmpl	2007-09-11 05:04:48 UTC (rev 905)
@@ -0,0 +1,23 @@
+<form method="post" action="" class="largeLabel">
+	<p>
+		<label><TMPL_VAR NAME="OBJECTTYPE_TEXT">:</label> <TMPL_VAR NAME="OBJECTTYPE">
+	</p>
+	<p>
+		<label><TMPL_VAR NAME="OBJECTNAME_TEXT">:</label> <TMPL_VAR NAME="OBJECTNAME">
+	</p>
+	<p>
+		<label for="description">
+			<TMPL_VAR NAME="DESCRIPTION_TEXT">:
+		</label>
+		<textarea name="description" id="description" cols="45" rows="7"><tmpl_var name="DESCRIPTION"></textarea>
+	</p>
+	<tmpl_if name="WARNING_PUBLIC">
+	<p>
+		<TMPL_VAR NAME="WARNING_PUBLIC">
+	</p>
+	</tmpl_if>
+	<input type="hidden" name="oid" value="<tmpl_var name="OID">" />
+	<p class="button" id="buttonSend">
+		<input type="submit" value="<TMPL_VAR NAME="SEND">" name="submitted" />
+	</p>
+</form>

Modified: trunk/vhffs-panel/templates/misc/service_index.tmpl
===================================================================
--- trunk/vhffs-panel/templates/misc/service_index.tmpl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/templates/misc/service_index.tmpl	2007-09-11 05:04:48 UTC (rev 905)
@@ -8,6 +8,10 @@
     &mdash; <a href="/<tmpl_var name="SERVICE">/prefs.pl?name=<tmpl_var name="DISPLAYNAME">"><tmpl_var name="ADMIN_TEXT"></a> -
 <tmpl_else>
     (<tmpl_var name="state">) &mdash;
+    <tmpl_if name="refused">
+       <a href="/object/resubmit.pl?oid=<tmpl_var name="OID">"><tmpl_var name="RESUBMIT_TEXT"></a> -
+       <a href="/object/quickdelete.pl?oid=<tmpl_var name="OID">"><tmpl_var name="DELETE_TEXT"></a> -
+    </tmpl_if>
 </tmpl_if>
 <a href="/history.pl?OID=<tmpl_var name="OID">"><tmpl_var name="HISTORY_TEXT"></a>
 </li>

Modified: trunk/vhffs-panel/user/delete.pl
===================================================================
--- trunk/vhffs-panel/user/delete.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/user/delete.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -97,6 +97,6 @@
 my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
 $template->param( MESSAGE => $message );
 
-$panel->set_refresh_url( "/panel.pl?project=$groupname" );
+$panel->set_refresh_url( "/group/view.pl?project=$groupname" );
 $panel->build( $template );
 $panel->display;

Modified: trunk/vhffs-panel/web/create.pl
===================================================================
--- trunk/vhffs-panel/web/create.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/web/create.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -72,7 +72,7 @@
     } elsif( $description =~ /^\s*$/ ) {
         $panel->add_error( gettext('You must enter a description') );
     } elsif( defined(Vhffs::Panel::Web::create_web( $vhffs, $servername, $description, $user, $group)) ) {
-        my $url = '/panel.pl?project='.$panel->{groupname}.'&msg='.gettext('The webarea was successfully created !');
+        my $url = '/group/view.pl?project='.$panel->{groupname}.'&msg='.gettext('The webarea was successfully created !');
         $panel->redirect($url);
     } else {
         $panel->add_error( gettext('Error creating webarea.') );

Modified: trunk/vhffs-panel/web/delete.pl
===================================================================
--- trunk/vhffs-panel/web/delete.pl	2007-09-11 04:58:08 UTC (rev 904)
+++ trunk/vhffs-panel/web/delete.pl	2007-09-11 05:04:48 UTC (rev 905)
@@ -106,6 +106,6 @@
 my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
 $template->param( MESSAGE => $message );
 
-$panel->set_refresh_url( "/panel.pl?project=$groupname" );
+$panel->set_refresh_url( "/group/view.pl?project=$groupname" );
 $panel->build( $template );
 $panel->display;


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