diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index f23a6751e..d7a6ebf29 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -1108,10 +1108,18 @@ function G_Text(form, element, name) break; case 46: case 45: - newValue = currentValue.substring(0, cursorStart); - newValue += currentValue.substring(cursorEnd + 1, currentValue.length); - newCursor = cursorStart; - break; + if (me.validate != "Email") { + newValue = currentValue.substring(0, cursorStart); + newValue += currentValue.substring(cursorEnd + 1, currentValue.length); + newCursor = cursorStart; + } else { + newKey = String.fromCharCode(keyCode); + newValue = currentValue.substring(0, cursorStart); + newValue += newKey; + newValue += currentValue.substring(cursorEnd, currentValue.length); + newCursor = cursorStart + 1; + } + break; case 256: newValue = currentValue.substring(0, cursorStart); newValue += '.'; @@ -1173,10 +1181,16 @@ function G_Text(form, element, name) case 8: case 46: //BACKSPACE OR DELETE case 35: case 36: //HOME OR END case 37: case 38: case 39: case 40: // ARROW KEYS - if (me.validate == 'NodeName' && ((pressKey == 8) || (pressKey == 46))) { - return true; + if ((pressKey == 8 || pressKey == 46) && me.validate == "NodeName") { + return true; } + + if (pressKey == 46 && me.validate == "Email") { + return true; + } + me.applyMask(pressKey); + if ((pressKey == 8 || pressKey == 46) && (me.validate != 'Login' && me.validate != 'NodeName')) me.sendOnChange(); me.checkBrowser(); if (me.browser.name == 'Chrome' || me.browser.name == 'Safari'){ @@ -1357,7 +1371,10 @@ function G_Text(form, element, name) if (keyValid){ //APPLY MASK - if ((me.validate == "Login" || me.validate == "NodeName") && me.mask == "") return true; + if ((me.validate == "Login" || me.validate == "NodeName") && me.mask == "") { + return true; + } + if (pressKey == 46){ me.applyMask(256); //This code send [.] period to the mask } @@ -1365,7 +1382,9 @@ function G_Text(form, element, name) me.applyMask(pressKey); } - if (updateOnChange) me.sendOnChange(); + if (updateOnChange) { + me.sendOnChange(); + } } if (me.browser.name == 'Firefox') { @@ -1473,10 +1492,9 @@ function G_Text(form, element, name) } } - if(this.validate=="Email") - { - //var pat=/^[\w\_\-\.çñ]{2,255}@[\w\_\-]{2,255}\.[a-z]{1,3}\.?[a-z]{0,3}$/; - var pat=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+$/; + if (this.validate == "Email") { + var pat = /^\w+(?:[\.-]?\w+)*@\w+(?:[\.-]?\w+)*\.\w{2,6}$/; + if(!pat.test(this.element.value)) { //old|if(this.required=="0"&&this.element.value=="") { diff --git a/gulliver/js/maborak/core/maborak.js b/gulliver/js/maborak/core/maborak.js index 482ee6063..8c037f8db 100644 --- a/gulliver/js/maborak/core/maborak.js +++ b/gulliver/js/maborak/core/maborak.js @@ -1010,10 +1010,12 @@ if(tamData>=tamMask){var minusExi;for(var numI=0;newValue.length>numI;numI++){va if(!(keyCode==45||(minusExi&&tamMask>=tamData))){if(sw&&!swPeriod&&testData.indexOf(me.comma_separator)==-1){action='none';} if(!sw)action='none';}}} switch(action){case'mask':case'move':dataNewMask=me.replaceMasks(newValue,newCursor);me.element.value=dataNewMask.result;me.setSelectionRange(dataNewMask.cursor,dataNewMask.cursor);break;}} -else{currentValue=me.element.value;currentSel=me.getCursorPosition();cursorStart=currentSel.selectionStart;cursorEnd=currentSel.selectionEnd;switch(keyCode){case 8:newValue=currentValue.substring(0,cursorStart-1);newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart-1;break;case 46:case 45:newValue=currentValue.substring(0,cursorStart);newValue+=currentValue.substring(cursorEnd+1,currentValue.length);newCursor=cursorStart;break;case 256:newValue=currentValue.substring(0,cursorStart);newValue+='.';newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart+1;break;case 35:case 36:case 37:case 38:case 39:case 40:newValue=currentValue;switch(keyCode){case 36:newCursor=0;break;case 35:newCursor=currentValue.length;break;case 37:newCursor=cursorStart-1;break;case 39:newCursor=cursorStart+1;break;} +else{currentValue=me.element.value;currentSel=me.getCursorPosition();cursorStart=currentSel.selectionStart;cursorEnd=currentSel.selectionEnd;switch(keyCode){case 8:newValue=currentValue.substring(0,cursorStart-1);newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart-1;break;case 46:case 45:if(me.validate!="Email"){newValue=currentValue.substring(0,cursorStart);newValue+=currentValue.substring(cursorEnd+1,currentValue.length);newCursor=cursorStart;}else{newKey=String.fromCharCode(keyCode);newValue=currentValue.substring(0,cursorStart);newValue+=newKey;newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart+1;} +break;case 256:newValue=currentValue.substring(0,cursorStart);newValue+='.';newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart+1;break;case 35:case 36:case 37:case 38:case 39:case 40:newValue=currentValue;switch(keyCode){case 36:newCursor=0;break;case 35:newCursor=currentValue.length;break;case 37:newCursor=cursorStart-1;break;case 39:newCursor=cursorStart+1;break;} break;default:newKey=String.fromCharCode(keyCode);newValue=currentValue.substring(0,cursorStart);newValue+=newKey;newValue+=currentValue.substring(cursorEnd,currentValue.length);newCursor=cursorStart+1;break;} if(newCursor<0)newCursor=0;me.element.value=newValue;me.setSelectionRange(newCursor,newCursor);}};this.sendOnChange=function(){if(me.element.fireEvent){me.element.fireEvent("onchange");}else{var evObj=document.createEvent('HTMLEvents');evObj.initEvent('change',true,true);me.element.dispatchEvent(evObj);}};this.handleKeyDown=function(event){if(me.element.readOnly){return true;} -if(me.validate=='Any'&&me.mask=='')return true;var pressKey=(window.event)?window.event.keyCode:event.which;switch(pressKey){case 8:case 46:case 35:case 36:case 37:case 38:case 39:case 40:if(me.validate=='NodeName'&&((pressKey==8)||(pressKey==46))){return true;} +if(me.validate=='Any'&&me.mask=='')return true;var pressKey=(window.event)?window.event.keyCode:event.which;switch(pressKey){case 8:case 46:case 35:case 36:case 37:case 38:case 39:case 40:if((pressKey==8||pressKey==46)&&me.validate=="NodeName"){return true;} +if(pressKey==46&&me.validate=="Email"){return true;} me.applyMask(pressKey);if((pressKey==8||pressKey==46)&&(me.validate!='Login'&&me.validate!='NodeName'))me.sendOnChange();me.checkBrowser();if(me.browser.name=='Chrome'||me.browser.name=='Safari'){event.returnValue=false;} else{return false;} break;case 9:return true;break;default:if(me.mType=='date'||me.mType=='currency'||me.mType=='percentage'||me.validate=='Real'||me.validate=='Int'){if((48<=pressKey&&pressKey<=57)||(pressKey==109||pressKey==190||pressKey==188||pressKey==189)||(96<=pressKey&&pressKey<=111)){return true;} @@ -1035,9 +1037,10 @@ else{if(me.element.value.indexOf(',')==-1){keyValid=keyValid||(pressKey==44);}}} break;case'Alpha':patron=/[a-zA-Z]/;key=String.fromCharCode(pressKey);keyValid=patron.test(key);break;case'AlphaNum':patron=/[a-zA-Z0-9\sáéíóúäëïöüñçÇÑ�É�ÓÚÄË�ÖÜ]/;key=String.fromCharCode(pressKey);keyValid=patron.test(key);break;case'NodeName':case'Login':updateOnChange=false;if(me.getCursorPos()==0){if((pressKey>=48)&&(pressKey<=57)){keyValid=false;break;}} if((keyCode==8)&&(me.validate=='NodeName')){keyValid=true;}else{var k=new leimnud.module.validator({valid:['Login'],key:(window.event)?window.event:event,lang:(typeof(me.language)!=='undefined')?me.language:"en"});keyValid=k.result();} break;default:var k=new leimnud.module.validator({valid:[me.validate],key:(window.event)?window.event:event,lang:(typeof(me.language)!=='undefined')?me.language:"en"});keyValid=k.result();break;} -if(keyValid){if((me.validate=="Login"||me.validate=="NodeName")&&me.mask=="")return true;if(pressKey==46){me.applyMask(256);} +if(keyValid){if((me.validate=="Login"||me.validate=="NodeName")&&me.mask==""){return true;} +if(pressKey==46){me.applyMask(256);} else{me.applyMask(pressKey);} -if(updateOnChange)me.sendOnChange();} +if(updateOnChange){me.sendOnChange();}} if(me.browser.name=='Firefox'){if(keyCode==0)return true;} if(me.browser.name=='Chrome'||me.browser.name=='Safari'){event.returnValue=false;} else{return false;}}};if(this.element){this.element.onblur=function(event) @@ -1050,8 +1053,7 @@ var decimalSet=numberSet[1];var decimalCade=decimalSet.split('');var countDecima if(countDecimalNow0){fTotal=(fTotal/i).toFixed(2);oAux=document.getElementById('form {var elem;var i=0 var j=0;for(j=0;j<=aFields.length-1;j++){i=iRow||1;while((elem=document.getElementById("form["+this.sGridName+"]["+i+"]["+aFields[j].sDependentOf+"]"))){leimnud.event.add(elem,sEvent,{method:this.evaluateFormula,instance:this,args:[elem,aFields[j]],event:true});i=i+1;}}};this.setFormulas=function(aFormulas){this.aFormulas=aFormulas;this.assignFormulas(this.aFormulas,'change');};this.evaluateFormula=function(oEvent,oDOM,oField){oDOM=(oDOM?oDOM:oEvent.target||window.event.srcElement);var aAux,sAux,i,oAux;var domId=oDOM.id;var oContinue=true;aAux=oDOM.name.split('][');sAux=oField.sFormula.replace(/\+|\-|\*|\/|\(|\)|\[|\]|\{|\}|\%|\$/g,' ');sAux=sAux.replace(/^\s+|\s+$/g,'');sAux=sAux.replace(/ /g,' ');sAux=sAux.replace(/ /g,' ');sAux=sAux.replace(/ /g,' ');sAux=sAux.replace(/ /g,' ');sAux=sAux.replace(/ /g,' ');aFields=sAux.split(' ');aFields=aFields.unique();sAux=oField.sFormula;for(i=0;i1){maskDecimal=maskDecimal[1].split(".");}else{maskDecimal=maskformula.split(".");} -if(typeof maskDecimal[1]!='undefined'){maskToPut=maskDecimal[1].length;}else{maskToPut=0;}}else{maskToPut=0;} +if(typeof maskDecimal[1]!='undefined'){maskToPut=maskDecimal[1].length;}else{maskToPut=0;}}else{if(swReal==1) +maskToPut=2;else +maskToPut=0;} document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value='';this.executeEvent(document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']'),'keypress');eval("document.getElementById('"+aAux[0]+']['+aAux[1]+']['+oField.sFieldName+"]').value = ("+sAux+').toFixed('+maskToPut+');');document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value=document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value.replace(/^\s*|\s*$/g,"");if(document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value=='NaN') document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value='';var symbol=document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value.replace(/[0-9.\s]/g,'');this.executeEvent(document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']'),'keypress');document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value=document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value.replace('-','');document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value=symbol+''+document.getElementById(aAux[0]+']['+aAux[1]+']['+oField.sFieldName+']').value;if(typeof document.getElementById(domId)!='undefined'){document.getElementById(domId).focus();} if(this.aFunctions.length>0){for(i=0;i ($translation == 1)? G::LoadTranslation("ID_TASK") : "**ID_TASK**", "dataIndex" => "APP_TAS_TITLE", "width" => 120); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_PROCESS") : "**ID_PROCESS**", "dataIndex" => "APP_PRO_TITLE", "width" => 120); //$caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_SENT_BY") : "**ID_SENT_BY**", "dataIndex" => "APP_DEL_PREVIOUS_USER", "width" => 120 ); - $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CURRENT_USER") : "**ID_CURRENT_USER**", "dataIndex" => "APP_CURRENT_USER", "width" => 120, "sortable" => false); + $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CURRENT_USER") : "**ID_CURRENT_USER**", "dataIndex" => "APP_CURRENT_USER", "width" => 120, "sortable" => true); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_LAST_MODIFY") : "**ID_LAST_MODIFY**", "dataIndex" => "APP_UPDATE_DATE", "width" => 80); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_DELEGATION_DATE") : "**ID_DELEGATION_DATE**", "dataIndex" => "DEL_DELEGATE_DATE", "width" => 80); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_DUE_DATE") : "**ID_DUE_DATE**", "dataIndex" => "DEL_TASK_DUE_DATE", "width" => 80); @@ -703,7 +703,7 @@ class Configurations // extends Configuration $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_PROCESS") : "**ID_PROCESS**", "dataIndex" => "APP_PRO_TITLE", "width" => 120); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_TASK") : "**ID_TASK**", "dataIndex" => "APP_TAS_TITLE", "width" => 120); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_SENT_BY") : "**ID_SENT_BY**", "dataIndex" => "APP_DEL_PREVIOUS_USER", "width" => 90); - $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CURRENT_USER") : "**ID_CURRENT_USER**", "dataIndex" => "APP_CURRENT_USER", "width" => 90, "sortable" => false); + $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CURRENT_USER") : "**ID_CURRENT_USER**", "dataIndex" => "APP_CURRENT_USER", "width" => 90, "sortable" => true); //$caseColumns[] = array("header" => "Sent By", "dataIndex" => "APP_DEL_PREVIOUS_USER", "width" => 90); //$caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_LAST_MODIFY") : "**ID_LAST_MODIFY**", "dataIndex" => "APP_UPDATE_DATE", "width" => 110); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_PRIORITY") : "**ID_PRIORITY**", "dataIndex" => "DEL_PRIORITY", "width" => 50); @@ -740,7 +740,7 @@ class Configurations // extends Configuration $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CASE") : "**ID_CASE**", "dataIndex" => "APP_TITLE", "width" => 150); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_PROCESS") : "**ID_PROCESS**", "dataIndex" => "APP_PRO_TITLE", "width" => 120); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_TASK") : "**ID_TASK**", "dataIndex" => "APP_TAS_TITLE", "width" => 120); - $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CURRENT_USER") : "**ID_CURRENT_USER**", "dataIndex" => "APP_CURRENT_USER", "width" => 90, "sortable" => false); + $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_CURRENT_USER") : "**ID_CURRENT_USER**", "dataIndex" => "APP_CURRENT_USER", "width" => 90, "sortable" => true); //$caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_SENT_BY") : "**ID_SENT_BY**", "dataIndex" => "APP_DEL_PREVIOUS_USER", "width" => 90); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_LAST_MODIFY") : "**ID_LAST_MODIFY**", "dataIndex" => "APP_UPDATE_DATE", "width" => 110); $caseColumns[] = array("header" => ($translation == 1)? G::LoadTranslation("ID_STATUS") : "**ID_STATUS**", "dataIndex" => "APP_STATUS", "width" => 50); diff --git a/workflow/engine/classes/class.spool.php b/workflow/engine/classes/class.spool.php index 35ef63063..82bc6009d 100755 --- a/workflow/engine/classes/class.spool.php +++ b/workflow/engine/classes/class.spool.php @@ -151,6 +151,8 @@ class spoolRun $this->status = strtolower( $aData['app_msg_status'] ); } + $aData["contentTypeIsHtml"] = (isset($aData["contentTypeIsHtml"]))? $aData["contentTypeIsHtml"] : true; + $this->setData($sUID, $aData["app_msg_subject"], $aData["app_msg_from"], $aData["app_msg_to"], $aData["app_msg_body"], $aData["app_msg_date"], $aData["app_msg_cc"], $aData["app_msg_bcc"], $aData["app_msg_template"], $aData["app_msg_attach"], $aData["contentTypeIsHtml"]); }