[Fusionforge-commits] FusionForge branch master updated. 69b395967ede31a8325b59ae334da038ab23216b

Franck VILLAUME nerville at fusionforge.org
Sun Nov 3 17:21:32 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  69b395967ede31a8325b59ae334da038ab23216b (commit)
      from  1deed89e112223d6092c979eecff5f8306c366b2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 69b395967ede31a8325b59ae334da038ab23216b
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 3 17:20:59 2013 +0100

    fix [#353]: Problems registering a new project
    registration page enhancement: use Html5 pattern and placeholder when possible, better error message, fix length test

diff --git a/src/common/include/Group.class.php b/src/common/include/Group.class.php
index 4cf1dfd..6ca7191 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -291,13 +291,13 @@ class Group extends Error {
 	 * @param	object	$user			The User object.
 	 * @param	string	$group_name		The full name of the user.
 	 * @param	string	$unix_name		The Unix name of the user.
-	 * @param	string	$description	The new group description.
+	 * @param	string	$description		The new group description.
 	 * @param	string	$purpose		The purpose of the group.
 	 * @param	string	$unix_box
 	 * @param	string	$scm_box
 	 * @param	bool	$is_public
 	 * @param	bool	$send_mail		Whether to send an email or not
-	 * @param	int		$built_from_template	The id of the project this new project is based on
+	 * @param	int	$built_from_template	The id of the project this new project is based on
 	 * @return	boolean	success or not
 	 */
 	function create(&$user, $group_name, $unix_name, $description, $purpose, $unix_box = 'shell1',
@@ -306,7 +306,7 @@ class Group extends Error {
 
 		global $SYS;
 		if ($this->getID()!=0) {
-			$this->setError(_('Group object already exists'));
+			$this->setError(_('Group object already exists.'));
 			return false;
 		} elseif (!$this->validateGroupName($group_name)) {
 			return false;
@@ -314,17 +314,17 @@ class Group extends Error {
 			$this->setError(_('Invalid Unix Name.'));
 			return false;
 		} elseif (!$SYS->sysUseUnixName($unix_name)) {
-			$this->setError(_('Unix name already taken'));
+			$this->setError(_('Unix name already taken.'));
 			return false;
 		} elseif (db_numrows(db_query_params('SELECT group_id FROM groups WHERE unix_group_name=$1',
 							array($unix_name))) > 0) {
 			$this->setError(_('Unix name already taken'));
 			return false;
 		} elseif (strlen($purpose)<10) {
-			$this->setError(_('Please describe your Registration Purpose in a more comprehensive manner'));
+			$this->setError(_('Please describe your Registration Project Purpose and Summarization in a more comprehensive manner.'));
 			return false;
 		} elseif (strlen($purpose)>1500) {
-			$this->setError(_('The Registration Purpose text is too long. Please make it smaller than 1500 bytes.'));
+			$this->setError(_('The Registration Project Purpose and Summarization text is too long. Please make it smaller than 1500 characters.'));
 			return false;
 		} elseif (strlen($description)<10) {
 			$this->setError(_('Describe in a more comprehensive manner your project.'));
@@ -2726,7 +2726,7 @@ The %1$s admin team will now examine your project submission.  You will be notif
 		if (strlen($group_name)<3) {
 			$this->setError(_('Group name is too short'));
 			return false;
-		} elseif (strlen(htmlspecialchars($group_name))>50) {
+		} elseif (strlen(htmlspecialchars($group_name))>40) {
 			$this->setError(_('Group name is too long'));
 			return false;
 		} elseif (group_get_object_by_publicname($group_name)) {
diff --git a/src/www/register/index.php b/src/www/register/index.php
index debc1d0..5b2b6ef 100644
--- a/src/www/register/index.php
+++ b/src/www/register/index.php
@@ -181,11 +181,11 @@ site_user_header(array('title'=>_('Register Project')));
 <input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>"/>
 <h2><?php echo $index++.'. '._('Project Full Name') ?></h2>
 <p>
-<?php echo _('You should start with specifying the name of your project. The “Full Name” is descriptive, and has no arbitrary restrictions (except a 40 character limit).') ?>
+<?php echo _('You should start with specifying the name of your project. The “Full Name” is descriptive, and has no arbitrary restrictions (except min 3 characters and max 40 characters).') ?>
 </p>
 <p>
 <?php echo _('Full Name') . _(': ') ?><br/>
-<input required="required" size="40" maxlength="40" type="text" name="full_name" value="<?php echo htmlspecialchars($full_name); ?>"/>
+<input required="required" size="40" maxlength="40" type="text" name="full_name" placeholder="<?php echo _('Project Full Name'); ?>" value="<?php echo htmlspecialchars($full_name); ?>" pattern=".{3,40}"/>
 </p>
 
 <?php
@@ -193,9 +193,9 @@ site_user_header(array('title'=>_('Register Project')));
 if ( !forge_get_config ('project_auto_approval') ) {
 	echo '<h2>'.$index++.'. '._('Project Purpose And Summarization').'</h2>';
 	echo '<p>';
-	printf(_('Please provide detailed, accurate description of your project and what %1$s resources and in which way you plan to use. This description will be the basis for the approval or rejection of your project\'s hosting on %1$s, and later, to ensure that you are using the services in the intended way. This description will not be used as a public description of your project. It must be written in English.'), forge_get_config ('forge_name'));
+	printf(_('Please provide detailed, accurate description of your project and what %1$s resources and in which way you plan to use. This description will be the basis for the approval or rejection of your project\'s hosting on %1$s, and later, to ensure that you are using the services in the intended way. This description will not be used as a public description of your project. It must be written in English. From 10 to 1500 characters.'), forge_get_config ('forge_name'));
 	echo '</p>';
-	echo '<textarea required="required" name="purpose" cols="70" rows="10">';
+	echo '<textarea required="required" name="purpose" cols="70" rows="10" placeholder="'. _('Project Purpose And Summarization').'" >';
 	echo htmlspecialchars($purpose);
 	echo '</textarea>';
 }
@@ -203,10 +203,10 @@ if ( !forge_get_config ('project_auto_approval') ) {
 
 <h2><?php echo $index++.'. '. _('Project Public Description') ?></h2>
 <p>
-<?php echo _('This is the description of your project which will be shown on the Project Summary page, in search results, etc.') ?>
+<?php echo _('This is the description of your project which will be shown on the Project Summary page, in search results, etc. (at least 10 characters)') ?>
 </p>
 
-<textarea required="required" name="description" cols="70" rows="5">
+<textarea required="required" name="description" cols="70" rows="5" placeholder="<?php echo _('Project Public Description'); ?>" >
 <?php echo htmlspecialchars($description); ?>
 </textarea>
 
@@ -234,7 +234,7 @@ if ( !forge_get_config ('project_auto_approval') ) {
 <p>
 <?php echo _('Unix Name') . _(':'); ?>
 <br />
-<input required="required" type="text" maxlength="15" size="15" name="unix_name" value="<?php echo htmlspecialchars($unix_name); ?>"/>
+<input required="required" type="text" maxlength="15" size="15" name="unix_name" value="<?php echo htmlspecialchars($unix_name); ?>" placeholder="<?php echo _('Unix Name'); ?>" pattern="[a-z0-9-]{3,15}"/>
 </p>
 
 <?php
@@ -279,7 +279,7 @@ if (count ($template_projects) > 1) {
 		$tpv_arr[] = $tp->getID() ;
 		$tpn_arr[] = $tp->getPublicName() ;
 	}
-	echo html_build_select_box_from_arrays ($tpv_arr, $tpn_arr, 'built_from_template', $template_projects[0]->getID(),
+	echo html_build_select_box_from_arrays ($tpv_arr, $tpn_arr, 'built_from_template', $built_from_template,
 						false, '', false, '') ;
 } elseif (count ($template_projects) == 1) {
 	echo '<p>';

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/Group.class.php |   14 +++++++-------
 src/www/register/index.php         |   16 ++++++++--------
 2 files changed, 15 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list