HOR-2052
HOR-2052
This commit is contained in:
@@ -82,6 +82,7 @@ class Light
|
|||||||
$tempTreeChild['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
|
$tempTreeChild['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
|
||||||
$tempTreeChild['processId'] = $processInfoChild['pro_uid'];
|
$tempTreeChild['processId'] = $processInfoChild['pro_uid'];
|
||||||
$tempTreeChild['taskId'] = $processInfoChild['uid'];
|
$tempTreeChild['taskId'] = $processInfoChild['uid'];
|
||||||
|
list($tempTreeChild['offlineEnabled'], $tempTreeChild['autoRoot']) = $task->getColumnValues($processInfoChild['pro_uid'], $processInfoChild['uid'], array('TAS_OFFLINE', 'TAS_AUTO_ROOT'));
|
||||||
$forms = $task->getSteps($processInfoChild['uid']);
|
$forms = $task->getSteps($processInfoChild['uid']);
|
||||||
$newForm = array();
|
$newForm = array();
|
||||||
$c = 0;
|
$c = 0;
|
||||||
|
|||||||
@@ -2016,4 +2016,33 @@ class Task
|
|||||||
//Return
|
//Return
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a specific value from TASK table
|
||||||
|
*
|
||||||
|
* @param string $prjUid Unique uid of Project
|
||||||
|
* @param string $actUid Unique uid of Task
|
||||||
|
* @param array $arrayColumns name of column
|
||||||
|
*
|
||||||
|
* return string
|
||||||
|
*/
|
||||||
|
public function getColumnValues($prjUid, $actUid, $arrayColumns){
|
||||||
|
try {
|
||||||
|
$prj_uid = $this->validateProUid($prjUid);
|
||||||
|
$taskUid = $this->validateActUid($actUid);
|
||||||
|
$task = new \Task();
|
||||||
|
$arrayDataAux = $task->load($taskUid);
|
||||||
|
$aProperties = array();
|
||||||
|
foreach ($arrayColumns as $value) {
|
||||||
|
if(isset($arrayDataAux[$value])){
|
||||||
|
$aProperties[] = $arrayDataAux[$value];
|
||||||
|
} else {
|
||||||
|
$aProperties[] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $aProperties;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,9 @@ class Light extends Api
|
|||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
|
//Complete the list information with some task properties
|
||||||
|
$response['data'] = $this->addTaskProperties($response['data']);
|
||||||
|
|
||||||
$result = $this->parserDataTodo($response['data']);
|
$result = $this->parserDataTodo($response['data']);
|
||||||
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
|
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -214,6 +217,16 @@ class Light extends Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addTaskProperties($data){
|
||||||
|
$task = new \ProcessMaker\BusinessModel\Task();
|
||||||
|
foreach ($data as $key => $value) {
|
||||||
|
$valueUpper = array_change_key_case($value, CASE_UPPER);
|
||||||
|
list($data[$key]['TAS_OFFLINE'], $data[$key]['TAS_AUTO_ROOT']) = $task->getColumnValues($valueUpper['PRO_UID'], $valueUpper['TAS_UID'], array('TAS_OFFLINE', 'TAS_AUTO_ROOT'));
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function parserDataTodo ($data)
|
public function parserDataTodo ($data)
|
||||||
{
|
{
|
||||||
$structure = array(
|
$structure = array(
|
||||||
@@ -240,7 +253,9 @@ class Light extends Api
|
|||||||
),
|
),
|
||||||
'task' => array(
|
'task' => array(
|
||||||
'TAS_UID' => 'taskId',
|
'TAS_UID' => 'taskId',
|
||||||
'APP_TAS_TITLE' => 'name'
|
'APP_TAS_TITLE' => 'name',
|
||||||
|
'TAS_OFFLINE' => 'offlineEnabled',
|
||||||
|
'TAS_AUTO_ROOT' => 'autoRoot'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -302,6 +317,9 @@ class Light extends Api
|
|||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
|
//Complete the list information with some task properties
|
||||||
|
$response['data'] = $this->addTaskProperties($response['data']);
|
||||||
|
|
||||||
$result = $this->parserDataDraft($response['data']);
|
$result = $this->parserDataDraft($response['data']);
|
||||||
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
|
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -334,7 +352,9 @@ class Light extends Api
|
|||||||
),
|
),
|
||||||
'task' => array(
|
'task' => array(
|
||||||
'TAS_UID' => 'taskId',
|
'TAS_UID' => 'taskId',
|
||||||
'APP_TAS_TITLE' => 'name'
|
'APP_TAS_TITLE' => 'name',
|
||||||
|
'TAS_OFFLINE' => 'offlineEnabled',
|
||||||
|
'TAS_AUTO_ROOT' => 'autoRoot'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user