I solved the issue PM-1939 pm-1940
This commit is contained in:
@@ -1420,11 +1420,11 @@ for(var i=0;i<this.aFields.length;i++){var fieldName='form['+sGridName+']['+curr
|
||||
if(this.aFields[i].sType!='file'&&this.aFields[i].sType!='hidden'&&document.getElementById(fieldName).focus){document.getElementById(fieldName).focus();break;}}
|
||||
if(this.onaddrow){this.onaddrow(currentRow);}};this.deleteGridRow=function(sRow,bWithoutConfirm)
|
||||
{if(leimnud.browser.isIE){if(typeof(bWithoutConfirm)=="undefined"){bWithoutConfirm=false;}
|
||||
if(this.oGrid.rows.length==2){new leimnud.module.app.alert().make({label:G_STRINGS.ID_MSG_NODELETE_GRID_ITEM,width:400,height:120});return false;}
|
||||
if(bWithoutConfirm){if(this.oGrid.rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(this.oGrid.rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),width:400,height:120,action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,width:400,height:120,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}}else{if(typeof(bWithoutConfirm)=="undefined"){bWithoutConfirm=false;}
|
||||
if(this.oGrid.rows.length==2){new leimnud.module.app.alert().make({label:G_STRINGS.ID_MSG_NODELETE_GRID_ITEM});return false;}
|
||||
if(bWithoutConfirm){if(this.oGrid.rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(this.oGrid.rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}}};this.deleteRowWC=function(oObj,aRow)
|
||||
{var sRow=new String(aRow);sRow=sRow.replace("[","");sRow=sRow.replace("]","");var iRow=Number(sRow);var iRowAux=iRow+1;var lastItem=oObj.oGrid.rows.length-2;var elemNodeName="";var elem2ParentNode;var elem2Id="";var elem2Name="";var elemAux;deleteRowOnDynaform(oObj,iRow);var i=0;while(iRowAux<=(lastItem)){for(i=1;i<oObj.oGrid.rows[iRowAux-1].cells.length;i++){var oCell1=oObj.oGrid.rows[iRowAux-1].cells[i];var oCell2=oObj.oGrid.rows[iRowAux].cells[i];elemNodeName=oCell1.innerHTML.substring(oCell1.innerHTML.indexOf("<")+1,oCell1.innerHTML.indexOf(" ")).toLowerCase();switch(elemNodeName){case"input":aObjects1=oCell1.getElementsByTagName('input');aObjects2=oCell2.getElementsByTagName('input');if(aObjects1&&aObjects2){switch(aObjects2[0].type){case"file":elem2ParentNode=aObjects2[0].parentNode;elem2Id=aObjects2[0].id;elem2Name=aObjects2[0].name;aObjects2[0].id=aObjects1[0].id;aObjects2[0].name=aObjects1[0].name;aObjects1[0].parentNode.replaceChild(aObjects2[0],aObjects1[0]);elemAux=document.createElement("input");elemAux.type="file";elemAux.setAttribute("id",elem2Id);elemAux.setAttribute("name",elem2Name);elem2ParentNode.insertBefore(elemAux,elem2ParentNode.firstChild);break;default:if(aObjects2[0].type=="checkbox"){aObjects1[0].checked=aObjects2[0].checked;}
|
||||
if(document.getElementById(this.sGridName).rows.length==2){new leimnud.module.app.alert().make({label:G_STRINGS.ID_MSG_NODELETE_GRID_ITEM,width:400,height:120});return false;}
|
||||
if(bWithoutConfirm){if(document.getElementById(this.sGridName).rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(document.getElementById(this.sGridName).rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),width:400,height:120,action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,width:400,height:120,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}}else{if(typeof(bWithoutConfirm)=="undefined"){bWithoutConfirm=false;}
|
||||
if(document.getElementById(this.sGridName).rows.length==2){new leimnud.module.app.alert().make({label:G_STRINGS.ID_MSG_NODELETE_GRID_ITEM});return false;}
|
||||
if(bWithoutConfirm){if(document.getElementById(this.sGridName).rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(document.getElementById(this.sGridName).rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}}};this.deleteRowWC=function(oObj,aRow)
|
||||
{var sRow=new String(aRow);sRow=sRow.replace("[","");sRow=sRow.replace("]","");var iRow=Number(sRow);var iRowAux=iRow+1;var lastItem=document.getElementById(this.sGridName).rows.length-2;var elemNodeName="";var elem2ParentNode;var elem2Id="";var elem2Name="";var elemAux;deleteRowOnDynaform(oObj,iRow);var i=0;while(iRowAux<=(lastItem)){for(i=1;i<document.getElementById(this.sGridName).rows[iRowAux-1].cells.length;i++){var oCell1=document.getElementById(this.sGridName).rows[iRowAux-1].cells[i];var oCell2=document.getElementById(this.sGridName).rows[iRowAux].cells[i];elemNodeName=oCell1.innerHTML.substring(oCell1.innerHTML.indexOf("<")+1,oCell1.innerHTML.indexOf(" ")).toLowerCase();switch(elemNodeName){case"input":aObjects1=oCell1.getElementsByTagName('input');aObjects2=oCell2.getElementsByTagName('input');if(aObjects1&&aObjects2){switch(aObjects2[0].type){case"file":elem2ParentNode=aObjects2[0].parentNode;elem2Id=aObjects2[0].id;elem2Name=aObjects2[0].name;aObjects2[0].id=aObjects1[0].id;aObjects2[0].name=aObjects1[0].name;aObjects1[0].parentNode.replaceChild(aObjects2[0],aObjects1[0]);elemAux=document.createElement("input");elemAux.type="file";elemAux.setAttribute("id",elem2Id);elemAux.setAttribute("name",elem2Name);elem2ParentNode.insertBefore(elemAux,elem2ParentNode.firstChild);break;default:if(aObjects2[0].type=="checkbox"){aObjects1[0].checked=aObjects2[0].checked;}
|
||||
aObjects1[0].value=aObjects2[0].value;aObjects1[0].className=aObjects2[0].className;if(typeof(aObjects1[1])!='undefined'&&typeof(aObjects2[1])!='undefined'){aObjects1[1].value=aObjects2[1].value;}
|
||||
break;}}
|
||||
aObjects=oCell1.getElementsByTagName('div');if(aObjects.length>0){if(aObjects[0]){aObjects[0].id=aObjects[0].id.replace('/\['+(iRowAux-1)+'\]/g','\['+iRowAux+'\]');aObjects[0].name=aObjects[0].id.replace('/\['+(iRowAux-1)+'\]/g','\['+iRowAux+'\]');if(aObjects[0].onclick){sAux=new String(aObjects[0].onclick);eval('aObjects[0].onclick = '+sAux.replace('/\['+(iRowAux-1)+'\]/g','\['+iRowAux+'\]')+';');}}
|
||||
@@ -1436,10 +1436,10 @@ if(swLink==1){aObjects1[0].href=aObjects2[0].href;aObjects1[0].innerHTML=aObject
|
||||
break;default:if((oCell2.innerHTML.indexOf('changeValues')==111||oCell2.innerHTML.indexOf('changeValues')==115)){break;}
|
||||
break;}}
|
||||
iRowAux++;}
|
||||
this.oGrid.deleteRow(lastItem);for(i=0;i<=this.aFields.length-1;i++){this.aElements.pop();}
|
||||
document.getElementById(this.sGridName).deleteRow(lastItem);for(i=0;i<=this.aFields.length-1;i++){this.aElements.pop();}
|
||||
var elem;if(oObj.aFunctions.length>0){for(i=0;i<=oObj.aFunctions.length-1;i++){elem=document.getElementById("form["+oObj.sGridName+"][1]["+oObj.aFunctions[i].sFieldName+"]");if(elem){switch(oObj.aFunctions[i].sFunction){case"sum":oObj.sum(false,elem);break;case"avg":oObj.avg(false,elem);break;}}}}
|
||||
if(oObj.ondeleterow){oObj.ondeleterow(iRow);}};this.clearRowWC=function(oObj,aRow)
|
||||
{var i=0;var j=0;var iAux=0;var pmLabel='';var elemNodeName='';var objects='';for(i=1;i<oObj.oGrid.rows[1].cells.length;i++){var oCell1=oObj.oGrid.rows[1].cells[i];elemNodeName=oCell1.innerHTML.substring(oCell1.innerHTML.indexOf("<")+1,oCell1.innerHTML.indexOf(" ")).toLowerCase();switch(elemNodeName){case"input":objects=oCell1.getElementsByTagName('input');if(objects[0].type=='checkbox'){document.getElementById(objects[0].id).checked=false;}else{document.getElementById(objects[0].id).value='';fieldSuggest=(objects[0].id).substring(0,(objects[0].id).length-7)+"]";if(document.getElementById(fieldSuggest)!=null){document.getElementById(fieldSuggest).value='';}}
|
||||
{var i=0;var j=0;var iAux=0;var pmLabel='';var elemNodeName='';var objects='';for(i=1;i<document.getElementById(this.sGridName).rows[1].cells.length;i++){var oCell1=document.getElementById(this.sGridName).rows[1].cells[i];elemNodeName=oCell1.innerHTML.substring(oCell1.innerHTML.indexOf("<")+1,oCell1.innerHTML.indexOf(" ")).toLowerCase();switch(elemNodeName){case"input":objects=oCell1.getElementsByTagName('input');if(objects[0].type=='checkbox'){document.getElementById(objects[0].id).checked=false;}else{document.getElementById(objects[0].id).value='';fieldSuggest=(objects[0].id).substring(0,(objects[0].id).length-7)+"]";if(document.getElementById(fieldSuggest)!=null){document.getElementById(fieldSuggest).value='';}}
|
||||
if(oObj.aFunctions.length>0){pmLabel='';for(iAux=0;iAux<=objects[0].attributes.length-1;iAux++){if(objects[0].attributes[iAux].name=="pm:label"){pmLabel=objects[0].attributes[iAux].nodeValue;break;}}
|
||||
for(j=0;j<oObj.aFunctions.length;j++){if(pmLabel!=''&&pmLabel==oObj.aFunctions[j].sFieldName){switch(oObj.aFunctions[j].sFunction){case"sum":oObj.sum(false,document.getElementById(objects[0].id));break;case"avg":oObj.avg(false,document.getElementById(objects[0].id));break;}
|
||||
break;}}}
|
||||
|
||||
@@ -950,7 +950,8 @@ var text=this.data.db.text[index];var pos=this.parent.dom.position(text.object.e
|
||||
{tt=options;var index=this.tools.getIndexOfUid(options.tas_uid);var from=this.data.db.task[index];this.data.render.deleteDerivation(options.tas_uid);var affe=options.data;from.derivation.type=options.type;for(var i=0;i<affe.length;i++)
|
||||
{from.derivation.to[i]={task:affe[i]};}
|
||||
this.data.render.lineDerivation(index);}},save:function()
|
||||
{}}.expand(this,true);this.patternPanel=function(event,index,din){var options=this.data.db.task[index];var db=this.data.db,task=db.task[index];var derivation=task.derivation.to;var vars={tas_uid:task.uid,pro_uid:this.options.uid}.concatMaborak((din)?{type:din.type,next_task:this.data.db.task[din.to].uid}:{});if(event)
|
||||
{}}.expand(this,true);this.patternPanel=function(event,index,din){var options=this.data.db.task[index];var db=this.data.db,task=db.task[index];var derivation=task.derivation.to;var vars={tas_uid:task.uid,pro_uid:this.options.uid}.concatMaborak((din)?{type:din.type,next_task:this.data.db.task[din.to].uid}:{});if(event===0||typeof(event)==='undefined'){event=window.event;}
|
||||
if(event)
|
||||
{if(typeof(this.data.db.task[index].derivation.type)=='undefined')
|
||||
{new leimnud.module.app.alert().make({label:G_STRINGS.ID_NO_DERIVATIONS_DEFINED});return false;}
|
||||
var iWidth,iHeight;switch(this.data.db.task[index].derivation.type)
|
||||
|
||||
@@ -2232,7 +2232,10 @@ var processmap=function(){
|
||||
/*
|
||||
* Aca se definen TASK inicio y TASK a la que se deriva.
|
||||
*/
|
||||
event = event || window.event;
|
||||
//In IE the event is undefined or 0
|
||||
if(event === 0 || typeof(event) === 'undefined'){
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
if (event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user