2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
2012-11-16 17:13:48 -04:00
|
|
|
//require_once 'classes/model/om/BaseTask.php';
|
|
|
|
|
//require_once 'classes/model/Content.php';
|
2010-12-02 23:34:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Skeleton subclass for representing a row from the 'TASK' table.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* You should add additional methods to this class to meet the
|
|
|
|
|
* application requirements. This class will only be generated as
|
|
|
|
|
* long as it does not already exist in the output directory.
|
|
|
|
|
*
|
2011-01-31 14:14:55 +00:00
|
|
|
* @package workflow.engine.classes.model
|
2010-12-02 23:34:41 +00:00
|
|
|
*/
|
2012-07-03 18:20:20 -04:00
|
|
|
class Task extends BaseTask
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_title_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_title column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasTitleContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in getTasTitle, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_title_content = Content::load('TAS_TITLE', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_title_content;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_title column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasTitleContent($v)
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in setTasTitle, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_TITLE, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_title_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
$res = Content::addContent('TAS_TITLE', '', $this->getTasUid(), $lang, $this->tas_title_content);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_description_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_description column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasDescriptionContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception( "Error in getTasDescription, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_description_content = Content::load('TAS_DESCRIPTION', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_description_content;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_description column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasDescriptionContent($v)
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in setTasDescription, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_DESCRIPTION, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_description_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
$res = Content::addContent('TAS_DESCRIPTION', '', $this->getTasUid(), $lang, $this->tas_description_content);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_def_title_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_def_title column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasDefTitleContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception( "Error in getTasDefTitle, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_title_content = Content::load('TAS_DEF_TITLE', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_def_title_content;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_def_title column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasDefTitleContent($v)
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in setTasDefTitle, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_DEF_TITLE, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_title_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
$res = Content::addContent('TAS_DEF_TITLE', '', $this->getTasUid(), $lang, $this->tas_def_title_content);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_def_description_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_def_description column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasDefDescriptionContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception( "Error in getTasDefDescription, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_description_content = Content::load('TAS_DEF_DESCRIPTION', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_def_description_content;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_def_description column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasDefDescriptionContent($v)
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in setTasDefDescription, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_DEF_DESCRIPTION, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_description_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
$res = Content::addContent('TAS_DEF_DESCRIPTION', '', $this->getTasUid(), $lang, $v);
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_def_proc_code_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_def_proc_code column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasDefProcCodeContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception( "Error in getTasDefProcCode, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_proc_code_content = Content::load('TAS_DEF_PROC_CODE', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_def_proc_code_content;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_def_proc_code column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasDefProcCodeContent($v)
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in setTasDefProcCode, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_DEF_PROC_CODE, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_proc_code_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
$res = Content::addContent('TAS_DEF_PROC_CODE', '', $this->getTasUid(), $lang, $this->tas_def_proc_code_content);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_def_message_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_def_message column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasDefMessageContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception( "Error in getTasDefMessage, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_message_content = Content::load('TAS_DEF_MESSAGE', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_def_message_content;
|
2011-04-25 09:58:04 -04:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_def_message column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasDefMessageContent($v)
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in setTasDefMessage, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_DEF_MESSAGE, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_message_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
$res = Content::addContent('TAS_DEF_MESSAGE', '', $this->getTasUid(), $lang, $this->tas_def_message_content);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2011-04-25 09:58:04 -04:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This value goes in the content table
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
protected $tas_def_subject_message_content = '';
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the tas_def_message column value.
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function getTasDefSubjectMessageContent()
|
2012-07-03 18:20:20 -04:00
|
|
|
{
|
|
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception("Error in getTasDefSubjectMessage, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_subject_message_content = Content::load('TAS_DEF_SUBJECT_MESSAGE', '', $this->getTasUid(), $lang);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-06-28 10:59:43 -04:00
|
|
|
return $this->tas_def_subject_message_content;
|
2011-04-25 09:58:04 -04:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the tas_def_subject_message column value.
|
|
|
|
|
*
|
|
|
|
|
* @param string $v new value
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2016-06-28 10:59:43 -04:00
|
|
|
public function setTasDefSubjectMessageContent($v)
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2012-07-03 18:20:20 -04:00
|
|
|
if ($this->getTasUid() == "") {
|
|
|
|
|
throw (new Exception( "Error in setTasDefSubjectMessage, the getTasUid() can't be blank"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$v = isset($v)? ((string)$v) : '';
|
|
|
|
|
$lang = defined('SYS_LANG')? SYS_LANG : 'en';
|
|
|
|
|
|
2017-04-06 10:04:29 -04:00
|
|
|
if (in_array(TaskPeer::TAS_DEF_SUBJECT_MESSAGE, $this->modifiedColumns) || $v === "") {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->tas_def_subject_message_content = $v;
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
$res = Content::addContent('TAS_DEF_SUBJECT_MESSAGE', '', $this->getTasUid(), $lang, $v);
|
|
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* create a new Task
|
|
|
|
|
*
|
|
|
|
|
* @param array $aData with new values
|
2014-03-26 12:20:58 -04:00
|
|
|
* @return string
|
2012-07-03 18:20:20 -04:00
|
|
|
*/
|
2013-12-17 11:14:36 -04:00
|
|
|
public function create($aData, $generateUid = true)
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2012-07-03 18:20:20 -04:00
|
|
|
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
|
|
|
|
|
|
|
|
|
try {
|
2013-12-17 11:14:36 -04:00
|
|
|
if ($generateUid) {
|
|
|
|
|
$sTaskUID = G::generateUniqueID();
|
|
|
|
|
} else {
|
|
|
|
|
$sTaskUID = $aData['TAS_UID'];
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-03 18:20:20 -04:00
|
|
|
$con->begin();
|
|
|
|
|
$this->setProUid($aData['PRO_UID']);
|
|
|
|
|
$this->setTasUid($sTaskUID);
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->setTasTitle((isset($aData['TAS_TITLE']) ? $aData['TAS_TITLE']: ''));
|
|
|
|
|
$this->setTasDescription((isset($aData['TAS_DESCRIPTION']) ? $aData['TAS_DESCRIPTION']: ''));
|
|
|
|
|
$this->setTasDefTitle("");
|
|
|
|
|
$this->setTasDefDescription("");
|
|
|
|
|
$this->setTasDefProcCode("");
|
|
|
|
|
$this->setTasDefMessage("");
|
|
|
|
|
$this->setTasDefSubjectMessage("");
|
2012-07-03 18:20:20 -04:00
|
|
|
$this->setTasType("NORMAL");
|
|
|
|
|
$this->setTasDuration("1");
|
|
|
|
|
$this->setTasDelayType("");
|
|
|
|
|
$this->setTasTemporizer("");
|
|
|
|
|
$this->setTasTypeDay("");
|
|
|
|
|
$this->setTasTimeunit("DAYS");
|
|
|
|
|
$this->setTasAlert("FALSE");
|
|
|
|
|
$this->setTasPriorityVariable("");
|
|
|
|
|
$this->setTasAssignType("BALANCED");
|
|
|
|
|
$this->setTasAssignVariable("@@SYS_NEXT_USER_TO_BE_ASSIGNED");
|
|
|
|
|
$this->setTasAssignLocation("FALSE");
|
|
|
|
|
$this->setTasAssignLocationAdhoc("FALSE");
|
|
|
|
|
$this->setTasTransferFly("FALSE");
|
|
|
|
|
$this->setTasLastAssigned("0");
|
|
|
|
|
$this->setTasUser("0");
|
|
|
|
|
$this->setTasCanUpload("FALSE");
|
|
|
|
|
$this->setTasViewUpload("FALSE");
|
|
|
|
|
$this->setTasViewAdditionalDocumentation("FALSE");
|
|
|
|
|
$this->setTasCanCancel("FALSE");
|
|
|
|
|
$this->setTasOwnerApp("FALSE");
|
|
|
|
|
$this->setStgUid("");
|
|
|
|
|
$this->setTasCanPause("FALSE");
|
|
|
|
|
$this->setTasCanSendMessage("TRUE");
|
|
|
|
|
$this->setTasCanDeleteDocs("FALSE");
|
|
|
|
|
$this->setTasSelfService("FALSE");
|
|
|
|
|
$this->setTasStart("FALSE");
|
|
|
|
|
$this->setTasToLastUser("FALSE");
|
|
|
|
|
$this->setTasSendLastEmail("FALSE");
|
|
|
|
|
$this->setTasDerivation("NORMAL");
|
|
|
|
|
$this->setTasPosx("");
|
|
|
|
|
$this->setTasPosy("");
|
|
|
|
|
$this->setTasColor("");
|
2017-01-10 10:48:38 -04:00
|
|
|
$this->setTasGroupVariable("");
|
2017-03-06 17:17:48 -04:00
|
|
|
if (!$generateUid && !empty($aData['TAS_ID'])) {
|
|
|
|
|
$this->setTasId($aData['TAS_ID']);
|
|
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
|
|
|
|
|
|
|
|
|
|
if ($this->validate()) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->setTasTitleContent((isset($aData['TAS_TITLE']) ? $aData['TAS_TITLE']: ''));
|
|
|
|
|
$this->setTasDescriptionContent((isset($aData['TAS_DESCRIPTION']) ? $aData['TAS_DESCRIPTION']: ''));
|
|
|
|
|
$this->setTasDefTitleContent("");
|
|
|
|
|
$this->setTasDefDescriptionContent("");
|
|
|
|
|
$this->setTasDefProcCodeContent("");
|
|
|
|
|
$this->setTasDefMessageContent("");
|
|
|
|
|
$this->setTasDefSubjectMessageContent("");
|
2012-07-03 18:20:20 -04:00
|
|
|
$this->save();
|
|
|
|
|
$con->commit();
|
|
|
|
|
return $sTaskUID;
|
|
|
|
|
} else {
|
|
|
|
|
$con->rollback();
|
|
|
|
|
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
|
|
|
|
$e->aValidationFailures=$this->getValidationFailures();
|
|
|
|
|
|
|
|
|
|
throw ($e);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
$con->rollback();
|
|
|
|
|
|
|
|
|
|
throw ($e);
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
|
|
|
|
|
2012-07-03 18:20:20 -04:00
|
|
|
public function kgetassigType($pro_uid, $tas)
|
|
|
|
|
{
|
2010-12-02 23:34:41 +00:00
|
|
|
$k = new Criteria();
|
|
|
|
|
$k->clearSelectColumns();
|
|
|
|
|
$k->addSelectColumn(TaskPeer::TAS_UID);
|
|
|
|
|
$k->addSelectColumn(TaskPeer::TAS_ASSIGN_TYPE);
|
|
|
|
|
$k->add(TaskPeer::PRO_UID, $pro_uid );
|
|
|
|
|
$k->add(TaskPeer::TAS_UID, $tas );
|
|
|
|
|
$rs = TaskPeer::doSelectRS($k);
|
|
|
|
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$rs->next();
|
|
|
|
|
$row = $rs->getRow();
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
return $row;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
2016-08-12 11:29:30 -04:00
|
|
|
/**
|
|
|
|
|
* @param $pro_uid
|
|
|
|
|
* @param $tas
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function getEmailServerSettingsForNotification($pro_uid, $tas)
|
|
|
|
|
{
|
|
|
|
|
$oCriteria = new Criteria();
|
|
|
|
|
$oCriteria->clearSelectColumns();
|
|
|
|
|
$oCriteria->addSelectColumn(TaskPeer::TAS_NOT_EMAIL_FROM_FORMAT);
|
|
|
|
|
$oCriteria->add(TaskPeer::PRO_UID, $pro_uid );
|
|
|
|
|
$oCriteria->add(TaskPeer::TAS_UID, $tas );
|
|
|
|
|
$rs = TaskPeer::doSelectRS($oCriteria);
|
|
|
|
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$rs->next();
|
|
|
|
|
$row = $rs->getRow();
|
|
|
|
|
|
|
|
|
|
return $row;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-03 18:20:20 -04:00
|
|
|
public function load($TasUid)
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2012-07-03 18:20:20 -04:00
|
|
|
try {
|
|
|
|
|
$oRow = TaskPeer::retrieveByPK($TasUid);
|
|
|
|
|
|
|
|
|
|
if (!is_null($oRow)) {
|
|
|
|
|
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
|
|
|
|
|
|
|
|
|
|
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME); //Populating an object from of the array
|
|
|
|
|
//Populating attributes
|
|
|
|
|
$this->setNew(false);
|
|
|
|
|
|
2015-06-12 09:46:14 -04:00
|
|
|
/*----------------------------------********---------------------------------*/
|
2017-08-04 14:11:09 -04:00
|
|
|
$indicator = new IndicatorsCalculator();
|
2015-06-12 12:00:28 -04:00
|
|
|
$data = $indicator->suggestedTimeForTask($TasUid);
|
2015-06-12 09:46:14 -04:00
|
|
|
$aFields["TAS_AVERAGE"] = $data['average'];
|
|
|
|
|
$aFields["TAS_SDV"] = $data['sdv'];
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
|
2012-07-03 18:20:20 -04:00
|
|
|
///////
|
|
|
|
|
return $aFields;
|
|
|
|
|
} else {
|
|
|
|
|
throw (new Exception("The row '" . $TasUid . "' in table TASK doesn't exist!"));
|
2012-06-29 17:54:45 -04:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
} catch (Exception $oError) {
|
|
|
|
|
throw ($oError);
|
2012-06-29 17:54:45 -04:00
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
public function update($fields)
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2012-07-03 18:20:20 -04:00
|
|
|
require_once ("classes/model/AppCacheView.php");
|
|
|
|
|
require_once ("classes/model/Configuration.php");
|
|
|
|
|
|
|
|
|
|
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$con->begin();
|
2015-09-08 16:07:09 -04:00
|
|
|
$oldValues = $this->load($fields["TAS_UID"]);
|
2012-07-03 18:20:20 -04:00
|
|
|
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
|
2015-09-08 16:07:09 -04:00
|
|
|
$this->validateAssignType($fields,$oldValues);
|
|
|
|
|
|
2012-07-03 18:20:20 -04:00
|
|
|
if ($this->validate()) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$taskDefTitlePrevious = $oldValues["TAS_DEF_TITLE"];
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
$contentResult = 0;
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_TITLE", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasTitleContent($fields["TAS_TITLE"]);
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_DESCRIPTION", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasDescriptionContent($fields["TAS_DESCRIPTION"]);
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_DEF_TITLE", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasDefTitleContent($fields["TAS_DEF_TITLE"]);
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_DEF_DESCRIPTION", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasDefDescriptionContent($fields["TAS_DEF_DESCRIPTION"]);
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_DEF_PROC_CODE", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasDefProcCodeContent($fields["TAS_DEF_PROC_CODE"]);
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_DEF_MESSAGE", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasDefMessageContent(trim($fields["TAS_DEF_MESSAGE"]));
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_DEF_SUBJECT_MESSAGE", $fields)) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$contentResult += $this->setTasDefSubjectMessageContent(trim($fields["TAS_DEF_SUBJECT_MESSAGE"]));
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists("TAS_CALENDAR", $fields)) {
|
|
|
|
|
$contentResult += $this->setTasCalendar($fields['TAS_UID'],$fields["TAS_CALENDAR"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$result = $this->save();
|
|
|
|
|
$result = ($result == 0)? (($contentResult > 0)? 1 : 0) : $result;
|
|
|
|
|
$con->commit();
|
|
|
|
|
|
|
|
|
|
if ($result == 1 &&
|
|
|
|
|
array_key_exists("TAS_DEF_TITLE", $fields) &&
|
|
|
|
|
$fields["TAS_DEF_TITLE"] != $taskDefTitlePrevious
|
|
|
|
|
) {
|
|
|
|
|
$criteria = new Criteria("workflow");
|
|
|
|
|
|
|
|
|
|
$criteria->addAsColumn("APPCV_NUM_ROWS", "COUNT(DISTINCT " . AppCacheViewPeer::APP_UID . ")");
|
|
|
|
|
$criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN");
|
|
|
|
|
$criteria->add(AppCacheViewPeer::TAS_UID, $fields["TAS_UID"]);
|
|
|
|
|
|
|
|
|
|
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
|
|
|
|
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
|
|
|
|
|
$rsCriteria->next();
|
|
|
|
|
$row = $rsCriteria->getRow();
|
|
|
|
|
|
|
|
|
|
$appcvNumRows = intval($row["APPCV_NUM_ROWS"]);
|
|
|
|
|
|
|
|
|
|
if ($appcvNumRows <= 1000) {
|
|
|
|
|
$appcv = new AppCacheView();
|
|
|
|
|
$appcv->appTitleByTaskCaseLabelUpdate($fields["TAS_UID"], SYS_LANG);
|
|
|
|
|
|
|
|
|
|
$result = 2;
|
|
|
|
|
} else {
|
|
|
|
|
//Delete record
|
|
|
|
|
$criteria = new Criteria("workflow");
|
|
|
|
|
|
|
|
|
|
$criteria->add(ConfigurationPeer::CFG_UID, "TAS_APP_TITLE_UPDATE");
|
|
|
|
|
$criteria->add(ConfigurationPeer::OBJ_UID, $fields["TAS_UID"]);
|
|
|
|
|
$criteria->add(ConfigurationPeer::CFG_VALUE, SYS_LANG);
|
|
|
|
|
|
|
|
|
|
$numRowDeleted = ConfigurationPeer::doDelete($criteria);
|
|
|
|
|
|
|
|
|
|
//Insert record
|
|
|
|
|
$conf = new Configuration();
|
|
|
|
|
|
|
|
|
|
$conf->create(
|
|
|
|
|
array(
|
|
|
|
|
"CFG_UID" => "TAS_APP_TITLE_UPDATE",
|
|
|
|
|
"OBJ_UID" => $fields["TAS_UID"],
|
|
|
|
|
"CFG_VALUE" => SYS_LANG,
|
|
|
|
|
"PRO_UID" => "",
|
|
|
|
|
"USR_UID" => "",
|
|
|
|
|
"APP_UID" => ""
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$result = 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
|
} else {
|
|
|
|
|
$con->rollback();
|
|
|
|
|
|
|
|
|
|
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
$con->rollback();
|
|
|
|
|
|
|
|
|
|
throw ($e);
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
public function remove($TasUid)
|
|
|
|
|
{
|
|
|
|
|
$oConnection = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$oTask = TaskPeer::retrieveByPK($TasUid);
|
|
|
|
|
|
|
|
|
|
if (!is_null($oTask)) {
|
|
|
|
|
$oConnection->begin();
|
|
|
|
|
|
|
|
|
|
Content::removeContent('TAS_TITLE', '', $oTask->getTasUid());
|
|
|
|
|
Content::removeContent('TAS_DESCRIPTION', '', $oTask->getTasUid());
|
|
|
|
|
Content::removeContent('TAS_DEF_TITLE', '', $oTask->getTasUid());
|
|
|
|
|
Content::removeContent('TAS_DEF_DESCRIPTION', '', $oTask->getTasUid());
|
|
|
|
|
Content::removeContent('TAS_DEF_PROC_CODE', '', $oTask->getTasUid());
|
|
|
|
|
Content::removeContent('TAS_DEF_MESSAGE', '', $oTask->getTasUid());
|
|
|
|
|
Content::removeContent('TAS_DEF_SUBJECT_MESSAGE', '', $oTask->getTasUid());
|
|
|
|
|
|
|
|
|
|
$iResult = $oTask->delete();
|
|
|
|
|
$oConnection->commit();
|
|
|
|
|
|
|
|
|
|
return $iResult;
|
|
|
|
|
} else {
|
|
|
|
|
throw (new Exception( "The row '" . $TasUid . "' in table TASK doesn't exist!"));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception $oError) {
|
|
|
|
|
$oConnection->rollback();
|
|
|
|
|
|
|
|
|
|
throw ($oError);
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* verify if Task row specified in [TasUid] exists.
|
|
|
|
|
*
|
|
|
|
|
* @param string $sProUid the uid of the Prolication
|
|
|
|
|
*/
|
|
|
|
|
public function taskExists($TasUid)
|
|
|
|
|
{
|
|
|
|
|
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$oPro = TaskPeer::retrieveByPk($TasUid);
|
|
|
|
|
|
|
|
|
|
if (is_object($oPro) && get_class($oPro) == 'Task') {
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception $oError) {
|
|
|
|
|
throw ($oError);
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* create a new Task
|
|
|
|
|
*
|
|
|
|
|
* @param array $aData with new values
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function createRow($aData)
|
|
|
|
|
{
|
|
|
|
|
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$con->begin();
|
|
|
|
|
|
|
|
|
|
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
|
|
|
|
|
|
|
|
|
|
if ($this->validate()) {
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->setTasTitleContent((isset($aData['TAS_TITLE'])? $aData['TAS_TITLE'] : ''));
|
|
|
|
|
$this->setTasDescriptionContent((isset($aData['TAS_DESCRIPTION'])? $aData['TAS_DESCRIPTION'] : ''));
|
|
|
|
|
$this->setTasDefTitleContent((isset($aData['TAS_DEF_TITLE'])? $aData['TAS_DEF_TITLE'] : ''));
|
|
|
|
|
$this->setTasDefDescriptionContent((isset($aData['TAS_DEF_DESCRIPTION'])? $aData['TAS_DEF_DESCRIPTION'] : ''));
|
|
|
|
|
$this->setTasDefProcCodeContent((isset($aData['TAS_DEF_DESCRIPTION'])? $aData['TAS_DEF_DESCRIPTION'] : ''));
|
|
|
|
|
$this->setTasDefMessageContent((isset($aData['TAS_DEF_MESSAGE'])? $aData['TAS_DEF_MESSAGE'] : ''));
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
$strAux = isset($aData['TAS_DEF_SUBJECT_MESSAGE'])? $aData['TAS_DEF_SUBJECT_MESSAGE'] : '';
|
2016-06-28 10:59:43 -04:00
|
|
|
$this->setTasDefSubjectMessageContent($strAux);
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
$this->save();
|
|
|
|
|
$con->commit();
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
$con->rollback();
|
|
|
|
|
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
|
|
|
|
$e->aValidationFailures=$this->getValidationFailures();
|
|
|
|
|
|
|
|
|
|
throw ($e);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
$con->rollback();
|
|
|
|
|
throw ($e);
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
public function setTasCalendar($taskUid, $calendarUid)
|
|
|
|
|
{
|
|
|
|
|
//Save Calendar ID for this process
|
|
|
|
|
$calendarObj = new Calendar();
|
|
|
|
|
$calendarObj->assignCalendarTo($taskUid, $calendarUid, 'TASK');
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
public function getDelegatedTaskData($TAS_UID, $APP_UID, $DEL_INDEX)
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2012-07-03 18:20:20 -04:00
|
|
|
require_once ('classes/model/AppDelegation.php');
|
|
|
|
|
require_once ('classes/model/Task.php');
|
|
|
|
|
|
|
|
|
|
$oTask = new Task();
|
|
|
|
|
|
|
|
|
|
$aFields = $oTask->load($TAS_UID);
|
|
|
|
|
$oCriteria = new Criteria('workflow');
|
|
|
|
|
$oCriteria->add(AppDelegationPeer::APP_UID, $APP_UID);
|
|
|
|
|
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $DEL_INDEX);
|
|
|
|
|
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
|
|
|
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$oDataset->next();
|
|
|
|
|
$taskData = $oDataset->getRow();
|
|
|
|
|
|
|
|
|
|
$iDiff = strtotime($taskData['DEL_FINISH_DATE']) - strtotime($taskData['DEL_INIT_DATE']);
|
|
|
|
|
|
|
|
|
|
$aFields['INIT_DATE'] = (
|
|
|
|
|
$taskData['DEL_INIT_DATE'] != null ?
|
|
|
|
|
$taskData['DEL_INIT_DATE'] : G::LoadTranslation('ID_CASE_NOT_YET_STARTED')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$aFields['DUE_DATE'] = (
|
|
|
|
|
$taskData['DEL_TASK_DUE_DATE'] != null ?
|
|
|
|
|
$taskData['DEL_TASK_DUE_DATE'] : G::LoadTranslation('ID_NOT_FINISHED')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$aFields['FINISH'] = (
|
|
|
|
|
$taskData['DEL_FINISH_DATE'] != null ?
|
|
|
|
|
$taskData['DEL_FINISH_DATE'] : G::LoadTranslation('ID_NOT_FINISHED')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$aFields['DURATION'] = ($taskData['DEL_FINISH_DATE'] != null ? (int) ($iDiff / 3600) . ' ' . ((int) ($iDiff / 3600) == 1 ? G::LoadTranslation('ID_HOUR') : G::LoadTranslation('ID_HOURS')) . ' ' . (int) (($iDiff % 3600) / 60) . ' ' . ((int) (($iDiff % 3600) / 60) == 1 ? G::LoadTranslation('ID_MINUTE') : G::LoadTranslation('ID_MINUTES')) . ' ' . (int) (($iDiff % 3600) % 60) . ' ' . ((int) (($iDiff % 3600) % 60) == 1 ? G::LoadTranslation('ID_SECOND') : G::LoadTranslation('ID_SECONDS')) : G::LoadTranslation('ID_NOT_FINISHED'));
|
|
|
|
|
|
|
|
|
|
return $aFields;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
|
|
|
|
|
//Added by qennix
|
|
|
|
|
//Gets Starting Event of current task
|
|
|
|
|
public function getStartingEvent()
|
|
|
|
|
{
|
|
|
|
|
require_once ('classes/model/Event.php');
|
|
|
|
|
|
|
|
|
|
$oCriteria = new Criteria('workflow');
|
|
|
|
|
$oCriteria->addSelectColumn(EventPeer::EVN_UID);
|
|
|
|
|
$oCriteria->add(EventPeer::EVN_TAS_UID_TO, $this->tas_uid);
|
|
|
|
|
//$oCriteria->add(EventPeer::EVN_TYPE, 'bpmnEventMessageStart');
|
|
|
|
|
$oDataset = EventPeer::doSelectRS($oCriteria);
|
|
|
|
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
|
|
|
|
|
if ($oDataset->next()) {
|
|
|
|
|
$row = $oDataset->getRow();
|
|
|
|
|
$event_uid = $row['EVN_UID'];
|
|
|
|
|
} else {
|
|
|
|
|
$event_uid = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $event_uid;
|
2011-02-28 22:18:05 +00:00
|
|
|
}
|
2015-09-08 16:07:09 -04:00
|
|
|
|
|
|
|
|
public function validateAssignType($newValues,$oldValues)
|
|
|
|
|
{
|
|
|
|
|
if(isset($newValues['TAS_ASSIGN_TYPE']) && isset($oldValues['TAS_ASSIGN_TYPE'])) {
|
|
|
|
|
$newAssigType = $newValues['TAS_ASSIGN_TYPE'];
|
|
|
|
|
$oldAssigType = $oldValues['TAS_ASSIGN_TYPE'];
|
|
|
|
|
if($newAssigType == 'SELF_SERVICE'){
|
|
|
|
|
$newAssigType = isset($newValues['TAS_GROUP_VARIABLE'])?(empty($newValues['TAS_GROUP_VARIABLE'])?'SELF_SERVICE':'SELF_SERVICE_VALUE_BASED'):'SELF_SERVICE';
|
|
|
|
|
}
|
|
|
|
|
if($oldAssigType == 'SELF_SERVICE'){
|
|
|
|
|
$oldAssigType = isset($oldValues['TAS_GROUP_VARIABLE'])?(empty($oldValues['TAS_GROUP_VARIABLE'])?'SELF_SERVICE':'SELF_SERVICE_VALUE_BASED'):'SELF_SERVICE';
|
|
|
|
|
}
|
|
|
|
|
if(($oldAssigType == 'SELF_SERVICE' && $newAssigType != 'SELF_SERVICE') || ($oldAssigType == 'SELF_SERVICE_VALUE_BASED' && $newAssigType != 'SELF_SERVICE_VALUE_BASED')) {
|
|
|
|
|
$oCriteria = new Criteria();
|
|
|
|
|
$oCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN");
|
|
|
|
|
$oCriteria->add(AppDelegationPeer::TAS_UID, $newValues['TAS_UID']);
|
2015-11-20 18:55:30 -04:00
|
|
|
$oCriteria->add(AppDelegationPeer::USR_UID, "");
|
2015-09-08 16:07:09 -04:00
|
|
|
$oApplication = AppDelegationPeer::doSelectOne($oCriteria);
|
|
|
|
|
if(!empty($oApplication)) {
|
|
|
|
|
throw (new Exception(G::LoadTranslation('ID_CURRENT_ASSING_TYPE_WITH_CASES')));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-03 18:20:20 -04:00
|
|
|
}
|
|
|
|
|
|
2015-09-08 16:07:09 -04:00
|
|
|
|