PMCORE-3876 Check Backward Incompatible Changes, specially "String to Number Comparison"

This commit is contained in:
Roly Gutierrez
2022-06-30 18:01:35 -04:00
parent dff6f45c55
commit 41298e0905
38 changed files with 96 additions and 1144 deletions

View File

@@ -263,7 +263,10 @@ class Net
$opt = [
'UID' => $this->db_user,
'PWD' => $this->db_passwd,
'Database' => $this->db_sourcename
'Database' => $this->db_sourcename,
'CharacterSet' => 'UTF-8',
'Encrypt' => true,
'TrustServerCertificate' => true
];
$link = @sqlsrv_connect($server, $opt);
@@ -399,7 +402,10 @@ class Net
$opt = [
'UID' => $this->db_user,
'PWD' => $this->db_passwd,
'Database' => $this->db_sourcename
'Database' => $this->db_sourcename,
'CharacterSet' => 'UTF-8',
'Encrypt' => true,
'TrustServerCertificate' => true
];
$link = $db = @sqlsrv_connect($server, $opt);
if ($link) {

View File

@@ -142,22 +142,6 @@ class ProcessMap
$aRow2['FINISH'] = '';
}
/*
if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) {
$oTask->color = '#FF0000';
} else {
if ($aRow2['CANT'] != 0) {
if ($aRow2['FINISH'] == null) {
//$oTask->color = '#FF9900';
$oTask->color = '#FF0000';
} else {
$oTask->color = '#006633';
}
} else {
$oTask->color = "#939598";
}
}
*/
if (empty($aRow2["FINISH"]) && $aRow1["TAS_UID"] == $sTask) {
$oTask->color = "#FF0000"; //Red
} else {

View File

@@ -2424,7 +2424,7 @@ class WsBase
$oAppDelay = new AppDelay();
$aRow = $oAppDelay->getCasesCancelOrPaused($caseId);
if (is_array($aRow)) {
if (isset($aRow['APP_DISABLE_ACTION_USER']) && $aRow['APP_DISABLE_ACTION_USER'] != 0 && isset($aRow['APP_DISABLE_ACTION_DATE']) && $aRow['APP_DISABLE_ACTION_DATE'] != '') {
if (isset($aRow['APP_DISABLE_ACTION_USER']) && intval($aRow['APP_DISABLE_ACTION_USER']) != 0 && isset($aRow['APP_DISABLE_ACTION_DATE']) && $aRow['APP_DISABLE_ACTION_DATE'] != '') {
$result = new WsResponse(19, G::LoadTranslation('ID_CASE_IN_STATUS') . " " . $aRow['APP_TYPE']);
return $result;
@@ -3486,7 +3486,7 @@ class WsBase
$respView = $case->getAllObjectsFrom($processUid, $caseUid, $taskUid, $userUid, "VIEW");
$respBlock = $case->getAllObjectsFrom($processUid, $caseUid, $taskUid, $userUid, "BLOCK");
if ($respView["CASES_NOTES"] == 0 && $respBlock["CASES_NOTES"] == 0) {
if (intval($respView["CASES_NOTES"]) == 0 && intval($respBlock["CASES_NOTES"]) == 0) {
$result = new WsResponse(100, G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS"));
return $result;

View File

@@ -78,7 +78,8 @@ class XmlFormFieldToolButton extends XmlFormField
case 'dropdown':
$html = '';
if (isset($this->owner->values['PRO_UID'])) {
$criteria = ProcessMap::getDynaformsCriteria($this->owner->values['PRO_UID']);
$processMap = new ProcessMap();
$criteria = $processMap->getDynaformsCriteria($this->owner->values['PRO_UID']);
$dataset = DynaformPeer::doSelectRS($criteria);
if ($dataset->getRecordCount() > 0) {
$html .= '<span style="display:inline-block; font-size: 8pt;margin-left: 5px;margin-bottom: 3px;">' . G::LoadTranslation('ID_DYNAFORM');

View File

@@ -992,7 +992,13 @@ class InstallerModule extends Controller
$info->wfDatabaseExists = count($response) > 0;
break;
case 'sqlsrv':
$arguments = array("UID" => $db_username, "PWD" => $db_password);
$arguments = [
'UID' => $db_username,
'PWD' => $db_password,
'CharacterSet' => 'UTF-8',
'Encrypt' => true,
'TrustServerCertificate' => true
];
$link = @sqlsrv_connect($db_hostname, $arguments);
$wfDatabase = $filter->validateInput($_REQUEST['wfDatabase'], 'nosql');
$query = "select * from sys.databases where name = '%s' ";

View File

@@ -17,7 +17,7 @@ class caseSchedulerProxy extends HttpProxyController
$sch_uid = $oData['EVN_ACTION'];
if ($sch_uid != '') {
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$rows = $oProcessMap->caseNewSchedulerList( $sch_uid );
if ($rows['SCH_OPTION'] == '3') {
$sch_start_day = explode( '|', $rows['SCH_START_DAY'] );

View File

@@ -5,7 +5,7 @@ class processOptionsProxy extends HttpProxyController
public function loadInputDocuments ($params)
{
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$pro_uid = $params->PRO_UID;
$start = isset( $params->start ) ? $params->start : 0;
@@ -24,7 +24,7 @@ class processOptionsProxy extends HttpProxyController
public function canDeleteInputDoc ($params)
{
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$aRows = $oProcessMap->getAllInputDocsByTask( $params->PRO_UID );
$response = isset( $aRows[$params->IDOC_UID] ) ? false : true;
$this->success = $response;

View File

@@ -279,7 +279,7 @@ class ProcessProxy extends HttpProxyController
switch ($httpData->type) {
case 'process':
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$process = $oProcessMap->editProcessNew( $httpData->UID );
$category = ProcessCategoryPeer::retrieveByPk( $process['PRO_CATEGORY'] );
$categoryName = is_object( $category ) ? $category->getCategoryName() : '';
@@ -404,7 +404,7 @@ class ProcessProxy extends HttpProxyController
*/
public function getPMVariables ($param)
{
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$rows = getDynaformsVars( $param->PRO_UID );
foreach ($rows as $i => $var) {
$rows[$i]['sName'] = "@@{$var['sName']}";

View File

@@ -218,7 +218,7 @@ class webEntryProxy extends HttpProxyController
public function load ($params)
{
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$PRO_UID = $params->PRO_UID;
$EVN_UID = $params->EVN_UID;
$sOutput = $oProcessMap->listNewWebEntry( $PRO_UID, $EVN_UID );

View File

@@ -99,7 +99,8 @@ try {
fclose( $templateHd1 );
}
$criteria = ProcessMap::getDynaformsCriteria($PRO_UID);
$processMap = new ProcessMap();
$criteria = $processMap->getDynaformsCriteria($PRO_UID);
//FROM
//WHERE
//QUERY

View File

@@ -54,7 +54,7 @@ foreach ($aAux1 as $aAux2) {
}
}
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$aTriggersList = $oProcessMap->getTriggers( $_SESSION['PROCESS'] );
$aTriggersFileds = array ();
$aTriggersFileds[] = array ('TRI_UID' => 'char','TRI_TITLE' => 'char');

View File

@@ -43,7 +43,7 @@ foreach ($aAux1 as $aAux2) {
}
}
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
$aTriggersList = $oProcessMap->getTriggers( $_GET['PRO_UID'] );
$aTriggersFileds = array();

View File

@@ -311,7 +311,7 @@ class Ajax
{
switch ($param['type']) {
case 'process':
$oProcessMap = new ProcessMap(new DBConnection());
$oProcessMap = new ProcessMap();
$process = $oProcessMap->editProcessNew($param['UID']);
$category = ProcessCategoryPeer::retrieveByPk($process['PRO_CATEGORY']);
$categoryName = is_object($category) ? $category->getCategoryName() : '';
@@ -447,7 +447,7 @@ class Ajax
public function getPMVariables($param)
{
$oProcessMap = new ProcessMap(new DBConnection());
$oProcessMap = new ProcessMap();
$response->rows = getDynaformsVars($param['PRO_UID']);
foreach ($response->rows as $i => $var) {
$response->rows[$i]['sName'] = "@@{$var['sName']}";

View File

@@ -110,7 +110,7 @@ try {
$resultProcess = $infoProcess->getProcessRow($proUid);
}
$oProcessMap = new ProcessMap(new DBConnection());
$oProcessMap = new ProcessMap();
switch ($_REQUEST['action']) {
case 'load':

View File

@@ -32,7 +32,7 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
try {
$oTrigger = new Triggers();
$oProcessMap = new ProcessMap( new DBConnection() );
$oProcessMap = new ProcessMap();
if (isset( $_POST['form'] )) {
$value = $_POST['form'];
} else {
@@ -84,10 +84,6 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
G::auditLog("UpdateTrigger", $description);
}
//if (! isset( $_POST['mode'] )) {
// $oProcessMap->triggersList( $value['PRO_UID'] );
//}
$response["success"] = true;
$response["msg"] = G::LoadTranslation("ID_TRIGGERS_SAVED");
} catch (Exception $e) {

View File

@@ -8,7 +8,7 @@ if (!class_exists('Triggers')) {
}
$triggers = new Triggers();
$processMap = new ProcessMap(new DBConnection());
$processMap = new ProcessMap();
$post = $_POST;

View File

@@ -8,7 +8,7 @@ if (!class_exists('Triggers')) {
}
$triggers = new Triggers();
$processMap = new ProcessMap(new DBConnection());
$processMap = new ProcessMap();
$post = $_POST;

View File

@@ -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

@@ -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 {