diff --git a/database/factories/GroupwfFactory.php b/database/factories/GroupwfFactory.php index 0a7e77198..8dbec9610 100644 --- a/database/factories/GroupwfFactory.php +++ b/database/factories/GroupwfFactory.php @@ -7,7 +7,6 @@ use Faker\Generator as Faker; $factory->define(\ProcessMaker\Model\Groupwf::class, function(Faker $faker) { return [ 'GRP_UID' => G::generateUniqueID(), - //'GRP_ID' The incremental fields of the tables must not be specified in the creation list. 'GRP_TITLE' => $faker->sentence(2), 'GRP_STATUS' => 'ACTIVE', 'GRP_LDAP_DN' => '', diff --git a/database/factories/ProcessFactory.php b/database/factories/ProcessFactory.php index 5465309c2..4e9706ae3 100644 --- a/database/factories/ProcessFactory.php +++ b/database/factories/ProcessFactory.php @@ -9,7 +9,6 @@ $factory->define(\ProcessMaker\Model\Process::class, function(Faker $faker) { //The incremental fields of the tables must not be specified in the creation list. return [ 'PRO_UID' => G::generateUniqueID(), - //'PRO_ID' The incremental fields of the tables must not be specified in the creation list. 'PRO_TITLE' => $faker->sentence(3), 'PRO_DESCRIPTION' => $faker->paragraph(3), 'PRO_CREATE_USER' => '00000000000000000000000000000001', @@ -31,7 +30,6 @@ $factory->state(\ProcessMaker\Model\Process::class, 'foreign_keys', function (Fa $user = factory(\ProcessMaker\Model\User::class)->create(); return [ 'PRO_UID' => G::generateUniqueID(), - //'PRO_ID' The incremental fields of the tables must not be specified in the creation list. 'PRO_TITLE' => $faker->sentence(3), 'PRO_DESCRIPTION' => $faker->paragraph(3), 'PRO_CREATE_USER' => $user->USR_UID, @@ -52,7 +50,6 @@ $factory->state(\ProcessMaker\Model\Process::class, 'flow', function (Faker $fak $user = factory(\ProcessMaker\Model\User::class)->create(); $process = [ 'PRO_UID' => G::generateUniqueID(), - //'PRO_ID' The incremental fields of the tables must not be specified in the creation list. 'PRO_TITLE' => $faker->sentence(3), 'PRO_DESCRIPTION' => $faker->paragraph(3), 'PRO_CREATE_USER' => $user->USR_UID, diff --git a/database/factories/TaskFactory.php b/database/factories/TaskFactory.php index 367734efb..90bbe13a2 100644 --- a/database/factories/TaskFactory.php +++ b/database/factories/TaskFactory.php @@ -11,7 +11,6 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) { 'PRO_UID' => $process->PRO_UID, 'PRO_ID' => $process->PRO_ID, 'TAS_UID' => G::generateUniqueID(), - //'TAS_ID' The incremental fields of the tables must not be specified in the creation list. 'TAS_TITLE' => $faker->sentence(2), 'TAS_TYPE' => 'NORMAL', 'TAS_TYPE_DAY' => 1, @@ -40,7 +39,6 @@ $factory->state(\ProcessMaker\Model\Task::class, 'foreign_keys', function (Faker 'PRO_UID' => $process->PRO_UID, 'PRO_ID' => $process->PRO_ID, 'TAS_UID' => G::generateUniqueID(), - //'TAS_ID' The incremental fields of the tables must not be specified in the creation list. 'TAS_TITLE' => $faker->sentence(2), 'TAS_TYPE' => 'NORMAL', 'TAS_TYPE_DAY' => 1, diff --git a/workflow/engine/classes/Derivation.php b/workflow/engine/classes/Derivation.php index b50a41ecc..335dedfbb 100644 --- a/workflow/engine/classes/Derivation.php +++ b/workflow/engine/classes/Derivation.php @@ -1416,7 +1416,7 @@ class Derivation protected function subProcessCreation(array $subProcessInfo, array $appFields, array $currentDelegation, $delIndex, $threadIndex) { // Check if is SelfService the task in the SubProcess - $isSelfService = (empty($subProcessInfo['USR_UID'])) ? true : false; + $isSelfService = empty($subProcessInfo['USR_UID']) ? true : false; // Create the new case in the sub-process // Set the initial date to null the time its created diff --git a/workflow/engine/methods/cases/cases_Derivate.php b/workflow/engine/methods/cases/cases_Derivate.php index 3d16da2c8..bae587c50 100644 --- a/workflow/engine/methods/cases/cases_Derivate.php +++ b/workflow/engine/methods/cases/cases_Derivate.php @@ -101,8 +101,8 @@ try { $index = $_SESSION["INDEX"]; $userLogged = $_SESSION["USER_LOGGED"]; - //Now we dispatch the derivation of the case through Jobs Laravel. - $closure = function() use($processUid, $application, $postForm, $sStatus, $flagGmail, $tasUid, $index, $userLogged) { + // Now we dispatch the derivation of the case through Jobs Laravel. + $closure = function() use ($processUid, $application, $postForm, $sStatus, $flagGmail, $tasUid, $index, $userLogged) { $cases = new Cases(); $cases->routeCase($processUid, $application, $postForm, $sStatus, $flagGmail, $tasUid, $index, $userLogged); }; @@ -114,18 +114,19 @@ try { $debuggerAvailable = true; $casesRedirector = 'casesListExtJsRedirector'; - if (isset($_SESSION ['user_experience']) && $flagGmail === false) { - $aNextStep ['PAGE'] = $casesRedirector . '?ux=' . $_SESSION ['user_experience']; + $nextStep = []; + if (isset($_SESSION['user_experience']) && $flagGmail === false) { + $nextStep['PAGE'] = $casesRedirector . '?ux=' . $_SESSION['user_experience']; $debuggerAvailable = false; } else { if ($flagGmail === true) { - $aNextStep ['PAGE'] = $casesRedirector . '?gmail=1'; + $nextStep['PAGE'] = $casesRedirector . '?gmail=1'; } else { - $aNextStep ['PAGE'] = $casesRedirector; + $nextStep['PAGE'] = $casesRedirector; } } - $loc = $aNextStep['PAGE']; + $loc = $nextStep['PAGE']; //Triggers After $isIE = Bootstrap::isIE(); diff --git a/workflow/engine/src/ProcessMaker/Cases/CasesTrait.php b/workflow/engine/src/ProcessMaker/Cases/CasesTrait.php index 8b1c65c1d..aee67bf5d 100644 --- a/workflow/engine/src/ProcessMaker/Cases/CasesTrait.php +++ b/workflow/engine/src/ProcessMaker/Cases/CasesTrait.php @@ -139,27 +139,27 @@ trait CasesTrait $this->updateCase($application, $appFields); // Send notifications - Start - $oUser = new Users(); - $aUser = $oUser->load($userLogged); - $fromName = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME']; + $user = new Users(); + $userInfo = $user->load($userLogged); + $fromName = $userInfo['USR_FIRSTNAME'] . ' ' . $userInfo['USR_LASTNAME']; - $sFromData = $fromName . ($aUser['USR_EMAIL'] != '' ? ' <' . $aUser['USR_EMAIL'] . '>' : ''); + $fromData = $fromName . ($userInfo['USR_EMAIL'] != '' ? ' <' . $userInfo['USR_EMAIL'] . '>' : ''); if ($flagGmail === true) { $appDel = new AppDelegation(); $actualThread = $appDel->Load($application, $index); $appDelPrev = $appDel->LoadParallel($application); - $Pmgmail = new Pmgmail(); + $pmGmail = new Pmgmail(); foreach ($appDelPrev as $app) { if (($app['DEL_INDEX'] != $index) && ($app['DEL_PREVIOUS'] != $actualThread['DEL_PREVIOUS'])) { - $Pmgmail->gmailsIfSelfServiceValueBased($application, $app['DEL_INDEX'], $postForm['TASKS'], $appFields['APP_DATA']); + $pmGmail->gmailsIfSelfServiceValueBased($application, $app['DEL_INDEX'], $postForm['TASKS'], $appFields['APP_DATA']); } } } try { - $this->sendNotifications($tasUid, $postForm['TASKS'], $appFields['APP_DATA'], $application, $index, $sFromData); + $this->sendNotifications($tasUid, $postForm['TASKS'], $appFields['APP_DATA'], $application, $index, $fromData); } catch (Exception $e) { G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR') . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%'); } @@ -263,8 +263,8 @@ trait CasesTrait $case->updateCase($appUid, $fields); if (isset($files['form'])) { if (isset($files["form"]["name"]) && count($files["form"]["name"]) > 0) { - $oInputDocument = new InputDocument(); - $oInputDocument->uploadFileCase($files, $case, $fields, $currentUsrUid, $appUid, $delIndex); + $inputDocument = new InputDocument(); + $inputDocument->uploadFileCase($files, $case, $fields, $currentUsrUid, $appUid, $delIndex); } } $wsBase = new WsBase(); diff --git a/workflow/engine/src/ProcessMaker/Model/SubApplication.php b/workflow/engine/src/ProcessMaker/Model/SubApplication.php index 615fd093e..b22a03b58 100644 --- a/workflow/engine/src/ProcessMaker/Model/SubApplication.php +++ b/workflow/engine/src/ProcessMaker/Model/SubApplication.php @@ -20,6 +20,7 @@ class SubApplication extends Model protected $primaryKey = 'APP_UID'; // The IDs are auto-incrementing public $incrementing = false; + /** * The model's default values for attributes. *