solved conflict composer.lock, config/app.php, workflow/engine/classes/SpoolRun.php
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Model\Process;
|
||||
use ProcessMaker\Validation\MySQL57;
|
||||
|
||||
CLI::taskName('info');
|
||||
CLI::taskDescription(<<<EOT
|
||||
Print information about the current system and any specified workspaces.
|
||||
@@ -362,6 +365,31 @@ EOT
|
||||
CLI::taskArg('workspace');
|
||||
CLI::taskRun("run_sync_forms_with_info_from_input_documents");
|
||||
|
||||
/**
|
||||
* Remove the deprecated files
|
||||
*/
|
||||
CLI::taskName('remove-unused-files');
|
||||
CLI::taskDescription(<<<EOT
|
||||
Remove the deprecated files.
|
||||
EOT
|
||||
);
|
||||
CLI::taskRun("remove_deprecated_files");
|
||||
|
||||
/*********************************************************************/
|
||||
CLI::taskName("check-queries-incompatibilities");
|
||||
CLI::taskDescription(<<<EOT
|
||||
Check queries incompatibilities (MySQL 5.7) for the specified workspace(s).
|
||||
|
||||
This command checks the queries incompatibilities (MySQL 5.7) in the specified workspace(s).
|
||||
|
||||
If no workspace is specified, the command will be run in all workspaces.
|
||||
More than one workspace can be specified.
|
||||
EOT
|
||||
);
|
||||
CLI::taskArg("workspace-name", true, true);
|
||||
CLI::taskRun("run_check_queries_incompatibilities");
|
||||
/*********************************************************************/
|
||||
|
||||
/**
|
||||
* Function run_info
|
||||
*
|
||||
@@ -467,6 +495,7 @@ function run_upgrade_content($args, $opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will upgrade the CONTENT table for a workspace
|
||||
* This function is executed only for one workspace
|
||||
@@ -1348,3 +1377,89 @@ function run_sync_forms_with_info_from_input_documents($args, $opts) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the deprecated files
|
||||
*
|
||||
* @return void
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php CLI::taskRun()
|
||||
* @link https://wiki.processmaker.com/3.3/processmaker_command
|
||||
*/
|
||||
function remove_deprecated_files()
|
||||
{
|
||||
//The constructor requires an argument, so we send an empty value in order to use the class.
|
||||
$workspaceTools = new WorkspaceTools('');
|
||||
$workspaceTools->removeDeprecatedFiles();
|
||||
CLI::logging("<*> The deprecated files has been removed. \n");
|
||||
}
|
||||
|
||||
/**
|
||||
* This function review the queries for each workspace or for an specific workspace
|
||||
*
|
||||
* @param array $args
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function run_check_queries_incompatibilities($args)
|
||||
{
|
||||
try {
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
if (count($args) === 1) {
|
||||
CLI::logging("> Workspace: " . $workspaces[0]->name . PHP_EOL);
|
||||
check_queries_incompatibilities($workspaces[0]->name);
|
||||
} else {
|
||||
foreach ($workspaces as $workspace) {
|
||||
passthru(PHP_BINARY . " processmaker check-queries-incompatibilities " . $workspace->name);
|
||||
}
|
||||
}
|
||||
echo "Done!\n\n";
|
||||
} catch (Exception $e) {
|
||||
G::outRes(CLI::error($e->getMessage()) . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for the incompatibilities in the queries for the specific workspace
|
||||
*
|
||||
* @param string $wsName
|
||||
*/
|
||||
function check_queries_incompatibilities($wsName)
|
||||
{
|
||||
Bootstrap::setConstantsRelatedWs($wsName);
|
||||
require_once(PATH_DB . $wsName . '/db.php');
|
||||
System::initLaravel();
|
||||
|
||||
$query = Process::query()->select('PRO_UID', 'PRO_TITLE');
|
||||
$processesToCheck = $query->get()->values()->toArray();
|
||||
|
||||
$obj = new MySQL57();
|
||||
$resTriggers = $obj->checkIncompatibilityTriggers($processesToCheck);
|
||||
|
||||
if (!empty($resTriggers)) {
|
||||
foreach ($resTriggers as $trigger) {
|
||||
echo ">> The \"" . $trigger['PRO_TITLE'] . "\" process has a trigger called: \"" . $trigger['TRI_TITLE'] . "\" that contains UNION queries. Review the code to discard incompatibilities with MySQL5.7." . PHP_EOL;
|
||||
}
|
||||
} else {
|
||||
echo ">> No MySQL 5.7 incompatibilities in triggers found for this workspace." . PHP_EOL;
|
||||
}
|
||||
|
||||
$resDynaforms = $obj->checkIncompatibilityDynaforms($processesToCheck);
|
||||
|
||||
if (!empty($resDynaforms)) {
|
||||
foreach ($resDynaforms as $dynaform) {
|
||||
echo ">> The \"" . $dynaform['PRO_TITLE'] . "\" process has a dynaform called: \"" . $dynaform['DYN_TITLE'] . "\" that contains UNION queries. Review the code to discard incompatibilities with MySQL5.7." . PHP_EOL;
|
||||
}
|
||||
} else {
|
||||
echo ">> No MySQL 5.7 incompatibilities in dynaforms found for this workspace." . PHP_EOL;
|
||||
}
|
||||
|
||||
$resVariables = $obj->checkIncompatibilityVariables($processesToCheck);
|
||||
|
||||
if (!empty($resVariables)) {
|
||||
foreach ($resVariables as $variable) {
|
||||
echo ">> The \"" . $variable['PRO_TITLE'] . "\" process has a variable called: \"" . $variable['VAR_NAME'] . "\" that contains UNION queries. Review the code to discard incompatibilities with MySQL5.7." . PHP_EOL;
|
||||
}
|
||||
} else {
|
||||
echo ">> No MySQL 5.7 incompatibilities in variables found for this workspace." . PHP_EOL;
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,7 @@ class Cases
|
||||
$task = TaskPeer::retrieveByPk($currentDelegations[$r]->getTasUid());
|
||||
$caseLabel = $task->$getTasDef();
|
||||
if ($caseLabel != '') {
|
||||
$appLabel = G::replaceDataField($caseLabel, $aAppData);
|
||||
$appLabel = G::replaceDataField($caseLabel, $aAppData, 'mysql', false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -686,7 +686,7 @@ class Cases
|
||||
//Get the case title
|
||||
$tasDefTitle = trim($row['TAS_DEF_TITLE']);
|
||||
if (!empty($tasDefTitle) && !$flagTitle) {
|
||||
$newAppProperty = G::replaceDataField($tasDefTitle, $lastFieldsCase);
|
||||
$newAppProperty = G::replaceDataField($tasDefTitle, $lastFieldsCase, 'mysql', false);
|
||||
$res['APP_TITLE'] = $newAppProperty;
|
||||
if (!(isset($currentValue) && ($currentValue == $tasDefTitle))) {
|
||||
$newValues['APP_TITLE'] = $newAppProperty;
|
||||
@@ -696,7 +696,7 @@ class Cases
|
||||
//Get the case description
|
||||
$tasDefDescription = trim($row['TAS_DEF_DESCRIPTION']);
|
||||
if (!empty($tasDefDescription) && !$flagDescription) {
|
||||
$newAppProperty = G::replaceDataField($tasDefDescription, $lastFieldsCase);
|
||||
$newAppProperty = G::replaceDataField($tasDefDescription, $lastFieldsCase, 'mysql', false);
|
||||
$res['APP_DESCRIPTION'] = $newAppProperty;
|
||||
if (!(isset($currentValue) && ($currentValue == $tasDefDescription))) {
|
||||
$newValues['APP_DESCRIPTION'] = $newAppProperty;
|
||||
@@ -5441,7 +5441,7 @@ class Cases
|
||||
switch ($typeSend) {
|
||||
case 'LAST':
|
||||
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
|
||||
$sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $arrayData);
|
||||
$sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $arrayData, 'mysql', false);
|
||||
} else {
|
||||
$sSubject = G::LoadTranslation('ID_MESSAGE_SUBJECT_DERIVATION');
|
||||
}
|
||||
@@ -5526,7 +5526,7 @@ class Cases
|
||||
break;
|
||||
case 'RECEIVE':
|
||||
if (isset($aTaskInfo['TAS_RECEIVE_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_RECEIVE_SUBJECT_MESSAGE'] != '') {
|
||||
$sSubject = G::replaceDataField($aTaskInfo['TAS_RECEIVE_SUBJECT_MESSAGE'], $arrayData);
|
||||
$sSubject = G::replaceDataField($aTaskInfo['TAS_RECEIVE_SUBJECT_MESSAGE'], $arrayData, 'mysql', false);
|
||||
} else {
|
||||
$sSubject = G::LoadTranslation('ID_MESSAGE_SUBJECT_DERIVATION');
|
||||
}
|
||||
@@ -5612,30 +5612,30 @@ class Cases
|
||||
/**
|
||||
* This function send an email for each task in $arrayTask if $to is definded
|
||||
*
|
||||
* @param array $dataLastEmail
|
||||
* @param array $arrayData
|
||||
* @param array $arrayTask
|
||||
* @param $dataLastEmail
|
||||
* @param $arrayData
|
||||
* @param $arrayTask
|
||||
* @return void
|
||||
*
|
||||
* @see \Cases->sendNotifications()
|
||||
*/
|
||||
public function sendMessage($dataLastEmail, $arrayData, $arrayTask)
|
||||
{
|
||||
foreach ($arrayTask as $theTask) {
|
||||
foreach ($arrayTask as $aTask) {
|
||||
//Check and fix if Task Id is complex
|
||||
if (strpos($theTask['TAS_UID'], "/") !== false) {
|
||||
$aux = explode("/", $theTask['TAS_UID']);
|
||||
if (strpos($aTask['TAS_UID'], "/") !== false) {
|
||||
$aux = explode("/", $aTask['TAS_UID']);
|
||||
if (isset($aux[1])) {
|
||||
$theTask['TAS_UID'] = $aux[1];
|
||||
$aTask['TAS_UID'] = $aux[1];
|
||||
}
|
||||
}
|
||||
//if the next is EOP dont send notification and continue with the next
|
||||
if ($theTask['TAS_UID'] === '-1') {
|
||||
if ($aTask['TAS_UID'] === '-1') {
|
||||
continue;
|
||||
}
|
||||
if (isset($theTask['DEL_INDEX'])) {
|
||||
if (isset($aTask['DEL_INDEX'])) {
|
||||
$arrayData2 = $arrayData;
|
||||
$appDelegation = AppDelegationPeer::retrieveByPK($dataLastEmail['applicationUid'], $theTask['DEL_INDEX']);
|
||||
$appDelegation = AppDelegationPeer::retrieveByPK($dataLastEmail['applicationUid'], $aTask['DEL_INDEX']);
|
||||
if (!is_null($appDelegation)) {
|
||||
$oTaskUpd = new Task();
|
||||
$aTaskUpdate = $oTaskUpd->load($appDelegation->getTasUid());
|
||||
@@ -5646,25 +5646,25 @@ class Cases
|
||||
$arrayData2 = $arrayData;
|
||||
}
|
||||
|
||||
if (isset($theTask['USR_UID']) && !empty($theTask['USR_UID'])) {
|
||||
if (isset($aTask['USR_UID']) && !empty($aTask['USR_UID'])) {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
$arrayUserData = $user->getUser($theTask['USR_UID'], true);
|
||||
$arrayUserData = $user->getUser($aTask['USR_UID'], true);
|
||||
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2,
|
||||
(trim($arrayUserData['USR_TIME_ZONE']) != '') ? trim($arrayUserData['USR_TIME_ZONE']) :
|
||||
\ProcessMaker\Util\System::getTimeZone());
|
||||
} else {
|
||||
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2);
|
||||
}
|
||||
$body2 = G::replaceDataGridField($dataLastEmail['body'], $arrayData2, false, true);
|
||||
$body2 = G::replaceDataGridField($dataLastEmail['body'], $arrayData2, false);
|
||||
$to = null;
|
||||
$cc = '';
|
||||
if ($theTask['TAS_UID'] != '-1') {
|
||||
$respTo = $this->getTo($theTask['TAS_UID'], $theTask['USR_UID'], $arrayData);
|
||||
if ($aTask['TAS_UID'] != '-1') {
|
||||
$respTo = $this->getTo($aTask['TAS_UID'], $aTask['USR_UID'], $arrayData);
|
||||
$to = $respTo['to'];
|
||||
$cc = $respTo['cc'];
|
||||
}
|
||||
|
||||
if ($theTask["TAS_ASSIGN_TYPE"] === "SELF_SERVICE") {
|
||||
if ($aTask ["TAS_ASSIGN_TYPE"] === "SELF_SERVICE") {
|
||||
if ($dataLastEmail['swtplDefault'] == 1) {
|
||||
G::verifyPath($dataLastEmail['pathEmail'], true); // Create if it does not exist
|
||||
$fileTemplate = $dataLastEmail['pathEmail'] . G::LoadTranslation('ID_UNASSIGNED_MESSAGE');
|
||||
@@ -5674,7 +5674,7 @@ class Cases
|
||||
) {
|
||||
@copy(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'), $fileTemplate);
|
||||
}
|
||||
$body2 = G::replaceDataField(file_get_contents($fileTemplate), $arrayData2);
|
||||
$body2 = G::replaceDataField(file_get_contents($fileTemplate), $arrayData2, 'mysql', false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6976,7 +6976,7 @@ class Cases
|
||||
return isset($row['DEL_INDEX']) ? $row['DEL_INDEX'] : 0;
|
||||
}
|
||||
|
||||
public function clearCaseSessionData()
|
||||
public static function clearCaseSessionData()
|
||||
{
|
||||
if (isset($_SESSION['APPLICATION'])) {
|
||||
unset($_SESSION['APPLICATION']);
|
||||
|
||||
@@ -22,7 +22,7 @@ class EnterpriseClass extends PMPlugin
|
||||
{
|
||||
}
|
||||
|
||||
public function enterpriseSystemUpdate($data) //$data = $oData
|
||||
public static function enterpriseSystemUpdate($data) //$data = $oData
|
||||
{
|
||||
if (count(glob(PATH_DATA_SITE . 'license/*.dat')) == 0) {
|
||||
return;
|
||||
|
||||
@@ -253,7 +253,7 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql = G::replaceDataField($json->sql, $dtFields);
|
||||
$sql = G::replaceDataField($json->sql, $dtFields, 'mysql', false);
|
||||
if ($value === "suggest") {
|
||||
$sql = $this->prepareSuggestSql($sql, $json);
|
||||
}
|
||||
@@ -715,7 +715,7 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
if ($json->dbConnection !== "" && $json->dbConnection !== "none" && $json->sql !== "") {
|
||||
$sql = G::replaceDataField($json->sql, $data);
|
||||
$sql = G::replaceDataField($json->sql, $data, 'mysql', false);
|
||||
$dt = $this->getCacheQueryData($json->dbConnection, $sql, $json->type);
|
||||
$row = isset($dt[0]) ? $dt[0] : [];
|
||||
$index = $json->variable === "" ? $json->id : $json->variable;
|
||||
|
||||
@@ -1919,14 +1919,19 @@ class Processes
|
||||
|
||||
|
||||
/**
|
||||
* Gets Input Documents Rows from aProcess.
|
||||
* Gets Input Documents Rows from process.
|
||||
*
|
||||
* @param string $proUid
|
||||
* @param boolean $unsetInpDocId
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*
|
||||
* @see Processes::getWorkflowData()
|
||||
* @see ProcessMaker\BusinessModel\Migrator\InputDocumentsMigrator::export()
|
||||
* @see ProcessMaker\Importer\Importer::saveCurrentProcess()
|
||||
*/
|
||||
public function getInputRows($proUid)
|
||||
public function getInputRows($proUid, $unsetInpDocId = true)
|
||||
{
|
||||
try {
|
||||
$inputList = [];
|
||||
@@ -1938,7 +1943,9 @@ class Processes
|
||||
while ($row = $dataset->getRow()) {
|
||||
$input = new InputDocument();
|
||||
$infoInput = $input->load($row['INP_DOC_UID']);
|
||||
unset($infoInput['INP_DOC_ID']);
|
||||
if ($unsetInpDocId === true) {
|
||||
unset($infoInput['INP_DOC_ID']);
|
||||
}
|
||||
$inputList[] = $infoInput;
|
||||
$dataset->next();
|
||||
}
|
||||
@@ -1956,6 +1963,10 @@ class Processes
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*
|
||||
* @see Processes::createProcessPropertiesFromData()
|
||||
* @see Processes::updateProcessFromData()
|
||||
* @see ProcessMaker\BusinessModel\Migrator\InputDocumentsMigrator::import()
|
||||
*/
|
||||
public function createInputRows($input)
|
||||
{
|
||||
@@ -1970,11 +1981,15 @@ class Processes
|
||||
//Get the INP_DOC_ID column
|
||||
$dataSet = BasePeer::doSelect($criteria, $con);
|
||||
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($dataSet->next()) {
|
||||
$inputInfo = $dataSet->getRow();
|
||||
$row['INP_DOC_ID'] = $inputInfo['INP_DOC_ID'];
|
||||
if (isset($row["__INP_DOC_ID_UPDATE__"]) && $row["__INP_DOC_ID_UPDATE__"] === false) {
|
||||
unset($row["__INP_DOC_ID_UPDATE__"]);
|
||||
} else {
|
||||
$row['INP_DOC_ID'] = null;
|
||||
if ($dataSet->next()) {
|
||||
$inputInfo = $dataSet->getRow();
|
||||
$row['INP_DOC_ID'] = $inputInfo['INP_DOC_ID'];
|
||||
} else {
|
||||
$row['INP_DOC_ID'] = null;
|
||||
}
|
||||
}
|
||||
BasePeer::doDelete($criteria, $con);
|
||||
//Prepare the insert
|
||||
@@ -2102,11 +2117,16 @@ class Processes
|
||||
* Gets the Output Documents Rows from a Process.
|
||||
*
|
||||
* @param string $proUid
|
||||
* @param boolean $unsetOutDocId
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*
|
||||
* @see Processes::getWorkflowData()
|
||||
* @see ProcessMaker\BusinessModel\Migrator\OutputDocumentsMigrator::export()
|
||||
* @see ProcessMaker\Importer\Importer::saveCurrentProcess()
|
||||
*/
|
||||
public function getOutputRows($proUid)
|
||||
public function getOutputRows($proUid, $unsetOutDocId = true)
|
||||
{
|
||||
try {
|
||||
$outputList = [];
|
||||
@@ -2118,7 +2138,9 @@ class Processes
|
||||
while ($row = $dataset->getRow()) {
|
||||
$output = new OutputDocument();
|
||||
$infoOutput = $output->Load($row['OUT_DOC_UID']);
|
||||
unset($infoOutput['OUT_DOC_ID']);
|
||||
if ($unsetOutDocId === true) {
|
||||
unset($infoOutput['OUT_DOC_ID']);
|
||||
}
|
||||
$outputList[] = $infoOutput;
|
||||
$dataset->next();
|
||||
}
|
||||
@@ -2136,6 +2158,10 @@ class Processes
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*
|
||||
* @see Processes::createProcessPropertiesFromData()
|
||||
* @see Processes::updateProcessFromData()
|
||||
* @see ProcessMaker\BusinessModel\Migrator\OutputDocumentsMigrator::import()
|
||||
*/
|
||||
public function createOutputRows($output)
|
||||
{
|
||||
@@ -2150,11 +2176,15 @@ class Processes
|
||||
//Get the OUT_DOC_ID column
|
||||
$dataSet = BasePeer::doSelect($criteria, $con);
|
||||
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($dataSet->next()) {
|
||||
$outputInfo = $dataSet->getRow();
|
||||
$row['OUT_DOC_ID'] = $outputInfo['OUT_DOC_ID'];
|
||||
if (isset($row["__OUT_DOC_ID_UPDATE__"]) && $row["__OUT_DOC_ID_UPDATE__"] === false) {
|
||||
unset($row["__OUT_DOC_ID_UPDATE__"]);
|
||||
} else {
|
||||
$row['OUT_DOC_ID'] = null;
|
||||
if ($dataSet->next()) {
|
||||
$outputInfo = $dataSet->getRow();
|
||||
$row['OUT_DOC_ID'] = $outputInfo['OUT_DOC_ID'];
|
||||
} else {
|
||||
$row['OUT_DOC_ID'] = null;
|
||||
}
|
||||
}
|
||||
BasePeer::doDelete($criteria, $con);
|
||||
//Prepare the insert
|
||||
@@ -2931,11 +2961,16 @@ class Processes
|
||||
* Get Dynaform Rows from a Process
|
||||
*
|
||||
* @param string $proUid
|
||||
* @param boolean $unsetDynId
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*
|
||||
* @see Processes::getWorkflowData()
|
||||
* @see ProcessMaker\BusinessModel\Migrator\DynaformsMigrator::export()
|
||||
* @see ProcessMaker\Importer\Importer::saveCurrentProcess()
|
||||
*/
|
||||
public function getDynaformRows($proUid)
|
||||
public function getDynaformRows($proUid, $unsetDynId = true)
|
||||
{
|
||||
try {
|
||||
$dynaformList = [];
|
||||
@@ -2947,7 +2982,9 @@ class Processes
|
||||
while ($row = $dataset->getRow()) {
|
||||
$dynaform = new Dynaform();
|
||||
$infoDyn = $dynaform->Load($row['DYN_UID']);
|
||||
unset($infoDyn['DYN_ID']);
|
||||
if ($unsetDynId === true) {
|
||||
unset($infoDyn['DYN_ID']);
|
||||
}
|
||||
$dynaformList[] = $infoDyn;
|
||||
$dataset->next();
|
||||
}
|
||||
@@ -3077,12 +3114,16 @@ class Processes
|
||||
}
|
||||
|
||||
/**
|
||||
* Create dynaforms for a process
|
||||
* Create dynaforms for a process.
|
||||
*
|
||||
* @param array $dynaforms
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*
|
||||
* @see Processes::createProcessPropertiesFromData()
|
||||
* @see Processes::updateProcessFromData()
|
||||
* @see ProcessMaker\BusinessModel\Migrator\DynaformsMigrator::import()
|
||||
*/
|
||||
public function createDynaformRows($dynaforms)
|
||||
{
|
||||
@@ -3097,11 +3138,15 @@ class Processes
|
||||
//Get the DYN_ID column
|
||||
$dataSet = BasePeer::doSelect($criteria, $con);
|
||||
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($dataSet->next()) {
|
||||
$dynInfo = $dataSet->getRow();
|
||||
$row['DYN_ID'] = $dynInfo['DYN_ID'];
|
||||
if (isset($row["__DYN_ID_UPDATE__"]) && $row["__DYN_ID_UPDATE__"] === false) {
|
||||
unset($row["__DYN_ID_UPDATE__"]);
|
||||
} else {
|
||||
$row['DYN_ID'] = null;
|
||||
if ($dataSet->next()) {
|
||||
$dynInfo = $dataSet->getRow();
|
||||
$row['DYN_ID'] = $dynInfo['DYN_ID'];
|
||||
} else {
|
||||
$row['DYN_ID'] = null;
|
||||
}
|
||||
}
|
||||
BasePeer::doDelete($criteria, $con);
|
||||
//Prepare the insert
|
||||
|
||||
@@ -111,6 +111,16 @@ class SpoolRun
|
||||
return $this->spoolId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fileData property
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFileData()
|
||||
{
|
||||
return $this->fileData;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all files into spool in a list
|
||||
*
|
||||
@@ -232,32 +242,52 @@ class SpoolRun
|
||||
}
|
||||
|
||||
/**
|
||||
* set email parameters
|
||||
* Set email parameters
|
||||
*
|
||||
* @param string $sAppMsgUid , $sSubject, $sFrom, $sTo, $sBody, $sDate, $sCC, $sBCC, $sTemplate
|
||||
* @return none
|
||||
* @param string $appMsgUid
|
||||
* @param string $subject
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @param string $body
|
||||
* @param string $date
|
||||
* @param string $cc
|
||||
* @param string $bcc
|
||||
* @param string $template
|
||||
* @param array $attachments
|
||||
* @param bool $contentTypeIsHtml
|
||||
* @param string $error
|
||||
*
|
||||
* @see SpoolRun->create()
|
||||
* @see SpoolRun->resendEmails()
|
||||
*/
|
||||
public function setData($sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate = "", $sCC = "", $sBCC = "", $sTemplate = "", $aAttachment = array(), $bContentTypeIsHtml = true, $sError = "")
|
||||
public function setData($appMsgUid, $subject, $from, $to, $body, $date = '', $cc = '', $bcc = '', $template = '', $attachments = [],
|
||||
$contentTypeIsHtml = true, $error = '')
|
||||
{
|
||||
$this->spoolId = $sAppMsgUid;
|
||||
$this->fileData['subject'] = $sSubject;
|
||||
$this->fileData['from'] = $sFrom;
|
||||
$this->fileData['to'] = $sTo;
|
||||
$this->fileData['body'] = $sBody;
|
||||
$this->fileData['date'] = ($sDate != '' ? $sDate : date('Y-m-d H:i:s'));
|
||||
$this->fileData['cc'] = $sCC;
|
||||
$this->fileData['bcc'] = $sBCC;
|
||||
$this->fileData['template'] = $sTemplate;
|
||||
$this->fileData['attachments'] = $aAttachment;
|
||||
$this->fileData['envelope_to'] = array();
|
||||
$this->fileData["contentTypeIsHtml"] = $bContentTypeIsHtml;
|
||||
$this->fileData["error"] = $sError;
|
||||
// Fill "fileData" property
|
||||
$this->spoolId = $appMsgUid;
|
||||
$this->fileData['subject'] = $subject;
|
||||
$this->fileData['from'] = $from;
|
||||
$this->fileData['to'] = $to;
|
||||
$this->fileData['body'] = $body;
|
||||
$this->fileData['date'] = (!empty($date) ? $date : date('Y-m-d H:i:s'));
|
||||
$this->fileData['cc'] = $cc;
|
||||
$this->fileData['bcc'] = $bcc;
|
||||
$this->fileData['template'] = $template;
|
||||
$this->fileData['attachments'] = $attachments;
|
||||
$this->fileData["contentTypeIsHtml"] = $contentTypeIsHtml;
|
||||
$this->fileData["error"] = $error;
|
||||
|
||||
// Initialize some values used internally
|
||||
$this->fileData['envelope_to'] = [];
|
||||
$this->fileData['envelope_cc'] = [];
|
||||
$this->fileData['envelope_bcc'] = [];
|
||||
|
||||
// Domain validation when the email engine is "OpenMail"
|
||||
if (array_key_exists('MESS_ENGINE', $this->config)) {
|
||||
if ($this->config['MESS_ENGINE'] == 'OPENMAIL') {
|
||||
if ($this->config['MESS_SERVER'] != '') {
|
||||
if (($sAux = @gethostbyaddr($this->config['MESS_SERVER']))) {
|
||||
$this->fileData['domain'] = $sAux;
|
||||
if ($this->config['MESS_ENGINE'] === 'OPENMAIL') {
|
||||
if (!empty($this->config['MESS_SERVER'])) {
|
||||
if (($domain = @gethostbyaddr($this->config['MESS_SERVER']))) {
|
||||
$this->fileData['domain'] = $domain;
|
||||
} else {
|
||||
$this->fileData['domain'] = $this->config['MESS_SERVER'];
|
||||
}
|
||||
@@ -841,4 +871,12 @@ class SpoolRun
|
||||
|
||||
return $appMsgUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the private method "handleEnvelopeTo", this method was created in order to use in the unit tests
|
||||
*/
|
||||
public function runHandleEnvelopeTo()
|
||||
{
|
||||
$this->handleEnvelopeTo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,7 +1074,6 @@ class WorkspaceTools
|
||||
$this->checkRbacPermissions();//check or add new permissions
|
||||
$this->checkSequenceNumber();
|
||||
$this->migrateIteeToDummytask($this->name);
|
||||
$this->upgradeConfiguration();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$this->upgradeAuditLog($this->name);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
@@ -3739,13 +3738,6 @@ class WorkspaceTools
|
||||
CLI::logging($message);
|
||||
}
|
||||
|
||||
public function upgradeConfiguration()
|
||||
{
|
||||
$conf = new Configurations();
|
||||
$conf->aConfig = 'neoclassic';
|
||||
$conf->saveConfig('SKIN_CRON', '');
|
||||
}
|
||||
|
||||
public function upgradeAuditLog($workspace)
|
||||
{
|
||||
$conf = new Configurations();
|
||||
|
||||
@@ -991,7 +991,7 @@ class WsBase
|
||||
$subject,
|
||||
G::buildFrom($setup, $from),
|
||||
$to,
|
||||
G::replaceDataGridField(file_get_contents($fileTemplate), $fieldsCase, false, true),
|
||||
G::replaceDataGridField(file_get_contents($fileTemplate), $fieldsCase, false),
|
||||
$cc,
|
||||
$bcc,
|
||||
'',
|
||||
|
||||
@@ -1750,7 +1750,7 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
||||
//The $_GET['UID'] variable is used when a process executes.
|
||||
//$_GET['UID']=($aOD['OUT_DOC_VERSIONING'])?$_GET['UID']:$aOD['OUT_DOC_UID'];
|
||||
//$sUID = ($aOD['OUT_DOC_VERSIONING'])?$_GET['UID']:$aOD['OUT_DOC_UID'];
|
||||
$sFilename = preg_replace( '[^A-Za-z0-9_]', '_', G::replaceDataField( $aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA'] ) );
|
||||
$sFilename = preg_replace( '[^A-Za-z0-9_]', '_', G::replaceDataField( $aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA'], 'mysql', false ) );
|
||||
require_once 'classes/model/AppFolder.php';
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
|
||||
|
||||
@@ -706,7 +706,7 @@ class PMScript
|
||||
try {
|
||||
$cnn = Propel::getConnection($varInfo["VAR_DBCONNECTION"]);
|
||||
$stmt = $cnn->createStatement();
|
||||
$sql = G::replaceDataField($varInfo["VAR_SQL"], $this->aFields);
|
||||
$sql = G::replaceDataField($varInfo["VAR_SQL"], $this->aFields, 'mysql', false);
|
||||
$rs = $stmt->executeQuery($sql, \ResultSet::FETCHMODE_NUM);
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
|
||||
@@ -1735,7 +1735,7 @@ class AppCacheView extends BaseAppCacheView
|
||||
$arrayAppField = $app->Load($appcvAppUid);
|
||||
|
||||
$appTitle = (!empty($appTitle))? $appTitle : "#" . $arrayAppField["APP_NUMBER"];
|
||||
$appTitleNew = G::replaceDataField($appTitle, unserialize($arrayAppField["APP_DATA"]));
|
||||
$appTitleNew = G::replaceDataField($appTitle, unserialize($arrayAppField["APP_DATA"]), 'mysql', false);
|
||||
|
||||
if (isset($arrayAppField["APP_TITLE"]) && $arrayAppField["APP_TITLE"] != $appTitleNew) {
|
||||
//Updating the value in content, where...
|
||||
|
||||
@@ -101,7 +101,7 @@ class AppDelay extends BaseAppDelay
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isPaused($appUid, $delIndex)
|
||||
public static function isPaused($appUid, $delIndex)
|
||||
{
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(AppDelayPeer::APP_UID, $appUid);
|
||||
|
||||
@@ -797,7 +797,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @param integer $index, Index to review
|
||||
* @return array
|
||||
*/
|
||||
public function getCurrentUsers($appUid, $index)
|
||||
public static function getCurrentUsers($appUid, $index)
|
||||
{
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
|
||||
@@ -145,8 +145,7 @@ class AppFolder extends BaseAppFolder
|
||||
|
||||
$oApplication = new Application();
|
||||
$appFields = $oApplication->Load( $sessionID );
|
||||
$folderPathParsed = G::replaceDataField( $folderPath, $appFields );
|
||||
$folderPathParsed = G::replaceDataField( $folderPath, unserialize( $appFields['APP_DATA'] ) );
|
||||
$folderPathParsed = G::replaceDataField( $folderPath, unserialize( $appFields['APP_DATA'] ), 'mysql', false );
|
||||
$folderPathParsedArray = explode( "/", $folderPathParsed );
|
||||
$folderRoot = "/"; //Always starting from Root
|
||||
foreach ($folderPathParsedArray as $folderName) {
|
||||
@@ -174,8 +173,7 @@ class AppFolder extends BaseAppFolder
|
||||
|
||||
$oApplication = new Application();
|
||||
$appFields = $oApplication->Load( $sessionID );
|
||||
$fileTagsParsed = G::replaceDataField( $fileTags, $appFields );
|
||||
$fileTagsParsed = G::replaceDataField( $fileTags, unserialize( $appFields['APP_DATA'] ) );
|
||||
$fileTagsParsed = G::replaceDataField( $fileTags, unserialize( $appFields['APP_DATA'] ), 'mysql', false );
|
||||
return $fileTagsParsed;
|
||||
}
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ class AppNotes extends BaseAppNotes
|
||||
$configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
|
||||
//Define the body for the notification
|
||||
$configNoteNotification['body'] = $this->getBodyCaseNote($authorName, $noteContent);
|
||||
$body = nl2br(G::replaceDataField($configNoteNotification['body'], $fieldCase));
|
||||
$body = nl2br(G::replaceDataField($configNoteNotification['body'], $fieldCase, 'mysql', false));
|
||||
|
||||
$users = new Users();
|
||||
$recipientsArray = explode(",", $noteRecipients);
|
||||
@@ -229,7 +229,7 @@ class AppNotes extends BaseAppNotes
|
||||
$appUid,
|
||||
$delIndex,
|
||||
WsBase::MESSAGE_TYPE_CASE_NOTE,
|
||||
G::replaceDataField($configNoteNotification['subject'], $fieldCase),
|
||||
G::replaceDataField($configNoteNotification['subject'], $fieldCase, 'mysql', false),
|
||||
G::buildFrom($configuration, $from),
|
||||
$to,
|
||||
$body,
|
||||
|
||||
@@ -34,7 +34,7 @@ class ListInbox extends BaseListInbox implements ListInterface
|
||||
if (isset($data['APP_TITLE'])) {
|
||||
$oCase = new Cases();
|
||||
$aData = $oCase->loadCase($data["APP_UID"]);
|
||||
$data['APP_TITLE'] = G::replaceDataField($data['APP_TITLE'], $aData['APP_DATA']);
|
||||
$data['APP_TITLE'] = G::replaceDataField($data['APP_TITLE'], $aData['APP_DATA'], 'mysql', false);
|
||||
}
|
||||
if (!empty($data['PRO_UID']) && empty($data['PRO_ID'])) {
|
||||
$p = new Process();
|
||||
@@ -124,7 +124,7 @@ class ListInbox extends BaseListInbox implements ListInterface
|
||||
if (isset($data['APP_TITLE'])) {
|
||||
$oCase = new Cases();
|
||||
$aData = $oCase->loadCase($data["APP_UID"]);
|
||||
$data['APP_TITLE'] = G::replaceDataField($data['APP_TITLE'], $aData['APP_DATA']);
|
||||
$data['APP_TITLE'] = G::replaceDataField($data['APP_TITLE'], $aData['APP_DATA'], 'mysql', false);
|
||||
}
|
||||
if ($isSelfService) {
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
|
||||
@@ -508,29 +508,20 @@ class OutputDocument extends BaseOutputDocument
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Generate the output document
|
||||
*
|
||||
* @param string $outDocUid
|
||||
* @param array $caseFields
|
||||
* @param string $path
|
||||
* @param string $filename
|
||||
* @param string $content
|
||||
* @param bool $landscape
|
||||
* @param string $typeDocsToGen
|
||||
* @param array $properties
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @see workflow/engine/methods/cases/cases_Step.php
|
||||
* @see workflow/engine/classes/class.pmFunctions.php:PMFGenerateOutputDocument()
|
||||
* @param string $sUID
|
||||
* @param array $aFields
|
||||
* @param string $sPath
|
||||
* @return variant
|
||||
*/
|
||||
public function generate($outDocUid, $caseFields, $path, $filename, $content, $landscape = false, $typeDocsToGen = 'BOTH', $properties = [])
|
||||
{
|
||||
if (($outDocUid != '') && is_array($caseFields) && ($path != '')) {
|
||||
$content = G::replaceDataGridField($content, $caseFields, true, true);
|
||||
|
||||
if (strpos($content, '<!---{') !== false) {
|
||||
public function generate($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $sTypeDocToGener = 'BOTH', $aProperties = array())
|
||||
{
|
||||
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
|
||||
$sContent = G::replaceDataGridField($sContent, $aFields);
|
||||
|
||||
if (strpos($sContent, '<!---{') !== false) {
|
||||
$template = new Smarty();
|
||||
$template->compile_dir = PATH_SMARTY_C;
|
||||
$template->cache_dir = PATH_SMARTY_CACHE;
|
||||
@@ -538,20 +529,20 @@ class OutputDocument extends BaseOutputDocument
|
||||
$template->caching = false;
|
||||
$template->left_delimiter = '<!---{';
|
||||
$template->right_delimiter = '}--->';
|
||||
$fp = fopen($path . $filename . '_smarty.html', 'wb');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
$template->templateFile = $path . $filename . '_smarty.html';
|
||||
$oFile = fopen($sPath . $sFilename . '_smarty.html', 'wb');
|
||||
fwrite($oFile, $sContent);
|
||||
fclose($oFile);
|
||||
$template->templateFile = $sPath . $sFilename . '_smarty.html';
|
||||
//assign the variables and use the template $template
|
||||
$template->assign($caseFields);
|
||||
$content = $template->fetch($template->templateFile);
|
||||
$template->assign($aFields);
|
||||
$sContent = $template->fetch($template->templateFile);
|
||||
unlink($template->templateFile);
|
||||
}
|
||||
|
||||
G::verifyPath($path, true);
|
||||
G::verifyPath($sPath, true);
|
||||
|
||||
//Start - Create .doc
|
||||
$fp = fopen($path . $filename . '.doc', 'wb');
|
||||
$oFile = fopen($sPath . $sFilename . '.doc', 'wb');
|
||||
|
||||
$size = [];
|
||||
$size["Letter"] = "216mm 279mm";
|
||||
@@ -575,7 +566,6 @@ class OutputDocument extends BaseOutputDocument
|
||||
$size["Screenshot800"] = "800mm 600mm";
|
||||
$size["Screenshot1024"] = "1024mm 768mm";
|
||||
|
||||
$sizeLandscape = [];
|
||||
$sizeLandscape["Letter"] = "279mm 216mm";
|
||||
$sizeLandscape["Legal"] = "357mm 216mm";
|
||||
$sizeLandscape["Executive"] = "267mm 184mm";
|
||||
@@ -597,41 +587,41 @@ class OutputDocument extends BaseOutputDocument
|
||||
$sizeLandscape["Screenshot800"] = "600mm 800mm";
|
||||
$sizeLandscape["Screenshot1024"] = "768mm 1024mm";
|
||||
|
||||
if (!isset($properties['media'])) {
|
||||
$properties['media'] = 'Letter';
|
||||
if (!isset($aProperties['media'])) {
|
||||
$aProperties['media'] = 'Letter';
|
||||
}
|
||||
|
||||
if ($landscape) {
|
||||
$media = $sizeLandscape[$properties['media']];
|
||||
if ($sLandscape) {
|
||||
$media = $sizeLandscape[$aProperties['media']];
|
||||
} else {
|
||||
$media = $size[$properties['media']];
|
||||
$media = $size[$aProperties['media']];
|
||||
}
|
||||
|
||||
$marginLeft = '15';
|
||||
|
||||
if (isset($properties['margins']['left'])) {
|
||||
$marginLeft = $properties['margins']['left'];
|
||||
if (isset($aProperties['margins']['left'])) {
|
||||
$marginLeft = $aProperties['margins']['left'];
|
||||
}
|
||||
|
||||
$marginRight = '15';
|
||||
|
||||
if (isset($properties['margins']['right'])) {
|
||||
$marginRight = $properties['margins']['right'];
|
||||
if (isset($aProperties['margins']['right'])) {
|
||||
$marginRight = $aProperties['margins']['right'];
|
||||
}
|
||||
|
||||
$marginTop = '15';
|
||||
|
||||
if (isset($properties['margins']['top'])) {
|
||||
$marginTop = $properties['margins']['top'];
|
||||
if (isset($aProperties['margins']['top'])) {
|
||||
$marginTop = $aProperties['margins']['top'];
|
||||
}
|
||||
|
||||
$marginBottom = '15';
|
||||
|
||||
if (isset($properties['margins']['bottom'])) {
|
||||
$marginBottom = $properties['margins']['bottom'];
|
||||
if (isset($aProperties['margins']['bottom'])) {
|
||||
$marginBottom = $aProperties['margins']['bottom'];
|
||||
}
|
||||
|
||||
fwrite($fp, '<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||||
fwrite($oFile, '<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||||
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||||
xmlns="http://www.w3.org/TR/REC-html40">
|
||||
@@ -677,31 +667,31 @@ class OutputDocument extends BaseOutputDocument
|
||||
<body>
|
||||
<div class=WordSection1>');
|
||||
|
||||
fwrite($fp, $content);
|
||||
fwrite($fp, "\n</div></body></html>\n\n");
|
||||
fclose($fp);
|
||||
fwrite($oFile, $sContent);
|
||||
fwrite($oFile, "\n</div></body></html>\n\n");
|
||||
fclose($oFile);
|
||||
/* End - Create .doc */
|
||||
|
||||
if ($typeDocsToGen == 'BOTH' || $typeDocsToGen == 'PDF') {
|
||||
$fp = fopen($path . $filename . '.html', 'wb');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
if ($sTypeDocToGener == 'BOTH' || $sTypeDocToGener == 'PDF') {
|
||||
$oFile = fopen($sPath . $sFilename . '.html', 'wb');
|
||||
fwrite($oFile, $sContent);
|
||||
fclose($oFile);
|
||||
/* Start - Create .pdf */
|
||||
if (isset($properties['report_generator'])) {
|
||||
switch ($properties['report_generator']) {
|
||||
if (isset($aProperties['report_generator'])) {
|
||||
switch ($aProperties['report_generator']) {
|
||||
case 'TCPDF':
|
||||
$this->generateTcpdf($outDocUid, $caseFields, $path, $filename, $content, $landscape, $properties);
|
||||
$this->generateTcpdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
|
||||
break;
|
||||
case 'HTML2PDF':
|
||||
default:
|
||||
$this->generateHtml2ps_pdf($outDocUid, $caseFields, $path, $filename, $content, $landscape, $properties);
|
||||
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$this->generateHtml2ps_pdf($outDocUid, $caseFields, $path, $filename, $content, $landscape, $properties);
|
||||
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
|
||||
}
|
||||
}
|
||||
//end if $typeDocsToGen
|
||||
//end if $sTypeDocToGener
|
||||
/* End - Create .pdf */
|
||||
} else {
|
||||
return PEAR::raiseError(
|
||||
|
||||
@@ -746,7 +746,13 @@ class Process extends BaseProcess
|
||||
return $aProcesses;
|
||||
}
|
||||
|
||||
public function getCasesCountForProcess($pro_uid)
|
||||
/**
|
||||
* This returns the number of cases for the process.
|
||||
* @param string $pro_uid
|
||||
* @return integer
|
||||
* @see ProcessMaker\Project\Bpmn::canRemove()
|
||||
*/
|
||||
public static function getCasesCountForProcess($pro_uid)
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('COUNT(*) AS TOTAL_CASES');
|
||||
|
||||
@@ -2815,6 +2815,12 @@ msgstr "Base DN"
|
||||
msgid "Batch Routing"
|
||||
msgstr "Batch Routing"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_BATCH_ROUTING_APPLY_CHANGES
|
||||
#: LABEL/ID_BATCH_ROUTING_APPLY_CHANGES
|
||||
msgid "The modification will be applied to all rows"
|
||||
msgstr "The modification will be applied to all rows"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_BATCH_ROUTING_TABLE_ALREADY_EXISTS
|
||||
#: LABEL/ID_BATCH_ROUTING_TABLE_ALREADY_EXISTS
|
||||
@@ -23768,8 +23774,8 @@ msgstr "Setting SUPER privilege"
|
||||
# TRANSLATION
|
||||
# LABEL/ID_SETUP
|
||||
#: LABEL/ID_SETUP
|
||||
msgid "ADMIN"
|
||||
msgstr "ADMIN"
|
||||
msgid "Admin"
|
||||
msgstr "Admin"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_SETUP_MAILCONF_TITLE
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* pmTablesProxy
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
* @inherits HttpProxyController
|
||||
* @access public
|
||||
*/
|
||||
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Validation\ExceptionRestApi;
|
||||
use ProcessMaker\Validation\ValidationUploadedFiles;
|
||||
|
||||
//We need to suppress the error for the unittest that use this function
|
||||
@header("Content-type: text/html;charset=utf-8");
|
||||
|
||||
|
||||
class pmTablesProxy extends HttpProxyController
|
||||
{
|
||||
|
||||
|
||||
@@ -57271,6 +57271,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_BARS','en','Bars','2015-03-09') ,
|
||||
( 'LABEL','ID_BASE_DN','en','Base DN','2014-01-15') ,
|
||||
( 'LABEL','ID_BATCH_ROUTING','en','Batch Routing','2016-02-29') ,
|
||||
( 'LABEL','ID_BATCH_ROUTING_APPLY_CHANGES','en','The modification will be applied to all rows','2019-06-03') ,
|
||||
( 'LABEL','ID_BATCH_ROUTING_TABLE_ALREADY_EXISTS','en','The specified batch routing table already exists. The existing table will be used to store the batch routing information. Please be sure that the table has the correct batch routing configuration.','2017-03-27') ,
|
||||
( 'LABEL','ID_BEFORE','en','Before','2014-01-15') ,
|
||||
( 'LABEL','ID_BEFORE_ASSIGNMENT','en','Before Assignment','2014-01-15') ,
|
||||
@@ -60846,7 +60847,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_SETTINGS_HEARTBEAT_TITLE','en','Display Setting','2014-01-15') ,
|
||||
( 'LABEL','ID_SETTING_MESSAGE','en','The Settings tool was clicked','2014-01-15') ,
|
||||
( 'LABEL','ID_SETTING_SUPER','en','Setting SUPER privilege','2014-01-28') ,
|
||||
( 'LABEL','ID_SETUP','en','ADMIN','2014-01-15') ,
|
||||
( 'LABEL','ID_SETUP','en','Admin','2014-01-15') ,
|
||||
( 'LABEL','ID_SETUP_MAILCONF_TITLE','en','Test SMTP Connection','2014-01-15') ,
|
||||
( 'LABEL','ID_SETUP_WEBSERVICES','en','Setup','2014-01-15') ,
|
||||
( 'LABEL','ID_SET_A_TABLE_NAME','en','Set a Table Name','2014-01-15') ,
|
||||
@@ -61632,8 +61633,7 @@ INSERT INTO CONFIGURATION (CFG_UID,OBJ_UID,CFG_VALUE,PRO_UID,USR_UID,APP_UID) VA
|
||||
('MIGRATED_APP_HISTORY', 'history', 'a:1:{s:7:\"updated\";b:1;}', '', '', ''),
|
||||
('MIGRATED_CONTENT','content','a:12:{i:0;s:7:"Groupwf";i:1;s:7:"Process";i:2;s:10:"Department";i:3;s:4:"Task";i:4;s:13:"InputDocument";i:5;s:11:"Application";i:6;s:11:"AppDocument";i:7;s:8:"Dynaform";i:8;s:14:"OutputDocument";i:9;s:11:"ReportTable";i:10;s:8:"Triggers";i:11;s:41:"\\ProcessMaker\\BusinessModel\\WebEntryEvent";}','','',''),
|
||||
('MIGRATED_LIST','list','true','list','list','list'),
|
||||
('MIGRATED_LIST_UNASSIGNED','list','true','list','list','list'),
|
||||
('SKIN_CRON','','s:10:\"neoclassic\";','','','');
|
||||
('MIGRATED_LIST_UNASSIGNED','list','true','list','list','list');
|
||||
|
||||
INSERT INTO CATALOG (CAT_UID,CAT_LABEL_ID,CAT_TYPE,CAT_FLAG,CAT_OBSERVATION,CAT_CREATE_DATE,CAT_UPDATE_DATE) VALUES
|
||||
('10','ID_BARS','GRAPHIC','','','2015-03-04 00:00:00','2015-03-04 00:00:00'),
|
||||
|
||||
@@ -2,32 +2,9 @@
|
||||
/**
|
||||
* processmaker.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
* ProcessMaker main menu
|
||||
*/
|
||||
|
||||
|
||||
/*************************************
|
||||
* ---= Processmaker main menu=---
|
||||
*************************************/
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
|
||||
@@ -57,7 +34,7 @@ if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
|
||||
// ADMIN MODULE
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('SETUP', 'setup/main', strtolower(G::LoadTranslation('ID_SETUP')), '', '', '', 'x-pm-setup');
|
||||
$G_TMP_MENU->AddIdRawOption('SETUP', 'setup/main', G::LoadTranslation('ID_SETUP'), '', '', '', 'x-pm-setup');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -162,14 +162,16 @@ if ($RBAC->userCanAccess('PM_USERS') === 1) {
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1 && $RBAC->userCanAccess('PM_USERS') === 1 && $RBAC->userCanAccess
|
||||
('PM_SETUP_USERS_AUTHENTICATION_SOURCES') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_USERS') === 1 && $RBAC->userCanAccess('PM_SETUP_USERS_AUTHENTICATION_SOURCES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'AUTHSOURCES', '../authSources/authSources_List',
|
||||
G::LoadTranslation('ID_AUTH_SOURCES'),
|
||||
'', '', 'users'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users');
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('SYSTEM', '../admin/system', G::LoadTranslation('ID_SYSTEM'), '', '', 'settings');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'INFORMATION', '../setup/systemInfo?option=processInfo',
|
||||
|
||||
@@ -116,7 +116,9 @@ try {
|
||||
$columnSearch
|
||||
);
|
||||
} else {
|
||||
$data = Delegation::search(
|
||||
//This section is used by the community version
|
||||
$apps = new Applications();
|
||||
$data = $apps->getAll(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
|
||||
@@ -23,7 +23,7 @@ $aFields = $oCase->loadCase($appUid);
|
||||
foreach ($G_FORM->fields as $key => $val) {
|
||||
if ($fieldName == $val->name) {
|
||||
if ($G_FORM->fields[$key]->sql != null) {
|
||||
$sqlQuery = G::replaceDataField($G_FORM->fields[$key]->sql, $aFields ["APP_DATA"]);
|
||||
$sqlQuery = G::replaceDataField($G_FORM->fields[$key]->sql, $aFields ["APP_DATA"], 'mysql', false);
|
||||
}
|
||||
//$coma = "";
|
||||
//$data1 = "";
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* data_usersList.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
isset( $_POST['textFilter'] ) ? $filter = $_POST['textFilter'] : $filter = '';
|
||||
|
||||
$sDelimiter = DBAdapter::getStringDelimiter();
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
|
||||
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
|
||||
if (G::LoadSystemExist( $sDataBase )) {
|
||||
$oDataBase = new database();
|
||||
$oCriteria->addAsColumn( 'USR_COMPLETENAME', $oDataBase->concatString( "USR_LASTNAME", "' '", "USR_FIRSTNAME" ) );
|
||||
//$oCriteria->addAsColumn('USR_PHOTO', $oDataBase->concatString("'".PATH_IMAGES_ENVIRONMENT_USERS."'", "USR_UID","'.gif'"));
|
||||
}
|
||||
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_ROLE );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_DUE_DATE );
|
||||
//$oCriteria->addAsColumn('USR_VIEW', $sDelimiter . G::LoadTranslation('ID_DETAIL') . $sDelimiter);
|
||||
//$oCriteria->addAsColumn('USR_EDIT', $sDelimiter . G::LoadTranslation('ID_EDIT') . $sDelimiter);
|
||||
//$oCriteria->addAsColumn('USR_DELETE', $sDelimiter . G::LoadTranslation('ID_DELETE') . $sDelimiter);
|
||||
//$oCriteria->addAsColumn('USR_AUTH', $sDelimiter . G::LoadTranslation('ID_AUTHENTICATION') . $sDelimiter);
|
||||
//$oCriteria->addAsColumn('USR_REASSIGN', $sDelimiter . G::LoadTranslation('ID_REASSIGN_CASES') . $sDelimiter);
|
||||
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
|
||||
), Criteria::NOT_IN );
|
||||
|
||||
if ($filter != '') {
|
||||
$cc = $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE ) ) );
|
||||
$oCriteria->add( $cc );
|
||||
//echo $oCriteria->toString();
|
||||
}
|
||||
|
||||
$rs = UsersPeer::DoSelectRS( $oCriteria, Propel::getDbConnection('workflow_ro') );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$rows = Array ();
|
||||
while ($rs->next()) {
|
||||
$rows[] = $rs->getRow();
|
||||
// if (!file_exists($aux['USR_PHOTO'])) $aux['USR_PHOTO'] = 'public_html/images/user.gif';
|
||||
// $rows[] = $aux;
|
||||
}
|
||||
echo '{users: ' . G::json_encode( $rows ) . '}';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel\Cases;
|
||||
|
||||
use G;
|
||||
use OutputDocument as ClassesOutputDocument;
|
||||
use PEAR;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
@@ -595,31 +592,21 @@ class OutputDocument
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Generate the output document
|
||||
*
|
||||
* @param string $outDocUid
|
||||
* @param array $caseFields
|
||||
* @param string $path
|
||||
* @param string $filename
|
||||
* @param string $content
|
||||
* @param bool $landscape
|
||||
* @param string $typeDocsToGen
|
||||
* @param array $properties
|
||||
* @param string $application
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @see this->addCasesOutputDocument()
|
||||
* @param string $sUID
|
||||
* @param array $aFields
|
||||
* @param string $sPath
|
||||
* @return variant
|
||||
*/
|
||||
public function generate($outDocUid, $caseFields, $path, $filename, $content, $landscape = false, $typeDocsToGen = 'BOTH', $properties = [], $application = '')
|
||||
public function generate($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $sTypeDocToGener = 'BOTH', $aProperties = array(), $sApplication)
|
||||
{
|
||||
if (($outDocUid != '') && is_array($caseFields) && ($path != '')) {
|
||||
$content = G::replaceDataGridField($content, $caseFields, true, true);
|
||||
G::verifyPath($path, true);
|
||||
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
|
||||
$sContent = \G::replaceDataGridField($sContent, $aFields);
|
||||
\G::verifyPath($sPath, true);
|
||||
//Start - Create .doc
|
||||
$fp = fopen($path . $filename . '.doc', 'wb');
|
||||
$size = [];
|
||||
$oFile = fopen($sPath . $sFilename . '.doc', 'wb');
|
||||
$size = array();
|
||||
$size["Letter"] = "216mm 279mm";
|
||||
$size["Legal"] = "216mm 357mm";
|
||||
$size["Executive"] = "184mm 267mm";
|
||||
@@ -640,7 +627,6 @@ class OutputDocument
|
||||
$size["Screenshot640"] = "640mm 480mm";
|
||||
$size["Screenshot800"] = "800mm 600mm";
|
||||
$size["Screenshot1024"] = "1024mm 768mm";
|
||||
$sizeLandscape = [];
|
||||
$sizeLandscape["Letter"] = "279mm 216mm";
|
||||
$sizeLandscape["Legal"] = "357mm 216mm";
|
||||
$sizeLandscape["Executive"] = "267mm 184mm";
|
||||
@@ -661,31 +647,31 @@ class OutputDocument
|
||||
$sizeLandscape["Screenshot640"] = "480mm 640mm";
|
||||
$sizeLandscape["Screenshot800"] = "600mm 800mm";
|
||||
$sizeLandscape["Screenshot1024"] = "768mm 1024mm";
|
||||
if (!isset($properties['media'])) {
|
||||
$properties['media'] = 'Letter';
|
||||
if (!isset($aProperties['media'])) {
|
||||
$aProperties['media'] = 'Letter';
|
||||
}
|
||||
if ($landscape) {
|
||||
$media = $sizeLandscape[$properties['media']];
|
||||
if ($sLandscape) {
|
||||
$media = $sizeLandscape[$aProperties['media']];
|
||||
} else {
|
||||
$media = $size[$properties['media']];
|
||||
$media = $size[$aProperties['media']];
|
||||
}
|
||||
$marginLeft = '15';
|
||||
if (isset($properties['margins']['left'])) {
|
||||
$marginLeft = $properties['margins']['left'];
|
||||
if (isset($aProperties['margins']['left'])) {
|
||||
$marginLeft = $aProperties['margins']['left'];
|
||||
}
|
||||
$marginRight = '15';
|
||||
if (isset($properties['margins']['right'])) {
|
||||
$marginRight = $properties['margins']['right'];
|
||||
if (isset($aProperties['margins']['right'])) {
|
||||
$marginRight = $aProperties['margins']['right'];
|
||||
}
|
||||
$marginTop = '15';
|
||||
if (isset($properties['margins']['top'])) {
|
||||
$marginTop = $properties['margins']['top'];
|
||||
if (isset($aProperties['margins']['top'])) {
|
||||
$marginTop = $aProperties['margins']['top'];
|
||||
}
|
||||
$marginBottom = '15';
|
||||
if (isset($properties['margins']['bottom'])) {
|
||||
$marginBottom = $properties['margins']['bottom'];
|
||||
if (isset($aProperties['margins']['bottom'])) {
|
||||
$marginBottom = $aProperties['margins']['bottom'];
|
||||
}
|
||||
fwrite($fp, '<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||||
fwrite($oFile, '<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||||
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||||
xmlns="http://www.w3.org/TR/REC-html40">
|
||||
@@ -730,40 +716,40 @@ class OutputDocument
|
||||
</head>
|
||||
<body>
|
||||
<div class=WordSection1>');
|
||||
fwrite($fp, $content);
|
||||
fwrite($fp, "\n</div></body></html>\n\n");
|
||||
fclose($fp);
|
||||
fwrite($oFile, $sContent);
|
||||
fwrite($oFile, "\n</div></body></html>\n\n");
|
||||
fclose($oFile);
|
||||
/* End - Create .doc */
|
||||
if ($typeDocsToGen == 'BOTH' || $typeDocsToGen == 'PDF') {
|
||||
$fp = fopen($path . $filename . '.html', 'wb');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
if ($sTypeDocToGener == 'BOTH' || $sTypeDocToGener == 'PDF') {
|
||||
$oFile = fopen($sPath . $sFilename . '.html', 'wb');
|
||||
fwrite($oFile, $sContent);
|
||||
fclose($oFile);
|
||||
/* Start - Create .pdf */
|
||||
if (isset($properties['report_generator'])) {
|
||||
switch ($properties['report_generator']) {
|
||||
if (isset($aProperties['report_generator'])) {
|
||||
switch ($aProperties['report_generator']) {
|
||||
case 'TCPDF':
|
||||
$o = new ClassesOutputDocument();
|
||||
if (strlen($content) == 0) {
|
||||
$o = new \OutputDocument();
|
||||
if (strlen($sContent) == 0) {
|
||||
libxml_use_internal_errors(true);
|
||||
$o->generateTcpdf($outDocUid, $caseFields, $path, $filename, ' ', $landscape, $properties);
|
||||
$o->generateTcpdf($sUID, $aFields, $sPath, $sFilename, ' ', $sLandscape, $aProperties);
|
||||
libxml_use_internal_errors(false);
|
||||
} else {
|
||||
$o->generateTcpdf($outDocUid, $caseFields, $path, $filename, $content, $landscape, $properties);
|
||||
$o->generateTcpdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
|
||||
}
|
||||
break;
|
||||
case 'HTML2PDF':
|
||||
default:
|
||||
$this->generateHtml2ps_pdf($outDocUid, $caseFields, $path, $filename, $content, $landscape, $properties, $application);
|
||||
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties, $sApplication);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$this->generateHtml2ps_pdf($outDocUid, $caseFields, $path, $filename, $content, $landscape, $properties);
|
||||
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
|
||||
}
|
||||
}
|
||||
//end if $typeDocsToGen
|
||||
//end if $sTypeDocToGener
|
||||
/* End - Create .pdf */
|
||||
} else {
|
||||
return PEAR::raiseError(
|
||||
return \PEAR::raiseError(
|
||||
null,
|
||||
G_ERROR_USER_UID,
|
||||
null,
|
||||
|
||||
@@ -1108,7 +1108,7 @@ class Consolidated
|
||||
foreach ($G_FORM->fields as $key => $val) {
|
||||
if ($fieldName == $val->name) {
|
||||
if ($G_FORM->fields[$key]->sql != "") {
|
||||
$sqlQuery = G::replaceDataField($G_FORM->fields[$key]->sql, $aFields ["APP_DATA"]);
|
||||
$sqlQuery = G::replaceDataField($G_FORM->fields[$key]->sql, $aFields ["APP_DATA"], 'mysql', false);
|
||||
}
|
||||
if ((is_array($val->options)) && (!empty($val->options))) {
|
||||
foreach ($val->options as $key1 => $val1) {
|
||||
|
||||
@@ -522,7 +522,7 @@ class EmailEvent
|
||||
$emailTo,
|
||||
'',
|
||||
'',
|
||||
G::replaceDataField($arrayData[5], $arrayApplicationData['APP_DATA']),
|
||||
G::replaceDataField($arrayData[5], $arrayApplicationData['APP_DATA'], 'mysql', false),
|
||||
$contentFile['prf_filename'],
|
||||
[],
|
||||
[],
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \Criteria;
|
||||
use \UsersPeer;
|
||||
use \PMLicensedFeatures;
|
||||
use G;
|
||||
use Criteria;
|
||||
use PMLicensedFeatures;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use UsersPeer;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Lists
|
||||
@@ -258,6 +258,7 @@ class Lists
|
||||
|
||||
/**
|
||||
* Get counters for lists
|
||||
*
|
||||
* @param $userId
|
||||
* @return array
|
||||
*/
|
||||
@@ -271,6 +272,13 @@ class Lists
|
||||
$total = $this->$listObject->getCountList($userId, array('action' => 'draft'));
|
||||
array_push($response, (array('count' => $total, 'item' => $item)));
|
||||
break;
|
||||
case 'ListSelfService':
|
||||
$total = Delegation::countSelfService($userId);
|
||||
array_push($response, ([
|
||||
'count' => $total,
|
||||
'item' => $item
|
||||
]));
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'ListConsolidated':
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
|
||||
@@ -9,6 +9,7 @@ use Faker;
|
||||
use G;
|
||||
use GzipFile;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Foundation\Http\Kernel;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use InputFilter;
|
||||
use InstallerModule;
|
||||
@@ -1023,7 +1024,7 @@ class System
|
||||
*
|
||||
* @return array $skinListArray
|
||||
*/
|
||||
public function getSkingList()
|
||||
public static function getSkingList()
|
||||
{
|
||||
//Create Skins custom folder if it doesn't exists
|
||||
if (!is_dir(PATH_CUSTOM_SKINS)) {
|
||||
@@ -1629,5 +1630,21 @@ class System
|
||||
{
|
||||
return !empty(self::getServerHostname()) ? self::getServerHostname() : 'processmaker.com';
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize laravel database configuration
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php->check_queries_incompatibilities()
|
||||
*/
|
||||
public static function initLaravel()
|
||||
{
|
||||
config(['database.connections.workflow.host' => DB_HOST]);
|
||||
config(['database.connections.workflow.database' => DB_NAME]);
|
||||
config(['database.connections.workflow.username' => DB_USER]);
|
||||
config(['database.connections.workflow.password' => DB_PASS]);
|
||||
|
||||
app()->useStoragePath(realpath(PATH_DATA));
|
||||
app()->make(Kernel::class)->bootstrap();
|
||||
restore_error_handler();
|
||||
}
|
||||
}
|
||||
// end System class
|
||||
|
||||
@@ -300,6 +300,24 @@ abstract class Importer
|
||||
$this->preserveEmailEventConfiguration($emailEvent);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->importData["tables"]["workflow"]["dynaforms"])) {
|
||||
foreach ($this->importData["tables"]["workflow"]["dynaforms"] as &$dynaform) {
|
||||
$this->preserveDynaformId($dynaform);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->importData["tables"]["workflow"]["inputs"])) {
|
||||
foreach ($this->importData["tables"]["workflow"]["inputs"] as &$input) {
|
||||
$this->preserveInputDocumentId($input);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->importData["tables"]["workflow"]["outputs"])) {
|
||||
foreach ($this->importData["tables"]["workflow"]["outputs"] as &$output) {
|
||||
$this->preserveOutputDocumentId($output);
|
||||
}
|
||||
}
|
||||
|
||||
$objectList = $granularObj->loadObjectsListSelected($this->importData, $newObjectArray);
|
||||
if (sizeof($objectList) > 0 && $processGranulate) {
|
||||
@@ -602,6 +620,18 @@ abstract class Importer
|
||||
foreach ($arrayWorkflowTables["emailEvent"] as &$emailEvent) {
|
||||
$this->preserveEmailEventConfiguration($emailEvent);
|
||||
}
|
||||
|
||||
foreach ($arrayWorkflowTables["dynaforms"] as &$dynaform) {
|
||||
$this->preserveDynaformId($dynaform);
|
||||
}
|
||||
|
||||
foreach ($arrayWorkflowTables["inputs"] as &$input) {
|
||||
$this->preserveInputDocumentId($input);
|
||||
}
|
||||
|
||||
foreach ($arrayWorkflowTables["outputs"] as &$output) {
|
||||
$this->preserveOutputDocumentId($output);
|
||||
}
|
||||
|
||||
$this->importWfTables($arrayWorkflowTables);
|
||||
|
||||
@@ -862,6 +892,8 @@ abstract class Importer
|
||||
* Saves the current objects before import.
|
||||
*
|
||||
* @param string $proUid
|
||||
*
|
||||
* @see ProcessMaker\Importer\Importer::import()
|
||||
*/
|
||||
public function saveCurrentProcess($proUid)
|
||||
{
|
||||
@@ -873,9 +905,9 @@ abstract class Importer
|
||||
$result->tasks = $processes->getTaskRows($proUid);
|
||||
$result->abeConfigurations = $processes->getActionsByEmail($proUid);
|
||||
$result->emailEvents = $processes->getEmailEvent($proUid);
|
||||
$result->dynaforms = $processes->getDynaformRows($proUid);
|
||||
$result->inputs = $processes->getInputRows($proUid);
|
||||
$result->outputs = $processes->getOutputRows($proUid);
|
||||
$result->dynaforms = $processes->getDynaformRows($proUid, false);
|
||||
$result->inputs = $processes->getInputRows($proUid, false);
|
||||
$result->outputs = $processes->getOutputRows($proUid, false);
|
||||
|
||||
$this->setCurrentProcess($result);
|
||||
}
|
||||
@@ -948,4 +980,87 @@ abstract class Importer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore DYN_ID value for specific dynaform.
|
||||
* The value of __DYN_ID_UPDATE__ only used like a reference.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @see ProcessMaker\Importer\Importer::import()
|
||||
* @see ProcessMaker\Importer\Importer::doImport()
|
||||
* @link https://wiki.processmaker.com/3.1/Importing_and_Exporting_Projects#Importing_a_Project
|
||||
*/
|
||||
public function preserveDynaformId(&$data)
|
||||
{
|
||||
$currentProccess = $this->getCurrentProcess();
|
||||
if (!is_object($currentProccess)) {
|
||||
return;
|
||||
}
|
||||
if (!is_array($currentProccess->dynaforms)) {
|
||||
return;
|
||||
}
|
||||
foreach ($currentProccess->dynaforms as $dynaform) {
|
||||
if ($data["DYN_UID"] === $dynaform["DYN_UID"]) {
|
||||
$data["DYN_ID"] = $dynaform["DYN_ID"];
|
||||
$data["__DYN_ID_UPDATE__"] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore INP_DOC_ID value for specific input document.
|
||||
* The value of __INP_DOC_ID_UPDATE__ only used like a reference.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @see ProcessMaker\Importer\Importer::import()
|
||||
* @see ProcessMaker\Importer\Importer::doImport()
|
||||
* @link https://wiki.processmaker.com/3.1/Importing_and_Exporting_Projects#Importing_a_Project
|
||||
*/
|
||||
public function preserveInputDocumentId(&$data)
|
||||
{
|
||||
$currentProccess = $this->getCurrentProcess();
|
||||
if (!is_object($currentProccess)) {
|
||||
return;
|
||||
}
|
||||
if (!is_array($currentProccess->inputs)) {
|
||||
return;
|
||||
}
|
||||
foreach ($currentProccess->inputs as $inputDocument) {
|
||||
if ($data["INP_DOC_UID"] === $inputDocument["INP_DOC_UID"]) {
|
||||
$data["INP_DOC_ID"] = $inputDocument["INP_DOC_ID"];
|
||||
$data["__INP_DOC_ID_UPDATE__"] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore OUT_DOC_ID value for specific output document.
|
||||
* The value of __OUT_DOC_ID_UPDATE__ only used like a reference.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @see ProcessMaker\Importer\Importer::import()
|
||||
* @see ProcessMaker\Importer\Importer::doImport()
|
||||
* @link https://wiki.processmaker.com/3.1/Importing_and_Exporting_Projects#Importing_a_Project
|
||||
*/
|
||||
public function preserveOutputDocumentId(&$data)
|
||||
{
|
||||
$currentProccess = $this->getCurrentProcess();
|
||||
if (!is_object($currentProccess)) {
|
||||
return;
|
||||
}
|
||||
if (!is_array($currentProccess->outputs)) {
|
||||
return;
|
||||
}
|
||||
foreach ($currentProccess->outputs as $outputDocument) {
|
||||
if ($data["OUT_DOC_UID"] === $outputDocument["OUT_DOC_UID"]) {
|
||||
$data["OUT_DOC_ID"] = $outputDocument["OUT_DOC_ID"];
|
||||
$data["__OUT_DOC_ID_UPDATE__"] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,63 @@ class AppAssignSelfServiceValue extends Model
|
||||
protected $primaryKey = 'ID';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return the case number this belongs to
|
||||
*/
|
||||
public function appNumber()
|
||||
{
|
||||
return $this->belongsTo(Delegation::class, 'APP_NUMBER', 'APP_NUMBER');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the index this belongs to
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return $this->belongsTo(Delegation::class, 'DEL_INDEX', 'DEL_INDEX');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the task this belongs to
|
||||
*/
|
||||
public function task()
|
||||
{
|
||||
return $this->belongsTo(Task::class, 'TAS_ID', 'TAS_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cases with assignment Self-Service Value Based
|
||||
*
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getSelfServiceCasesByEvaluatePerUser($usrUid)
|
||||
{
|
||||
//Get the groups related to the user
|
||||
$groups = GroupUser::getGroups($usrUid);
|
||||
|
||||
// Build query
|
||||
$query = AppAssignSelfServiceValue::query()->select();
|
||||
$query->join('APP_ASSIGN_SELF_SERVICE_VALUE_GROUP', function ($join) {
|
||||
$join->on('APP_ASSIGN_SELF_SERVICE_VALUE.ID', '=', 'APP_ASSIGN_SELF_SERVICE_VALUE_GROUP.ID');
|
||||
});
|
||||
$query->where(function ($query) use ($usrUid, $groups) {
|
||||
//Filtering the user assigned in the task
|
||||
$query->where('APP_ASSIGN_SELF_SERVICE_VALUE_GROUP.GRP_UID', '=', $usrUid);
|
||||
if (!empty($groups)) {
|
||||
//Consider the group related to the user
|
||||
$query->orWhere(function ($query) use ($groups) {
|
||||
$query->whereIn('APP_ASSIGN_SELF_SERVICE_VALUE_GROUP.ASSIGNEE_ID', $groups);
|
||||
$query->where('APP_ASSIGN_SELF_SERVICE_VALUE_GROUP.ASSIGNEE_TYPE', '=', 2);
|
||||
});
|
||||
}
|
||||
});
|
||||
$query->distinct();
|
||||
$result = $query->get()->values()->toArray();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,5 +9,13 @@ class AppAssignSelfServiceValueGroup extends Model
|
||||
protected $table = 'APP_ASSIGN_SELF_SERVICE_VALUE_GROUP';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return the appSelfServiceValue this belongs to
|
||||
*/
|
||||
public function appSelfService()
|
||||
{
|
||||
return $this->belongsTo(AppAssignSelfServiceValue::class, 'ID', 'ID');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,79 @@ class Delegation extends Model
|
||||
return $query->where('APP_UID', '=', $appUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include open threads
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeIsThreadOpen($query)
|
||||
{
|
||||
return $query->where('DEL_THREAD_STATUS', '=', 'OPEN');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include threads without user
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeNoUserInThread($query)
|
||||
{
|
||||
return $query->where('USR_ID', '=', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include specific tasks
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param array $tasks
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeTasksIn($query, array $tasks)
|
||||
{
|
||||
return $query->whereIn('APP_DELEGATION.TAS_ID', $tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include a specific case
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $appNumber
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeCase($query, $appNumber)
|
||||
{
|
||||
return $query->where('APP_NUMBER', '=', $appNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include a specific index
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $index
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeIndex($query, $index)
|
||||
{
|
||||
return $query->where('DEL_INDEX', '=', $index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include a specific task
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $task
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeTask($query, $task)
|
||||
{
|
||||
return $query->where('APP_DELEGATION.TAS_ID', '=', $task);
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for delegations which match certain criteria
|
||||
*
|
||||
@@ -389,4 +462,47 @@ class Delegation extends Model
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the self-services cases by user
|
||||
*
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function countSelfService($usrUid)
|
||||
{
|
||||
//Get the task self services related to the user
|
||||
$taskSelfService = TaskUser::getSelfServicePerUser($usrUid);
|
||||
//Get the task self services value based related to the user
|
||||
$selfServiceValueBased = AppAssignSelfServiceValue::getSelfServiceCasesByEvaluatePerUser($usrUid);
|
||||
|
||||
//Start the query for get the cases related to the user
|
||||
$query = Delegation::query()->select('APP_NUMBER');
|
||||
//Add Join with task filtering only the type self-service
|
||||
$query->join('TASK', function ($join) {
|
||||
$join->on('APP_DELEGATION.TAS_ID', '=', 'TASK.TAS_ID')
|
||||
->where('TASK.TAS_ASSIGN_TYPE', '=', 'SELF_SERVICE');
|
||||
});
|
||||
//Filtering the open threads and without users
|
||||
$query->isThreadOpen()->noUserInThread();
|
||||
|
||||
//Get the cases unassigned
|
||||
if (!empty($selfServiceValueBased)) {
|
||||
$query->where(function ($query) use ($selfServiceValueBased, $taskSelfService) {
|
||||
//Get the cases related to the task self service
|
||||
$query->tasksIn($taskSelfService);
|
||||
foreach ($selfServiceValueBased as $case) {
|
||||
//Get the cases related to the task self service value based
|
||||
$query->orWhere(function ($query) use ($case) {
|
||||
$query->case($case['APP_NUMBER'])->index($case['DEL_INDEX'])->task($case['TAS_ID']);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//Get the cases related to the task self service
|
||||
$query->tasksIn($taskSelfService);
|
||||
}
|
||||
|
||||
return $query->count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,13 @@ use Illuminate\Support\Facades\DB;
|
||||
class Dynaform extends Model
|
||||
{
|
||||
protected $table = 'DYNAFORM';
|
||||
protected $primaryKey = "DYN_ID";
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return relation process.
|
||||
* @return object
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
return $this->belongsTo(Process::class, 'PRO_UID', 'PRO_UID');
|
||||
@@ -61,4 +66,16 @@ class Dynaform extends Model
|
||||
->where('DYNAFORM.DYN_UID', '!=', $dynUid)
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to filter an specific process
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $columns
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeProcess($query, string $proUID)
|
||||
{
|
||||
return $query->where('PRO_UID', $proUID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,53 @@ class GroupUser extends Model
|
||||
protected $table = 'GROUP_USER';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return the user this belongs to
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'USR_UID', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the group user this belongs to
|
||||
*/
|
||||
public function groupsWf()
|
||||
{
|
||||
return $this->belongsTo(Groupwf::class, 'GRP_ID', 'GRP_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to specific user
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $user
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeUser($query, $user)
|
||||
{
|
||||
return $query->where('USR_UID', '=', $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the groups from a user
|
||||
*
|
||||
* @param string $usrUid
|
||||
* @param string $column
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getGroups($usrUid, $column = 'GRP_ID')
|
||||
{
|
||||
$groups = GroupUser::query()->select(['GROUP_USER.' . $column])
|
||||
->join('GROUPWF', function ($join) use ($usrUid) {
|
||||
$join->on('GROUPWF.GRP_ID', '=', 'GROUP_USER.GRP_ID')
|
||||
->where('GROUPWF.GRP_STATUS', 'ACTIVE')
|
||||
->where('GROUP_USER.USR_UID', $usrUid);
|
||||
})->get()->values()->toArray();
|
||||
|
||||
return $groups;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,24 @@ class Groupwf extends Model
|
||||
protected $primaryKey = 'GRP_ID';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Scope a query to active groups
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('GRP_STATUS', '=', 'ACTIVE');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user this belongs to
|
||||
*/
|
||||
public function groupUsers()
|
||||
{
|
||||
return $this->belongsTo(GroupUser::class, 'GRP_ID', 'GRP_ID');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
45
workflow/engine/src/ProcessMaker/Model/InputDocument.php
Normal file
45
workflow/engine/src/ProcessMaker/Model/InputDocument.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Represents a input document object in the system.
|
||||
*/
|
||||
class InputDocument extends Model
|
||||
{
|
||||
protected $table = 'INPUT_DOCUMENT';
|
||||
protected $primaryKey = 'INP_DOC_ID';
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return relation process.
|
||||
* @return object
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
return $this->belongsTo(Process::class, 'PRO_UID', 'PRO_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get input documents by PRO_UID
|
||||
* @param string $proUid
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public static function getByProUid($proUid)
|
||||
{
|
||||
return InputDocument::where('PRO_UID', '=', $proUid)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get input document by INP_DOC_UID
|
||||
* @param type $inpDocUid
|
||||
* @return Model
|
||||
*/
|
||||
public static function getByInpDocUid($inpDocUid)
|
||||
{
|
||||
return InputDocument::where('INP_DOC_UID', '=', $inpDocUid)->first();
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,65 @@ class ListUnassigned extends Model
|
||||
return $this->belongsTo(Process::class, 'PRO_ID', 'PRO_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user this belongs to
|
||||
*/
|
||||
public function previousUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'DEL_PREVIOUS_USR_UID', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include specific tasks
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param array $tasks
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeTasksIn($query, array $tasks)
|
||||
{
|
||||
return $query->whereIn('TAS_ID', $tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include a specific case
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $appNumber
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeCase($query, $appNumber)
|
||||
{
|
||||
return $query->where('APP_NUMBER', '=', $appNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include a specific index
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $index
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeIndex($query, $index)
|
||||
{
|
||||
return $query->where('DEL_INDEX', '=', $index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include a specific task
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $task
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeTask($query, $task)
|
||||
{
|
||||
return $query->where('TAS_ID', '=', $task);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get count
|
||||
*
|
||||
@@ -42,7 +101,7 @@ class ListUnassigned extends Model
|
||||
* @param array $filters
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
*/
|
||||
public static function doCount($userUid, $filters = [])
|
||||
{
|
||||
$list = new PropelListUnassigned();
|
||||
@@ -51,6 +110,43 @@ class ListUnassigned extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the self-services cases by user
|
||||
*
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function countSelfService($usrUid)
|
||||
{
|
||||
//Get the task self services related to the user
|
||||
$taskSelfService = TaskUser::getSelfServicePerUser($usrUid);
|
||||
//Get the task self services value based related to the user
|
||||
$selfServiceValueBased = AppAssignSelfServiceValue::getSelfServiceCasesByEvaluatePerUser($usrUid);
|
||||
|
||||
//Start the query for get the cases related to the user
|
||||
$query = ListUnassigned::query()->select('APP_NUMBER');
|
||||
|
||||
//Get the cases unassigned
|
||||
if (!empty($selfServiceValueBased)) {
|
||||
$query->where(function ($query) use ($selfServiceValueBased, $taskSelfService) {
|
||||
//Get the cases related to the task self service
|
||||
$query->tasksIn($taskSelfService);
|
||||
foreach ($selfServiceValueBased as $case) {
|
||||
//Get the cases related to the task self service value based
|
||||
$query->orWhere(function ($query) use ($case) {
|
||||
$query->case($case['APP_NUMBER'])->index($case['DEL_INDEX'])->task($case['TAS_ID']);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//Get the cases related to the task self service
|
||||
$query->tasksIn($taskSelfService);
|
||||
}
|
||||
|
||||
return $query->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search data
|
||||
*
|
||||
@@ -67,4 +163,3 @@ class ListUnassigned extends Model
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
45
workflow/engine/src/ProcessMaker/Model/OutputDocument.php
Normal file
45
workflow/engine/src/ProcessMaker/Model/OutputDocument.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Represents a output document object in the system.
|
||||
*/
|
||||
class OutputDocument extends Model
|
||||
{
|
||||
protected $table = 'OUTPUT_DOCUMENT';
|
||||
protected $primaryKey = 'OUT_DOC_ID';
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return relation process.
|
||||
* @return object
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
return $this->belongsTo(Process::class, 'PRO_UID', 'PRO_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output documents by PRO_UID.
|
||||
* @param string $proUid
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public static function getByProUid($proUid)
|
||||
{
|
||||
return OutputDocument::where('PRO_UID', '=', $proUid)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output document by OUT_DOC_UID.
|
||||
* @param string $outDocUid
|
||||
* @return Model
|
||||
*/
|
||||
public static function getByOutDocUid($outDocUid)
|
||||
{
|
||||
return OutputDocument::where('OUT_DOC_UID', '=', $outDocUid)->first();
|
||||
}
|
||||
}
|
||||
27
workflow/engine/src/ProcessMaker/Model/ProcessVariables.php
Normal file
27
workflow/engine/src/ProcessMaker/Model/ProcessVariables.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProcessVariables extends Model
|
||||
{
|
||||
// Set our table name
|
||||
protected $table = 'PROCESS_VARIABLES';
|
||||
// No timestamps
|
||||
public $timestamps = false;
|
||||
//primary key
|
||||
protected $primaryKey = 'VAR_UID';
|
||||
|
||||
/**
|
||||
* Scope a query to filter an specific process
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $columns
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeProcess($query, string $proUID)
|
||||
{
|
||||
return $query->where('PRJ_UID', $proUID);
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,16 @@ class Task extends Model
|
||||
{
|
||||
return $this->hasMany(Delegation::class, 'TAS_ID', 'TAS_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include self-service
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeIsSelfService($query)
|
||||
{
|
||||
return $query->where('TAS_ASSIGN_TYPE', '=', 'SELF_SERVICE')
|
||||
->where('TAS_GROUP_VARIABLE', '=', '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,64 @@ class TaskUser extends Model
|
||||
protected $table = 'TASK_USER';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Return the task this belongs to
|
||||
*/
|
||||
public function task()
|
||||
{
|
||||
return $this->belongsTo(Task::class, 'TAS_UID', 'TAS_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user this belongs to
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'USR_UID', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the task self services related to the user
|
||||
*
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getSelfServicePerUser($usrUid)
|
||||
{
|
||||
//Get the groups related to the user
|
||||
$groups = GroupUser::getGroups($usrUid, 'GRP_UID');
|
||||
|
||||
// Build query
|
||||
$query = Task::query()->select('TAS_ID');
|
||||
//Add Join with process filtering only the active process
|
||||
$query->join('PROCESS', function ($join) {
|
||||
$join->on('PROCESS.PRO_UID', '=', 'TASK.PRO_UID')
|
||||
->where('PROCESS.PRO_STATUS', 'ACTIVE');
|
||||
});
|
||||
//Add join with with the task users
|
||||
$query->join('TASK_USER', function ($join) {
|
||||
$join->on('TASK.TAS_UID', '=', 'TASK_USER.TAS_UID')
|
||||
//We not considered the Ad-hoc
|
||||
->where('TASK_USER.TU_TYPE', '=', 1);
|
||||
});
|
||||
//Filtering only the task self-service
|
||||
$query->isSelfService();
|
||||
//Filtering the task related to the user
|
||||
$query->where(function ($query) use ($usrUid, $groups) {
|
||||
//Filtering the user assigned in the task
|
||||
$query->where('TASK_USER.USR_UID', '=', $usrUid);
|
||||
if (!empty($groups)) {
|
||||
//Consider the group related to the user
|
||||
$query->orWhere(function ($query) use ($groups) {
|
||||
$query->whereIn('TASK_USER.USR_UID', $groups);
|
||||
});
|
||||
}
|
||||
});
|
||||
$query->distinct();
|
||||
$tasks = $query->get()->values()->toArray();
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
}
|
||||
27
workflow/engine/src/ProcessMaker/Model/Triggers.php
Normal file
27
workflow/engine/src/ProcessMaker/Model/Triggers.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Triggers extends Model
|
||||
{
|
||||
// Set our table name
|
||||
protected $table = 'TRIGGERS';
|
||||
// No timestamps
|
||||
public $timestamps = false;
|
||||
//primary key
|
||||
protected $primaryKey = 'TRI_UID';
|
||||
|
||||
/**
|
||||
* Scope a query to filter an specific process
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $columns
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeProcess($query, string $proUID)
|
||||
{
|
||||
return $query->where('PRO_UID', $proUID);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class User extends Model
|
||||
{
|
||||
protected $table = "USERS";
|
||||
protected $primaryKey = 'USR_ID';
|
||||
// Our custom timestamp columns
|
||||
const CREATED_AT = 'USR_CREATE_DATE';
|
||||
const UPDATED_AT = 'USR_UPDATE_DATE';
|
||||
@@ -18,4 +19,24 @@ class User extends Model
|
||||
{
|
||||
return $this->hasMany(Delegation::class, 'USR_ID', 'USR_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user this belongs to
|
||||
*/
|
||||
public function groups()
|
||||
{
|
||||
return $this->belongsTo(GroupUser::class, 'USR_UID', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the groups from a user
|
||||
*
|
||||
* @param boolean $usrUid
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getGroups($usrUid)
|
||||
{
|
||||
return User::find($usrUid)->groups()->get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,10 +652,11 @@ class Light extends Api
|
||||
if (preg_match($this->regexNull, $newerThan)) {
|
||||
return [];
|
||||
}
|
||||
$paged = ($start === 0 && $limit === 0) ? false : true;
|
||||
|
||||
$dataList['userId'] = $this->getUserId();
|
||||
$dataList['action'] = 'unassigned';
|
||||
$dataList['paged'] = false;
|
||||
$dataList['paged'] = $paged;
|
||||
|
||||
$dataList['start'] = $start;
|
||||
$dataList['limit'] = $limit;
|
||||
@@ -682,6 +683,9 @@ class Light extends Api
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($paged === true) {
|
||||
$response = $response['data'];
|
||||
}
|
||||
$result = $this->parserDataUnassigned($response);
|
||||
|
||||
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
|
||||
|
||||
@@ -409,7 +409,7 @@ class Server implements iAuthenticate
|
||||
return $this->server;
|
||||
}
|
||||
|
||||
public function getUserId()
|
||||
public static function getUserId()
|
||||
{
|
||||
return self::$userId;
|
||||
}
|
||||
|
||||
@@ -485,33 +485,6 @@ function csrfToken()
|
||||
return isset($_SESSION['USR_CSRF_TOKEN']) ? $_SESSION['USR_CSRF_TOKEN'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a string is a valid HTML code
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @see G::replaceDataField()
|
||||
*/
|
||||
function stringIsValidHtml($string)
|
||||
{
|
||||
// To validate we use the DOMDocument class
|
||||
$doc = new DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
// Clean previous errors
|
||||
libxml_clear_errors();
|
||||
|
||||
// This line have to be silenced because if the string is not an HTML a Warning is displayed
|
||||
@$doc->loadHTML($string);
|
||||
|
||||
// Get last error parsing the HTML
|
||||
$libXmlError = libxml_get_last_error();
|
||||
|
||||
// If the attribute "textContent" is empty or exists libxml errors, is not a valid HTML
|
||||
return $doc->textContent !== '' && empty($libXmlError);
|
||||
}
|
||||
|
||||
// Methods deleted in PHP 7.x, added in this file in order to keep compatibility with old libraries included/used in ProcessMaker
|
||||
if (!function_exists('set_magic_quotes_runtime')) {
|
||||
function set_magic_quotes_runtime($value) {
|
||||
|
||||
110
workflow/engine/src/ProcessMaker/Validation/MySQL57.php
Normal file
110
workflow/engine/src/ProcessMaker/Validation/MySQL57.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Validation;
|
||||
|
||||
use ProcessMaker\Model\Dynaform;
|
||||
use ProcessMaker\Model\Process;
|
||||
use ProcessMaker\Model\ProcessVariables;
|
||||
use ProcessMaker\Model\Triggers;
|
||||
|
||||
class MySQL57
|
||||
{
|
||||
const REGEX = '/(?i)(select|\$).*?UNION.*?(select|\$).*?/ms';
|
||||
|
||||
/**
|
||||
* Checks the queries inside triggers that could have possible incompatibilities with MySQL 5.7
|
||||
*
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php->check_queries_incompatibilities()
|
||||
* @param array $processes
|
||||
* @return array
|
||||
*/
|
||||
public function checkIncompatibilityTriggers($processes)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
foreach ($processes as $process) {
|
||||
$triggerQuery = Triggers::query()->select();
|
||||
//Call the scope method to filter by process
|
||||
$triggerQuery->process($process['PRO_UID']);
|
||||
$triggers = $triggerQuery->get()->values()->toArray();
|
||||
foreach ($triggers as $trigger) {
|
||||
$resultIncompatibility = $this->analyzeQuery($trigger['TRI_WEBBOT']);
|
||||
if ($resultIncompatibility) {
|
||||
$aux = array_merge($process, $trigger);
|
||||
array_push($result, $aux);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the queries inside dynaforms that could have possible incompatibilities with MySQL 5.7
|
||||
*
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php->check_queries_incompatibilities()
|
||||
* @param array $processes
|
||||
* @return array
|
||||
*/
|
||||
public function checkIncompatibilityDynaforms($processes)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
foreach ($processes as $process) {
|
||||
$dynaformQuery = Dynaform::query()->select();
|
||||
//Call the scope method to filter by process
|
||||
$dynaformQuery->process($process['PRO_UID']);
|
||||
$dynaforms = $dynaformQuery->get()->values()->toArray();
|
||||
foreach ($dynaforms as $dynaform) {
|
||||
$resultIncompatibility = $this->analyzeQuery($dynaform['DYN_CONTENT']);
|
||||
if ($resultIncompatibility) {
|
||||
$aux = array_merge($process, $dynaform);
|
||||
array_push($result, $aux);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the queries inside variables that could have possible incompatibilities with MySQL 5.7
|
||||
*
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php->check_queries_incompatibilities()
|
||||
* @param array $processes
|
||||
* @return array
|
||||
*/
|
||||
public function checkIncompatibilityVariables($processes)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
foreach ($processes as $process) {
|
||||
$variablesQuery = ProcessVariables::query()->select();
|
||||
//Call the scope method to filter by process
|
||||
$variablesQuery->process($process['PRO_UID']);
|
||||
$variables = $variablesQuery->get()->values()->toArray();
|
||||
foreach ($variables as $variable) {
|
||||
$resultIncompatibility = $this->analyzeQuery($variable['VAR_SQL']);
|
||||
if ($resultIncompatibility) {
|
||||
$aux = array_merge($process, $variable);
|
||||
array_push($result, $aux);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyze the query using the regular expression
|
||||
*
|
||||
* @param string $query
|
||||
* @return bool
|
||||
*/
|
||||
public function analyzeQuery($query)
|
||||
{
|
||||
preg_match_all($this::REGEX, $query, $matches, PREG_SET_ORDER, 0);
|
||||
|
||||
return !empty($matches);
|
||||
}
|
||||
}
|
||||
@@ -793,7 +793,7 @@ function generateGridClassic(proUid, tasUid, dynUid) {
|
||||
if (Ext.getCmp("chk_allColumn").checked) {
|
||||
Ext.Msg.show({
|
||||
title: "",
|
||||
msg: "The modification will be applied to all rows in your selection.",
|
||||
msg: _("ID_BATCH_ROUTING_APPLY_CHANGES"),
|
||||
buttons: Ext.Msg.YESNO,
|
||||
fn: function (btn) {
|
||||
if (btn == "yes") {
|
||||
@@ -1027,7 +1027,7 @@ function generateGrid(proUid, tasUid, dynUid) {
|
||||
if (Ext.getCmp("chk_allColumn").checked) {
|
||||
Ext.Msg.show({
|
||||
title: "",
|
||||
msg: "The modification will be applied to all rows in your selection.",
|
||||
msg: _("ID_BATCH_ROUTING_APPLY_CHANGES"),
|
||||
buttons: Ext.Msg.YESNO,
|
||||
fn: function (btn) {
|
||||
if (btn == "yes") {
|
||||
|
||||
Reference in New Issue
Block a user