Merged in luisfernandosl/processmaker/PM-2035 (pull request #2058)
PM-2254 "Designer>Designer BPMN>Input Documents..." SOLVED
This commit is contained in:
@@ -89,10 +89,10 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Validating the format of the allowed extentions
|
//Validating the format of the allowed extentions
|
||||||
//Allowed Types has to have this format -> *.pdf, *.docx or *.* to all.
|
//Allowed Types has to have this format -> *.pdf, .xls, *.docx, *.* or .* to all.
|
||||||
$allowedTypes = explode(", ", $aData['INP_DOC_TYPE_FILE']);
|
$allowedTypes = explode(", ", $aData['INP_DOC_TYPE_FILE']);
|
||||||
foreach ($allowedTypes as $types => $val) {
|
foreach ($allowedTypes as $types => $val) {
|
||||||
if((preg_match('/^\*\.?[a-zA-Z0-9]{2,15}$/', $val)) || ($val == '*.*')){
|
if ((preg_match("/^.*\.?[a-zA-Z0-9]{2,15}$/", $val)) || ($val == "*.*") || ($val == ".*")) {
|
||||||
}else {
|
}else {
|
||||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT' );
|
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT' );
|
||||||
G::SendMessageText( $message, "ERROR" );
|
G::SendMessageText( $message, "ERROR" );
|
||||||
|
|||||||
@@ -71,7 +71,13 @@ var verifyInfo = function(oForm)
|
|||||||
allowedTypes = getField('fileTypes').value.split(", ");
|
allowedTypes = getField('fileTypes').value.split(", ");
|
||||||
|
|
||||||
for(i=0; i<allowedTypes.length; i++){
|
for(i=0; i<allowedTypes.length; i++){
|
||||||
allowed = allowedTypes[i].replace('*','').replace('.','');
|
var arrayMatch = [];
|
||||||
|
var allowed = "";
|
||||||
|
|
||||||
|
if ((arrayMatch = /^.*\.(.+)$/.exec(allowedTypes[i]))) {
|
||||||
|
allowed = arrayMatch[1];
|
||||||
|
}
|
||||||
|
|
||||||
if((allowed != '*') && (docType.toLowerCase() != allowed.toLowerCase())){
|
if((allowed != '*') && (docType.toLowerCase() != allowed.toLowerCase())){
|
||||||
flag = 1;
|
flag = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ var currentPagedTable = @#PAGED_TABLE_ID;
|
|||||||
}
|
}
|
||||||
|
|
||||||
allowedTypes = getField('INP_DOC_TYPE_FILE').value.split(", ");
|
allowedTypes = getField('INP_DOC_TYPE_FILE').value.split(", ");
|
||||||
expreg = /^\*\.?[a-zA-Z0-9]{2,15}$/;
|
expreg = /^.*\.?[a-zA-Z0-9]{2,15}$/;
|
||||||
|
|
||||||
for(i=0; i<allowedTypes.length; i++){
|
for(i=0; i<allowedTypes.length; i++){
|
||||||
atype = allowedTypes[i];
|
atype = allowedTypes[i];
|
||||||
|
|
||||||
if((atype=='*.*') || (expreg.test(atype)) ){
|
if ((atype == ".*") || (atype == "*.*") || (expreg.test(atype))) {
|
||||||
//
|
//
|
||||||
} else {
|
} else {
|
||||||
alert('@G::LoadTranslation(ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT)');
|
alert('@G::LoadTranslation(ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT)');
|
||||||
|
|||||||
Reference in New Issue
Block a user