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

View File

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