BUG 9288 Change the source code to permite negative numbers in currency fields (IE) SOLVED

- Don't works on IE
- Add validation for IE browser
This commit is contained in:
Julio Cesar Laura
2012-09-17 17:08:41 -04:00
parent 9f22dfafca
commit 1d351cc97d
6 changed files with 161 additions and 158 deletions

View File

@@ -1021,7 +1021,7 @@ function G_Text(form, element, name)
break; break;
case 45: case 45:
if (me.mType == 'currency') { if (me.mType == 'currency') {
newValue = currentValue.substring(0, currentValue.length); newValue = currentValue.substring(0, currentValue.length).split('');
for (var numI = 0; newValue.length > numI; numI++) { for (var numI = 0; newValue.length > numI; numI++) {
var campVal = newValue[numI]; var campVal = newValue[numI];
if ((typeof(campVal) === 'number' || typeof(campVal) === 'string') && (campVal !== '') && (!isNaN(campVal))) { if ((typeof(campVal) === 'number' || typeof(campVal) === 'string') && (campVal !== '') && (!isNaN(campVal))) {
@@ -1038,6 +1038,9 @@ function G_Text(form, element, name)
} }
} }
} }
if (newValue.join) {
newValue = newValue.join('');
}
} }
break; break;
default: default:

View File

