[Fusionforge-commits] r12500 - in trunk/src: common/import plugins/projectimport/3rd-party/oslc-tools/arc2-plugin

Olivier Berger olberger at fusionforge.org
Tue Mar 1 22:57:18 CET 2011


Author: olberger
Date: 2011-03-01 22:57:18 +0100 (Tue, 01 Mar 2011)
New Revision: 12500

Modified:
   trunk/src/common/import/import_arrays.php
   trunk/src/common/import/import_trackers.php
   trunk/src/plugins/projectimport/3rd-party/oslc-tools/arc2-plugin/ARC2_OSLCCoreRDFJSONParserPlugin.php
Log:
Syntax checks should be better now


Modified: trunk/src/common/import/import_arrays.php
===================================================================
--- trunk/src/common/import/import_arrays.php	2011-03-01 21:53:12 UTC (rev 12499)
+++ trunk/src/common/import/import_arrays.php	2011-03-01 21:57:18 UTC (rev 12500)
@@ -1,7 +1,7 @@
-<?php
-
-
-//Default values for trackers
-
+<?php
 
-?>
+
+//Default values for trackers
+
+
+?>

Modified: trunk/src/common/import/import_trackers.php
===================================================================
--- trunk/src/common/import/import_trackers.php	2011-03-01 21:53:12 UTC (rev 12499)
+++ trunk/src/common/import/import_trackers.php	2011-03-01 21:57:18 UTC (rev 12500)
@@ -1,4 +1,4 @@
-<?php
+<?php
 require_once('../env.inc.php');
 require_once $gfwww.'include/pre.php';
 require_once($gfcommon.'tracker/ArtifactType.class.php');
@@ -7,16 +7,16 @@
 require_once($gfcommon.'tracker/ArtifactExtraField.class.php');
 require_once($gfcommon.'tracker/ArtifactFile.class.php');
 //require_once($gfcommon.'import/import_arrays.php');
-
-define('TRACKER_IS_PUBLIC', 1);
+
+define('TRACKER_IS_PUBLIC', 1);
 define('TRACKER_ALLOW_ANON', 0);
-define('TRACKER_BUGS', 1);
-define('TRACKER_SUPPORT', 2);
-define('TRACKER_PATCHES', 3);
-define('TRACKER_FEATURES', 4);
-
-static $NOT_EXTRA_FIELDS = array('assigned_to', 'attachments', 'class', 'comments', 'date', 'history', 'priority', 'status_id', 'submitter', 'summary', 'closed_at', 'description', 'type', 'type_of_search', 'id');//last 3 should not be there at all.
+define('TRACKER_BUGS', 1);
+define('TRACKER_SUPPORT', 2);
+define('TRACKER_PATCHES', 3);
+define('TRACKER_FEATURES', 4);
 
+static $NOT_EXTRA_FIELDS = array('assigned_to', 'attachments', 'class', 'comments', 'date', 'history', 'priority', 'status_id', 'submitter', 'summary', 'closed_at', 'description', 'type', 'type_of_search', 'id');//last 3 should not be there at all.
+
 /**
  * findType - get the type of a field from its name, value, and vocabulary : default 0 (text box), otherwise 1 (select box) or 2 (multi choice field)
  * @param string	Name of the field
@@ -63,7 +63,7 @@
  * @param array	Vocabulary and artifacts for the ArtifactType
  * @return false if failed
  */
