BUG 13942 Mala generacion de output document Processmaker 2.5.2 SOLVED
- Los saltos de linea no estaban siendo parseados correctamente debido a un cambio previo en la version 2.5.2 - Se repuso y adapto parte del codigo que hacia el cambio de los saltos de linea
This commit is contained in:
@@ -1727,7 +1727,7 @@ class G
|
|||||||
* @param type Array $aFields
|
* @param type Array $aFields
|
||||||
* @return type String
|
* @return type String
|
||||||
*/
|
*/
|
||||||
public function replaceDataGridField($sContent, $aFields)
|
public function replaceDataGridField($sContent, $aFields, $nl2brRecursive = true)
|
||||||
{
|
{
|
||||||
$nrt = array("\n", "\r", "\t");
|
$nrt = array("\n", "\r", "\t");
|
||||||
$nrthtml = array("(n /)", "(r /)", "(t /)");
|
$nrthtml = array("(n /)", "(r /)", "(t /)");
|
||||||
@@ -1760,6 +1760,13 @@ class G
|
|||||||
|
|
||||||
if (isset($aFields[$grdName]) && is_array($aFields[$grdName])) {
|
if (isset($aFields[$grdName]) && is_array($aFields[$grdName])) {
|
||||||
foreach ($aFields[$grdName] as $aRow) {
|
foreach ($aFields[$grdName] as $aRow) {
|
||||||
|
if ($nl2brRecursive) {
|
||||||
|
foreach ($aRow as $sKey => $vValue) {
|
||||||
|
if (!is_array($vValue)) {
|
||||||
|
$aRow[$sKey] = nl2br($aRow[$sKey]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$strData = $strData . G::replaceDataField($arrayMatch2[2], $aRow);
|
$strData = $strData . G::replaceDataField($arrayMatch2[2], $aRow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1778,6 +1785,14 @@ class G
|
|||||||
|
|
||||||
$sContent = $strContentAux;
|
$sContent = $strContentAux;
|
||||||
|
|
||||||
|
if ($nl2brRecursive) {
|
||||||
|
foreach ($aFields as $sKey => $vValue) {
|
||||||
|
if (!is_array($vValue)) {
|
||||||
|
$aFields[$sKey] = nl2br($aFields[$sKey]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sContent = G::replaceDataField($sContent, $aFields);
|
$sContent = G::replaceDataField($sContent, $aFields);
|
||||||
|
|
||||||
return $sContent;
|
return $sContent;
|
||||||
@@ -5219,7 +5234,7 @@ class G
|
|||||||
return in_array(strtolower($functionName), $allFunctions['user']);
|
return in_array(strtolower($functionName), $allFunctions['user']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for inputFilter class. Only first parameter is required.
|
* Constructor for inputFilter class. Only first parameter is required.
|
||||||
* @access constructor
|
* @access constructor
|
||||||
* @data Mixed - input string/array-of-string to be 'cleaned'
|
* @data Mixed - input string/array-of-string to be 'cleaned'
|
||||||
@@ -5235,11 +5250,11 @@ class G
|
|||||||
$filtro = new InputFilter($tagsArray , $attrArray, $tagsMethod, $attrMethod, $xssAuto);
|
$filtro = new InputFilter($tagsArray , $attrArray, $tagsMethod, $attrMethod, $xssAuto);
|
||||||
return $filtro->process($data);
|
return $filtro->process($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a message in the log file, if the file size exceeds
|
* Stores a message in the log file, if the file size exceeds
|
||||||
* specified log file is renamed and a new one is created.
|
* specified log file is renamed and a new one is created.
|
||||||
*
|
*
|
||||||
* @param type $message
|
* @param type $message
|
||||||
* @param type $pathData
|
* @param type $pathData
|
||||||
* @param type $file
|
* @param type $file
|
||||||
@@ -5248,9 +5263,9 @@ class G
|
|||||||
{
|
{
|
||||||
$config = System::getSystemConfiguration();
|
$config = System::getSystemConfiguration();
|
||||||
G::LoadSystem('logger');
|
G::LoadSystem('logger');
|
||||||
|
|
||||||
$oLogger =& Logger::getSingleton($pathData, PATH_SEP, $file);
|
$oLogger =& Logger::getSingleton($pathData, PATH_SEP, $file);
|
||||||
$oLogger->limitFile = $config['number_log_file'];
|
$oLogger->limitFile = $config['number_log_file'];
|
||||||
$oLogger->limitSize = $config['size_log_file'];
|
$oLogger->limitSize = $config['size_log_file'];
|
||||||
$oLogger->write($message);
|
$oLogger->write($message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
public function generate($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $sTypeDocToGener = 'BOTH', $aProperties = array())
|
public function generate($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $sTypeDocToGener = 'BOTH', $aProperties = array())
|
||||||
{
|
{
|
||||||
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
|
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
|
||||||
$sContent = nl2br(G::replaceDataGridField($sContent, $aFields));
|
$sContent = G::replaceDataGridField($sContent, $aFields);
|
||||||
|
|
||||||
G::verifyPath($sPath, true);
|
G::verifyPath($sPath, true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user