From 11a00a182b7c9c1cdfbb6b0d6c11dfbac63a9c35 Mon Sep 17 00:00:00 2001 From: Ronald Q Date: Tue, 26 Jul 2016 14:07:00 -0400 Subject: [PATCH] HOR-1511 Task: Muestra mensaje de error al asignar usuarios change type in field TAS_SELFSERVICE_TIME in schema.xml, schema.sql and models --- .../classes/model/map/TaskMapBuilder.php | 2 +- workflow/engine/classes/model/om/BaseTask.php | 20 +++++----- workflow/engine/config/schema.xml | 2 +- workflow/engine/data/mysql/schema.sql | 4 +- .../Services/Api/Project/Activity.php | 40 +++++++++---------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/workflow/engine/classes/model/map/TaskMapBuilder.php b/workflow/engine/classes/model/map/TaskMapBuilder.php index 863efc4f2..53f50d5cf 100755 --- a/workflow/engine/classes/model/map/TaskMapBuilder.php +++ b/workflow/engine/classes/model/map/TaskMapBuilder.php @@ -165,7 +165,7 @@ class TaskMapBuilder $tMap->addColumn('TAS_SELFSERVICE_TIMEOUT', 'TasSelfserviceTimeout', 'int', CreoleTypes::INTEGER, false, null); - $tMap->addColumn('TAS_SELFSERVICE_TIME', 'TasSelfserviceTime', 'string', CreoleTypes::VARCHAR, false, 15); + $tMap->addColumn('TAS_SELFSERVICE_TIME', 'TasSelfserviceTime', 'int', CreoleTypes::INTEGER, false, null); $tMap->addColumn('TAS_SELFSERVICE_TIME_UNIT', 'TasSelfserviceTimeUnit', 'string', CreoleTypes::VARCHAR, false, 15); diff --git a/workflow/engine/classes/model/om/BaseTask.php b/workflow/engine/classes/model/om/BaseTask.php index e4466be70..c757656aa 100755 --- a/workflow/engine/classes/model/om/BaseTask.php +++ b/workflow/engine/classes/model/om/BaseTask.php @@ -329,9 +329,9 @@ abstract class BaseTask extends BaseObject implements Persistent /** * The value for the tas_selfservice_time field. - * @var string + * @var int */ - protected $tas_selfservice_time = ''; + protected $tas_selfservice_time = 0; /** * The value for the tas_selfservice_time_unit field. @@ -918,7 +918,7 @@ abstract class BaseTask extends BaseObject implements Persistent /** * Get the [tas_selfservice_time] column value. * - * @return string + * @return int */ public function getTasSelfserviceTime() { @@ -2050,19 +2050,19 @@ abstract class BaseTask extends BaseObject implements Persistent /** * Set the value of [tas_selfservice_time] column. * - * @param string $v new value + * @param int $v new value * @return void */ public function setTasSelfserviceTime($v) { - // Since the native PHP type for this column is string, - // we will cast the input to a string (if it is not). - if ($v !== null && !is_string($v)) { - $v = (string) $v; + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; } - if ($this->tas_selfservice_time !== $v || $v === '') { + if ($this->tas_selfservice_time !== $v || $v === 0) { $this->tas_selfservice_time = $v; $this->modifiedColumns[] = TaskPeer::TAS_SELFSERVICE_TIME; } @@ -2252,7 +2252,7 @@ abstract class BaseTask extends BaseObject implements Persistent $this->tas_selfservice_timeout = $rs->getInt($startcol + 49); - $this->tas_selfservice_time = $rs->getString($startcol + 50); + $this->tas_selfservice_time = $rs->getInt($startcol + 50); $this->tas_selfservice_time_unit = $rs->getString($startcol + 51); diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index f6face3a0..12020753f 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -1307,7 +1307,7 @@ - + diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index b6c79bf91..1ff347be5 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -654,12 +654,12 @@ CREATE TABLE `TASK` `TAS_BOUNDARY` VARCHAR(32) default '' NOT NULL, `TAS_DERIVATION_SCREEN_TPL` VARCHAR(128) default '', `TAS_SELFSERVICE_TIMEOUT` INTEGER default 0, - `TAS_SELFSERVICE_TIME` VARCHAR(15) default '', + `TAS_SELFSERVICE_TIME` INTEGER default 0, `TAS_SELFSERVICE_TIME_UNIT` VARCHAR(15) default '', `TAS_SELFSERVICE_TRIGGER_UID` VARCHAR(32) default '', `TAS_SELFSERVICE_EXECUTION` VARCHAR(15) default 'EVERY_TIME', PRIMARY KEY (`TAS_UID`), - KEY `indexTasUid` (`TAS_UID`) + KEY `indexTasUid`(`TAS_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Task of workflow'; #----------------------------------------------------------------------------- #-- TASK_USER diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php index 136db2822..ae961df42 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php @@ -233,42 +233,42 @@ class ActivityPropertiesStructure public $tas_title; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_description; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_priority_variable; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_derivation_screen_tpl; /** - * @var string {@from body} {@choice TRUE,FALSE} + * @var string {@from body} {@choice TRUE,FALSE} {@required false} */ public $tas_start; /** - * @var string {@from body} {@choice BALANCED,MANUAL,EVALUATE,REPORT_TO,SELF_SERVICE,SELF_SERVICE_EVALUATE,MULTIPLE_INSTANCE,MULTIPLE_INSTANCE_VALUE_BASED} + * @var string {@from body} {@choice BALANCED,MANUAL,EVALUATE,REPORT_TO,SELF_SERVICE,SELF_SERVICE_EVALUATE,MULTIPLE_INSTANCE,MULTIPLE_INSTANCE_VALUE_BASED} {@required false} */ public $tas_assign_type; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_assign_variable; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_group_variable; /** - * @var string {@from body} + * @var int {@from body} {@required false} */ public $tas_selfservice_time; @@ -278,12 +278,12 @@ class ActivityPropertiesStructure public $tas_selfservice_timeout; /** - * @var string {@from body} {@choice DAYS,,HOURS,MINUTES} + * @var string {@from body} {@choice DAYS,,HOURS,MINUTES} {@required false} */ public $tas_selfservice_time_unit; /** - * @var string {@from body} {@min 0} {@max 32} + * @var string {@from body} {@min 0} {@max 32} {@required false} */ public $tas_selfservice_trigger_uid; @@ -298,22 +298,22 @@ class ActivityPropertiesStructure public $tas_transfer_fly; /** - * @var int {@from body} + * @var int {@from body} {@required false} */ public $tas_duration; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_timeunit; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_type_day; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_calendar; @@ -323,12 +323,12 @@ class ActivityPropertiesStructure public $tas_type; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_def_title; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_def_description; @@ -338,22 +338,22 @@ class ActivityPropertiesStructure public $tas_send_last_email; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_def_subject_message; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_def_message_type; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_def_message; /** - * @var string {@from body} + * @var string {@from body} {@required false} */ public $tas_def_message_template; }