//define('ARTIFACT_EXTRAFIELDTYPE_ASSIGNEE',8);
define('ARTIFACT_EXTRAFIELDTYPE_RELATION',9);
define('ARTIFACT_EXTRAFIELDTYPE_INTEGER',10);
+/* reserved for aljeux extension, for merge into FusionForge */
+define('ARTIFACT_EXTRAFIELDTYPE_FORMULA',11);
+/* reserved for Evolvis extension, for merge into FusionForge */
+define('ARTIFACT_EXTRAFIELDTYPE_DATETIME',12);
class ArtifactExtraField extends Error {
var $data_array;
/**
- * ArtifactExtraField - Constructer
- *
- * @param object ArtifactType object.
- * @param array (all fields from artifact_file_user_vw) OR id from database.
- * @return boolean success.
+ * @param $ArtifactType
+ * @param bool $data
*/
function __construct(&$ArtifactType, $data=false) {
$this->Error();
return false;
}
if (!$field_type) {
- $this->setError("Type of custom field not selected");
+ $this->setError(_('Type of custom field not selected'));
return false;
}
if (!forge_check_perm ('tracker_admin', $this->ArtifactType->Group->getID())) {
}
if ($field_type == ARTIFACT_EXTRAFIELDTYPE_TEXT || $field_type == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
if (!$attribute1 || !$attribute2 || $attribute2 < $attribute1) {
- $this->setError("Invalid size/maxlength for text field");
+ $this->setError(_('Invalid size/maxlength for text field'));
return false;
}
}
if ($field_type == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
if (!$attribute1 || !$attribute2) {
- $this->setError("Invalid rows/cols for textarea field");
+ $this->setError(_('Invalid rows/cols for textarea field'));
+ return false;
+ }
+ } elseif ($field_type == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
+ if ($this->ArtifactType->getCustomStatusField()) {
+ $this->setError(_('This Tracker already uses custom statuses'));
return false;
}
}
/**
* fetchData - re-fetch the data for this ArtifactExtraField from the database.
*
- * @param int ID of the Box.
+ * @param int $id ID of the Box.
* @return boolean success.
*/
function fetchData($id) {
/**
* Generate an alias for this field. The alias can be entered by the user or
* be generated automatically from the name of the field.
- * @param string Alias entered by the user
- * @param string Name of the field entered by the user (it'll be used when $alias is empty)
+ * @param string $alias Alias entered by the user
+ * @param string $name Name of the field entered by the user (it'll be used when $alias is empty)
* @return string
*/
function generateAlias($alias, $name) {
return false;
}
$i = 1;
+ $data = array();
while ($i <= $max) {
if ($i == $new_pos) {
$data[] = $element_id;