@@ -72,7 +72,7 @@ var maborak = function(forceCssLoad){
/* create Stylesheet BEGIN */ /* create Stylesheet BEGIN */
//erik: Now the core css is available just by demand //erik: Now the core css is available just by demand
if (this.forceCssLoad === true) { if (this.forceCssLoad === true) {
console.log('cargo css'); //console.log('cargo css');
var st =$dce('link'); var st =$dce('link');
st.rel ='stylesheet'; st.rel ='stylesheet';
st.type ='text/css'; st.type ='text/css';
@@ -756,7 +756,7 @@ var maborak = function(forceCssLoad){
this.serializeToString=function(xml){ this.serializeToString=function(xml){
return xml.xml || xml.outerHTML || "Error XMLSerializer"; return xml.xml || xml.outerHTML || "Error XMLSerializer";
}; };
}; };
} }
}; };
/** /**
@@ -1114,11 +1114,11 @@ var maborak = function(forceCssLoad){
{ {
this.options = { this.options = {
zip:false zip:false
}.concat(options || {}); }.concat(options || {});
if(arguments.length<2 || !this.check()){return false;} if(arguments.length<2 || !this.check()){return false;}
this.toLoad = ((this.options.Absolute===true)?this.options.Path:file).split(","); this.toLoad = ((this.options.Absolute===true)?this.options.Path:file).split(",");
if(this.type === 'module' && (this.options.zip===true || this.parent.options.zip===true)) if(this.type === 'module' && (this.options.zip===true || this.parent.options.zip===true))
{ {
var tl = []; var tl = [];
for (var i = this.toLoad.length; i > 0; i--) for (var i = this.toLoad.length; i > 0; i--)
{ {
@@ -1618,7 +1618,7 @@ var maborak = function(forceCssLoad){
}; };
if(!DOM){return position;} if(!DOM){return position;}
//var m = parseInt(this.parent.dom.getStyle(DOM,"margin"),10) || 0; //var m = parseInt(this.parent.dom.getStyle(DOM,"margin"),10) || 0;
position.x=parseInt(DOM.offsetLeft,10); position.x=parseInt(DOM.offsetLeft,10);
position.y=parseInt(DOM.offsetTop,10); position.y=parseInt(DOM.offsetTop,10);
//alert(DOM.offsetParent); //alert(DOM.offsetParent);
@@ -1884,9 +1884,9 @@ var maborak = function(forceCssLoad){
return [window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop]; return [window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop];
}; };
this.getPageSize = function() this.getPageSize = function()
{ {
var xScroll, yScroll; var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) { if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX; xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY; yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
@@ -1896,12 +1896,12 @@ var maborak = function(forceCssLoad){
xScroll = document.body.offsetWidth; xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight; yScroll = document.body.offsetHeight;
} }
var windowWidth, windowHeight; var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer if (self.innerHeight) { // all except Explorer
if(document.documentElement.clientWidth){ if(document.documentElement.clientWidth){
windowWidth = document.documentElement.clientWidth; windowWidth = document.documentElement.clientWidth;
} else { } else {
windowWidth = self.innerWidth; windowWidth = self.innerWidth;
} }
@@ -1913,21 +1913,21 @@ var maborak = function(forceCssLoad){
} else if (document.body) { // other Explorers } else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth; windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight; windowHeight = document.body.clientHeight;
} }
// for small pages with total height less then height of the viewport // for small pages with total height less then height of the viewport
if(yScroll < windowHeight){ if(yScroll < windowHeight){
pageHeight = windowHeight; pageHeight = windowHeight;
} else { } else {
pageHeight = yScroll; pageHeight = yScroll;
} }
// for small pages with total width less then width of the viewport // for small pages with total width less then width of the viewport
if(xScroll < windowWidth){ if(xScroll < windowWidth){
pageWidth = xScroll; pageWidth = xScroll;
} else { } else {
pageWidth = windowWidth; pageWidth = windowWidth;
} }
return [pageWidth,pageHeight]; return [pageWidth,pageHeight];
}; };
this.serializer = this.parent.factory(function(DOM,obj) this.serializer = this.parent.factory(function(DOM,obj)
@@ -2000,7 +2000,7 @@ var maborak = function(forceCssLoad){
} }
} }
return this.serialized; return this.serialized;
}; };
this.select = function() this.select = function()
{ {
for(var i=0;i<this.DOM.length;i++) for(var i=0;i<this.DOM.length;i++)

View File

@@ -237,7 +237,7 @@ leimnud.Package.Public({
if(this.drop.selected!==false) if(this.drop.selected!==false)
{ {
var inp = this.drop.elements[this.drop.selected].value; var inp = this.drop.elements[this.drop.selected].value;
console.log(this.options.panel[inp]); //console.log(this.options.panel[inp]);
//console.info("========================"); //console.info("========================");
//console.info(i+":"+this.drop.selected); //console.info(i+":"+this.drop.selected);
//console.info(this.drop.elements[this.drop.selected].value); //console.info(this.drop.elements[this.drop.selected].value);

View File

@@ -127,7 +127,7 @@ leimnud.Package.Public({
if(this.options.editor.showed===true && this.options.editor.selected==b) if(this.options.editor.showed===true && this.options.editor.selected==b)
{ {
if(b=='xml') if(b=='xml')
{ {
//this.options.buttons.template.disabled=false; //this.options.buttons.template.disabled=false;
//this.options.buttons.xml.disabled=true; //this.options.buttons.xml.disabled=true;
this.options.buttons.xml.className="dbo"; this.options.buttons.xml.className="dbo";
@@ -154,8 +154,8 @@ leimnud.Package.Public({
{ {
//this.options.buttons.template.disabled=false; //this.options.buttons.template.disabled=false;
//this.options.buttons.xml.disabled=true; //this.options.buttons.xml.disabled=true;
this.options.window.textarea.value=this.xmlform.serialize().sReplace('><','>\n<'); this.options.window.textarea.value=this.xmlform.serialize().sReplace('><','>\n<');
this.options.buttons.xml.dv='1'; this.options.buttons.xml.dv='1';
this.options.buttons.template.dv='0'; this.options.buttons.template.dv='0';
this.options.buttons.xml.className="dbo"; this.options.buttons.xml.className="dbo";
@@ -241,11 +241,11 @@ leimnud.Package.Public({
this.tplSetPoints({ this.tplSetPoints({
html:t html:t
}); });
this.tplSetDropables(); this.tplSetDropables();
this.menu_root = new this.parent.module.app.menuRight(); this.menu_root = new this.parent.module.app.menuRight();
this.options.observers['menu'].register(this.menu_root.remove,this.menu_root); this.options.observers['menu'].register(this.menu_root.remove,this.menu_root);
this.menu_root.make({ this.menu_root.make({
@@ -468,12 +468,12 @@ leimnud.Package.Public({
//alert(this.tmp.t.value+":"+this.tmp.n.value+":"+this.tmp.v.value) //alert(this.tmp.t.value+":"+this.tmp.n.value+":"+this.tmp.v.value)
}.extend(this); }.extend(this);
this.options.panel.add.elements.statusBarButtons[1].onmouseup=this.options.panel.add.remove; this.options.panel.add.elements.statusBarButtons[1].onmouseup=this.options.panel.add.remove;
/*g = window.event?evt:g; /*g = window.event?evt:g;
this.add_element(this.unique_name(),true,{group:g,type:"other",ufo:7676});*/ this.add_element(this.unique_name(),true,{group:g,type:"other",ufo:7676});*/
}.extend(this,this.isPoint(dom))}, }.extend(this,this.isPoint(dom))},
{text:'New section',launch:this.add_section.args(dom)}, {text:'New section',launch:this.add_section.args(dom)},
{separator:true}, {separator:true},
@@ -487,13 +487,13 @@ leimnud.Package.Public({
*/ */
principal:function(dom) principal:function(dom)
{ {
} }
}.expand(this); }.expand(this);
this.group={ this.group={
elements:[ elements:[
{text:'New Element',launch:function(){ {text:'New Element',launch:function(){
console.log(this) //console.log(this)
}.extend(this)}, }.extend(this)},
] ]
}; };
@@ -603,7 +603,7 @@ leimnud.Package.Public({
{ {
this.tmp.pr[i].passed(); this.tmp.pr[i].passed();
s.push(v); s.push(v);
} }
} }
if(r) if(r)
{ {
@@ -644,7 +644,7 @@ leimnud.Package.Public({
//alert(this.tmp.p.length); //alert(this.tmp.p.length);
this.add_element(this.tmp.n.value.trim(),true,{group:this.tmp.g,type:this.tmp.t.value}.concat(a)); this.add_element(this.tmp.n.value.trim(),true,{group:this.tmp.g,type:this.tmp.t.value}.concat(a));
this.options.panel.add.remove();*/ this.options.panel.add.remove();*/
//alert(this.tmp.t.value+":"+this.tmp.n.value+":"+this.tmp.v.value) //alert(this.tmp.t.value+":"+this.tmp.n.value+":"+this.tmp.v.value)
}.extend(this); }.extend(this);
}; };
@@ -721,7 +721,7 @@ leimnud.Package.Public({
} }
} }
catch(e){ catch(e){
} }
this.xmlform.tag_edit(t,db_uid,this.sync_xml_node.args(db_uid)); this.xmlform.tag_edit(t,db_uid,this.sync_xml_node.args(db_uid));
return false; return false;
@@ -787,7 +787,7 @@ leimnud.Package.Public({
this.options.drag.phantom.make(); this.options.drag.phantom.make();
this.options.drag.phantom.onInit(event,0); this.options.drag.phantom.onInit(event,0);
//return false; //return false;
return false; return false;
}; };
this.reorder_element=function(event,db_uid) this.reorder_element=function(event,db_uid)
{ {
@@ -827,7 +827,7 @@ leimnud.Package.Public({
this.options.drag.phantom.make(); this.options.drag.phantom.make();
this.options.drag.phantom.onInit(event,0); this.options.drag.phantom.onInit(event,0);
//return false; //return false;
return false; return false;
}; };
this.sync_xml_node=function(data,db_uid) this.sync_xml_node=function(data,db_uid)
@@ -838,11 +838,11 @@ leimnud.Package.Public({
}; };
this.sync_dom=function(db_uid,obj) this.sync_dom=function(db_uid,obj)
{ {
}; };
this.register_groups_drop=function(group) this.register_groups_drop=function(group)
{ {
}; };
this.register_elements_drop=function(group) this.register_elements_drop=function(group)
{ {
@@ -914,7 +914,7 @@ leimnud.Package.Public({
} }
else else
{ {
} }
} }
@@ -955,10 +955,10 @@ leimnud.Package.Public({
else else
{ {
insertRowIn = drop.selected; insertRowIn = drop.selected;
begin = true; begin = true;
} }
var t = this.db[drop.elements[insertRowIn].value]; var t = this.db[drop.elements[insertRowIn].value];
// t.parentNode.insertBefore(new DOM('input').replace(this.db[db_uid])); // t.parentNode.insertBefore(new DOM('input').replace(this.db[db_uid]));
var n = t.before(new DOM('div')).replace(this.db[db_uid]); var n = t.before(new DOM('div')).replace(this.db[db_uid]);
drag.flush(); drag.flush();
new this.parent.module.fx.move().make({ new this.parent.module.fx.move().make({
@@ -995,7 +995,7 @@ leimnud.Package.Public({
this.phantom_static.remove(); this.phantom_static.remove();
delete this.phantom_static; delete this.phantom_static;
} }
}; };
/* Contar elementos en grupo */ /* Contar elementos en grupo */
@@ -1092,7 +1092,7 @@ leimnud.Package.Public({
{ {
if(get){return ['size','maxlength','defaultvalue','required','dependentfields','linkfield','other_attribute'];} if(get){return ['size','maxlength','defaultvalue','required','dependentfields','linkfield','other_attribute'];}
options={ options={
}.concat(options || {}); }.concat(options || {});
var pd; var pd;
this.options.points[options.group].append( this.options.points[options.group].append(
@@ -1108,7 +1108,7 @@ leimnud.Package.Public({
{ {
if(get){return ['other1','other2','other_attribute'];} if(get){return ['other1','other2','other_attribute'];}
options={ options={
}.concat(options || {}); }.concat(options || {});
var pd; var pd;
this.options.points[options.group].append( this.options.points[options.group].append(
@@ -1124,7 +1124,7 @@ leimnud.Package.Public({
{ {
if(get){return ['other_attribute'];} if(get){return ['other_attribute'];}
options={ options={
}.concat(options || {}); }.concat(options || {});
var pd; var pd;
this.options.points[options.group].append( this.options.points[options.group].append(

View File

@@ -1,9 +1,9 @@
/* /*
* @author: Douglas Medrano * @author: Douglas Medrano
* May 03, 2011 * May 03, 2011
*/ */
md5 = function(s,raw,hexcase,chrsz){ md5 = function(s,raw,hexcase,chrsz){
raw = raw || false; raw = raw || false;
hexcase = hexcase || false; hexcase = hexcase || false;
chrsz = chrsz || 8; chrsz = chrsz || 8;
function safe_add(x, y){ function safe_add(x, y){
@@ -29,7 +29,7 @@
function md5_ii(a, b, c, d, x, s, t){ function md5_ii(a, b, c, d, x, s, t){
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
} }
function core_md5(x, len){ function core_md5(x, len){
x[len >> 5] |= 0x80 << ((len) % 32); x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len; x[(((len + 64) >>> 9) << 4) + 14] = len;
@@ -129,7 +129,7 @@
} }
return str; return str;
} }
function binl2hex(binarray){ function binl2hex(binarray){
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = ""; var str = "";
@@ -140,30 +140,30 @@
} }
return (raw ? binl2str(core_md5(str2binl(s), s.length * chrsz)) : binl2hex(core_md5(str2binl(s), s.length * chrsz)) ); return (raw ? binl2str(core_md5(str2binl(s), s.length * chrsz)) : binl2hex(core_md5(str2binl(s), s.length * chrsz)) );
}; };
function ajaxPostRequest(url, callback_function, id){ function ajaxPostRequest(url, callback_function, id){
var d = new Date(); var d = new Date();
var time = d.getTime(); var time = d.getTime();
url= url + '&nocachetime='+time; url= url + '&nocachetime='+time;
var return_xml=false; var return_xml=false;
var http_request = false; var http_request = false;
if (window.XMLHttpRequest){ // Mozilla, Safari,... if (window.XMLHttpRequest){ // Mozilla, Safari,...
http_request = new XMLHttpRequest(); http_request = new XMLHttpRequest();
if (http_request.overrideMimeType){ if (http_request.overrideMimeType){
http_request.overrideMimeType('text/xml'); http_request.overrideMimeType('text/xml');
} }
} }
else if (window.ActiveXObject){// IE else if (window.ActiveXObject){// IE
try{ try{
http_request = new ActiveXObject("Msxml2.XMLHTTP"); http_request = new ActiveXObject("Msxml2.XMLHTTP");
} }
catch (e){ catch (e){
try{ try{
http_request = new ActiveXObject("Microsoft.XMLHTTP"); http_request = new ActiveXObject("Microsoft.XMLHTTP");
} }
catch (e){ catch (e){
} }
} }
} }
@@ -171,17 +171,17 @@
alert('This browser is not supported.'); alert('This browser is not supported.');
return false; return false;
} }
http_request.onreadystatechange = function(){ http_request.onreadystatechange = function(){
if (http_request.readyState == 4){ if (http_request.readyState == 4){
if (http_request.status == 200){ if (http_request.status == 200){
if (return_xml){ if (return_xml){
eval(callback_function + '(http_request.responseXML)'); eval(callback_function + '(http_request.responseXML)');
} }
else{ else{
eval(callback_function + '(http_request.responseText, \''+id+'\')'); eval(callback_function + '(http_request.responseText, \''+id+'\')');
} }
} }
else{ else{
alert('Error found on request:(Code: ' + http_request.status + ')'); alert('Error found on request:(Code: ' + http_request.status + ')');
} }
@@ -189,8 +189,8 @@
} }
http_request.open('GET', url, true); http_request.open('GET', url, true);
http_request.send(null); http_request.send(null);
} }
var processesGrid; var processesGrid;
var store; var store;
@@ -202,7 +202,7 @@
table.style.display = ''; table.style.display = '';
} }
} }
new Ext.KeyMap( new Ext.KeyMap(
document, document,
{ {
@@ -225,90 +225,90 @@
Ext.onReady(function(){ Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init(); Ext.QuickTips.init();
historyDynaformGrid(); historyDynaformGrid();
}); });
var historyDynaformGridPreviewGlobal = {}; var historyDynaformGridPreviewGlobal = {};
historyDynaformGridPreviewGlobal.DYN_UID = ''; historyDynaformGridPreviewGlobal.DYN_UID = '';
historyDynaformGridPreviewGlobal.DYN_TITLE = ''; historyDynaformGridPreviewGlobal.DYN_TITLE = '';
function historyDynaformGridPreview(){ function historyDynaformGridPreview(){
//historyDynaformGridPreviewGlobalSystem //historyDynaformGridPreviewGlobalSystem
var DYN_UID = historyDynaformGridPreviewGlobal.DYN_UID; var DYN_UID = historyDynaformGridPreviewGlobal.DYN_UID;
var DYN_TITLE = historyDynaformGridPreviewGlobal.DYN_TITLE; var DYN_TITLE = historyDynaformGridPreviewGlobal.DYN_TITLE;
var tabData = Ext.util.JSON.encode(historyDynaformGridPreviewGlobal); var tabData = Ext.util.JSON.encode(historyDynaformGridPreviewGlobal);
var tabName = 'historyDynaformGridPreview_'+DYN_UID; var tabName = 'historyDynaformGridPreview_'+DYN_UID;
var tabTitle = 'Preview('+DYN_TITLE+')'; var tabTitle = 'Preview('+DYN_TITLE+')';
window.parent.ActionTabFrameGlobal.tabData = tabData; window.parent.ActionTabFrameGlobal.tabData = tabData;
window.parent.ActionTabFrameGlobal.tabName = tabName; window.parent.ActionTabFrameGlobal.tabName = tabName;
window.parent.ActionTabFrameGlobal.tabTitle = tabTitle; window.parent.ActionTabFrameGlobal.tabTitle = tabTitle;
window.parent.Actions.tabFrame(tabName); window.parent.Actions.tabFrame(tabName);
} }
var historyDynaformGridHistoryGlobal = {}; var historyDynaformGridHistoryGlobal = {};
historyDynaformGridHistoryGlobal.PRO_UID = ''; historyDynaformGridHistoryGlobal.PRO_UID = '';
historyDynaformGridHistoryGlobal.APP_UID = ''; historyDynaformGridHistoryGlobal.APP_UID = '';
historyDynaformGridHistoryGlobal.TAS_UID = ''; historyDynaformGridHistoryGlobal.TAS_UID = '';
historyDynaformGridHistoryGlobal.DYN_UID = ''; historyDynaformGridHistoryGlobal.DYN_UID = '';
historyDynaformGridHistoryGlobal.DYN_TITLE = ''; historyDynaformGridHistoryGlobal.DYN_TITLE = '';
function historyDynaformGridHistory(){ function historyDynaformGridHistory(){
//historyDynaformGridGlobal //historyDynaformGridGlobal
historyDynaformGridGlobal.ref = historyDynaformGridGlobal.ref; historyDynaformGridGlobal.ref = historyDynaformGridGlobal.ref;
//!historyDynaformGridGlobalSystem //!historyDynaformGridGlobalSystem
var ref = historyDynaformGridGlobal.ref; var ref = historyDynaformGridGlobal.ref;
//historyDynaformGridHistoryGlobalSystem //historyDynaformGridHistoryGlobalSystem
var PRO_UID = historyDynaformGridHistoryGlobal.PRO_UID; var PRO_UID = historyDynaformGridHistoryGlobal.PRO_UID;
var APP_UID = historyDynaformGridHistoryGlobal.APP_UID; var APP_UID = historyDynaformGridHistoryGlobal.APP_UID;
var TAS_UID = historyDynaformGridHistoryGlobal.TAS_UID; var TAS_UID = historyDynaformGridHistoryGlobal.TAS_UID;
var DYN_UID = historyDynaformGridHistoryGlobal.DYN_UID; var DYN_UID = historyDynaformGridHistoryGlobal.DYN_UID;
var DYN_TITLE = historyDynaformGridHistoryGlobal.DYN_TITLE; var DYN_TITLE = historyDynaformGridHistoryGlobal.DYN_TITLE;
var idUnique = md5(PRO_UID+APP_UID+TAS_UID+DYN_UID); var idUnique = md5(PRO_UID+APP_UID+TAS_UID+DYN_UID);
console.log(window.content); //console.log(window.content);
var tabData = Ext.util.JSON.encode(historyDynaformGridHistoryGlobal); var tabData = Ext.util.JSON.encode(historyDynaformGridHistoryGlobal);
var tabName = 'historyDynaformGridHistory_'+idUnique; var tabName = 'historyDynaformGridHistory_'+idUnique;
var tabTitle = 'Change Log('+DYN_TITLE+')'; var tabTitle = 'Change Log('+DYN_TITLE+')';
window.parent.ActionTabFrameGlobal.tabData = tabData; window.parent.ActionTabFrameGlobal.tabData = tabData;
window.parent.ActionTabFrameGlobal.tabName = tabName; window.parent.ActionTabFrameGlobal.tabName = tabName;
window.parent.ActionTabFrameGlobal.tabTitle = tabTitle; window.parent.ActionTabFrameGlobal.tabTitle = tabTitle;
//window.parent.Actions.tabFrame('showDynaformListHistory'+"&PRO_UID="+ PRO_UID +"&APP_UID="+ APP_UID+"&TAS_UID="+ TAS_UID+"&DYN_UID="+ DYN_UID); //window.parent.Actions.tabFrame('showDynaformListHistory'+"&PRO_UID="+ PRO_UID +"&APP_UID="+ APP_UID+"&TAS_UID="+ TAS_UID+"&DYN_UID="+ DYN_UID);
window.parent.Actions.tabFrame(tabName); window.parent.Actions.tabFrame(tabName);
} }
historyDynaformGridGlobal = {}; historyDynaformGridGlobal = {};
function historyDynaformGrid(){ function historyDynaformGrid(){
//dataGlobalConstructor //dataGlobalConstructor
historyDynaformGridGlobal.ref = 'casesHistoryDynaformPage_Ajax.php'; historyDynaformGridGlobal.ref = 'casesHistoryDynaformPage_Ajax.php';
//dataGlobal //dataGlobal
historyDynaformGridGlobal.ref = historyDynaformGridGlobal.ref; historyDynaformGridGlobal.ref = historyDynaformGridGlobal.ref;
//!dataSystemGlobal //!dataSystemGlobal
var ref = historyDynaformGridGlobal.ref; var ref = historyDynaformGridGlobal.ref;
//!dataSystem //!dataSystem
var url = ref+'?actionAjax=historyDynaformGrid_Ajax'; var url = ref+'?actionAjax=historyDynaformGrid_Ajax';
store = new Ext.data.GroupingStore({ store = new Ext.data.GroupingStore({
proxy : new Ext.data.HttpProxy proxy : new Ext.data.HttpProxy
( (
{ {
url: url url: url
} }
), ),
reader : new Ext.data.JsonReader reader : new Ext.data.JsonReader
( (
{ {
@@ -319,26 +319,26 @@
{name : 'PRO_UID'}, {name : 'PRO_UID'},
{name : 'APP_UID'}, {name : 'APP_UID'},
{name : 'TAS_UID'}, {name : 'TAS_UID'},
{name : 'DYN_UID'}, {name : 'DYN_UID'},
{name : 'DYN_TITLE'} {name : 'DYN_TITLE'}
] ]
} }
) )
}); });
var expander = new Ext.ux.grid.RowExpander({ var expander = new Ext.ux.grid.RowExpander({
tpl : new Ext.Template( tpl : new Ext.Template(
'<p><b>'+TRANSLATIONS.ID_PRO_DESCRIPTION+':</b> {PRO_DESCRIPTION}</p><br>' '<p><b>'+TRANSLATIONS.ID_PRO_DESCRIPTION+':</b> {PRO_DESCRIPTION}</p><br>'
) )
}); });
startDateRender = function(v){ startDateRender = function(v){
var dateString = "-"; var dateString = "-";
if(v!="-"){ if(v!="-"){
dateString = _DF(v,"m/d/Y H:i:s"); dateString = _DF(v,"m/d/Y H:i:s");
} }
return dateString; return dateString;
} }
escapeHtml = function(v){ escapeHtml = function(v){
var pre = document.createElement('pre'); var pre = document.createElement('pre');
@@ -346,7 +346,7 @@
pre.appendChild(text); pre.appendChild(text);
return pre.innerHTML; return pre.innerHTML;
} }
actionRenderingTranslation = function(v){ actionRenderingTranslation = function(v){
var actionTranslate = ""; var actionTranslate = "";
if(v=="PAUSE"){ if(v=="PAUSE"){
@@ -363,11 +363,11 @@
} }
else if(v==""||v==null){ else if(v==""||v==null){
actionTranslate = _("ID_DERIVATED"); actionTranslate = _("ID_DERIVATED");
} }
return actionTranslate; return actionTranslate;
}; };
var processesGrid = new Ext.grid.GridPanel({ var processesGrid = new Ext.grid.GridPanel({
region: 'center', region: 'center',
layout: 'fit', layout: 'fit',
@@ -383,53 +383,53 @@
frame:false, frame:false,
//plugins: expander, //plugins: expander,
cls : 'grid_with_checkbox', cls : 'grid_with_checkbox',
columnLines: true, columnLines: true,
viewConfig: { viewConfig: {
forceFit:true forceFit:true
}, },
cm: new Ext.grid.ColumnModel({ cm: new Ext.grid.ColumnModel({
defaults: { defaults: {
width: 200, width: 200,
sortable: true sortable: true
}, },
columns: columns:
[ [
{id:'PRO_UID', dataIndex: 'PRO_UID', hidden:true, hideable:false}, {id:'PRO_UID', dataIndex: 'PRO_UID', hidden:true, hideable:false},
{id:'APP_UID', dataIndex: 'APP_UID', hidden:true, hideable:false}, {id:'APP_UID', dataIndex: 'APP_UID', hidden:true, hideable:false},
{id:'TAS_UID', dataIndex: 'TAS_UID', hidden:true, hideable:false}, {id:'TAS_UID', dataIndex: 'TAS_UID', hidden:true, hideable:false},
{id:'DYN_UID', dataIndex: 'DYN_UID', hidden:true, hideable:false}, {id:'DYN_UID', dataIndex: 'DYN_UID', hidden:true, hideable:false},
{header: _("ID_TITLE_FIELD"), dataIndex: 'DYN_TITLE', width: 70} {header: _("ID_TITLE_FIELD"), dataIndex: 'DYN_TITLE', width: 70}
] ]
}), }),
store: store, store: store,
tbar:[ tbar:[
{ {
text:_("ID_DYNAFORM_HISTORY"), text:_("ID_DYNAFORM_HISTORY"),
id:'sendMailMessageFormRadioId', id:'sendMailMessageFormRadioId',
iconCls: 'button_menu_ext', iconCls: 'button_menu_ext',
icon: '/images/ext/gray/shapes/hourglass.png', icon: '/images/ext/gray/shapes/hourglass.png',
handler: function(){ handler: function(){
var rowSelected = processesGrid.getSelectionModel().getSelected(); var rowSelected = processesGrid.getSelectionModel().getSelected();
if( rowSelected ){ if( rowSelected ){
//!dataGrid //!dataGrid
//historyDynaformGridGlobal construct //historyDynaformGridGlobal construct
historyDynaformGridHistoryGlobal.PRO_UID = rowSelected.data.PRO_UID; historyDynaformGridHistoryGlobal.PRO_UID = rowSelected.data.PRO_UID;
historyDynaformGridHistoryGlobal.APP_UID = rowSelected.data.APP_UID; historyDynaformGridHistoryGlobal.APP_UID = rowSelected.data.APP_UID;
historyDynaformGridHistoryGlobal.TAS_UID = rowSelected.data.TAS_UID; historyDynaformGridHistoryGlobal.TAS_UID = rowSelected.data.TAS_UID;
historyDynaformGridHistoryGlobal.DYN_UID = rowSelected.data.DYN_UID; historyDynaformGridHistoryGlobal.DYN_UID = rowSelected.data.DYN_UID;
historyDynaformGridHistoryGlobal.DYN_TITLE = rowSelected.data.DYN_TITLE; historyDynaformGridHistoryGlobal.DYN_TITLE = rowSelected.data.DYN_TITLE;
var PRO_UID = historyDynaformGridHistoryGlobal.PRO_UID; var PRO_UID = historyDynaformGridHistoryGlobal.PRO_UID;
var APP_UID = historyDynaformGridHistoryGlobal.APP_UID; var APP_UID = historyDynaformGridHistoryGlobal.APP_UID;
var TAS_UID = historyDynaformGridHistoryGlobal.TAS_UID; var TAS_UID = historyDynaformGridHistoryGlobal.TAS_UID;
var DYN_UID = historyDynaformGridHistoryGlobal.DYN_UID; var DYN_UID = historyDynaformGridHistoryGlobal.DYN_UID;
var DYN_TITLE = historyDynaformGridHistoryGlobal.DYN_TITLE; var DYN_TITLE = historyDynaformGridHistoryGlobal.DYN_TITLE;
historyDynaformGridHistory(); historyDynaformGridHistory();
} }
else{ else{
Ext.Msg.show({ Ext.Msg.show({
@@ -441,11 +441,11 @@
icon: Ext.MessageBox.INFO, icon: Ext.MessageBox.INFO,
buttons: Ext.MessageBox.OK buttons: Ext.MessageBox.OK
}); });
} }
}, },
disabled:false disabled:false
}, },
@@ -457,21 +457,21 @@
id:'viewMailMessageFormRadioId', id:'viewMailMessageFormRadioId',
iconCls: 'button_menu_ext', iconCls: 'button_menu_ext',
icon: '/images/documents/_filefind.png', icon: '/images/documents/_filefind.png',
handler: function(){ handler: function(){
var rowSelected = processesGrid.getSelectionModel().getSelected(); var rowSelected = processesGrid.getSelectionModel().getSelected();
if( rowSelected ){ if( rowSelected ){
//!historyDynaformGridPreviewGlobal|Constructor //!historyDynaformGridPreviewGlobal|Constructor
historyDynaformGridPreviewGlobal.DYN_UID = rowSelected.data.DYN_UID; historyDynaformGridPreviewGlobal.DYN_UID = rowSelected.data.DYN_UID;
historyDynaformGridPreviewGlobal.DYN_TITLE = rowSelected.data.DYN_TITLE; historyDynaformGridPreviewGlobal.DYN_TITLE = rowSelected.data.DYN_TITLE;
var DYN_UID = historyDynaformGridPreviewGlobal.DYN_UID; var DYN_UID = historyDynaformGridPreviewGlobal.DYN_UID;
var DYN_TITLE = historyDynaformGridPreviewGlobal.DYN_TITLE; var DYN_TITLE = historyDynaformGridPreviewGlobal.DYN_TITLE;
historyDynaformGridPreview(); historyDynaformGridPreview();
} }
else{ else{
Ext.Msg.show({ Ext.Msg.show({
@@ -482,9 +482,9 @@
animEl: 'elId', animEl: 'elId',
icon: Ext.MessageBox.INFO, icon: Ext.MessageBox.INFO,
buttons: Ext.MessageBox.OK buttons: Ext.MessageBox.OK
}); });
} }
}, },
disabled:false disabled:false
}, },
@@ -504,16 +504,16 @@
rowdblclick: emptyReturn, rowdblclick: emptyReturn,
render: function(){ render: function(){
this.loadMask = new Ext.LoadMask(this.body, {msg:'Loading...'}); this.loadMask = new Ext.LoadMask(this.body, {msg:'Loading...'});
processesGrid.getSelectionModel().on('rowselect', function(){ processesGrid.getSelectionModel().on('rowselect', function(){
var rowSelected = processesGrid.getSelectionModel().getSelected(); var rowSelected = processesGrid.getSelectionModel().getSelected();
}); });
} }
} }
}); });
processesGrid.store.load({params: {"function":"languagesList"}}); processesGrid.store.load({params: {"function":"languagesList"}});
processesGrid.store.on( processesGrid.store.on(
'load', 'load',
function() function()
@@ -525,16 +525,16 @@
single: true single: true
} }
); );
processesGrid.addListener('rowcontextmenu', emptyReturn,this); processesGrid.addListener('rowcontextmenu', emptyReturn,this);
processesGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { processesGrid.on('rowcontextmenu', function (grid, rowIndex, evt) {
var sm = grid.getSelectionModel(); var sm = grid.getSelectionModel();
sm.selectRow(rowIndex, sm.isSelected(rowIndex)); sm.selectRow(rowIndex, sm.isSelected(rowIndex));
var rowSelected = Ext.getCmp('processesGrid').getSelectionModel().getSelected(); var rowSelected = Ext.getCmp('processesGrid').getSelectionModel().getSelected();
var activator = Ext.getCmp('activator2'); var activator = Ext.getCmp('activator2');
var debug = Ext.getCmp('debug'); var debug = Ext.getCmp('debug');
if( rowSelected.data.PRO_STATUS == 'ACTIVE' ){ if( rowSelected.data.PRO_STATUS == 'ACTIVE' ){
activator.setIconClass('icon-deactivate'); activator.setIconClass('icon-deactivate');
activator.setText(TRANSLATIONS.ID_DEACTIVATE); activator.setText(TRANSLATIONS.ID_DEACTIVATE);
@@ -542,7 +542,7 @@
activator.setIconClass('icon-activate'); activator.setIconClass('icon-activate');
activator.setText(TRANSLATIONS.ID_ACTIVATE); activator.setText(TRANSLATIONS.ID_ACTIVATE);
} }
if( rowSelected.data.PRO_DEBUG == 1){ if( rowSelected.data.PRO_DEBUG == 1){
debug.setIconClass('icon-debug-disabled'); debug.setIconClass('icon-debug-disabled');
debug.setText(_('ID_DISABLE_DEBUG')); debug.setText(_('ID_DISABLE_DEBUG'));
@@ -551,14 +551,14 @@
debug.setText(_('ID_ENABLE_DEBUG')); debug.setText(_('ID_ENABLE_DEBUG'));
} }
}, this); }, this);
processesGrid.on('contextmenu', function (evt) { processesGrid.on('contextmenu', function (evt) {
evt.preventDefault(); evt.preventDefault();
}, this); }, this);
function emptyReturn(){ function emptyReturn(){
} }
var viewport = new Ext.Viewport({ var viewport = new Ext.Viewport({
layout: 'border', layout: 'border',
autoScroll: true, autoScroll: true,

View File

@@ -1,14 +1,14 @@
var wizard; var wizard;
// Extend timeout for all Ext.Ajax.requests to 90 seconds. // Extend timeout for all Ext.Ajax.requests to 90 seconds.
// Ext.Ajax is a singleton, this statement will extend the timeout // Ext.Ajax is a singleton, this statement will extend the timeout
// for all subsequent Ext.Ajax calls. // for all subsequent Ext.Ajax calls.
Ext.Ajax.timeout = 4 * 60 * 1000; Ext.Ajax.timeout = 4 * 60 * 1000;
Ext.onReady(function(){ Ext.onReady(function(){
Ext.QuickTips.init(); Ext.QuickTips.init();
wizard = new Ext.ux.Wiz({ wizard = new Ext.ux.Wiz({
height: 520, height: 520,
width : 780, width : 780,
@@ -35,10 +35,10 @@ Ext.onReady(function(){
finish: finishInstallation finish: finishInstallation
} }
}); });
// show the wizard // show the wizard
wizard.show(); wizard.show();
}); });
function finishInstallation() function finishInstallation()
{ {
@@ -63,15 +63,15 @@ function finishInstallation()
//setTimeout("_redirect('"+response.url+"')", 3000); //setTimeout("_redirect('"+response.url+"')", 3000);
// Ext.Msg.alert( // Ext.Msg.alert(
// 'ProcessMaker was successfully installed', // 'ProcessMaker was successfully installed',
// 'Workspace "' + Ext.getCmp('workspace').getValue() + '" was installed correctly now you will be redirected to your new workspace.', // 'Workspace "' + Ext.getCmp('workspace').getValue() + '" was installed correctly now you will be redirected to your new workspace.',
// function() {_redirectwindow.location = response.url;} // function() {_redirectwindow.location = response.url;}
// ); // );
} }
else { else {
PMExt.error('ERROR', response.message, function(){ PMExt.error('ERROR', response.message, function(){
if (response.canRedirect) { if (response.canRedirect) {
_redirect(response.uri); _redirect(response.uri);
} }
}) })
} }
@@ -101,7 +101,7 @@ function finishInstallation()
} }
function _redirect(_uri){ function _redirect(_uri){
console.log('redirecting:: '+_uri); //console.log('redirecting:: '+_uri);
window.location = _uri; window.location = _uri;
} }