-function createFields($at, $data){
+function createFields($at, $data){
 	global $NOT_EXTRA_FIELDS;
 //new dBug($data);
 	//TODO:Create ExtraFields	
@@ -72,13 +72,13 @@
 	foreach($artifactToCheck as $fieldName => $fieldValue){
 		if (!in_array($fieldName, $NOT_EXTRA_FIELDS)){
 			$type = findType($fieldName, $fieldValue, $data["vocabulary"]);
-			$aef = new ArtifactExtraField($at);
-			
-			$defaultExtraFieldsSettings = array(0,0,0);
-			$defaultTextFieldsSettings = array(40,100,0);
+			$aef = new ArtifactExtraField($at);
 			
+			$defaultExtraFieldsSettings = array(0,0,0);
+			$defaultTextFieldsSettings = array(40,100,0);
+			
 			if($type==ARTIFACT_EXTRAFIELDTYPE_TEXT){
-				$extraFieldSettings = $defaultTextFieldsSettings;				
+				$extraFieldSettings = $defaultTextFieldsSettings;				
 			}
 			else{
 				$extraFieldSettings = $defaultExtraFieldsSettings;
@@ -95,7 +95,7 @@
 		}
 	}
 	return true;
-}
+}
 
 /**
  * createTracker - Create a specific tracker from data in the specified group
@@ -103,45 +103,45 @@
  * @param Group	The group which the tracker belongs to
  * @param array	Tracker data from JSON
  * @return ArtifactType	the tracker created
- */
-
-function createTracker($tracker, $group, $data){
+ */
+
+function createTracker($tracker, $group, $data){
 	//	Create a tracker
 	db_begin();
-	$at = new ArtifactType($group);
+	$at = new ArtifactType($group);
 	if (!$at || !is_object($at)) {
-		db_rollback();
-		return false;
+		db_rollback();
+		return false;
 	}
-	//include $GLOBALS['gfcommon'].'import/import_arrays.php';
-	
+	//include $GLOBALS['gfcommon'].'import/import_arrays.php';
+	
 	$base_tracker_association = array( 'bugs' => TRACKER_BUGS, 'support' => TRACKER_SUPPORT, 'patches' => TRACKER_PATCHES, 'features' => TRACKER_FEATURES );
-	if(array_key_exists($tracker, $base_tracker_association)){
-		$valueType = $base_tracker_association[$tracker];
-	} else {
-		$valueType = 0;
-	}
-	
-	$is_public = TRACKER_IS_PUBLIC;
-	$allow_anon = TRACKER_ALLOW_ANON;
-	$email_all = '';
-	$email_address = '';
-	$due_period = 30;
-	$use_resolution = 0;
-	$submit_instructions = 0;
-	$use_resolution = 0;
+	if(array_key_exists($tracker, $base_tracker_association)){
+		$valueType = $base_tracker_association[$tracker];
+	} else {
+		$valueType = 0;
+	}
 	
+	$is_public = TRACKER_IS_PUBLIC;
+	$allow_anon = TRACKER_ALLOW_ANON;
+	$email_all = '';
+	$email_address = '';
+	$due_period = 30;
+	$use_resolution = 0;
+	$submit_instructions = 0;
+	$use_resolution = 0;
+	
 	if (!$at->create($data["label"], $data["label"], $is_public, $allow_anon, $email_all, $email_address, $due_period, $use_resolution, $submit_instructions, $use_resolution, $valueType)) {
-		db_rollback();
-		return false;
+		db_rollback();
+		return false;
 	} else {
-		//	Create each field in the tracker
+		//	Create each field in the tracker
 		createFields($at, $data);
 	}
 	db_commit();
-	return $at;
+	return $at;
 }
-
+
 /**
  * deleteTrackers - Delete all existing default trackers from a projet
  * @param Group A Group object
@@ -239,12 +239,12 @@
 /**
  * createArtifacts - Create all the artifacts for an ArtifactType from an array of data.
  * @param ArtifactType The ArtifactType object which the artifacts to be added belong to.
- * @param array	The data of all the artifacts of the current Type (dictionary)
- * @param $hashrn
+ * @param array	The data of all the artifacts of the current Type (dictionary)
+ * @param $hashrn
  * @param $hashlogin
  */
-function createArtifacts($at, $data, $hashrn, $hashlogin) {
-	global $NOT_EXTRA_FIELDS;
+function createArtifacts($at, $data, $hashrn, $hashlogin) {
+	global $NOT_EXTRA_FIELDS;
 	
 	$name_id = array();
 	//include $GLOBALS['gfcommon'].'import/import_arrays.php';
@@ -350,4 +350,4 @@
 
 }
 
-?>
+?>

Modified: trunk/src/plugins/projectimport/3rd-party/oslc-tools/arc2-plugin/ARC2_OSLCCoreRDFJSONParserPlugin.php
===================================================================
--- trunk/src/plugins/projectimport/3rd-party/oslc-tools/arc2-plugin/ARC2_OSLCCoreRDFJSONParserPlugin.php	2011-03-01 21:53:12 UTC (rev 12499)
+++ trunk/src/plugins/projectimport/3rd-party/oslc-tools/arc2-plugin/ARC2_OSLCCoreRDFJSONParserPlugin.php	2011-03-01 21:57:18 UTC (rev 12500)
@@ -4,7 +4,7 @@
 
 RDF Parser for ARC2 to OSLC Core RDF JSON format
 
-Copyright (c) 2010 Olivier Berger, Institut T�l�com
+Copyright (c) 2010 Olivier Berger, Institut Telecom
 
 homepage: See http://oslc-tools.svn.sourceforge.net/viewvc/oslc-tools/language-libs/php/arc2-plugin/
 license:  




More information about the Fusionforge-commits mailing list