Al derivar de un script task y end email no envía el correo

R-1763
Process Name - limit size

R-1763
Process Name - limit size
This commit is contained in:
Dheeyi William
2016-09-01 14:51:00 -04:00
parent db477509b2
commit f59382b176
4 changed files with 37 additions and 17 deletions

View File

@@ -27,6 +27,11 @@ class PMXPublisher
return $filename;
}
/**
* @param $outputFile
* @param bool $dirName
* @return mixed|string
*/
public function truncateName($outputFile, $dirName = true)
{
$limit = 200;
@@ -34,23 +39,27 @@ class PMXPublisher
$limit = 150;
}
if ($dirName) {
if (strlen(basename($outputFile)) >= $limit) {
$lastPos = strrpos(basename($outputFile), '.');
$fileName = substr(basename($outputFile), 0, $lastPos);
$currentLocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, 'en_US.UTF-8');
$filename = basename($outputFile);
if (strlen($filename) >= $limit) {
$lastPos = strrpos($filename, '.');
$fileName = substr($filename, 0, $lastPos);
$newFileName = \G::inflect($fileName);
$excess = strlen($newFileName) - $limit;
$newFileName = substr($newFileName, 0, strlen($newFileName) - $excess);
$newFileName = substr($newFileName, 0, strlen($newFileName) - $excess - 1);
$newOutputFile = str_replace($fileName, $newFileName, $outputFile);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$newOutputFile = str_replace("/", DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, $newOutputFile);
}
$outputFile = $newOutputFile;
}
setlocale(LC_CTYPE, $currentLocale);
} else {
$outputFile = \G::inflect($outputFile);
if (strlen($outputFile) >= $limit) {
$excess = strlen($outputFile) - $limit;
$newFileName = substr($outputFile, 0, strlen($outputFile) - $excess);
$newFileName = substr($outputFile, 0, strlen($outputFile) - $excess - 1);
$outputFile = $newFileName;
}
}

View File

@@ -162,6 +162,11 @@ class XmlExporter extends Exporter
}
}
/**
* @param $outputFile
* @param bool $dirName
* @return mixed|string
*/
public function truncateName($outputFile, $dirName = true)
{
$limit = 200;
@@ -169,23 +174,27 @@ class XmlExporter extends Exporter
$limit = 150;
}
if ($dirName) {
if (strlen(basename($outputFile)) >= $limit) {
$lastPos = strrpos(basename($outputFile),'.');
$fileName = substr(basename($outputFile),0,$lastPos);
$currentLocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, 'en_US.UTF-8');
$filename = basename($outputFile);
if (strlen($filename) >= $limit) {
$lastPos = strrpos($filename, '.');
$fileName = substr($filename, 0, $lastPos);
$newFileName = \G::inflect($fileName);
$excess = strlen($newFileName) - $limit;
$newFileName = substr($newFileName,0,strlen($newFileName)-$excess);
$newFileName = substr($newFileName, 0, strlen($newFileName) - $excess - 1);
$newOutputFile = str_replace($fileName, $newFileName, $outputFile);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$newOutputFile = str_replace("/", DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, $newOutputFile);
}
$outputFile = $newOutputFile;
}
setlocale(LC_CTYPE, $currentLocale);
} else {
$outputFile = \G::inflect($outputFile);
if (strlen($outputFile) >= $limit) {
$excess = strlen($outputFile) - $limit;
$newFileName = substr($outputFile,0,strlen($outputFile)-$excess);
$newFileName = substr($outputFile, 0, strlen($outputFile) - $excess - 1);
$outputFile = $newFileName;
}
}

View File

@@ -813,9 +813,11 @@ function newProcess(params)
fieldLabel: _('ID_TITLE'),
xtype:'textfield',
width: 260,
maxLength: 100,
maskRe: /^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\...*)(\..+)?$)[^\x00-\x1f\\?*\";|/]+$/i,
allowBlank: false,
vtype: "textWithoutTags",
autoCreate: {tag: 'input', type: 'text', size: '100', autocomplete: 'off', maxlength: '100'},
listeners: {
'focus' : function(value){
document.getElementById("PRO_TITLE").onpaste = function() {