[Fusionforge-commits] r12276 - branches/Branch_5_1/src/common/tracker

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Fri Feb 11 21:39:38 CET 2011


Author: aljeux
Date: 2011-02-11 21:39:38 +0100 (Fri, 11 Feb 2011)
New Revision: 12276

Modified:
   branches/Branch_5_1/src/common/tracker/ArtifactType.class.php
Log:
Check that tracker name is not already taken.

Modified: branches/Branch_5_1/src/common/tracker/ArtifactType.class.php
===================================================================
--- branches/Branch_5_1/src/common/tracker/ArtifactType.class.php	2011-02-11 20:30:11 UTC (rev 12275)
+++ branches/Branch_5_1/src/common/tracker/ArtifactType.class.php	2011-02-11 20:39:38 UTC (rev 12276)
@@ -956,6 +956,17 @@
 			return false;
 		}
 		
+		$result = db_query_params('SELECT count(*) AS count FROM artifact_group_list WHERE group_id=$1 AND name=$2 AND group_artifact_id!=$3',
+								  array ($this->Group->getID(), $name, $this->getID()));
+		if (! $result) {
+			$this->setError('ArtifactType::Update(): '.db_error());
+			return false;
+		}
+		if (db_result($result, 0, 'count')) {
+			$this->setError(_('Tracker name already used'));
+			return false;
+		}
+		
 		if ($email_address) {
 			$invalid_emails = validate_emails($email_address);
 			if (count($invalid_emails) > 0) {




More information about the Fusionforge-commits mailing list