Merged in feature/PMCORE-3834 (pull request #8566)

Merging feature/PMCORE-3834 to develop
This commit is contained in:
Julio Cesar Laura Avendaño
2022-09-13 15:13:25 +00:00
1231 changed files with 6402 additions and 200710 deletions

View File

@@ -1970,7 +1970,7 @@ class Cases
* @return void
* @throws Exception
*/
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null, $usr_uid, $del_index = 0)
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null, $usr_uid = '', $del_index = 0)
{
Validator::isString($app_uid, '$app_uid');
Validator::appUid($app_uid, '$app_uid');
@@ -2208,7 +2208,7 @@ class Cases
/**
* Get all Tasks of Case
* Based in: processmaker/workflow/engine/classes/class.processMap.php
* Method: processMap::load()
* Method: processMap::load()
*
* @param string $applicationUid Unique id of Case
*

View File

@@ -1657,7 +1657,7 @@ class AbstractCases implements CasesInterface
*
* @return array
*/
public function getCasesRisk($processId, $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null)
public function getCasesRisk($processId = '', $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null)
{
$date = new DateTime('now');
$currentDate = $date->format('Y-m-d H:i:s');

View File

@@ -728,6 +728,7 @@ class OutputDocument
if (isset($aProperties['report_generator'])) {
switch ($aProperties['report_generator']) {
case 'TCPDF':
default:
$o = new \OutputDocument();
if (strlen($sContent) == 0) {
libxml_use_internal_errors(true);
@@ -737,13 +738,10 @@ class OutputDocument
$o->generateTcpdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
}
break;
case 'HTML2PDF':
default:
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties, $sApplication);
break;
}
} else {
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
$o = new \OutputDocument();
$o->generateTcpdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
}
}
//end if $sTypeDocToGener
@@ -761,197 +759,6 @@ class OutputDocument
}
}
/*
* Generate Html2ps_pdf
* @param string $sUID
* @param array $aFields
* @param string $sPath
* @param string $sApplication
* @return variant
*/
public function generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $aProperties = array(), $sApplication)
{
define("MAX_FREE_FRACTION", 1);
define('PATH_OUTPUT_FILE_DIRECTORY', PATH_HTML . 'files/' . $sApplication . '/outdocs/');
\G::verifyPath(PATH_OUTPUT_FILE_DIRECTORY, true);
require_once(PATH_THIRDPARTY . 'html2ps_pdf/config.inc.php');
require_once(PATH_THIRDPARTY . 'html2ps_pdf/pipeline.factory.class.php');
parse_config_file(PATH_THIRDPARTY . 'html2ps_pdf/html2ps.config');
$GLOBALS['g_config'] = array(
'cssmedia' => 'screen',
'media' => 'Letter',
'scalepoints' => false,
'renderimages' => true,
'renderfields' => true,
'renderforms' => false,
'pslevel' => 3,
'renderlinks' => true,
'pagewidth' => 800,
'landscape' => $sLandscape,
'method' => 'fpdf',
'margins' => array('left' => 15, 'right' => 15, 'top' => 15, 'bottom' => 15,),
'encoding' => '',
'ps2pdf' => false,
'compress' => true,
'output' => 2,
'pdfversion' => '1.3',
'transparency_workaround' => false,
'imagequality_workaround' => false,
'draw_page_border' => isset($_REQUEST['pageborder']),
'debugbox' => false,
'html2xhtml' => true,
'mode' => 'html',
'smartpagebreak' => true
);
$GLOBALS['g_config'] = array_merge($GLOBALS['g_config'], $aProperties);
$g_media = \Media::predefined($GLOBALS['g_config']['media']);
$g_media->set_landscape($GLOBALS['g_config']['landscape']);
$g_media->set_margins($GLOBALS['g_config']['margins']);
$g_media->set_pixels($GLOBALS['g_config']['pagewidth']);
if (isset($GLOBALS['g_config']['pdfSecurity'])) {
if (isset($GLOBALS['g_config']['pdfSecurity']['openPassword']) &&
$GLOBALS['g_config']['pdfSecurity']['openPassword'] != ""
) {
$GLOBALS['g_config']['pdfSecurity']['openPassword'] = G::decrypt(
$GLOBALS['g_config']['pdfSecurity']['openPassword'],
$sUID
);
}
if (isset($GLOBALS['g_config']['pdfSecurity']['ownerPassword']) &&
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'] != ""
) {
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'] = G::decrypt(
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'],
$sUID
);
}
$g_media->set_security($GLOBALS['g_config']['pdfSecurity']);
require_once(HTML2PS_DIR . 'pdf.fpdf.encryption.php');
}
$pipeline = new \Pipeline();
if (extension_loaded('curl')) {
require_once(HTML2PS_DIR . 'fetcher.url.curl.class.php');
$pipeline->fetchers = array(new \FetcherURLCurl());
if (isset($proxy)) {
if ($proxy != '') {
$pipeline->fetchers[0]->set_proxy($proxy);
}
}
} else {
require_once(HTML2PS_DIR . 'fetcher.url.class.php');
$pipeline->fetchers[] = new \FetcherURL();
}
$pipeline->data_filters[] = new \DataFilterDoctype();
$pipeline->data_filters[] = new \DataFilterUTF8($GLOBALS['g_config']['encoding']);
if ($GLOBALS['g_config']['html2xhtml']) {
$pipeline->data_filters[] = new \DataFilterHTML2XHTML();
} else {
$pipeline->data_filters[] = new \DataFilterXHTML2XHTML();
}
$pipeline->parser = new \ParserXHTML();
$pipeline->pre_tree_filters = array();
$header_html = '';
$footer_html = '';
$filter = new \PreTreeFilterHeaderFooter($header_html, $footer_html);
$pipeline->pre_tree_filters[] = $filter;
if ($GLOBALS['g_config']['renderfields']) {
$pipeline->pre_tree_filters[] = new \PreTreeFilterHTML2PSFields();
}
if ($GLOBALS['g_config']['method'] === 'ps') {
$pipeline->layout_engine = new \LayoutEnginePS();
} else {
$pipeline->layout_engine = new \LayoutEngineDefault();
}
$pipeline->post_tree_filters = array();
if ($GLOBALS['g_config']['pslevel'] == 3) {
$image_encoder = new \PSL3ImageEncoderStream();
} else {
$image_encoder = new \PSL2ImageEncoderStream();
}
switch ($GLOBALS['g_config']['method']) {
case 'fastps':
if ($GLOBALS['g_config']['pslevel'] == 3) {
$pipeline->output_driver = new \OutputDriverFastPS($image_encoder);
} else {
$pipeline->output_driver = new \OutputDriverFastPSLevel2($image_encoder);
}
break;
case 'pdflib':
$pipeline->output_driver = new \OutputDriverPDFLIB16($GLOBALS['g_config']['pdfversion']);
break;
case 'fpdf':
$pipeline->output_driver = new \OutputDriverFPDF();
break;
case 'png':
$pipeline->output_driver = new \OutputDriverPNG();
break;
case 'pcl':
$pipeline->output_driver = new \OutputDriverPCL();
break;
default:
die('Unknown output method');
}
if (isset($GLOBALS['g_config']['watermarkhtml'])) {
$watermark_text = $GLOBALS['g_config']['watermarkhtml'];
} else {
$watermark_text = '';
}
$pipeline->output_driver->set_watermark($watermark_text);
if ($watermark_text != '') {
$dispatcher = $pipeline->getDispatcher();
}
if ($GLOBALS['g_config']['debugbox']) {
$pipeline->output_driver->set_debug_boxes(true);
}
if ($GLOBALS['g_config']['draw_page_border']) {
$pipeline->output_driver->set_show_page_border(true);
}
if ($GLOBALS['g_config']['ps2pdf']) {
$pipeline->output_filters[] = new \OutputFilterPS2PDF($GLOBALS['g_config']['pdfversion']);
}
if ($GLOBALS['g_config']['compress'] && $GLOBALS['g_config']['method'] == 'fastps') {
$pipeline->output_filters[] = new \OutputFilterGZip();
}
if (!isset($GLOBALS['g_config']['process_mode'])) {
$GLOBALS['g_config']['process_mode'] = '';
}
if ($GLOBALS['g_config']['process_mode'] == 'batch') {
$filename = 'batch';
} else {
$filename = $sFilename;
}
switch ($GLOBALS['g_config']['output']) {
case 0:
$pipeline->destination = new \DestinationBrowser($filename);
break;
case 1:
$pipeline->destination = new \DestinationDownload($filename);
break;
case 2:
$pipeline->destination = new \DestinationFile($filename);
break;
}
copy($sPath . $sFilename . '.html', PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
try {
$status = $pipeline->process(System::getServerProtocolHost() . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media);
copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
} catch (\Exception $e) {
if ($e->getMessage() == 'ID_OUTPUT_NOT_GENERATE') {
include_once 'classes/model/AppDocument.php';
$dataDocument = explode('_', $sFilename);
if (!isset($dataDocument[1])) {
$dataDocument[1] = 1;
}
$oAppDocument = new \AppDocument();
$oAppDocument->remove($dataDocument[0], $dataDocument[1]);
\G::SendTemporalMessage(\G::LoadTranslation('ID_OUTPUT_NOT_GENERATE'), 'Error');
}
}
}
/**
* Check of user has permission of process
*

View File

@@ -783,7 +783,7 @@ class FilesManager
$sMainDirectory = 'public';
}
if (file_exists($path)) {
$oProcessMap = new \ProcessMap(new \DBConnection());
$oProcessMap = new \ProcessMap();
$oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sFile);
die();
} else {

View File

@@ -264,7 +264,9 @@ class Task
}
foreach ($arrayProperty as $k => $v) {
$arrayProperty[$k] = str_replace("@amp@", "&", $v);
if (!is_array($v)) {
$arrayProperty[$k] = str_replace("@amp@", "&", $v);
}
}
if (isset($arrayProperty["TAS_SEND_LAST_EMAIL"])) {

View File

@@ -1579,7 +1579,7 @@ class User
* @return User
* @throws Exception
*/
public function checkPermissionForEdit($userUid, $arrayPermission = array(), $form)
public function checkPermissionForEdit($userUid, $arrayPermission = [], $form = [])
{
try {
foreach ($arrayPermission as $key => $value) {

View File

@@ -1464,7 +1464,7 @@ class System
*
* @return array
*/
public static function checkPermissionsDbUser($adapter = 'mysql', $serverName, $port = 3306, $userName, $pass, $dbName = '')
public static function checkPermissionsDbUser($adapter = 'mysql', $serverName = '', $port = 3306, $userName = '', $pass = '', $dbName = '')
{
if (empty($port)) {
//setting defaults ports

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class AbeConfiguration extends model
{
use HasFactory;
protected $table = "ABE_CONFIGURATION";
// We do not have create/update timestamps for this table
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class AbeRequest extends Model
{
use HasFactory;
protected $table = "ABE_REQUESTS";
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use AdditionalTables as ModelAdditionalTables;
use Illuminate\Database\Eloquent\Model;
class AdditionalTables extends Model
{
use HasFactory;
protected $table = 'ADDITIONAL_TABLES';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppAssignSelfServiceValue extends Model
{
use HasFactory;
protected $table = 'APP_ASSIGN_SELF_SERVICE_VALUE';
protected $primaryKey = 'ID';
// We do not have create/update timestamps for this table

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppAssignSelfServiceValueGroup extends Model
{
use HasFactory;
protected $table = 'APP_ASSIGN_SELF_SERVICE_VALUE_GROUP';
// We do not have create/update timestamps for this table
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppDelay extends Model
{
use HasFactory;
protected $table = 'APP_DELAY';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppMessage extends Model
{
use HasFactory;
protected $table = 'APP_MESSAGE';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppNotes extends Model
{
use HasFactory;
// Set our table name
protected $table = 'APP_NOTES';
// No timestamps

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppThread extends Model
{
use HasFactory;
protected $table = 'APP_THREAD';
// We do not have create/update timestamps for this table
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AppTimeoutAction extends Model
{
use HasFactory;
protected $table = 'APP_TIMEOUT_ACTION_EXECUTED';
// We do not have create/update timestamps for this table
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Application extends Model
{
use HasFactory;
protected $table = "APPLICATION";
protected $primaryKey = 'APP_NUMBER';
public $incrementing = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class BpmnDiagram extends Model
{
use HasFactory;
protected $table = 'BPMN_DIAGRAM';
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class BpmnEvent extends Model
{
use HasFactory;
protected $table = 'BPMN_EVENT';
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class BpmnProcess extends Model
{
use HasFactory;
protected $table = 'BPMN_PROCESS';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BpmnProject extends Model
{
use HasFactory;
// Set our table name
protected $table = 'BPMN_PROJECT';
protected $primaryKey = 'PRJ_UID';

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Exception;
use G;
use ProcessMaker\BusinessModel\Table;
@@ -13,6 +14,8 @@ use Illuminate\Database\Eloquent\Model;
class CaseList extends Model
{
use HasFactory;
/**
* The table associated with the model.
* @var string

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Configuration extends Model
{
use HasFactory;
// Set our table name
protected $table = 'CONFIGURATION';
// Set the PK

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Consolidated extends Model
{
use HasFactory;
// Set our table name
protected $table = 'CASE_CONSOLIDATED';
// Set the PK

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
@@ -12,6 +13,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class DbSource extends Model
{
use HasFactory;
// Set our table name
protected $table = 'DB_SOURCE';
// We do not store timestamps

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Cases;
use DateTime;
use G;
@@ -13,6 +14,8 @@ use ProcessMaker\Model\Task;
class Delegation extends Model
{
use HasFactory;
// Class constants
const PRIORITIES_MAP = [1 => 'VL', 2 => 'L', 3 => 'N', 4 => 'H', 5 => 'VH'];

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
@@ -10,6 +11,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class Department extends Model
{
use HasFactory;
// Set our table name
protected $table = 'DEPARTMENT';
// We do not store timestamps

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Documents extends Model
{
use HasFactory;
// Set our table name
protected $table = 'APP_DOCUMENT';
// No timestamps

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
@@ -13,6 +14,8 @@ use Illuminate\Support\Facades\DB;
*/
class Dynaform extends Model
{
use HasFactory;
protected $table = 'DYNAFORM';
protected $primaryKey = "DYN_ID";
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use G;
use Illuminate\Database\Eloquent\Model;
class ElementTaskRelation extends Model
{
use HasFactory;
protected $table = 'ELEMENT_TASK_RELATION';
protected $primaryKey = 'ETR_UID';
// We do not have create/update timestamps for this table

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use ProcessMaker\Model\EmailServerModel;
class EmailEvent extends Model
{
use HasFactory;
protected $table = 'EMAIL_EVENT';
public $timestamps = false;

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Crypt;
class EmailServerModel extends Model
{
use HasFactory;
protected $table = 'EMAIL_SERVER';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Fields extends Model
{
use HasFactory;
protected $table = 'FIELDS';
public $timestamps = false;

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Exception;
use G;
use Illuminate\Database\Eloquent\Model;
@@ -10,6 +11,8 @@ use ProcessMaker\Model\RbacUsers;
class GroupUser extends Model
{
use HasFactory;
protected $table = 'GROUP_USER';
// We do not have create/update timestamps for this table
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Groupwf extends Model
{
use HasFactory;
protected $table = 'GROUPWF';
protected $primaryKey = 'GRP_ID';
// We do not have create/update timestamps for this table

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
@@ -10,6 +11,8 @@ use Illuminate\Support\Facades\DB;
*/
class InputDocument extends Model
{
use HasFactory;
protected $table = 'INPUT_DOCUMENT';
protected $primaryKey = 'INP_DOC_ID';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class LicenseManager extends Model
{
use HasFactory;
protected $table = "LICENSE_MANAGER";
protected $primaryKey = "LICENSE_UID";
public $incrementing = false;

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use ListUnassigned as PropelListUnassigned;
@@ -12,6 +13,8 @@ use ListUnassigned as PropelListUnassigned;
*/
class ListUnassigned extends Model
{
use HasFactory;
protected $table = "LIST_UNASSIGNED";
// No timestamps
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class OauthClients extends Model
{
use HasFactory;
protected $table = "OAUTH_CLIENTS";
protected $primaryKey = "CLIENT_ID";
public $incrementing = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ObjectPermission extends Model
{
use HasFactory;
protected $table = "OBJECT_PERMISSION";
protected $primaryKey = 'OP_UID';
public $timestamps = false;

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
@@ -10,6 +11,8 @@ use Illuminate\Support\Facades\DB;
*/
class OutputDocument extends Model
{
use HasFactory;
protected $table = 'OUTPUT_DOCUMENT';
protected $primaryKey = 'OUT_DOC_ID';
public $timestamps = false;

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Configurations;
use Exception;
use G;
@@ -10,6 +11,8 @@ use RBAC;
class Process extends Model
{
use HasFactory;
// Set our table name
protected $table = 'PROCESS';
protected $primaryKey = 'PRO_ID';

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
@@ -12,6 +13,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class ProcessCategory extends Model
{
use HasFactory;
// Set our table name
protected $table = 'PROCESS_CATEGORY';

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ProcessFiles extends Model
{
use HasFactory;
protected $table = 'PROCESS_FILES';
protected $primaryKey = 'PRF_UID';
public $incrementing = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ProcessUser extends Model
{
use HasFactory;
protected $table = 'PROCESS_USER';
protected $primaryKey = 'PU_UID';
// We do not have create/update timestamps for this table

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class ProcessVariables extends Model
{
use HasFactory;
// Set our table name
protected $table = 'PROCESS_VARIABLES';
// No timestamps

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class RbacAuthenticationSource extends Model
{
use HasFactory;
protected $table = "RBAC_AUTHENTICATION_SOURCE";
public $incrementing = false;
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class RbacRoles extends Model
{
use HasFactory;
protected $table = 'RBAC_ROLES';
public $timestamps = false;

View File

@@ -2,12 +2,15 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Exception;
use Illuminate\Database\Eloquent\Model;
use ProcessMaker\Model\RbacUsersRoles;
class RbacUsers extends Model
{
use HasFactory;
protected $table = 'RBAC_USERS';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class RbacUsersRoles extends Model
{
use HasFactory;
protected $table = 'RBAC_USERS_ROLES';
public $timestamps = false;

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
@@ -12,6 +13,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class Route extends Model
{
use HasFactory;
// Set our table name
protected $table = 'ROUTE';

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Step extends Model
{
use HasFactory;
protected $table = "STEP";
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class StepTrigger extends Model
{
use HasFactory;
protected $table = 'STEP_TRIGGER';
protected $primaryKey = 'STEP_UID';
public $incrementing = false;

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
@@ -12,6 +13,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class SubApplication extends Model
{
use HasFactory;
// Set our table name
protected $table = 'SUB_APPLICATION';
// No timestamps

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use ProcessMaker\Model\Application;
class SubProcess extends Model
{
use HasFactory;
protected $table = 'SUB_PROCESS';
protected $primaryKey = 'SP_UID';
// We do not have create/update timestamps for this table

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use G;
use Illuminate\Database\Eloquent\Model;
class Task extends Model
{
use HasFactory;
protected $table = 'TASK';
protected $primaryKey = 'TAS_ID';
// We do not have create/update timestamps for this table

View File

@@ -2,7 +2,8 @@
namespace ProcessMaker\Model;
use \Illuminate\Database\Eloquent\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* Class TaskScheduler
@@ -12,6 +13,8 @@ use \Illuminate\Database\Eloquent\Model;
*/
class TaskScheduler extends Model
{
use HasFactory;
protected $table = 'SCHEDULER';
public $timestamps = true;
const CREATED_AT = 'creation_date';

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TaskUser extends Model
{
use HasFactory;
protected $table = 'TASK_USER';
public $timestamps = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Translation extends Model
{
use HasFactory;
protected $table = 'TRANSLATION';
protected $primaryKey = ['TRN_CATEGORY', 'TRN_ID', 'TRN_LANG'];
public $incrementing = false;

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Triggers extends Model
{
use HasFactory;
// Set our table name
protected $table = 'TRIGGERS';
// No timestamps

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Configurations;
use Illuminate\Database\Eloquent\Model;
use Exception;
@@ -9,6 +10,8 @@ use RBAC;
class User extends Model
{
use HasFactory;
protected $table = "USERS";
protected $primaryKey = 'USR_ID';
// Our custom timestamp columns

View File

@@ -2,11 +2,14 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use stdClass;
class UserConfig extends Model
{
use HasFactory;
/**
* Bind table.
* @var string

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class UserExtendedAttributes extends Model
{
use HasFactory;
protected $table = "USER_EXTENDED_ATTRIBUTES";
protected $primaryKey = "UEA_ID";
public $incrementing = true;

View File

@@ -1,13 +1,14 @@
<?php
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class UserReporting extends Model
{
use HasFactory;
protected $table = "USR_REPORTING";
public $timestamps = false;
}

View File

@@ -2,10 +2,13 @@
namespace ProcessMaker\Model;
use App\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class WebEntry extends Model
{
use HasFactory;
// Set our table name
protected $table = 'WEB_ENTRY';
protected $primaryKey = 'WE_UID';

View File

@@ -352,7 +352,7 @@ trait PluginStructure
$valueField = [];
if ((array_key_exists($name, $fieldsInTable) && $fieldsInTable[$name])) {
foreach ($fieldsInTable[$name] as $index => $item) {
if (method_exists($item, 'getAttributes')) {
if (is_object($item) && method_exists($item, 'getAttributes')) {
$valueField[$index] = $item->getAttributes();
} else {
$valueField[$index] = $item;

View File

@@ -288,7 +288,14 @@ class Bpmn extends Handler
return $response;
}
public function exists($projectUid)
/**
* This method verifies if a project exists
*
* @param string $projectUid Unique id of Project
*
* return boolean
*/
public static function exists($projectUid)
{
try {
$obj = ProjectPeer::retrieveByPK($projectUid);
@@ -715,14 +722,6 @@ class Bpmn extends Handler
public function updateEvent($evnUid, array $data)
{
/*if (array_key_exists("EVN_CANCEL_ACTIVITY", $data)) {
$data["EVN_CANCEL_ACTIVITY"] = $data["EVN_CANCEL_ACTIVITY"] ? 1 : 0;
}
if (array_key_exists("EVN_WAIT_FOR_COMPLETION", $data)) {
$data["EVN_WAIT_FOR_COMPLETION"] = $data["EVN_WAIT_FOR_COMPLETION"] ? 1 : 0;
}*/
try {
self::log("Update Event: $evnUid", "With data: ", $data);

View File

@@ -164,7 +164,7 @@ class Metrics extends Api
*
* @class AccessControl {@permission TASK_METRICS_VIEW}
*/
public function getCasesRiskByProcess($caseList = 'inbox', $process, $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null)
public function getCasesRiskByProcess($caseList = 'inbox', $process = '', $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null)
{
try {
switch ($caseList) {

View File

@@ -47,13 +47,13 @@ class Test extends Api
'age' => ''
);
if (array_key_exists('name', $request_data)) {
if (is_array($request_data) && array_key_exists('name', $request_data)) {
$this->data[$id]['name'] = $request_data['name'];
}
if (array_key_exists('lastname', $request_data)) {
if (is_array($request_data) && array_key_exists('lastname', $request_data)) {
$this->data[$id]['lastname'] = $request_data['lastname'];
}
if (array_key_exists('age', $request_data)) {
if (is_array($request_data) && array_key_exists('age', $request_data)) {
$this->data[$id]['age'] = $request_data['age'];
}
@@ -65,13 +65,13 @@ class Test extends Api
public function put($id, $request_data = null)
{
if (array_key_exists($id, $this->data)) {
if (array_key_exists('name', $request_data)) {
if (is_array($request_data) && array_key_exists('name', $request_data)) {
$this->data[$id]['name'] = $request_data['name'];
}
if (array_key_exists('lastname', $request_data)) {
if (is_array($request_data) && array_key_exists('lastname', $request_data)) {
$this->data[$id]['lastname'] = $request_data['lastname'];
}
if (array_key_exists('age', $request_data)) {
if (is_array($request_data) && array_key_exists('age', $request_data)) {
$this->data[$id]['age'] = $request_data['age'];
}
$this->saveData();

View File

@@ -25,7 +25,7 @@ function postNote($httpData)
@ob_flush();
@flush();
@ob_end_flush();
ob_implicit_flush(1);
ob_implicit_flush(true);
//send notification in background
$noteRecipientsList = array();
@@ -727,3 +727,14 @@ function calculateDate($iniDate, $timeUnit, $time)
return $datetime->format('Y-m-d H:i:s');
}
/**
* Get the constant value.
* @param string $name
* @param mixed $default
* @return mixed
*/
function getConstant(string $name, $default = '')
{
return defined($name) === true ? constant($name) : $default;
}