Merged in release/3.7.4 (pull request #8376)

release/3.7.4
This commit is contained in:
Paula Quispe
2022-02-03 15:50:34 +00:00
41 changed files with 713 additions and 314 deletions

View File

@@ -3,11 +3,15 @@
namespace ProcessMaker\BusinessModel\Cases;
use ProcessMaker\Model\Consolidated;
use ProcessMaker\Model\Delegation;
class BatchRouting extends AbstractCases
{
// Columns to see in the cases list
public $columnsView = [];
public $columnsView = [
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
];
/**
* Get the columns related to the cases list
@@ -37,6 +41,8 @@ class BatchRouting extends AbstractCases
*/
public function getData()
{
$query = Delegation::query()->select($this->getColumnsView());
$this->filters($query);
// todo, the list for consolidated cases was not defined for the new HOME
return [];
}

View File

@@ -7,7 +7,10 @@ use ProcessMaker\Model\Delegation;
class Canceled extends AbstractCases
{
// Columns to see in the cases list
public $columnsView = [];
public $columnsView = [
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
];
/**
* Get the columns related to the cases list
@@ -37,6 +40,8 @@ class Canceled extends AbstractCases
*/
public function getData()
{
$query = Delegation::query()->select($this->getColumnsView());
$this->filters($query);
// todo, the list for canceled cases was not defined
return [];
}

View File

@@ -7,7 +7,10 @@ use ProcessMaker\Model\Delegation;
class Completed extends AbstractCases
{
// Columns to see in the cases list
public $columnsView = [];
public $columnsView = [
// Columns view in the cases list
'APP_DELEGATION.APP_NUMBER', // Case #
];
/**
* Get the columns related to the cases list
@@ -37,6 +40,8 @@ class Completed extends AbstractCases
*/
public function getData()
{
$query = Delegation::query()->select($this->getColumnsView());
$this->filters($query);
// todo, the list for completed cases was defined in participated
return [];
}

View File

@@ -454,34 +454,34 @@ class InputDocument
/**
* Get data of Cases InputDocument
*
* @param string $applicationUid
* @param string $appUid
* @param string $userUid
* @param string $inputDocumentUid
*
* @return array Return an array with data of an InputDocument
* @throws Exception
*/
public function getCasesInputDocument($applicationUid, $userUid, $inputDocumentUid)
public function getCasesInputDocument($appUid, $userUid, $inputDocumentUid)
{
try {
$sApplicationUID = $applicationUid;
$sUserUID = $userUid;
$appUid = $applicationUid;
$oCase = new Cases();
$fields = $oCase->loadCase( $sApplicationUID );
$sProcessUID = $fields['PRO_UID'];
$sTaskUID = '';
$oCaseRest = new BusinessModelCases();
$oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID );
$result = array ();
$case = new Cases();
$fields = $case->loadCase($appUid);
$proUid = $fields['PRO_UID'];
$taskUid = '';
$caseRest = new BusinessModelCases();
$caseRest->getAllUploadedDocumentsCriteria($proUid, $appUid, $taskUid, $userUid);
$result = [];
global $_DBArray;
$flagInputDocument = false;
foreach ($_DBArray['inputDocuments'] as $key => $row) {
if (isset( $row['DOC_VERSION'] )) {
$docrow = array ();
if (isset($row['DOC_VERSION'])) {
$docrow = [];
$docrow['app_doc_uid'] = $row['APP_DOC_UID'];
$docrow['app_doc_filename'] = $row['APP_DOC_FILENAME'];
$docrow['app_doc_comment'] = $row['APP_DOC_COMMENT'];
$docrow['doc_uid'] = $row['DOC_UID'];
$docrow['app_doc_version'] = $row['DOC_VERSION'];
$docrow['app_doc_create_date'] = $row['CREATE_DATE'];
@@ -506,11 +506,10 @@ class InputDocument
}
if (!$flagInputDocument) {
throw new Exception(G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($inputDocumentUid)));
throw new Exception(G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", [$inputDocumentUid]));
}
$oResponse = json_decode(json_encode($result), false);
return $oResponse;
return json_decode(json_encode($result), false);
} catch (Exception $e) {
throw $e;
}

View File

@@ -692,7 +692,7 @@ class EmailServer
{
try {
if ($this->checkIfIsDefault($emailServerUid)) {
throw new Exception(G::LoadTranslation("ID_EMAIL_SERVER_IS_DEFAULT", array($fieldNameForException, $emailServerUid)));
throw new Exception(G::LoadTranslation("ID_EMAIL_SERVER_IS_DEFAULT"));
}
} catch (Exception $e) {
throw $e;

View File

@@ -474,7 +474,9 @@ class ReportTable
$buildResult = ob_get_contents();
ob_end_clean();
if (ob_get_contents()) {
ob_end_clean();
}
//Updating additional table struture information
$addTabData = [
@@ -572,7 +574,9 @@ class ReportTable
} catch (Exception $e) {
$buildResult = ob_get_contents();
ob_end_clean();
if (ob_get_contents()) {
ob_end_clean();
}
$result->success = false;
@@ -833,7 +837,9 @@ class ReportTable
ob_start();
$pmTable->buildModelFor($dbsUid, $tables);
$buildResult = ob_get_contents();
ob_end_clean();
if (ob_get_contents()) {
ob_end_clean();
}
$errors .= $pmTable->upgradeDatabaseFor($pmTable->getDataSource(), $tables);
}

View File

@@ -379,7 +379,9 @@ class Table
}
$pmTable->build();
$buildResult = ob_get_contents();
ob_end_clean();
if (ob_get_contents()) {
ob_end_clean();
}
unset($buildResult);
// Updating additional table struture information
@@ -586,7 +588,9 @@ class Table
$pmTable->build();
$buildResult = ob_get_contents();
ob_end_clean();
if (ob_get_contents()) {
ob_end_clean();
}
unset($buildResult);
$addTabData = [

View File

@@ -1448,16 +1448,16 @@ class TimerEvent
}
if (!$flagRecord) {
$common->frontEndShow("TEXT", "Not exists any record to start a new case, on date \"$datetime (UTC +00:00)\"");
$common->frontEndShow("TEXT", "There are no records to start new cases, on date \"$datetime (UTC +00:00)\"");
$action = "NO-RECORDS";
$this->log($action, "Not exists any record to start a new case");
$this->log($action, "There are no records to start new cases");
$aInfo = array(
'ip' => \G::getIpAddress()
,'action' => $action
,'timeZone' => $datetime
,'workspace'=> $sysSys
);
$message = 'Not exists any record to start a new case';
$message = 'There are no records to start new cases';
$context = $aInfo;
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
}
@@ -1466,14 +1466,14 @@ class TimerEvent
//Intermediate Catch Timer-Event (continue the case) ///////////////////////////////////////////////////////
$action = "START-CONTINUE-CASES";
$this->log($action, "Start continue the cases");
$this->log($action, "Start continuing the cases");
$aInfo = array(
'ip' => \G::getIpAddress()
,'action' => $action
,'timeZone' => $datetime
,'workspace'=> $sysSys
);
$message = 'Start continue the cases';
$message = 'Start continuing the cases';
$context = $aInfo;
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
@@ -1719,16 +1719,16 @@ class TimerEvent
} while ($flagNextRecord);
if (!$flagRecord) {
$common->frontEndShow("TEXT", "No existing records to continue a case, on date \"$datetime (UTC +00:00)\"");
$common->frontEndShow("TEXT", "There are no records to continue cases, on date \"$datetime (UTC +00:00)\"");
$this->log("NO-RECORDS", "No existing records to continue a case");
$this->log("NO-RECORDS", "There are no records to continue cases");
$aInfo = array(
'ip' => \G::getIpAddress()
,'action' => $action
,'timeZone' => $datetime
,'workspace'=> $sysSys
);
$message = 'No existing records to continue a case';
$message = 'There are no records to continue cases';
$context = $aInfo;
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
}

View File

@@ -8,7 +8,7 @@ class ProjectNotFound extends \RuntimeException
const EXCEPTION_CODE = 400;
public function __construct(Project\Handler $obj, $uid, $message = "", \Exception $previous = null) {
$message = empty($message) ? sprintf("Project \"%s\" with UID: %s, does not exist.", get_class($obj), $uid) : $message;
$message = empty($message) ? 'Project ' . $uid . ', does not exist.' : $message;
parent::__construct($message, self::EXCEPTION_CODE, $previous);
}

View File

@@ -858,6 +858,7 @@ class Cases extends Api
* PUT /cases/{app_uid}/execute-trigger/{tri_uid} to execute it.
*
* @url POST /impersonate
* @status 201
*
* @param string $pro_uid {@from body} {@min 32}{@max 32}
* @param string $usr_uid {@from body} {@min 32}{@max 32}
@@ -1194,6 +1195,7 @@ class Cases extends Api
* access case notes may create a case note.
*
* @url POST /:appUid/note
* @status 201
*
* @param string $appUid {@min 1}{@max 32}
* @param string $note_content {@min 1}{@max 500}

View File

@@ -18,17 +18,22 @@ class Variable extends Api
* @url GET /:prj_uid/process-variables
*
* @param string $prj_uid {@min 32}{@max 32}
*
* @return array
* @throws RestException
*
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*/
public function doGetVariables($prj_uid)
{
try {
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$response = $variable->getVariables($prj_uid);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
@@ -42,6 +47,12 @@ class Variable extends Api
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $search {@from path}
*
* @return array
* @throws RestException
*
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*/
public function doGetVariablesByType($prj_uid, $typeVariable, $start = null, $limit = null, $search = null)
{
@@ -65,7 +76,7 @@ class Variable extends Api
return $response;
} catch (Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
@@ -74,17 +85,22 @@ class Variable extends Api
*
* @param string $var_uid {@min 32}{@max 32}
* @param string $prj_uid {@min 32}{@max 32}
*
* @return array
* @throws RestException
*
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*/
public function doGetVariable($var_uid, $prj_uid)
{
try {
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$response = $variable->getVariable($prj_uid, $var_uid);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
@@ -107,15 +123,13 @@ class Variable extends Api
{
try {
$request_data = (array)($request_data);
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$arrayData = $variable->create($prj_uid, $request_data);
$response = $arrayData;
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
@@ -137,31 +151,32 @@ class Variable extends Api
{
try {
$request_data = (array)($request_data);
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$variable->update($prj_uid, $var_uid, $request_data);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* @url DELETE /:prj_uid/process-variable/:var_uid
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
* @param string $var_uid {@min 32}{@max 32}
*
* @throws RestException
*
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*/
public function doDeleteVariable($prj_uid, $var_uid)
{
try {
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$variable->delete($prj_uid, $var_uid);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
@@ -185,14 +200,12 @@ class Variable extends Api
public function doPostVariableExecuteSql($prj_uid, $var_name = '', $request_data = array())
{
try {
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$arrayData = ($request_data != null)? $variable->executeSql($prj_uid, $var_name, $request_data) : $variable->executeSql($prj_uid, $var_name);
$response = $arrayData;
return $response;
} catch (\Exception $e) {
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
@@ -217,14 +230,12 @@ class Variable extends Api
public function doPostVariableExecuteSqlSuggest($prj_uid, $var_name, $request_data)
{
try {
$variable = new \ProcessMaker\BusinessModel\Variable();
$variable = new BmVariable();
$arrayData = ($request_data != null)? $variable->executeSqlSuggest($prj_uid, $var_name, $request_data) : $variable->executeSqlSuggest($prj_uid, $var_name);
$response = $arrayData;
return $response;
} catch (\Exception $e) {
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}