Merged in release/3.3.13 (pull request #6946)
Updating branch develop with last changes from release/3.3.13 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -91,6 +91,16 @@ class SpoolRun
|
||||
$this->appMsgUid = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fileData property
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFileData()
|
||||
{
|
||||
return $this->fileData;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all files into spool in a list
|
||||
*
|
||||
@@ -212,32 +222,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'];
|
||||
}
|
||||
@@ -818,4 +848,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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user