[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1711-g575dabf

Marc-Etienne VARGENAU vargenau at libremir.placard.fr.eu.org
Thu Apr 27 16:17:23 CEST 2017


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  575dabf36b3afb199b06883851d55ff337b6b048 (commit)
      from  cb5baad7071aeec04e9ae2a6a365583333aaf062 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=575dabf36b3afb199b06883851d55ff337b6b048

commit 575dabf36b3afb199b06883851d55ff337b6b048
Author: Marc-Etienne Vargenau <marc-etienne.vargenau at nokia.com>
Date:   Thu Apr 27 16:17:17 2017 +0200

    Add new extra field types for SLA (to be continued)

diff --git a/src/common/tracker/ArtifactExtraField.class.php b/src/common/tracker/ArtifactExtraField.class.php
index 35fd826..45d6325 100644
--- a/src/common/tracker/ArtifactExtraField.class.php
+++ b/src/common/tracker/ArtifactExtraField.class.php
@@ -758,7 +758,9 @@ class ArtifactExtraField extends FFError {
 			ARTIFACT_EXTRAFIELDTYPE_DATETIME => _('Datetime'),
 			ARTIFACT_EXTRAFIELDTYPE_USER => _('User'),
 			ARTIFACT_EXTRAFIELDTYPE_RELEASE => _('Release'),
-			ARTIFACT_EXTRAFIELDTYPE_EFFORT => _('Effort')
+			ARTIFACT_EXTRAFIELDTYPE_EFFORT => _('Effort'),
+			ARTIFACT_EXTRAFIELDTYPE_FORMULA => _('Formula'),
+			ARTIFACT_EXTRAFIELDTYPE_SLA => _('SLA')
 			);
 	}
 
@@ -865,6 +867,18 @@ class ArtifactExtraField extends FFError {
 		return $return;
 	}
 
+
+	/**
+	 * setRequired - Set the required for this extra field
+	 *
+	 * @param	int	$required		value of the field.
+	 * @param	int	$id				id of the field.
+	 */
+	function setRequired($required, $id) {
+		$res = db_query_params ('UPDATE artifact_extra_field_list SET is_required = $1 WHERE extra_field_id = $2',
+				array ($required, $id));
+	}
+
 	/**
 	 * update - update a row in the table used to store box names
 	 * for a tracker.  This function is only to update rowsf
@@ -1175,6 +1189,76 @@ class ArtifactExtraField extends FFError {
 		return true;
 	}
 
+	/**
+	 *    getMandatoryExtraFields - List of possible user built extra fields
+	 *    set up for this artifact type.
+	 *
+	 * @return array arrays of data;
+	 */
+	static function getMandatoryExtraFields($atid) {
+		$return = array();
+
+		$res = db_query_params('SELECT *
+				FROM artifact_extra_field_list
+				WHERE group_artifact_id=$1
+				AND is_required = 1
+				ORDER BY field_type ASC, alias ASC',
+				array($atid));
+
+		while ($arr = db_fetch_array($res)) {
+			$return[] = $arr;
+		}
+
+		return $return;
+	}
+
+	/**
+	 *    getAllExtraFields - List of possible user built extra fields
+	 *    set up for this artifact type.
+	 *
+	 * @return array arrays of data;
+	 */
+	static function getAllExtraFields($atid) {
+		$return = array();
+
+		$res = db_query_params('SELECT *
+				FROM artifact_extra_field_list
+				WHERE group_artifact_id=$1
+				ORDER BY field_type ASC, alias ASC',
+				array($atid));
+
+		while ($arr = db_fetch_array($res)) {
+			$return[] = $arr;
+		}
+
+		return $return;
+	}
+
+	/**
+	 *    checkExtraFieldElements - Check the elements for extra fields
+	 *    set up for this artifact type.
+	 *
+	 * @return boolean;
+	 */
+	static function checkExtraFieldElements($field_id, $element_name) {
+		$return = false;
+
+		$result = db_query_params('SELECT element_id
+				FROM artifact_extra_field_elements
+				WHERE extra_field_id=$1
+				AND element_name=$2',
+				array($field_id, trim($element_name)));
+
+		if ($result) {
+			while ($row = db_fetch_array($result)) {
+				if ($row['element_id'] > 0)
+					return $row['element_id'];
+			}
+		}
+
+		return $return;
+	}
+
 }
 
 // Local Variables:

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

Summary of changes:
 src/common/tracker/ArtifactExtraField.class.php | 86 ++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list