Merged in develop (pull request #7127)
Update with develop Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
@@ -833,7 +833,7 @@ class ActionsByEmailCoreClass extends PMPlugin
|
||||
URL_KEY, true) . '&DEL_INDEX=' . G::encrypt($this->getIndex(), URL_KEY,
|
||||
true) . '&DYN_UID=' . G::encrypt($this->getItemAbeProperties('DYN_UID'), URL_KEY,
|
||||
true) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY,
|
||||
true) . '" target="_blank">Please complete this form</a>';
|
||||
true) . '" target="_blank">' . G::LoadTranslation('ID_ACTIONS_BY_EMAIL_LINK_TO_FILL_A_FORM') . '</a>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -1334,8 +1334,8 @@ class Derivation
|
||||
$aOldFields = $this->case->loadCase( $aNewCase['APPLICATION'] );
|
||||
|
||||
foreach ($aFields as $sOriginField => $sTargetField) {
|
||||
$sOriginField = trim($sOriginField, " @#%?$=");
|
||||
$sTargetField = trim($sTargetField, " @#%?$=");
|
||||
$sOriginField = trim($sOriginField, " @#%?$=&");
|
||||
$sTargetField = trim($sTargetField, " @#%?$=&");
|
||||
|
||||
$aNewFields[$sTargetField] = isset( $appFields['APP_DATA'][$sOriginField] ) ? $appFields['APP_DATA'][$sOriginField] : '';
|
||||
|
||||
@@ -1653,12 +1653,14 @@ class Derivation
|
||||
$originField = str_replace('?', '', $originField);
|
||||
$originField = str_replace('$', '', $originField);
|
||||
$originField = str_replace('=', '', $originField);
|
||||
$originField = str_replace('&', '', $originField);
|
||||
$targetField = str_replace('@', '', $targetField);
|
||||
$targetField = str_replace('#', '', $targetField);
|
||||
$targetField = str_replace('%', '', $targetField);
|
||||
$targetField = str_replace('?', '', $targetField);
|
||||
$targetField = str_replace('$', '', $targetField);
|
||||
$targetField = str_replace('=', '', $targetField);
|
||||
$targetField = str_replace('&', '', $targetField);
|
||||
$newFields[$targetField] = isset($childCaseData[$originField]) ? $childCaseData[$originField] : '';
|
||||
|
||||
if (array_key_exists($originField . '_label', $childCaseData)) {
|
||||
|
||||
@@ -27,7 +27,7 @@ class PmDynaform
|
||||
public $fields = null;
|
||||
public $isRTL = false;
|
||||
public $lang = SYS_LANG;
|
||||
public $langs = null;
|
||||
public $translations = null;
|
||||
public $onPropertyRead = "onPropertyReadFormInstance";
|
||||
public $pathRTLCss = '';
|
||||
public $record = null;
|
||||
@@ -109,6 +109,46 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the translation defined in the dynaform
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getTranslations()
|
||||
{
|
||||
return $this->translations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the translations defined in the dynaform
|
||||
*
|
||||
* @param string $dynUid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setTranslations($dynUid)
|
||||
{
|
||||
$dynaForm = ModelDynaform::getByDynUid($dynUid);
|
||||
$this->translations = empty($dynaForm->DYN_LABEL) ? null : G::json_decode($dynaForm->DYN_LABEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the labels from a specific language defined in the dynaform, if does not exist will return null
|
||||
*
|
||||
* @param string $language
|
||||
*
|
||||
* @return object|null
|
||||
*/
|
||||
public function getLabelsPo($language)
|
||||
{
|
||||
$labelsPo = null;
|
||||
if (!is_null($this->translations) && !empty($this->translations->{$language}->{'Labels'})) {
|
||||
$labelsPo = $this->translations->{$language}->{'Labels'};
|
||||
}
|
||||
|
||||
return $labelsPo;
|
||||
}
|
||||
|
||||
public function getDynaformTitle($idDynaform)
|
||||
{
|
||||
$d = new Dynaform();
|
||||
@@ -119,11 +159,13 @@ class PmDynaform
|
||||
|
||||
/**
|
||||
* Get a dynaform.
|
||||
*
|
||||
* @return array|null
|
||||
* @see ConsolidatedCases->processConsolidated()
|
||||
*
|
||||
* @see workflow/engine/methods/cases/caseConsolidated.php
|
||||
* @see ProcessMaker\BusinessModel\Cases->getCaseVariables()
|
||||
* @see PmDynaform->__construct()
|
||||
* @see ConsolidatedCases::processConsolidated()
|
||||
* @see PmDynaform::__construct()
|
||||
* @see \ProcessMaker\BusinessModel\Cases::getCaseVariables()
|
||||
*/
|
||||
public function getDynaform()
|
||||
{
|
||||
@@ -135,10 +177,10 @@ class PmDynaform
|
||||
}
|
||||
$dynaform = ModelDynaform::getByDynUid($this->fields["CURRENT_DYNAFORM"]);
|
||||
if (empty($dynaform)) {
|
||||
$this->langs = null;
|
||||
$this->translations = null;
|
||||
return null;
|
||||
}
|
||||
$this->langs = empty($dynaform->DYN_LABEL) ? null : G::json_decode($dynaform->DYN_LABEL);
|
||||
$this->translations = empty($dynaform->DYN_LABEL) ? null : G::json_decode($dynaform->DYN_LABEL);
|
||||
$this->record = (array) $dynaform;
|
||||
return $this->record;
|
||||
}
|
||||
@@ -675,14 +717,26 @@ class PmDynaform
|
||||
$this->setDataSchema($json, $this->fields["APP_DATA"][$json->name]);
|
||||
}
|
||||
}
|
||||
//languages
|
||||
// Set the language defined in the json
|
||||
if ($this->lang === null && $key === "language" && isset($json->language)) {
|
||||
$this->lang = $json->language;
|
||||
}
|
||||
if ($this->langs !== null) {
|
||||
if (($key === "label" || $key === "title" || $key === "hint" || $key === "placeholder" || $key === "validateMessage" || $key === "alternateText" || $key === "comment" || $key === "alt") && isset($this->langs->{$this->lang})) {
|
||||
$langs = $this->langs->{$this->lang}->Labels;
|
||||
foreach ($langs as $langsValue) {
|
||||
|
||||
// Get the translations related to the language
|
||||
if (!is_null($this->translations)) {
|
||||
$labelsPo = $this->getLabelsPo($this->lang);
|
||||
$translatableLabels = [
|
||||
"label",
|
||||
"title",
|
||||
"hint",
|
||||
"placeholder",
|
||||
"validateMessage",
|
||||
"alternateText",
|
||||
"comment",
|
||||
"alt"
|
||||
];
|
||||
if ((in_array($key, $translatableLabels)) && !is_null($labelsPo)) {
|
||||
foreach ($labelsPo as $langsValue) {
|
||||
if (is_object($json) && $json->{$key} === $langsValue->msgid) {
|
||||
$json->{$key} = $langsValue->msgstr;
|
||||
}
|
||||
@@ -931,7 +985,7 @@ class PmDynaform
|
||||
}
|
||||
break;
|
||||
case "subquery":
|
||||
if (strpos($sAlias, $sBaseExpr, 0) != 0) {
|
||||
if (strpos($sAlias, $sBaseExpr, 0) !== 0) {
|
||||
$select .= $sAlias;
|
||||
} else {
|
||||
$select .= $sBaseExpr . " AS " . $sAlias;
|
||||
@@ -969,7 +1023,7 @@ class PmDynaform
|
||||
. $dt[$key]["table"]
|
||||
. ($dt[$key]["table"] == $dt[$key]["alias"] ? "" : " " . $dt[$key]["alias"]) . " "
|
||||
. $dt[$key]["ref_type"] . " "
|
||||
. $dt[$key]["ref_clause"];
|
||||
. rtrim($dt[$key]["ref_clause"], " INNER");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1701,32 +1755,44 @@ class PmDynaform
|
||||
return false;
|
||||
}
|
||||
|
||||
public function searchField($dyn_uid, $field_id, $pro_uid = null)
|
||||
/**
|
||||
* This funtion will get the DYN_CONTENT from the dynaform then
|
||||
* Get the field and the properties defined, it's considerate the sub-forms
|
||||
*
|
||||
* @param string $dynUid
|
||||
* @param string $fieldId
|
||||
* @param string $proUid
|
||||
*
|
||||
* @return object
|
||||
*
|
||||
* @see \ProcessMaker\BusinessModel\Variable::executeSqlControl()
|
||||
*/
|
||||
public function searchField($dynUid, $fieldId, $proUid = null)
|
||||
{
|
||||
//get pro_uid if empty
|
||||
if (empty($pro_uid)) {
|
||||
if (empty($proUid)) {
|
||||
$a = new Criteria("workflow");
|
||||
$a->addSelectColumn(DynaformPeer::PRO_UID);
|
||||
$a->add(DynaformPeer::DYN_UID, $dyn_uid, Criteria::EQUAL);
|
||||
$a->add(DynaformPeer::DYN_UID, $dynUid, Criteria::EQUAL);
|
||||
$ds = DynaformPeer::doSelectRS($a);
|
||||
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$ds->next();
|
||||
$row = $ds->getRow();
|
||||
$pro_uid = $row["PRO_UID"];
|
||||
$proUid = $row["PRO_UID"];
|
||||
}
|
||||
//get dynaforms
|
||||
$a = new Criteria("workflow");
|
||||
$a->addSelectColumn(DynaformPeer::DYN_UID);
|
||||
$a->addSelectColumn(DynaformPeer::DYN_CONTENT);
|
||||
$a->add(DynaformPeer::PRO_UID, $pro_uid, Criteria::EQUAL);
|
||||
$a->add(DynaformPeer::PRO_UID, $proUid, Criteria::EQUAL);
|
||||
$ds = DynaformPeer::doSelectRS($a);
|
||||
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$json = new stdClass();
|
||||
$dynaforms = array();
|
||||
$dynaforms = [];
|
||||
while ($ds->next()) {
|
||||
$row = $ds->getRow();
|
||||
if ($row["DYN_UID"] === $dyn_uid) {
|
||||
if ($row["DYN_UID"] === $dynUid) {
|
||||
$json = G::json_decode($row["DYN_CONTENT"]);
|
||||
} else {
|
||||
$dynaforms[] = G::json_decode($row["DYN_CONTENT"]);
|
||||
@@ -1745,7 +1811,7 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
|
||||
return $this->jsonsf($json, $field_id);
|
||||
return $this->jsonsf($json, $fieldId);
|
||||
}
|
||||
|
||||
public function searchFieldByName($dyn_uid, $name)
|
||||
|
||||
@@ -1026,4 +1026,13 @@ class PmTable
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the folder "pmt-folder" and all the content inside
|
||||
*/
|
||||
public static function removePmtPropelFolder()
|
||||
{
|
||||
$pmtPropelFolder = PATH_DB . config('system.workspace') . PATH_SEP . 'pmt-propel';
|
||||
G::rm_dir($pmtPropelFolder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4807,9 +4807,7 @@ class Processes
|
||||
$oData->abeConfiguration = $this->getActionsByEmail($sProUid);
|
||||
$oData->elementTask = $this->getElementTaskRelation($sProUid);
|
||||
$oData->groupwfs = $this->groupwfsMerge($oData->groupwfs, $oData->processUser, "USR_UID");
|
||||
$oData->process["PRO_TYPE_PROCESS"] = "PUBLIC";
|
||||
|
||||
//Return
|
||||
return $oData;
|
||||
}
|
||||
|
||||
|
||||
@@ -1837,6 +1837,12 @@ msgstr "Actions"
|
||||
msgid "actionsByEmail.html"
|
||||
msgstr "actionsByEmail.html"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ACTIONS_BY_EMAIL_LINK_TO_FILL_A_FORM
|
||||
#: LABEL/ID_ACTIONS_BY_EMAIL_LINK_TO_FILL_A_FORM
|
||||
msgid "Please complete this form"
|
||||
msgstr "Please complete this form"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ACTIONS_BY_EMAIL_LOG
|
||||
#: LABEL/ID_ACTIONS_BY_EMAIL_LOG
|
||||
|
||||
@@ -207,6 +207,9 @@ class pmTablesProxy extends HttpProxyController
|
||||
public function save ($httpData, $alterTable = true)
|
||||
{
|
||||
try {
|
||||
// Remove temporary Propel folder used by Report Tables and PM Tables (Bug PMC-388)
|
||||
PmTable::removePmtPropelFolder();
|
||||
|
||||
$reportTable = new \ProcessMaker\BusinessModel\ReportTable();
|
||||
|
||||
return $reportTable->saveStructureOfTable((array)($httpData), $alterTable);
|
||||
@@ -816,6 +819,9 @@ class pmTablesProxy extends HttpProxyController
|
||||
|
||||
fclose($f);
|
||||
|
||||
// Remove temporary Propel folder used by Report Tables and PM Tables (Bug PMC-388)
|
||||
PmTable::removePmtPropelFolder();
|
||||
|
||||
//First Validate the file
|
||||
$reportTable = new \ProcessMaker\BusinessModel\ReportTable();
|
||||
|
||||
|
||||
@@ -57104,6 +57104,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_ACTION','en','Action','2014-01-15') ,
|
||||
( 'LABEL','ID_ACTIONS','en','Actions','2014-01-15') ,
|
||||
( 'LABEL','ID_ACTIONS_BY_EMAIL','en','actionsByEmail.html','2014-01-15') ,
|
||||
( 'LABEL','ID_ACTIONS_BY_EMAIL_LINK_TO_FILL_A_FORM','en','Please complete this form','2019-10-18') ,
|
||||
( 'LABEL','ID_ACTIONS_BY_EMAIL_LOG','en','Actions By Email Log','2016-01-12') ,
|
||||
( 'LABEL','ID_ACTION_DISABLED_TO_LOW_PERFORMANCE_1','en','This action was disabled to prevent slow browser performance. There are more than 100 records in the column definition grid.','2015-01-16') ,
|
||||
( 'LABEL','ID_ACTION_DISABLED_TO_LOW_PERFORMANCE_2','en','<br/><br/>Please perform this action with manual selection only.','2014-01-15') ,
|
||||
|
||||
@@ -385,6 +385,8 @@ class ActionsByEmail
|
||||
$emailServer = new EmailServerModel();
|
||||
$criteria = $emailServer->getEmailServer($dataRes['ABE_EMAIL_SERVER_UID']);
|
||||
$setup = !empty($criteria) ? $criteria : $emailServer->getEmailServerDefault();
|
||||
$setup['SMTPSecure'] = $setup['SMTPSECURE'];
|
||||
unset($setup['SMTPSECURE']);
|
||||
$spool = new SpoolRun();
|
||||
$spool->setConfig($setup);
|
||||
$abeCore = new ActionsByEmailCoreClass();
|
||||
|
||||
@@ -1859,6 +1859,11 @@ class Cases
|
||||
$arrayCaseVariable = array_merge($arrayCaseVariable, $dateHistory);
|
||||
}
|
||||
|
||||
// Get the SYS_LANG defined, it can be updated
|
||||
if (defined('SYS_LANG')) {
|
||||
$arrayCaseVariable['SYS_LANG'] = SYS_LANG;
|
||||
}
|
||||
|
||||
return $arrayCaseVariable;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,9 +69,9 @@ class GranularImporter
|
||||
switch ($nameObject) {
|
||||
case 'PROCESSDEFINITION':
|
||||
$objectList['PROCESSDEFINITION']['bpmn'] = isset($data['tables']['bpmn']) ? $this->structureBpmnData
|
||||
($data['tables']['bpmn']) : [];
|
||||
$objectList['PROCESSDEFINITION']['workflow'] = isset($data['tables']['workflow']) ?
|
||||
$data['tables']['workflow'] : [];
|
||||
($data['tables']['bpmn']) : [];
|
||||
$objectList['PROCESSDEFINITION']['workflow'] = isset($data['tables']['workflow']) ?
|
||||
$data['tables']['workflow'] : [];
|
||||
break;
|
||||
case 'ASSIGNMENTRULES':
|
||||
$objectList['ASSIGNMENTRULES']['tasks'] = isset($data['tables']['workflow']['tasks']) ?
|
||||
@@ -165,17 +165,16 @@ class GranularImporter
|
||||
{
|
||||
$project = $tables["project"][0];
|
||||
$diagram = $tables["diagram"][0];
|
||||
$diagram["activities"] = (isset($tables["activity"])) ? $tables["activity"] : array();
|
||||
$diagram["artifacts"] = (isset($tables["artifact"])) ? $tables["artifact"] : array();
|
||||
$diagram["events"] = (isset($tables["event"])) ? $tables["event"] : array();
|
||||
$diagram["flows"] = (isset($tables["flow"])) ? $tables["flow"] : array();
|
||||
$diagram["gateways"] = (isset($tables["gateway"])) ? $tables["gateway"] : array();
|
||||
$diagram["data"] = (isset($tables["data"])) ? $tables["data"] : array();
|
||||
$diagram["participants"] = (isset($tables["participant"])) ? $tables["participant"] : array();
|
||||
$diagram["laneset"] = (isset($tables["laneset"])) ? $tables["laneset"] : array();
|
||||
$diagram["lanes"] = (isset($tables["lane"])) ? $tables["lane"] : array();
|
||||
$diagram["activities"] = (isset($tables["activity"])) ? $tables["activity"] : [];
|
||||
$diagram["artifacts"] = (isset($tables["artifact"])) ? $tables["artifact"] : [];
|
||||
$diagram["events"] = (isset($tables["event"])) ? $tables["event"] : [];
|
||||
$diagram["flows"] = (isset($tables["flow"])) ? $tables["flow"] : [];
|
||||
$diagram["gateways"] = (isset($tables["gateway"])) ? $tables["gateway"] : [];
|
||||
$diagram["data"] = (isset($tables["data"])) ? $tables["data"] : [];
|
||||
$diagram["participants"] = (isset($tables["participant"])) ? $tables["participant"] : [];
|
||||
$diagram["laneset"] = (isset($tables["laneset"])) ? $tables["laneset"] : [];
|
||||
$diagram["lanes"] = (isset($tables["lane"])) ? $tables["lane"] : [];
|
||||
$project["diagrams"] = array($diagram);
|
||||
$project["prj_author"] = isset($this->data["usr_uid"]) ? $this->data["usr_uid"] : "00000000000000000000000000000001";
|
||||
$project["process"] = $tables["process"][0];
|
||||
return $project;
|
||||
}
|
||||
|
||||
@@ -1230,7 +1230,7 @@ class TimerEvent
|
||||
//Start Timer-Event (start new case) ///////////////////////////////////////////////////////////////////////
|
||||
$common->frontEndShow("START");
|
||||
|
||||
$this->log("START-NEW-CASES", "Date \"$datetime (UTC +00:00)\": Start new cases");
|
||||
$this->log("START-NEW-CASES", "Start new cases");
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => 'START-NEW-CASES'
|
||||
@@ -1506,7 +1506,7 @@ class TimerEvent
|
||||
|
||||
//Intermediate Catch Timer-Event (continue the case) ///////////////////////////////////////////////////////
|
||||
$action = "START-CONTINUE-CASES";
|
||||
$this->log($action, "Date \"$datetime (UTC +00:00)\": Start continue the cases");
|
||||
$this->log($action, "Start continue the cases");
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => $action
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
namespace ProcessMaker\Importer;
|
||||
|
||||
use Processes;
|
||||
use ProcessMaker\Util;
|
||||
use ProcessMaker\Project;
|
||||
use ProcessMaker\Project\Adapter;
|
||||
use ProcessMaker\BusinessModel\Migrator;
|
||||
use ProcessMaker\BusinessModel\Migrator\ImportException;
|
||||
use ProcessMaker\Model\Process;
|
||||
use ProcessMaker\Project;
|
||||
use ProcessMaker\Project\Adapter;
|
||||
use ProcessMaker\Util;
|
||||
use ProcessMaker\Util\Common;
|
||||
use ProcessPeer;
|
||||
use stdClass;
|
||||
@@ -18,7 +19,7 @@ abstract class Importer
|
||||
protected $filename = "";
|
||||
protected $saveDir = "";
|
||||
protected $metadata = array();
|
||||
protected $prjCreateUser = '';
|
||||
|
||||
/**
|
||||
* Stores the current objects before import.
|
||||
* @var object
|
||||
@@ -332,7 +333,7 @@ abstract class Importer
|
||||
$diagram = $project->getStruct($projectUid);
|
||||
$res = $project->updateFromStruct($projectUid, $diagram);
|
||||
}
|
||||
|
||||
$this->updateTheProcessOwner($projectUid);
|
||||
return $projectUid;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
@@ -341,10 +342,28 @@ abstract class Importer
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$result = $this->doImport($generateUid);
|
||||
|
||||
//Return
|
||||
$this->updateTheProcessOwner($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This updates the process owner.
|
||||
* @param string $proUid
|
||||
* @return void
|
||||
*/
|
||||
private function updateTheProcessOwner(string $proUid): void
|
||||
{
|
||||
$processOwner = $this->data["usr_uid"];
|
||||
|
||||
$currentProcess = $this->getCurrentProcess();
|
||||
if (is_object($currentProcess)) {
|
||||
$processOwner = $currentProcess->process->getProCreateUser();
|
||||
}
|
||||
$process = Process::where('PRO_UID', '=', $proUid);
|
||||
$process->update([
|
||||
'PRO_CREATE_USER' => $processOwner
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare for import, it makes all validations needed
|
||||
@@ -535,19 +554,17 @@ abstract class Importer
|
||||
// Build BPMN project struct
|
||||
$project = $tables["project"][0];
|
||||
$diagram = $tables["diagram"][0];
|
||||
$diagram["activities"] = (isset($tables["activity"]))? $tables["activity"] : array();
|
||||
$diagram["artifacts"] = (isset($tables["artifact"]))? $tables["artifact"] : array();
|
||||
$diagram["events"] = (isset($tables["event"]))? $tables["event"] : array();
|
||||
$diagram["flows"] = (isset($tables["flow"]))? $tables["flow"] : array();
|
||||
$diagram["gateways"] = (isset($tables["gateway"]))? $tables["gateway"]: array();
|
||||
$diagram["data"] = (isset($tables["data"]))? $tables["data"] : array();
|
||||
$diagram["participants"] = (isset($tables["participant"]))? $tables["participant"] : array();
|
||||
$diagram["laneset"] = (isset($tables["laneset"]))? $tables["laneset"] : array();
|
||||
$diagram["lanes"] = (isset($tables["lane"]))? $tables["lane"] : array();
|
||||
$diagram["activities"] = (isset($tables["activity"]))? $tables["activity"] : [];
|
||||
$diagram["artifacts"] = (isset($tables["artifact"]))? $tables["artifact"] : [];
|
||||
$diagram["events"] = (isset($tables["event"]))? $tables["event"] : [];
|
||||
$diagram["flows"] = (isset($tables["flow"]))? $tables["flow"] : [];
|
||||
$diagram["gateways"] = (isset($tables["gateway"]))? $tables["gateway"]: [];
|
||||
$diagram["data"] = (isset($tables["data"]))? $tables["data"] : [];
|
||||
$diagram["participants"] = (isset($tables["participant"]))? $tables["participant"] : [];
|
||||
$diagram["laneset"] = (isset($tables["laneset"]))? $tables["laneset"] : [];
|
||||
$diagram["lanes"] = (isset($tables["lane"]))? $tables["lane"] : [];
|
||||
$project["diagrams"] = array($diagram);
|
||||
$project["prj_author"] = isset($this->data["usr_uid"])? $this->data["usr_uid"]: "00000000000000000000000000000001";
|
||||
$project["process"] = $tables["process"][0];
|
||||
$project["prjCreateUser"] = $this->prjCreateUser;
|
||||
|
||||
return Adapter\BpmnWorkflow::createFromStruct($project, $generateUid);
|
||||
}
|
||||
@@ -839,7 +856,7 @@ abstract class Importer
|
||||
}
|
||||
}
|
||||
|
||||
public function saveAs($prj_uid, $prj_name, $prj_description, $prj_category, $prj_user = '')
|
||||
public function saveAs($prj_uid, $prj_name, $prj_description, $prj_category)
|
||||
{
|
||||
try {
|
||||
$exporter = new \ProcessMaker\Exporter\XmlExporter($prj_uid);
|
||||
@@ -857,7 +874,7 @@ abstract class Importer
|
||||
|
||||
$this->setSourceFile($outputFilename);
|
||||
$this->prepare();
|
||||
$this->prjCreateUser = $prj_user;
|
||||
|
||||
$this->importData["tables"]["bpmn"]["project"][0]["prj_name"] = $prj_name;
|
||||
$this->importData["tables"]["bpmn"]["project"][0]["prj_description"] = $prj_description;
|
||||
$this->importData["tables"]["bpmn"]["diagram"][0]["dia_name"] = $prj_name;
|
||||
@@ -869,7 +886,9 @@ abstract class Importer
|
||||
$this->importData["tables"]["workflow"]["process"][0]["PRO_UPDATE_DATE"] = null;
|
||||
$this->importData["tables"]["workflow"]["process"] = $this->importData["tables"]["workflow"]["process"][0];
|
||||
|
||||
return ['prj_uid' => $this->doImport(true, false)];
|
||||
$result = $this->doImport(true, false);
|
||||
$this->updateTheProcessOwner($result);
|
||||
return ['prj_uid' => $result];
|
||||
} catch (\Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
|
||||
@@ -14,30 +14,24 @@ class Process extends Model
|
||||
{
|
||||
// Set our table name
|
||||
protected $table = 'PROCESS';
|
||||
protected $primaryKey = 'PRO_ID';
|
||||
// Our custom timestamp columns
|
||||
const CREATED_AT = 'PRO_CREATE_DATE';
|
||||
const UPDATED_AT = 'PRO_UPDATE_DATE';
|
||||
/**
|
||||
* Retrieve all applications that belong to this process
|
||||
*/
|
||||
public function applications()
|
||||
{
|
||||
return $this->hasMany(Application::class, 'PRO_ID', 'PRO_ID');
|
||||
}
|
||||
|
||||
public function tasks()
|
||||
{
|
||||
return $this->hasMany(Task::class, 'PRO_UID', 'PRO_UID');
|
||||
return $this->belongsTo(Task::class, 'PRO_ID', 'PRO_ID');
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->hasOne(User::class, 'PRO_CREATE_USER', 'USR_UID');
|
||||
return $this->belongsTo(User::class, 'PRO_CREATE_USER', 'USR_UID');
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->hasOne(ProcessCategory::class, 'PRO_CATEGORY', 'CATEGORY_UID');
|
||||
return $this->belongsTo(ProcessCategory::class, 'PRO_CATEGORY', 'CATEGORY_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,10 +99,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$wpData["PRO_STATUS"] = $data["PRO_STATUS"];
|
||||
}
|
||||
|
||||
if (array_key_exists("PRO_CREATE_USER", $data)) {
|
||||
$wpData["PRO_CREATE_USER"] = $data["PRO_CREATE_USER"];
|
||||
}
|
||||
|
||||
$this->wp = new Project\Workflow();
|
||||
$this->wp->create($wpData);
|
||||
|
||||
@@ -1312,10 +1308,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$data["PRO_STATUS"] = $projectData['pro_status'];
|
||||
}
|
||||
|
||||
if (!empty($projectData['prjCreateUser'])) {
|
||||
$data["PRO_CREATE_USER"] = $projectData['prjCreateUser'];
|
||||
}
|
||||
|
||||
$bwp->create($data);
|
||||
|
||||
$diagramData = $processData = array();
|
||||
|
||||
@@ -277,7 +277,8 @@ class Project extends Api
|
||||
public function doSaveAs($prj_uid, $prj_name, $prj_description = null, $prj_category = null)
|
||||
{
|
||||
$importer = new \ProcessMaker\Importer\XmlImporter();
|
||||
return $importer->saveAs($prj_uid, $prj_name, $prj_description, $prj_category, $this->getUserId());
|
||||
$importer->setData("usr_uid", $this->getUserId());
|
||||
return $importer->saveAs($prj_uid, $prj_name, $prj_description, $prj_category);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -181,7 +181,7 @@ class Server implements iAuthenticate
|
||||
if (! isset($_SESSION['USER_LOGGED'])) {
|
||||
$http = \G::is_https() ? 'https' : 'http';
|
||||
$host = $http . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
|
||||
$redirect = urlencode($host.'/'.self::$workspace.$_SERVER['REQUEST_URI']);
|
||||
$redirect = urlencode('/'.self::$workspace.$_SERVER['REQUEST_URI']);
|
||||
|
||||
$loginLink = sprintf('%s/sys%s/%s/%s/login/login?u=%s', $host, config("system.workspace"), SYS_LANG, SYS_SKIN, $redirect);
|
||||
header('location: ' . $loginLink);
|
||||
|
||||
@@ -453,7 +453,7 @@ Ext.onReady(function(){
|
||||
color = r.get('PRO_STATUS') == 'ACTIVE'? 'green': 'red';
|
||||
return String.format("<font color='{0}'>{1}</font>", color, v);
|
||||
}},
|
||||
{header: _('ID_PRO_USER'), dataIndex: 'PRO_CREATE_USER_LABEL', width: 150},
|
||||
{header: _('ID_OWNER'), dataIndex: 'PRO_CREATE_USER_LABEL', width: 150},
|
||||
{header: _('ID_PRO_CREATE_DATE'), dataIndex: 'PRO_CREATE_DATE', width: 90},
|
||||
{header: _('ID_INBOX'), dataIndex: 'CASES_COUNT_TO_DO', width: 50, align:'right'},
|
||||
{header: _('ID_DRAFT'), dataIndex: 'CASES_COUNT_DRAFT', width: 50, align:'right'},
|
||||
|
||||
Reference in New Issue
Block a user