BUG 9509 "On ProcessMaker 2.0.42 the WYSISWG editor doesn't..." SOLVED
- OutputDocument the WYSISWG editor doesn't generate the content of a GRID correctly - Solved problem, now generated correctly the source of the OutputDocument, was also corrected the problem with the tag <table>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
PMExtJSCommon = function() {
|
PMExtJSCommon = function() {
|
||||||
this.version = '1.8';
|
this.version = '1.8';
|
||||||
|
|
||||||
this.notify_time_out = 3;
|
this.notify_time_out = 3;
|
||||||
|
|
||||||
this.confirm = function(title, msg, fnYes, fnNo)
|
this.confirm = function(title, msg, fnYes, fnNo)
|
||||||
@@ -16,9 +16,9 @@ PMExtJSCommon = function() {
|
|||||||
setTimeout(fnYes, 0)
|
setTimeout(fnYes, 0)
|
||||||
else if( fnNo != undefined )
|
else if( fnNo != undefined )
|
||||||
setTimeout(fnNo, 0)
|
setTimeout(fnNo, 0)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.info = function(title, msg, fn) {
|
this.info = function(title, msg, fn) {
|
||||||
Ext.MessageBox.show({
|
Ext.MessageBox.show({
|
||||||
title: title,
|
title: title,
|
||||||
@@ -65,12 +65,12 @@ PMExtJSCommon = function() {
|
|||||||
icon: Ext.MessageBox.ERROR
|
icon: Ext.MessageBox.ERROR
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.notify = function(title, msg, type, time)
|
this.notify = function(title, msg, type, time)
|
||||||
{
|
{
|
||||||
Ext.msgBoxSlider.msg(title, msg, type, time);
|
Ext.msgBoxSlider.msg(title, msg, type, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getBrowser = function()
|
this.getBrowser = function()
|
||||||
{
|
{
|
||||||
var browsersList = new Array("opera", "msie", "firefox", "chrome", "safari");
|
var browsersList = new Array("opera", "msie", "firefox", "chrome", "safari");
|
||||||
@@ -78,12 +78,12 @@ PMExtJSCommon = function() {
|
|||||||
var name = 'Unknown';
|
var name = 'Unknown';
|
||||||
var version = '';
|
var version = '';
|
||||||
var screen = {
|
var screen = {
|
||||||
width : Ext.getBody().getViewSize().width,
|
width : Ext.getBody().getViewSize().width,
|
||||||
height : Ext.getBody().getViewSize().height
|
height : Ext.getBody().getViewSize().height
|
||||||
};
|
};
|
||||||
|
|
||||||
var so = Ext.isLinux ? 'Linux' : ( Ext.isWindows ? 'Windows' : (Ext.isMac ? 'Mac OS' : 'Unknown') );
|
var so = Ext.isLinux ? 'Linux' : ( Ext.isWindows ? 'Windows' : (Ext.isMac ? 'Mac OS' : 'Unknown') );
|
||||||
|
|
||||||
for (var i = 0; i < browsersList.length; i++){
|
for (var i = 0; i < browsersList.length; i++){
|
||||||
if ((name == "") && (browserMeta.indexOf(browsersList[i]) != -1)){
|
if ((name == "") && (browserMeta.indexOf(browsersList[i]) != -1)){
|
||||||
name = browsersList[i];
|
name = browsersList[i];
|
||||||
@@ -91,7 +91,7 @@ PMExtJSCommon = function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {name:name, version:version, screen: screen}
|
return {name:name, version:version, screen: screen}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ PMExtJSCommon = function() {
|
|||||||
var labelColumnWidth = 170;
|
var labelColumnWidth = 170;
|
||||||
var valueColumnWidth = 350;
|
var valueColumnWidth = 350;
|
||||||
params = params || {};
|
params = params || {};
|
||||||
|
|
||||||
if(typeof columnsSize != 'undefined') {
|
if(typeof columnsSize != 'undefined') {
|
||||||
labelColumnWidth = columnsSize[0] || labelColumnWidth;
|
labelColumnWidth = columnsSize[0] || labelColumnWidth;
|
||||||
valueColumnWidth = columnsSize[1] || valueColumnWidth;
|
valueColumnWidth = columnsSize[1] || valueColumnWidth;
|
||||||
@@ -124,7 +124,7 @@ PMExtJSCommon = function() {
|
|||||||
dataIndex : 'label',
|
dataIndex : 'label',
|
||||||
renderer: function(v){return '<b><font color="#465070">'+v+'</font></b>'},
|
renderer: function(v){return '<b><font color="#465070">'+v+'</font></b>'},
|
||||||
align: 'right'
|
align: 'right'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width : valueColumnWidth,
|
width : valueColumnWidth,
|
||||||
dataIndex : 'value'
|
dataIndex : 'value'
|
||||||
@@ -133,7 +133,7 @@ PMExtJSCommon = function() {
|
|||||||
dataIndex : 'section'
|
dataIndex : 'section'
|
||||||
}],
|
}],
|
||||||
autoHeight : true,
|
autoHeight : true,
|
||||||
columnLines: true,
|
columnLines: true,
|
||||||
trackMouseOver:false,
|
trackMouseOver:false,
|
||||||
disableSelection:true,
|
disableSelection:true,
|
||||||
view: new Ext.grid.GroupingView({
|
view: new Ext.grid.GroupingView({
|
||||||
@@ -171,7 +171,7 @@ PMExtJSCommon = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
var PMExt = new PMExtJSCommon();
|
var PMExt = new PMExtJSCommon();
|
||||||
|
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
}
|
}
|
||||||
//msgCt.alignTo(document, 'br-br');
|
//msgCt.alignTo(document, 'br-br');
|
||||||
//msgCt.alignTo(document, "br-br", [-20, -20]);
|
//msgCt.alignTo(document, "br-br", [-20, -20]);
|
||||||
|
|
||||||
var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));
|
var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));
|
||||||
var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
|
var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
|
||||||
m.setWidth(400 );
|
m.setWidth(400 );
|
||||||
@@ -207,7 +207,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
|
|
||||||
type = typeof type != 'undefined' ? type : '';
|
type = typeof type != 'undefined' ? type : '';
|
||||||
time = typeof time != 'undefined' ? time : PMExt.notify_time_out;
|
time = typeof time != 'undefined' ? time : PMExt.notify_time_out;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 'alert':
|
case 'alert':
|
||||||
case 'warning':
|
case 'warning':
|
||||||
@@ -222,7 +222,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
case 'info':
|
case 'info':
|
||||||
image = '/images/info.png';
|
image = '/images/info.png';
|
||||||
break;
|
break;
|
||||||
case 'success':
|
case 'success':
|
||||||
case 'ok':
|
case 'ok':
|
||||||
image = '/images/select-icon.png';
|
image = '/images/select-icon.png';
|
||||||
break;
|
break;
|
||||||
@@ -244,7 +244,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
msgTopCenter : function(type, title, format, time) {
|
msgTopCenter : function(type, title, format, time) {
|
||||||
if (typeof remove == 'undefined')
|
if (typeof remove == 'undefined')
|
||||||
remove : true;
|
remove : true;
|
||||||
|
|
||||||
time = typeof time != 'undefined' ? time : PMExt.notify_time_out;
|
time = typeof time != 'undefined' ? time : PMExt.notify_time_out;
|
||||||
@@ -252,7 +252,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
if( ! msgCt ) {
|
if( ! msgCt ) {
|
||||||
msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div', style:'position:absolute'}, true);
|
msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div', style:'position:absolute'}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var s = String.format.apply(String, Array.prototype.slice.call(arguments, 2));
|
var s = String.format.apply(String, Array.prototype.slice.call(arguments, 2));
|
||||||
var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
|
var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
|
||||||
m.setWidth(400 );
|
m.setWidth(400 );
|
||||||
@@ -273,7 +273,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
case 'info':
|
case 'info':
|
||||||
image = '/images/info.png';
|
image = '/images/info.png';
|
||||||
break;
|
break;
|
||||||
case 'success':
|
case 'success':
|
||||||
case 'ok':
|
case 'ok':
|
||||||
image = '/images/select-icon.png';
|
image = '/images/select-icon.png';
|
||||||
break;
|
break;
|
||||||
@@ -318,7 +318,7 @@ Ext.msgBoxSlider = function(){
|
|||||||
};
|
};
|
||||||
}();*/
|
}();*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translator function for internationalization
|
* Translator function for internationalization
|
||||||
*/
|
*/
|
||||||
function _()
|
function _()
|
||||||
@@ -328,20 +328,20 @@ function _()
|
|||||||
|
|
||||||
if( typeof TRANSLATIONS != 'undefined' && TRANSLATIONS) {
|
if( typeof TRANSLATIONS != 'undefined' && TRANSLATIONS) {
|
||||||
if( typeof TRANSLATIONS[argv[0]] != 'undefined' ) {
|
if( typeof TRANSLATIONS[argv[0]] != 'undefined' ) {
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
trn = TRANSLATIONS[argv[0]];
|
trn = TRANSLATIONS[argv[0]];
|
||||||
for (i = 1; i < argv.length; i++) {
|
for (i = 1; i < argv.length; i++) {
|
||||||
trn = trn.replace('{'+(i-1)+'}', argv[i]);
|
trn = trn.replace('{'+(i-1)+'}', argv[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
trn = TRANSLATIONS[argv[0]];
|
trn = TRANSLATIONS[argv[0]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
trn = '**' + argv[0] + '**';
|
trn = '**' + argv[0] + '**';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PMExt.error('Processmaker JS Core Error', 'The TRANSLATIONS global object is not loaded!');
|
PMExt.error('Processmaker JS Core Error', 'The TRANSLATIONS global object is not loaded!');
|
||||||
trn = '';
|
trn = '';
|
||||||
@@ -349,18 +349,18 @@ function _()
|
|||||||
return trn;
|
return trn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Environment Formats function for full name
|
* Environment Formats function for full name
|
||||||
*/
|
*/
|
||||||
function _FNF(USER_NAME, FIRST_NAME, LAST_NAME, FN_FORMAT)
|
function _FNF(USER_NAME, FIRST_NAME, LAST_NAME, FN_FORMAT)
|
||||||
{
|
{
|
||||||
if (typeof FORMATS != 'undefined') {
|
if (typeof FORMATS != 'undefined') {
|
||||||
FN_FORMAT = FORMATS.format;
|
FN_FORMAT = FORMATS.format;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FN_FORMAT = '(@lastName, @firstName) @userName';
|
FN_FORMAT = '(@lastName, @firstName) @userName';
|
||||||
}
|
}
|
||||||
|
|
||||||
var aux = FN_FORMAT;
|
var aux = FN_FORMAT;
|
||||||
aux = aux.replace('@userName',USER_NAME);
|
aux = aux.replace('@userName',USER_NAME);
|
||||||
aux = aux.replace('@firstName',FIRST_NAME);
|
aux = aux.replace('@firstName',FIRST_NAME);
|
||||||
@@ -368,13 +368,13 @@ function _FNF(USER_NAME, FIRST_NAME, LAST_NAME, FN_FORMAT)
|
|||||||
return aux;
|
return aux;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Environment Formats function for date
|
* Environment Formats function for date
|
||||||
*/
|
*/
|
||||||
function _DF(DATE_TIME, D_FORMAT)
|
function _DF(DATE_TIME, D_FORMAT)
|
||||||
{
|
{
|
||||||
function LZ(x){return(x<0||x>9?"":"0")+x;}
|
function LZ(x){return(x<0||x>9?"":"0")+x;}
|
||||||
|
|
||||||
if(typeof D_FORMAT == 'undefined'){
|
if(typeof D_FORMAT == 'undefined'){
|
||||||
if (typeof FORMATS != 'undefined') {
|
if (typeof FORMATS != 'undefined') {
|
||||||
D_FORMAT = FORMATS.dateFormat;
|
D_FORMAT = FORMATS.dateFormat;
|
||||||
@@ -388,7 +388,7 @@ function _DF(DATE_TIME, D_FORMAT)
|
|||||||
if (DATE_TIME == '')
|
if (DATE_TIME == '')
|
||||||
return '';
|
return '';
|
||||||
else
|
else
|
||||||
return '**' + DATE_TIME + '**';
|
return '**' + DATE_TIME + '**';
|
||||||
}
|
}
|
||||||
|
|
||||||
var arrD = DATE_TIME.split(' ');
|
var arrD = DATE_TIME.split(' ');
|
||||||
@@ -400,8 +400,8 @@ function _DF(DATE_TIME, D_FORMAT)
|
|||||||
else {
|
else {
|
||||||
var arrH = new Array(0,0,0);
|
var arrH = new Array(0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var MONTH_NAMES=new Array(_('ID_MONTH_1'),_('ID_MONTH_2'),_('ID_MONTH_3'),_('ID_MONTH_4'),_('ID_MONTH_5'),_('ID_MONTH_6'),_('ID_MONTH_7'),
|
var MONTH_NAMES=new Array(_('ID_MONTH_1'),_('ID_MONTH_2'),_('ID_MONTH_3'),_('ID_MONTH_4'),_('ID_MONTH_5'),_('ID_MONTH_6'),_('ID_MONTH_7'),
|
||||||
_('ID_MONTH_8'),_('ID_MONTH_9'),_('ID_MONTH_10'),_('ID_MONTH_11'),_('ID_MONTH_12'),_('ID_MONTH_ABB_1'),_('ID_MONTH_ABB_2'),
|
_('ID_MONTH_8'),_('ID_MONTH_9'),_('ID_MONTH_10'),_('ID_MONTH_11'),_('ID_MONTH_12'),_('ID_MONTH_ABB_1'),_('ID_MONTH_ABB_2'),
|
||||||
_('ID_MONTH_ABB_3'),_('ID_MONTH_ABB_4'),_('ID_MONTH_ABB_5'),_('ID_MONTH_ABB_6'),_('ID_MONTH_ABB_7'),_('ID_MONTH_ABB_8'),
|
_('ID_MONTH_ABB_3'),_('ID_MONTH_ABB_4'),_('ID_MONTH_ABB_5'),_('ID_MONTH_ABB_6'),_('ID_MONTH_ABB_7'),_('ID_MONTH_ABB_8'),
|
||||||
@@ -418,7 +418,7 @@ function _DF(DATE_TIME, D_FORMAT)
|
|||||||
var H=date.getHours();
|
var H=date.getHours();
|
||||||
var m=date.getMinutes();
|
var m=date.getMinutes();
|
||||||
var s=date.getSeconds();
|
var s=date.getSeconds();
|
||||||
|
|
||||||
var values = new Object();
|
var values = new Object();
|
||||||
values['Y'] = y;
|
values['Y'] = y;
|
||||||
values['y'] = y.substring(2, 4);
|
values['y'] = y.substring(2, 4);
|
||||||
@@ -442,14 +442,14 @@ function _DF(DATE_TIME, D_FORMAT)
|
|||||||
if (H>11) values['A'] = 'PM'; else values['A'] = 'AM';
|
if (H>11) values['A'] = 'PM'; else values['A'] = 'AM';
|
||||||
if (typeof FORMATS == 'undefined') values['T'] = '**';
|
if (typeof FORMATS == 'undefined') values['T'] = '**';
|
||||||
else values['T'] = FORMATS.TimeZone;
|
else values['T'] = FORMATS.TimeZone;
|
||||||
|
|
||||||
var aDate = D_FORMAT.split('');
|
var aDate = D_FORMAT.split('');
|
||||||
var aux = '';
|
var aux = '';
|
||||||
|
|
||||||
var xParts = new Array('Y','y','F','M','m','n','d','j','D','l','G','H','g','h','i','s','a','A','T');
|
var xParts = new Array('Y','y','F','M','m','n','d','j','D','l','G','H','g','h','i','s','a','A','T');
|
||||||
for (var i=0; i < aDate.length; i++){
|
for (var i=0; i < aDate.length; i++){
|
||||||
if (xParts.indexOf(aDate[i])==-1){
|
if (xParts.indexOf(aDate[i])==-1){
|
||||||
aux = aux + aDate[i];
|
aux = aux + aDate[i];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
aux = aux + values[aDate[i]];
|
aux = aux + values[aDate[i]];
|
||||||
@@ -482,3 +482,13 @@ String.prototype.nl2br = function () {
|
|||||||
return this.replace(/\n/g,'<br />');
|
return this.replace(/\n/g,'<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String Replace function, if StrSearch has special characters "(", "[", must be escape "\\(", "\\[".
|
||||||
|
*/
|
||||||
|
function stringReplace(strSearch, stringReplace, str)
|
||||||
|
{
|
||||||
|
var expression = eval("/" + strSearch + "/g");
|
||||||
|
|
||||||
|
return str.replace(expression, stringReplace);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -509,8 +509,12 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
$aProperties=array()
|
$aProperties=array()
|
||||||
) {
|
) {
|
||||||
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
|
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
|
||||||
$sContent = G::unhtmlentities($sContent);
|
$nrt = array("\n", "\r", "\t");
|
||||||
$strContentAux = str_replace(array("\n", "\r", "\t"), array(null, null, null), $sContent);
|
$nrthtml = array("(n /)", "(r /)", "(t /)");
|
||||||
|
|
||||||
|
$sContent = G::unhtmlentities($sContent);
|
||||||
|
|
||||||
|
$strContentAux = str_replace($nrt, $nrthtml, $sContent);
|
||||||
|
|
||||||
$iOcurrences = preg_match_all('/\@(?:([\>])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/', $strContentAux, $arrayMatch1, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
$iOcurrences = preg_match_all('/\@(?:([\>])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/', $strContentAux, $arrayMatch1, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||||
|
|
||||||
@@ -554,6 +558,8 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$strContentAux = str_replace($nrthtml, $nrt, $strContentAux);
|
||||||
|
|
||||||
$sContent = $strContentAux;
|
$sContent = $strContentAux;
|
||||||
|
|
||||||
foreach ($aFields as $sKey => $vValue) {
|
foreach ($aFields as $sKey => $vValue) {
|
||||||
|
|||||||
@@ -1,14 +1,97 @@
|
|||||||
|
function setGridHtml(outdocHtml, swEdit)
|
||||||
|
{
|
||||||
|
var outdocHtmlAux = outdocHtml;
|
||||||
|
|
||||||
|
outdocHtmlAux = stringReplace("\\x0A", "(n /)", outdocHtmlAux); //\n 10
|
||||||
|
outdocHtmlAux = stringReplace("\\x0D", "(r /)", outdocHtmlAux); //\r 13
|
||||||
|
outdocHtmlAux = stringReplace("\\x09", "(t /)", outdocHtmlAux); //\t 9
|
||||||
|
|
||||||
|
var arrayMatch1 = [];
|
||||||
|
var outdocHtmlAux1 = "";
|
||||||
|
var strHtml = "";
|
||||||
|
|
||||||
|
///////
|
||||||
|
outdocHtmlAux1 = outdocHtmlAux;
|
||||||
|
strHtml = "";
|
||||||
|
|
||||||
|
//@>
|
||||||
|
if (swEdit == 1) {
|
||||||
|
while ((arrayMatch1 = /^(.*)<tr>[\(\)nrt\s\/]*<td>[\(\)nrt\s\/]*(@>[a-zA-Z\_]\w*)[\(\)nrt\s\/]*<\/td>[\(\)nrt\s\/]*<\/tr>(.*)$/ig.exec(outdocHtmlAux1))) {
|
||||||
|
outdocHtmlAux1 = arrayMatch1[1];
|
||||||
|
strHtml = arrayMatch1[2] + arrayMatch1[3] + strHtml;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while ((arrayMatch1 = /^(.*<table.*>.*)(@>[a-zA-Z\_]\w*)(.*<\/table>.*)$/ig.exec(outdocHtmlAux1))) {
|
||||||
|
outdocHtmlAux1 = arrayMatch1[1];
|
||||||
|
strHtml = "<tr><td>" + arrayMatch1[2] + "</td></tr>" + arrayMatch1[3] + strHtml;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strHtml = outdocHtmlAux1 + strHtml;
|
||||||
|
|
||||||
|
///////
|
||||||
|
outdocHtmlAux1 = strHtml;
|
||||||
|
strHtml = "";
|
||||||
|
|
||||||
|
//@< //Copy of @>
|
||||||
|
if (swEdit == 1) {
|
||||||
|
while ((arrayMatch1 = /^(.*)<tr>[\(\)nrt\s\/]*<td>[\(\)nrt\s\/]*(@<[a-zA-Z\_]\w*)[\(\)nrt\s\/]*<\/td>[\(\)nrt\s\/]*<\/tr>(.*)$/ig.exec(outdocHtmlAux1))) {
|
||||||
|
outdocHtmlAux1 = arrayMatch1[1];
|
||||||
|
strHtml = arrayMatch1[2] + arrayMatch1[3] + strHtml;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while ((arrayMatch1 = /^(.*<table.*>.*)(@<[a-zA-Z\_]\w*)(.*<\/table>.*)$/ig.exec(outdocHtmlAux1))) {
|
||||||
|
outdocHtmlAux1 = arrayMatch1[1];
|
||||||
|
strHtml = "<tr><td>" + arrayMatch1[2] + "</td></tr>" + arrayMatch1[3] + strHtml;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strHtml = outdocHtmlAux1 + strHtml;
|
||||||
|
|
||||||
|
///////
|
||||||
|
strHtml = stringReplace("\\(n \\/\\)", "\n", strHtml);
|
||||||
|
strHtml = stringReplace("\\(r \\/\\)", "\r", strHtml);
|
||||||
|
strHtml = stringReplace("\\(t \\/\\)", "\t", strHtml);
|
||||||
|
|
||||||
|
outdocHtml = strHtml;
|
||||||
|
|
||||||
|
return outdocHtml;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setHtml(outdocHtml, swEdit)
|
||||||
|
{
|
||||||
|
if (outdocHtml.indexOf("@>") > 0 || outdocHtml.indexOf("@>") > 0) {
|
||||||
|
if (swEdit == 1) {
|
||||||
|
outdocHtml = stringReplace("@>", "@>", outdocHtml);
|
||||||
|
outdocHtml = stringReplace("@<", "@<", outdocHtml);
|
||||||
|
|
||||||
|
outdocHtml = setGridHtml(outdocHtml, swEdit);
|
||||||
|
} else {
|
||||||
|
outdocHtml = setGridHtml(outdocHtml, swEdit);
|
||||||
|
|
||||||
|
outdocHtml = stringReplace("@>", "@>", outdocHtml);
|
||||||
|
outdocHtml = stringReplace("@<", "@<", outdocHtml);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return outdocHtml;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var importOption;
|
var importOption;
|
||||||
|
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
|
|
||||||
Ext.QuickTips.init();
|
Ext.QuickTips.init();
|
||||||
|
|
||||||
// turn on validation errors beside the field globally
|
// turn on validation errors beside the field globally
|
||||||
Ext.form.Field.prototype.msgTarget = 'side';
|
Ext.form.Field.prototype.msgTarget = 'side';
|
||||||
|
|
||||||
var bd = Ext.getBody();
|
var bd = Ext.getBody();
|
||||||
|
var sourceEdit = 0;
|
||||||
|
|
||||||
importOption = new Ext.Action({
|
importOption = new Ext.Action({
|
||||||
text: _('ID_LOAD_FROM_FILE'),
|
text: _('ID_LOAD_FROM_FILE'),
|
||||||
iconCls: 'silk-add',
|
iconCls: 'silk-add',
|
||||||
@@ -22,7 +105,7 @@ Ext.onReady(function(){
|
|||||||
autoScroll: false,
|
autoScroll: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
new Ext.FormPanel({
|
new Ext.FormPanel({
|
||||||
/*renderTo: 'form-panel',*/
|
/*renderTo: 'form-panel',*/
|
||||||
@@ -58,25 +141,21 @@ Ext.onReady(function(){
|
|||||||
uploader.getForm().submit({
|
uploader.getForm().submit({
|
||||||
url: 'outputdocs_Ajax?action=setTemplateFile',
|
url: 'outputdocs_Ajax?action=setTemplateFile',
|
||||||
waitMsg: _('ID_UPLOADING_FILE'),
|
waitMsg: _('ID_UPLOADING_FILE'),
|
||||||
success: function(o, resp){
|
success: function (o, resp) {
|
||||||
w.close();
|
w.close();
|
||||||
|
|
||||||
Ext.Ajax.request({
|
|
||||||
url: 'outputdocs_Ajax?action=getTemplateFile&r='+Math.random(),
|
|
||||||
success: function(response){
|
|
||||||
txtParse = response.responseText;
|
|
||||||
if ((txtParse.indexOf('@>')>0)||(txtParse.indexOf('@>')>0)){
|
|
||||||
txtParse = txtParse.replace('@<','@<');
|
|
||||||
response.responseText = txtParse;
|
|
||||||
}
|
|
||||||
Ext.getCmp('OUT_DOC_TEMPLATE').setValue(response.responseText);
|
|
||||||
if(Ext.getCmp('OUT_DOC_TEMPLATE').getValue(response.responseText)=='')
|
|
||||||
Ext.Msg.alert(_('ID_ALERT_MESSAGE'), _('ID_INVALID_FILE'));
|
|
||||||
},
|
|
||||||
failure: function(){},
|
|
||||||
params: {request: 'getRows'}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url: "outputdocs_Ajax?action=getTemplateFile&r=" + Math.random(),
|
||||||
|
success: function (response) {
|
||||||
|
Ext.getCmp("OUT_DOC_TEMPLATE").setValue(setHtml(response.responseText, sourceEdit));
|
||||||
|
|
||||||
|
if (Ext.getCmp("OUT_DOC_TEMPLATE").getValue() == "") {
|
||||||
|
Ext.Msg.alert(_("ID_ALERT_MESSAGE"), _("ID_INVALID_FILE"));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
failure: function () {},
|
||||||
|
params: {request: "getRows"}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
failure: function(o, resp){
|
failure: function(o, resp){
|
||||||
w.close();
|
w.close();
|
||||||
@@ -99,7 +178,7 @@ Ext.onReady(function(){
|
|||||||
w.show();
|
w.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var top = new Ext.FormPanel({
|
var top = new Ext.FormPanel({
|
||||||
labelAlign: 'top',
|
labelAlign: 'top',
|
||||||
@@ -116,36 +195,17 @@ Ext.onReady(function(){
|
|||||||
height:300,
|
height:300,
|
||||||
anchor:'98%',
|
anchor:'98%',
|
||||||
listeners: {
|
listeners: {
|
||||||
editmodechange: function(he,b){
|
editmodechange: function (he, srcEdit) {
|
||||||
txtParse = he.getRawValue();
|
sourceEdit = (srcEdit == true)? 1 : 0;
|
||||||
if (!b){
|
|
||||||
if ((txtParse.indexOf('@>')>0)||(txtParse.indexOf('@>')>0)){
|
he.setValue(setHtml(he.getRawValue(), sourceEdit));
|
||||||
txtParse = txtParse.replace('@<','@<');
|
|
||||||
he.setValue(txtParse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
beforepush: function(he, h){
|
beforepush: function (he, outdocHtml) {
|
||||||
txtParse = h;
|
//
|
||||||
if ((txtParse.indexOf('@>')>0)||(txtParse.indexOf('@>')>0)){
|
}
|
||||||
if (txtParse.indexOf('@<')>0){
|
//,
|
||||||
txtParse = txtParse.replace('@<','@<');
|
//beforesync: function (he, h) {
|
||||||
he.setValue(txtParse);
|
//}
|
||||||
}
|
|
||||||
//return false;
|
|
||||||
}
|
|
||||||
}//,
|
|
||||||
// beforesync: function(he, h){
|
|
||||||
// alert(h);
|
|
||||||
// txtParse = h;
|
|
||||||
// if ((txtParse.indexOf('@>')>0)||(txtParse.indexOf('@>')>0)){
|
|
||||||
// if (txtParse.indexOf('@<')>0){
|
|
||||||
// txtParse = txtParse.replace('@<','@<');
|
|
||||||
// he.setValue(txtParse);
|
|
||||||
// }
|
|
||||||
// //return false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
|
||||||
@@ -153,24 +213,24 @@ Ext.onReady(function(){
|
|||||||
text: _('ID_SAVE'),
|
text: _('ID_SAVE'),
|
||||||
handler: function(){
|
handler: function(){
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'outputdocs_Save',
|
url: "outputdocs_Save",
|
||||||
success: function(response){
|
success: function (response) {
|
||||||
Ext.Msg.show({
|
Ext.Msg.show({
|
||||||
title: '',
|
title: "",
|
||||||
msg: _('ID_SAVED_SUCCESSFULLY'),
|
msg: _("ID_SAVED_SUCCESSFULLY"),
|
||||||
fn: function(){},
|
fn: function () {},
|
||||||
animEl: 'elId',
|
animEl: "elId",
|
||||||
icon: Ext.MessageBox.INFO,
|
icon: Ext.MessageBox.INFO,
|
||||||
buttons: Ext.MessageBox.OK
|
buttons: Ext.MessageBox.OK
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
failure: function(){},
|
failure: function () {},
|
||||||
params: {
|
params: {
|
||||||
'form[OUT_DOC_UID]': OUT_DOC_UID,
|
"form[OUT_DOC_UID]": OUT_DOC_UID,
|
||||||
'form[OUT_DOC_TEMPLATE]':Ext.getCmp('OUT_DOC_TEMPLATE').getValue()
|
"form[OUT_DOC_TEMPLATE]": setHtml(Ext.getCmp("OUT_DOC_TEMPLATE").getValue(), 1)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
text: _('ID_CANCEL'),
|
text: _('ID_CANCEL'),
|
||||||
handler: function(){
|
handler: function(){
|
||||||
@@ -184,18 +244,14 @@ Ext.onReady(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
top.render(document.body);
|
top.render(document.body);
|
||||||
|
|
||||||
Ext.Ajax.request({
|
|
||||||
url: 'outputdocs_Ajax?action=loadTemplateContent&r='+Math.random(),
|
|
||||||
success: function(response){
|
|
||||||
Ext.getCmp('OUT_DOC_TEMPLATE').setValue(response.responseText);
|
|
||||||
},
|
|
||||||
failure: function(){},
|
|
||||||
params: {OUT_DOC_UID: OUT_DOC_UID}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url: "outputdocs_Ajax?action=loadTemplateContent&r=" + Math.random(),
|
||||||
|
success: function(response){
|
||||||
|
Ext.getCmp("OUT_DOC_TEMPLATE").setValue(setHtml(response.responseText, 0));
|
||||||
|
},
|
||||||
|
failure: function () {},
|
||||||
|
params: {OUT_DOC_UID: OUT_DOC_UID}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//function _(ID){
|
|
||||||
// return TRANSLATIONS[ID];
|
|
||||||
//}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user