Merge remote branch 'upstream/master' into BUG-9510
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'),
|
||||||
@@ -410,7 +410,7 @@ function _DF(DATE_TIME, D_FORMAT)
|
|||||||
_('ID_WEEKDAY_6'),_('ID_WEEKDAY_ABB_0'),_('ID_WEEKDAY_ABB_1'),_('ID_WEEKDAY_ABB_2'),_('ID_WEEKDAY_ABB_3'),_('ID_WEEKDAY_ABB_4'),
|
_('ID_WEEKDAY_6'),_('ID_WEEKDAY_ABB_0'),_('ID_WEEKDAY_ABB_1'),_('ID_WEEKDAY_ABB_2'),_('ID_WEEKDAY_ABB_3'),_('ID_WEEKDAY_ABB_4'),
|
||||||
_('ID_WEEKDAY_ABB_5'),_('ID_WEEKDAY_ABB_6'));
|
_('ID_WEEKDAY_ABB_5'),_('ID_WEEKDAY_ABB_6'));
|
||||||
|
|
||||||
var date = new Date(arrF[0],parseInt(arrF[1])-1,arrF[2],arrH[0],arrH[1],arrH[2],0);
|
var date = new Date(arrF[0],parseFloat(arrF[1])-1,arrF[2],arrH[0],arrH[1],arrH[2],0);
|
||||||
var y=date.getFullYear()+'';
|
var y=date.getFullYear()+'';
|
||||||
var M=date.getMonth()+1;
|
var M=date.getMonth()+1;
|
||||||
var d=date.getDate();
|
var d=date.getDate();
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -563,14 +563,21 @@ class G
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_dir($dirName)) {
|
if (is_dir($dirName)) {
|
||||||
foreach(glob($dirName . '/*') as $file) {
|
foreach(glob($dirName . '/{,.}*', GLOB_BRACE) as $file) {
|
||||||
|
if ( $file == $dirName . '/.' || $file == $dirName . '/..') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(is_dir($file)) {
|
if(is_dir($file)) {
|
||||||
G::rm_dir($file);
|
G::rm_dir($file);
|
||||||
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
exec('DEL /F /S /Q %' . $dirName . '%', $res);
|
$dirNameWin = str_replace('/','\\' ,$dirName);
|
||||||
else
|
exec('DEL /F /S /Q ' . $dirNameWin . '', $res);
|
||||||
|
exec('RD /S /Q ' . $dirNameWin . '', $res);
|
||||||
|
} else {
|
||||||
@rmdir($file);
|
@rmdir($file);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
|
|||||||
@@ -1242,6 +1242,17 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
|
|||||||
$depValues = '+';
|
$depValues = '+';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$aDepFields = array();
|
||||||
|
$count = 0;
|
||||||
|
if ($this->dependentFields !== '') {
|
||||||
|
$sqlDepField = $owner->fields[$this->dependentFields]->sql;
|
||||||
|
$count = preg_match_all('/\@(?:([\@\%\#\=\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/',
|
||||||
|
$sqlDepField, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||||
|
for ($cnt = 0; $cnt < $count; $cnt++) {
|
||||||
|
$aDepFields[$cnt] = $match[2][$cnt][0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sOptions = 'script: function (input) { ';
|
$sOptions = 'script: function (input) { ';
|
||||||
$sOptions .= ' var inputValue = base64_encode(getField(\''. $this->name .'_label\').value); ';
|
$sOptions .= ' var inputValue = base64_encode(getField(\''. $this->name .'_label\').value); ';
|
||||||
|
|
||||||
@@ -1251,7 +1262,7 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
|
|||||||
$sOptions .= '},';
|
$sOptions .= '},';
|
||||||
$sOptions .= 'json: true,';
|
$sOptions .= 'json: true,';
|
||||||
$sOptions .= 'limit: '.$this->maxresults.',';
|
$sOptions .= 'limit: '.$this->maxresults.',';
|
||||||
// $sOptions .= 'varname: "input",';
|
|
||||||
$sOptions .= 'shownoresults: ' . ($this->shownoresults ? 'true' : 'false') . ',';
|
$sOptions .= 'shownoresults: ' . ($this->shownoresults ? 'true' : 'false') . ',';
|
||||||
$sOptions .= 'maxresults: '.$this->maxresults.',';
|
$sOptions .= 'maxresults: '.$this->maxresults.',';
|
||||||
$sOptions .= 'chache: true,';
|
$sOptions .= 'chache: true,';
|
||||||
@@ -1260,8 +1271,20 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
|
|||||||
|
|
||||||
$sOptions .= 'callback: function(obj){';
|
$sOptions .= 'callback: function(obj){';
|
||||||
|
|
||||||
$sOptions .= ' var jField = { ' . $this->name . ' : obj.id };';
|
$sOptions .= ' var jField = { };';
|
||||||
|
$sOptions .= ' var sField = "[]"; ';
|
||||||
|
if ($count > 0) {
|
||||||
|
for ($cnt = 0; $cnt < $count; $cnt++ ) {
|
||||||
|
$sOptions .= 'if ( "' . $this->name . '" == "' . $aDepFields[$cnt] . '" ) {';
|
||||||
|
$sOptions .= ' jField[\'' . $aDepFields[$cnt] . '\'] = obj.id;';
|
||||||
|
$sOptions .= '} else { ';
|
||||||
|
$sOptions .= ' jField[\'' . $aDepFields[$cnt] . '\'] = getField(\'' . $aDepFields[$cnt] . '\').value; ';
|
||||||
|
$sOptions .= '}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sOptions .= ' var sField = "["+ encodeURIComponent(jField.toJSONString()) + "]"; ';
|
$sOptions .= ' var sField = "["+ encodeURIComponent(jField.toJSONString()) + "]"; ';
|
||||||
|
|
||||||
$sOptions .= $sCallBack . '; getField("' . $this->name . '").value = obj.id;';
|
$sOptions .= $sCallBack . '; getField("' . $this->name . '").value = obj.id;';
|
||||||
|
|
||||||
$sOptions .= 'var response = ajax_function("../gulliver/defaultAjaxDynaform", "reloadField", ';
|
$sOptions .= 'var response = ajax_function("../gulliver/defaultAjaxDynaform", "reloadField", ';
|
||||||
@@ -1279,6 +1302,7 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
|
|||||||
$sOptions .= ' for (ni = 0; ni < fieldLength; ni++ ){ ';
|
$sOptions .= ' for (ni = 0; ni < fieldLength; ni++ ){ ';
|
||||||
$sOptions .= ' getField(newcont[i].name).options.remove(ni); ';
|
$sOptions .= ' getField(newcont[i].name).options.remove(ni); ';
|
||||||
$sOptions .= ' } ';
|
$sOptions .= ' } ';
|
||||||
|
$sOptions .= ' getField(newcont[i].name).length = 0; ';
|
||||||
|
|
||||||
$sOptions .= ' for (ni = 0; ni < newcont[i].content.options.length; ni++ ){ ';
|
$sOptions .= ' for (ni = 0; ni < newcont[i].content.options.length; ni++ ){ ';
|
||||||
$sOptions .= ' var opt = document.createElement("OPTION"); ';
|
$sOptions .= ' var opt = document.createElement("OPTION"); ';
|
||||||
|
|||||||
@@ -23,14 +23,51 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// check script parameters
|
// check script parameters
|
||||||
// php reindex_solr.php workspacename [reindexall|reindexmissing]
|
// php reindex_solr.php workspacename [reindexall|reindexmissing|optimizeindex] [-skip 1005] [-reindextrunksize 1000]
|
||||||
// var_dump($argv);
|
// var_dump($argv);
|
||||||
if (count ($argv) != 3) {
|
//(count ($argv) == 4) || ((count ($argv) == 5) && ($argv [3] != '-skip'))
|
||||||
print "Invalid command line arguments: \n syntax: php reindex_solr.php [workspace_name] [reindexall|reindexmissing] \n" . " Where reindexall : reindex all the database \n" . " reindexmissing: reindex only the missing records stored in database.\n";
|
$commandLineSyntaxMsg = "Invalid command line arguments: \n " .
|
||||||
|
"syntax: ".
|
||||||
|
"php reindex_solr.php [workspace_name] [reindexall|reindexmissing|optimizeindex] [-skip {record_number}] [-reindextrunksize {trunk_size}]\n" .
|
||||||
|
" Where \n".
|
||||||
|
" reindexall : reindex all the database. \n" .
|
||||||
|
" reindexmissing: reindex only the missing records stored in database. \n".
|
||||||
|
" (records defined in APP_SOLR_QUEUE table are required)\n" .
|
||||||
|
" optimizeindex: optimize the changes in the search index. (used to get faster results) \n" .
|
||||||
|
" Optional Options: \n" .
|
||||||
|
" -skip {record_number}: used to skip a number of records. \n ex: -skip 10000 //skips the first 10000 records. \n" .
|
||||||
|
" -reindextrunksize {trunk_size}: specify the number of records sent to index each time. \n ex: -reindextrunksize 100 //(default = 1000) \n Reduce the trunk if using big documents, and memory is not enough. \n";
|
||||||
|
|
||||||
|
if ( (count ($argv) < 3) || ((count ($argv) % 2) == 0) ||
|
||||||
|
($argv [2] != 'reindexall' && $argv [2] != 'reindexmissing' && $argv [2] != 'optimizeindex')) {
|
||||||
|
print $commandLineSyntaxMsg;
|
||||||
die ();
|
die ();
|
||||||
}
|
}
|
||||||
$workspaceName = $argv [1];
|
$workspaceName = $argv [1];
|
||||||
$ScriptAction = $argv [2];
|
$ScriptAction = $argv [2];
|
||||||
|
$SkipRecords = 0;
|
||||||
|
$TrunkSize = 1000;
|
||||||
|
//3 5 7
|
||||||
|
if(count ($argv) > 3) {
|
||||||
|
for($argNumber = 3 ; $argNumber < count ($argv) ; $argNumber += 2) {
|
||||||
|
if(($argv [$argNumber] == '-skip' || $argv [$argNumber] == '-reindextrunksize')) {
|
||||||
|
//get options
|
||||||
|
if($argv [$argNumber] == '-skip') {
|
||||||
|
//use skip option
|
||||||
|
$SkipRecords = intval($argv [$argNumber + 1]);
|
||||||
|
}
|
||||||
|
if($argv [$argNumber] == '-reindextrunksize') {
|
||||||
|
//use skip option
|
||||||
|
$TrunkSize = intval($argv [$argNumber + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print $commandLineSyntaxMsg;
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ini_set ('display_errors', 1);
|
ini_set ('display_errors', 1);
|
||||||
error_reporting (E_ALL);
|
error_reporting (E_ALL);
|
||||||
@@ -237,6 +274,8 @@ function processWorkspace()
|
|||||||
{
|
{
|
||||||
global $sLastExecution;
|
global $sLastExecution;
|
||||||
global $ScriptAction;
|
global $ScriptAction;
|
||||||
|
global $SkipRecords;
|
||||||
|
global $TrunkSize;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -249,11 +288,14 @@ function processWorkspace()
|
|||||||
|
|
||||||
$oAppSolr = new AppSolr ($solrConf ['solr_enabled'], $solrConf ['solr_host'], $solrConf ['solr_instance']);
|
$oAppSolr = new AppSolr ($solrConf ['solr_enabled'], $solrConf ['solr_host'], $solrConf ['solr_instance']);
|
||||||
if ($ScriptAction == "reindexall") {
|
if ($ScriptAction == "reindexall") {
|
||||||
$oAppSolr->reindexAllApplications ();
|
$oAppSolr->reindexAllApplications ($SkipRecords, $TrunkSize);
|
||||||
}
|
}
|
||||||
if ($ScriptAction == "reindexmissing") {
|
if ($ScriptAction == "reindexmissing") {
|
||||||
$oAppSolr->synchronizePendingApplications ();
|
$oAppSolr->synchronizePendingApplications ();
|
||||||
}
|
}
|
||||||
|
if ($ScriptAction == "optimizeindex") {
|
||||||
|
$oAppSolr->optimizeSearchIndex ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
|
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
|
||||||
|
|||||||
@@ -85,6 +85,31 @@ class ApplicationWithoutDelegationRecordsException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dynaform file corrupt
|
||||||
|
*
|
||||||
|
* @author Herbert Saal Gutierrez
|
||||||
|
*
|
||||||
|
* @category Colosa
|
||||||
|
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||||
|
*/
|
||||||
|
class ApplicationWithCorruptDynaformException extends Exception
|
||||||
|
{
|
||||||
|
// Redefine the exception so message isn't optional
|
||||||
|
public function __construct($message, $code = 0)
|
||||||
|
{
|
||||||
|
// some code
|
||||||
|
// make sure everything is assigned properly
|
||||||
|
parent::__construct ($message, $code);
|
||||||
|
}
|
||||||
|
|
||||||
|
// custom string representation of object
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application APP_DATA could not be unserialized exception
|
* Application APP_DATA could not be unserialized exception
|
||||||
*
|
*
|
||||||
@@ -219,6 +244,7 @@ class AppSolr
|
|||||||
$swErrorInSearchText = false;
|
$swErrorInSearchText = false;
|
||||||
$solrQueryResult = null;
|
$solrQueryResult = null;
|
||||||
$aPriorities = array('1'=>'VL', '2'=>'L', '3'=>'N', '4'=>'H', '5'=>'VH');
|
$aPriorities = array('1'=>'VL', '2'=>'L', '3'=>'N', '4'=>'H', '5'=>'VH');
|
||||||
|
$delegationIndexes = array();
|
||||||
|
|
||||||
$result = array ();
|
$result = array ();
|
||||||
$result ['totalCount'] = 0;
|
$result ['totalCount'] = 0;
|
||||||
@@ -321,30 +347,30 @@ class AppSolr
|
|||||||
if ($userUid != null && $action == 'todo') {
|
if ($userUid != null && $action == 'todo') {
|
||||||
if ($filter == 'read') {
|
if ($filter == 'read') {
|
||||||
$solrSearchText .= "APP_ASSIGNED_USERS_READ:" . $userUid . " AND ";
|
$solrSearchText .= "APP_ASSIGNED_USERS_READ:" . $userUid . " AND ";
|
||||||
$delIndexDynaField = "APP_ASSIGNED_USER_READ_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_ASSIGNED_USER_READ_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
}
|
}
|
||||||
elseif ($filter == 'unread') {
|
elseif ($filter == 'unread') {
|
||||||
$solrSearchText .= "APP_ASSIGNED_USERS_UNREAD:" . $userUid . " AND ";
|
$solrSearchText .= "APP_ASSIGNED_USERS_UNREAD:" . $userUid . " AND ";
|
||||||
$delIndexDynaField = "APP_ASSIGNED_USER_UNREAD_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_ASSIGNED_USER_UNREAD_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$solrSearchText .= "APP_ASSIGNED_USERS:" . $userUid . " AND ";
|
$solrSearchText .= "APP_ASSIGNED_USERS:" . $userUid . " AND ";
|
||||||
$delIndexDynaField = "APP_ASSIGNED_USER_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_ASSIGNED_USER_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// participated, add condition
|
// participated, add condition
|
||||||
if ($userUid != null && $action == 'sent') {
|
if ($userUid != null && $action == 'sent') {
|
||||||
if ($filter == 'started') {
|
if ($filter == 'started') {
|
||||||
$solrSearchText .= "APP_PARTICIPATED_USERS_STARTED:" . $userUid . " AND ";
|
$solrSearchText .= "APP_PARTICIPATED_USERS_STARTED:" . $userUid . " AND ";
|
||||||
$delIndexDynaField = "APP_PARTICIPATED_USER_STARTED_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_PARTICIPATED_USER_STARTED_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
}
|
}
|
||||||
elseif ($filter == 'completed') {
|
elseif ($filter == 'completed') {
|
||||||
$solrSearchText .= "APP_PARTICIPATED_USERS_COMPLETED:" . $userUid . " AND ";
|
$solrSearchText .= "APP_PARTICIPATED_USERS_COMPLETED:" . $userUid . " AND ";
|
||||||
$delIndexDynaField = "APP_PARTICIPATED_USER_COMPLETED_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_PARTICIPATED_USER_COMPLETED_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$solrSearchText .= "APP_PARTICIPATED_USERS:" . $userUid . " AND ";
|
$solrSearchText .= "APP_PARTICIPATED_USERS:" . $userUid . " AND ";
|
||||||
$delIndexDynaField = "APP_PARTICIPATED_USER_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_PARTICIPATED_USER_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// draft, add condition
|
// draft, add condition
|
||||||
@@ -356,6 +382,7 @@ class AppSolr
|
|||||||
if ($userUid != null && $action == 'unassigned') {
|
if ($userUid != null && $action == 'unassigned') {
|
||||||
// get the list of groups to which belongs the user.
|
// get the list of groups to which belongs the user.
|
||||||
$userGroups = $this->getUserGroups ($userUid);
|
$userGroups = $this->getUserGroups ($userUid);
|
||||||
|
|
||||||
$solrSearchText .= "(APP_UNASSIGNED_USERS:" . $userUid;
|
$solrSearchText .= "(APP_UNASSIGNED_USERS:" . $userUid;
|
||||||
if (count ($userGroups) > 0) {
|
if (count ($userGroups) > 0) {
|
||||||
$solrSearchText .= " OR ";
|
$solrSearchText .= " OR ";
|
||||||
@@ -370,7 +397,10 @@ class AppSolr
|
|||||||
}
|
}
|
||||||
$solrSearchText .= ") AND ";
|
$solrSearchText .= ") AND ";
|
||||||
|
|
||||||
$delIndexDynaField = "APP_UNASSIGNED_USER_GROUP_DEL_INDEX_" . trim ($userUid) . '_txt';
|
$delegationIndexes[] = "APP_UNASSIGNED_USER_GROUP_DEL_INDEX_" . trim ($userUid) . '_txt';
|
||||||
|
foreach ($userGroups as $group) {
|
||||||
|
$delegationIndexes[] = "APP_UNASSIGNED_USER_GROUP_DEL_INDEX_" . trim ($group ['GRP_UID']) . '_txt';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove last AND in condition
|
// remove last AND in condition
|
||||||
@@ -392,10 +422,9 @@ class AppSolr
|
|||||||
if ($search != "")
|
if ($search != "")
|
||||||
$solrSearchText .= "(" . $search . ")";
|
$solrSearchText .= "(" . $search . ")";
|
||||||
}
|
}
|
||||||
// add del_index dynamic field to list of resulting columns
|
// add del_index dynamic fields to list of resulting columns
|
||||||
$columsToInclude = array_merge ($columsToInclude, array (
|
// the fields begin in the 30th column and more
|
||||||
$delIndexDynaField
|
$columsToInclude = array_merge ($columsToInclude, $delegationIndexes);
|
||||||
));
|
|
||||||
|
|
||||||
// if is a counter no records are returned
|
// if is a counter no records are returned
|
||||||
if ($doCount) {
|
if ($doCount) {
|
||||||
@@ -420,6 +449,7 @@ class AppSolr
|
|||||||
'resultFormat' => 'json'
|
'resultFormat' => 'json'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$solrRequestData = Entity_SolrRequestData::createForRequestPagination ($data);
|
$solrRequestData = Entity_SolrRequestData::createForRequestPagination ($data);
|
||||||
// use search index to return list of cases
|
// use search index to return list of cases
|
||||||
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
||||||
@@ -465,13 +495,24 @@ class AppSolr
|
|||||||
$result ['totalCount'] = $solrQueryResult->iTotalDisplayRecords;
|
$result ['totalCount'] = $solrQueryResult->iTotalDisplayRecords;
|
||||||
|
|
||||||
// complete the missing data to display it in the grid.
|
// complete the missing data to display it in the grid.
|
||||||
|
$delIndexes = array(); //store all the delegation indexes
|
||||||
foreach ($solrQueryResult->aaData as $i => $data) {
|
foreach ($solrQueryResult->aaData as $i => $data) {
|
||||||
|
//initialize array
|
||||||
|
$delIndexes = array();
|
||||||
// complete empty values
|
// complete empty values
|
||||||
$appUID = $data [11];
|
$appUID = $data [11];
|
||||||
$delIndexes = $data [30];
|
//get all the delindexes
|
||||||
|
for($i = 30 ; $i < count($data) ; $i++) {
|
||||||
|
if (is_array ($data [$i])) {
|
||||||
|
foreach($data [$i] as $delIndex){
|
||||||
|
$delIndexes[] = $delIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// verify if the delindex is an array
|
// verify if the delindex is an array
|
||||||
// if is not an array all the indexed must be returned
|
// if is not check different types of repositories
|
||||||
if (! is_array ($delIndexes)) {
|
// the delegation index must always be defined.
|
||||||
|
if (count($delIndexes) == 0) {
|
||||||
// if is draft
|
// if is draft
|
||||||
if ($action == 'draft') {
|
if ($action == 'draft') {
|
||||||
$delIndexes [] = 1; // the first default index
|
$delIndexes [] = 1; // the first default index
|
||||||
@@ -480,9 +521,14 @@ class AppSolr
|
|||||||
// get all the indexes
|
// get all the indexes
|
||||||
$delIndexes = $this->getApplicationDelegationsIndex ($appUID);
|
$delIndexes = $this->getApplicationDelegationsIndex ($appUID);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$delIndexes = array();
|
//error an index must always be defined
|
||||||
|
print "Delegation not defined\n";
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
elseif ($action == 'unassigned'){
|
||||||
|
$delIndexes = $this->getApplicationDelegationsIndex ($appUID);
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
foreach ($delIndexes as $delIndex) {
|
foreach ($delIndexes as $delIndex) {
|
||||||
$aRow = array ();
|
$aRow = array ();
|
||||||
@@ -535,14 +581,14 @@ class AppSolr
|
|||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
} // end try
|
} // end try
|
||||||
catch ( InvalidIndexSearchTextException $e ) {
|
catch ( InvalidIndexSearchTextException $ex ) {
|
||||||
// return empty result with description of error
|
// return empty result with description of error
|
||||||
$result = array ();
|
$result = array ();
|
||||||
$result ['totalCount'] = 0;
|
$result ['totalCount'] = 0;
|
||||||
$result ['data'] = array ();
|
$result ['data'] = array ();
|
||||||
$result ['success'] = true;
|
$result ['success'] = true;
|
||||||
$result ['result'] = false;
|
$result ['result'] = false;
|
||||||
$result ['message'] = $e->getMessage ();
|
$result ['message'] = $ex->getMessage ();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -928,6 +974,7 @@ class AppSolr
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the information of the specified applications in Solr
|
* Update the information of the specified applications in Solr
|
||||||
*
|
*
|
||||||
@@ -954,6 +1001,7 @@ class AppSolr
|
|||||||
foreach ($aaAPPUIDs as $aAPPUID) {
|
foreach ($aaAPPUIDs as $aAPPUID) {
|
||||||
$this->applicationChangedUpdateSolrQueue ($aAPPUID ['APP_UID'], true);
|
$this->applicationChangedUpdateSolrQueue ($aAPPUID ['APP_UID'], true);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// create XML document
|
// create XML document
|
||||||
$xmlDoc = $this->createSolrXMLDocument ($aaAPPUIDs);
|
$xmlDoc = $this->createSolrXMLDocument ($aaAPPUIDs);
|
||||||
@@ -974,8 +1022,8 @@ class AppSolr
|
|||||||
$oSearchIndex->updateIndexDocument ($oSolrUpdateDocument);
|
$oSearchIndex->updateIndexDocument ($oSolrUpdateDocument);
|
||||||
// commit changes
|
// commit changes
|
||||||
$oSearchIndex->commitIndexChanges ($this->_solrInstance);
|
$oSearchIndex->commitIndexChanges ($this->_solrInstance);
|
||||||
} catch(Exception $ex)
|
}
|
||||||
{
|
catch(Exception $ex) {
|
||||||
//print "Excepcion indexing data: " . $ex->getMessage() . "\n"; die;
|
//print "Excepcion indexing data: " . $ex->getMessage() . "\n"; die;
|
||||||
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
||||||
fwrite($fh, $ex->getMessage());
|
fwrite($fh, $ex->getMessage());
|
||||||
@@ -1032,11 +1080,27 @@ class AppSolr
|
|||||||
try {
|
try {
|
||||||
$result = $this->getApplicationIndexData ($aAPPUID ['APP_UID']);
|
$result = $this->getApplicationIndexData ($aAPPUID ['APP_UID']);
|
||||||
}
|
}
|
||||||
catch ( ApplicationWithoutDelegationRecordsException $e ) {
|
catch ( ApplicationWithoutDelegationRecordsException $ex ) {
|
||||||
// exception trying to get application information
|
// exception trying to get application information
|
||||||
// skip and continue with the next application
|
// skip and continue with the next application
|
||||||
|
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
||||||
|
fwrite($fh, $ex->getMessage());
|
||||||
|
fclose($fh);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
catch( ApplicationWithCorruptDynaformException $ex) {
|
||||||
|
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
||||||
|
fwrite($fh, $ex->getMessage());
|
||||||
|
fclose($fh);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
catch (Exception $ex) {
|
||||||
|
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
||||||
|
fwrite($fh, "getApplicationIndexData " . $aAPPUID . ":" . $ex->getMessage() . "\n");
|
||||||
|
fclose($fh);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$documentInformation = $result [0];
|
$documentInformation = $result [0];
|
||||||
$dynaformFieldTypes = $result [1];
|
$dynaformFieldTypes = $result [1];
|
||||||
$lastUpdateDate = $result [2];
|
$lastUpdateDate = $result [2];
|
||||||
@@ -1058,14 +1122,20 @@ class AppSolr
|
|||||||
$draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
|
$draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
|
||||||
$unassignedUsers, $unassignedGroups);
|
$unassignedUsers, $unassignedGroups);
|
||||||
}
|
}
|
||||||
catch ( ApplicationAPP_DATAUnserializeException $e ) {
|
catch ( ApplicationAPP_DATAUnserializeException $ex ) {
|
||||||
// exception trying to get application information
|
// exception trying to get application information
|
||||||
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
||||||
fwrite($fh, $e->getMessage());
|
fwrite($fh, $ex->getMessage());
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
// skip and continue with the next application
|
// skip and continue with the next application
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
catch (Exception $ex) {
|
||||||
|
$fh = fopen("./SolrIndexErrors.txt", 'a') or die("can't open file to store Solr index errors.");
|
||||||
|
fwrite($fh, "buildSearchIndexDocumentPMOS2 " . $aAPPUID . ":" . $ex->getMessage() . "\n");
|
||||||
|
fclose($fh);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1315,8 +1385,8 @@ class AppSolr
|
|||||||
|
|
||||||
// add dynamic field for del_index information
|
// add dynamic field for del_index information
|
||||||
$writer->startElement ("field");
|
$writer->startElement ("field");
|
||||||
$writer->writeAttribute ('name', 'APP_UNASSIGNED_USER_GROUP_DEL_INDEX_' . trim ($userUID ['USR_UID']) . '_txt');
|
$writer->writeAttribute ('name', 'APP_UNASSIGNED_USER_GROUP_DEL_INDEX_' . trim ($groupUID ['USR_UID']) . '_txt');
|
||||||
$writer->text ($userUID ['DEL_INDEX']);
|
$writer->text ($groupUID ['DEL_INDEX']);
|
||||||
$writer->endElement ();
|
$writer->endElement ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1333,7 +1403,7 @@ class AppSolr
|
|||||||
|
|
||||||
if (! $UnSerializedCaseData) {
|
if (! $UnSerializedCaseData) {
|
||||||
// error unserializing
|
// error unserializing
|
||||||
throw new ApplicationAPP_DATAUnserializeException ("Could not unserialize APP_DATA of APP_UID: " . $documentData ['APP_UID']);
|
throw new ApplicationAPP_DATAUnserializeException ("Could not unserialize APP_DATA of APP_UID: " . $documentData ['APP_UID'] . "\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach ($UnSerializedCaseData as $k => $value) {
|
foreach ($UnSerializedCaseData as $k => $value) {
|
||||||
@@ -1347,14 +1417,14 @@ class AppSolr
|
|||||||
$typeSufix = '_t';
|
$typeSufix = '_t';
|
||||||
break;
|
break;
|
||||||
case 'Int' :
|
case 'Int' :
|
||||||
if(intval ($value) > 2147483647) {
|
if(intval ($value) > 2147483647) {
|
||||||
$typeSufix = '_tl'; //for long values
|
$typeSufix = '_tl'; //for long values
|
||||||
$value = intval ($value);
|
$value = intval ($value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$typeSufix = '_ti';
|
$typeSufix = '_ti';
|
||||||
$value = intval ($value);
|
$value = intval ($value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Real' :
|
case 'Real' :
|
||||||
$typeSufix = '_td';
|
$typeSufix = '_td';
|
||||||
@@ -1397,7 +1467,7 @@ class AppSolr
|
|||||||
break;
|
break;
|
||||||
case 'currency' :
|
case 'currency' :
|
||||||
$typeSufix = '_td';
|
$typeSufix = '_td';
|
||||||
$value = floatval ($value);
|
$value = floatval ($value);
|
||||||
break;
|
break;
|
||||||
case 'percentage' :
|
case 'percentage' :
|
||||||
$typeSufix = '_t';
|
$typeSufix = '_t';
|
||||||
@@ -1481,7 +1551,7 @@ class AppSolr
|
|||||||
// this case occurs when the application doesn't have related delegation
|
// this case occurs when the application doesn't have related delegation
|
||||||
// records.
|
// records.
|
||||||
if (empty ($allAppDbData) || ! isset ($allAppDbData [0])) {
|
if (empty ($allAppDbData) || ! isset ($allAppDbData [0])) {
|
||||||
throw new ApplicationWithoutDelegationRecordsException ("Application without delegation records. APP_UID: " . $AppUID);
|
throw new ApplicationWithoutDelegationRecordsException ("Application without delegation records. APP_UID: " . $AppUID . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the application information
|
// copy the application information
|
||||||
@@ -1593,33 +1663,42 @@ class AppSolr
|
|||||||
// search information of unassigned users
|
// search information of unassigned users
|
||||||
// the unassigned users are the self service users and groups.
|
// the unassigned users are the self service users and groups.
|
||||||
// the self service users are defined in the TASKs of the PROCESS.
|
// the self service users are defined in the TASKs of the PROCESS.
|
||||||
foreach ($allAppDbData as $row) {
|
$unassignedUsers = array ();
|
||||||
|
$unassignedGroups = array ();
|
||||||
|
//filter only the delegations that are in selfservice status
|
||||||
|
// `USR_UID` = '' AND `DEL_FINISH_DATE` IS NULL
|
||||||
|
$indexes = $this->aaSearchRecords ($allAppDbData, array (
|
||||||
|
'USR_UID' => 'NULL',
|
||||||
|
'DEL_FINISH_DATE' => 'NULL',
|
||||||
|
'APP_THREAD_STATUS' => 'OPEN'
|
||||||
|
));
|
||||||
|
foreach ($indexes as $index) {
|
||||||
$unassignedUsersGroups = array ();
|
$unassignedUsersGroups = array ();
|
||||||
// use cache
|
// use cache
|
||||||
$oMemcache = PMmemcached::getSingleton ($this->_solrInstance);
|
$oMemcache = PMmemcached::getSingleton ($this->_solrInstance);
|
||||||
$unassignedUsersGroups = $oMemcache->get ($row ['PRO_UID'] . "_" . $row ['TAS_UID']);
|
$unassignedUsersGroups = $oMemcache->get ($allAppDbData [$index] ['PRO_UID'] . "_" . $allAppDbData [$index] ['TAS_UID']);
|
||||||
if (! $unassignedUsersGroups) {
|
if (! $unassignedUsersGroups) {
|
||||||
|
|
||||||
$unassignedUsersGroups = $this->getTaskUnassignedUsersGroupsData ($row ['PRO_UID'], $row ['TAS_UID']);
|
$unassignedUsersGroups = $this->getTaskUnassignedUsersGroupsData ($allAppDbData [$index] ['PRO_UID'], $allAppDbData [$index] ['TAS_UID']);
|
||||||
|
|
||||||
// add del_index
|
// if the task has unassigned users or groups add del_index of delegation
|
||||||
foreach ($unassignedUsersGroups as $i => $newRow) {
|
foreach ($unassignedUsersGroups as $i => $newRow) {
|
||||||
$unassignedUsersGroups [$i] ['DEL_INDEX'] = $row ['DEL_INDEX'];
|
$unassignedUsersGroups [$i] ['DEL_INDEX'] = $allAppDbData [$index] ['DEL_INDEX'];
|
||||||
}
|
}
|
||||||
// store in cache
|
// store in cache
|
||||||
$oMemcache->set ($row ['PRO_UID'] . "_" . $row ['TAS_UID'], $unassignedUsersGroups);
|
$oMemcache->set ($allAppDbData [$index] ['PRO_UID'] . "_" . $allAppDbData [$index] ['TAS_UID'], $unassignedUsersGroups);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy list of unassigned users and groups
|
// copy list of unassigned users and groups
|
||||||
$unassignedUsers = array ();
|
|
||||||
$unassignedGroups = array ();
|
|
||||||
foreach ($unassignedUsersGroups as $unassignedUserGroup) {
|
foreach ($unassignedUsersGroups as $unassignedUserGroup) {
|
||||||
|
//unassigned users
|
||||||
if ($unassignedUserGroup ['TU_RELATION'] == 1) {
|
if ($unassignedUserGroup ['TU_RELATION'] == 1) {
|
||||||
$unassignedUsers [] = array (
|
$unassignedUsers [] = array (
|
||||||
'USR_UID' => $unassignedUserGroup ['USR_UID'],
|
'USR_UID' => $unassignedUserGroup ['USR_UID'],
|
||||||
'DEL_INDEX' => $unassignedUserGroup ['DEL_INDEX']
|
'DEL_INDEX' => $unassignedUserGroup ['DEL_INDEX']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
//unassigned groups
|
||||||
elseif ($unassignedUserGroup ['TU_RELATION'] == 2) {
|
elseif ($unassignedUserGroup ['TU_RELATION'] == 2) {
|
||||||
$unassignedGroups [] = array (
|
$unassignedGroups [] = array (
|
||||||
'USR_UID' => $unassignedUserGroup ['USR_UID'],
|
'USR_UID' => $unassignedUserGroup ['USR_UID'],
|
||||||
@@ -1644,12 +1723,17 @@ class AppSolr
|
|||||||
G::LoadClass ('dynaformhandler');
|
G::LoadClass ('dynaformhandler');
|
||||||
$dynaformFileNames = $this->getProcessDynaformFileNames ($documentInformation ['PRO_UID']);
|
$dynaformFileNames = $this->getProcessDynaformFileNames ($documentInformation ['PRO_UID']);
|
||||||
$dynaformFields = array ();
|
$dynaformFields = array ();
|
||||||
foreach ($dynaformFileNames as $dynaformFileName) {
|
foreach ($dynaformFileNames as $dynaformFileName) {
|
||||||
if (file_exists (PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&
|
if (file_exists (PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&
|
||||||
filesize(PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml') >0 ) {
|
filesize(PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml') >0 ) {
|
||||||
$dyn = new dynaFormHandler (PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml');
|
$dyn = new dynaFormHandler (PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml');
|
||||||
$dynaformFields [] = $dyn->getFields ();
|
$dynaformFields [] = $dyn->getFields ();
|
||||||
}
|
}
|
||||||
|
if (file_exists (PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&
|
||||||
|
filesize(PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName ['DYN_FILENAME'] . '.xml') == 0 ) {
|
||||||
|
|
||||||
|
throw new ApplicationWithCorruptDynaformException("Application with corrupt dynaform. APP_UID: " . $AppUID . "\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($dynaformFields as $aDynFormFields) {
|
foreach ($dynaformFields as $aDynFormFields) {
|
||||||
@@ -1787,10 +1871,10 @@ class AppSolr
|
|||||||
* Search array of indexes that fullfill the conditions
|
* Search array of indexes that fullfill the conditions
|
||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
* array o arrays $arr contains the arrays that are searched
|
* array of arrays $arr contains the arrays that are searched
|
||||||
* @param array $andColumnsConditions
|
* @param array $andColumnsConditions
|
||||||
* contain the conditions that must fullfill 'Column'=>'Condition'
|
* contain the conditions that must fullfill 'Column'=>'Condition'
|
||||||
* @return array array of indexes with the found records
|
* @return array of indexes with the found records
|
||||||
*/
|
*/
|
||||||
public function aaSearchRecords($arr, $andColumnsConditions)
|
public function aaSearchRecords($arr, $andColumnsConditions)
|
||||||
{
|
{
|
||||||
@@ -2092,11 +2176,28 @@ class AppSolr
|
|||||||
*/
|
*/
|
||||||
public function getCountApplicationsSearchIndex()
|
public function getCountApplicationsSearchIndex()
|
||||||
{
|
{
|
||||||
|
G::LoadClass ('searchIndex');
|
||||||
|
|
||||||
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
||||||
// execute query
|
// execute query
|
||||||
$count = $searchIndex->getNumberDocuments ($this->_solrInstance);
|
$count = $searchIndex->getNumberDocuments ($this->_solrInstance);
|
||||||
|
|
||||||
return $count;
|
return $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optimize the records in search index
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public function optimizeSearchIndex()
|
||||||
|
{
|
||||||
|
G::LoadClass ('searchIndex');
|
||||||
|
|
||||||
|
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
// execute query
|
||||||
|
$searchIndex->optimizeIndexChanges ($this->_solrInstance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2135,9 +2236,9 @@ class AppSolr
|
|||||||
* Reindex all the application records in Solr server
|
* Reindex all the application records in Solr server
|
||||||
* update applications in groups of 1000
|
* update applications in groups of 1000
|
||||||
*/
|
*/
|
||||||
public function reindexAllApplications()
|
public function reindexAllApplications($SkipRecords = 0, $indexTrunkSize = 1000)
|
||||||
{
|
{
|
||||||
$trunk = 1000;
|
$trunk = $indexTrunkSize;
|
||||||
// delete all documents to begin reindex
|
// delete all documents to begin reindex
|
||||||
// deleteAllDocuments();
|
// deleteAllDocuments();
|
||||||
// commitChanges();
|
// commitChanges();
|
||||||
@@ -2147,8 +2248,8 @@ class AppSolr
|
|||||||
print "Total number of records: " . $numRows . "\n";
|
print "Total number of records: " . $numRows . "\n";
|
||||||
//
|
//
|
||||||
$initTimeAll = microtime (true);
|
$initTimeAll = microtime (true);
|
||||||
// $numRows = 15;
|
|
||||||
for ($skip = 0; $skip <= $numRows;) {
|
for ($skip = $SkipRecords; $skip <= $numRows;) {
|
||||||
$aaAPPUIds = $this->getPagedApplicationUids ($skip, $trunk);
|
$aaAPPUIds = $this->getPagedApplicationUids ($skip, $trunk);
|
||||||
|
|
||||||
printf ("Indexing %d to %d \n", $skip, $skip + $trunk);
|
printf ("Indexing %d to %d \n", $skip, $skip + $trunk);
|
||||||
@@ -2162,6 +2263,7 @@ class AppSolr
|
|||||||
|
|
||||||
$curTimeDoc = gmdate ('H:i:s', (microtime (true) - $initTimeAll));
|
$curTimeDoc = gmdate ('H:i:s', (microtime (true) - $initTimeAll));
|
||||||
printf ("Total reindex time: %s \n", $curTimeDoc);
|
printf ("Total reindex time: %s \n", $curTimeDoc);
|
||||||
|
printf ("Reindex completed successfully!!.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -445,6 +445,7 @@ class processMap {
|
|||||||
|
|
||||||
//If the function returns a DEFAULT calendar it means that this object doesn't have assigned any calendar
|
//If the function returns a DEFAULT calendar it means that this object doesn't have assigned any calendar
|
||||||
$aFields['PRO_CALENDAR'] = $calendarInfo ['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo ['CALENDAR_UID'] : "";
|
$aFields['PRO_CALENDAR'] = $calendarInfo ['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo ['CALENDAR_UID'] : "";
|
||||||
|
$aFields['SYS_LANG'] = SYS_LANG;
|
||||||
|
|
||||||
global $G_PUBLISH;
|
global $G_PUBLISH;
|
||||||
$G_PUBLISH = new Publisher ( );
|
$G_PUBLISH = new Publisher ( );
|
||||||
|
|||||||
@@ -331,6 +331,20 @@ class BpmnEngine_Services_SearchIndex
|
|||||||
$solr->commitChanges ($workspace);
|
$solr->commitChanges ($workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optimize index changes
|
||||||
|
* @param string $workspace
|
||||||
|
*/
|
||||||
|
public function optimizeIndexChanges($workspace)
|
||||||
|
{
|
||||||
|
G::LoadClass ('solr');
|
||||||
|
|
||||||
|
$solr = new BpmnEngine_SearchIndexAccess_Solr ($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
|
// commit
|
||||||
|
$solr->optimizeChanges ($workspace);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call Solr server to return the list of paginated pages.
|
* Call Solr server to return the list of paginated pages.
|
||||||
* @param FacetRequest $solrRequestData
|
* @param FacetRequest $solrRequestData
|
||||||
|
|||||||
@@ -968,10 +968,16 @@ class workspaceTools {
|
|||||||
$backup = new Archive_Tar($filename);
|
$backup = new Archive_Tar($filename);
|
||||||
//Get a temporary directory in the upgrade directory
|
//Get a temporary directory in the upgrade directory
|
||||||
$tempDirectory = PATH_DATA . "upgrade/" . basename(tempnam(__FILE__, ''));
|
$tempDirectory = PATH_DATA . "upgrade/" . basename(tempnam(__FILE__, ''));
|
||||||
mkdir($tempDirectory);
|
$parentDirectory = PATH_DATA . "upgrade";
|
||||||
|
if (is_writable($parentDirectory)) {
|
||||||
|
mkdir($tempDirectory);
|
||||||
|
} else {
|
||||||
|
throw new Exception("Could not create directory:" . $parentDirectory);
|
||||||
|
}
|
||||||
//Extract all backup files, including database scripts and workspace files
|
//Extract all backup files, including database scripts and workspace files
|
||||||
if (!$backup->extract($tempDirectory))
|
if (!$backup->extract($tempDirectory)) {
|
||||||
throw new Exception("Could not extract backup");
|
throw new Exception("Could not extract backup");
|
||||||
|
}
|
||||||
//Search for metafiles in the new standard (the old standard would contain
|
//Search for metafiles in the new standard (the old standard would contain
|
||||||
//txt files).
|
//txt files).
|
||||||
$metaFiles = glob($tempDirectory . "/*.meta");
|
$metaFiles = glob($tempDirectory . "/*.meta");
|
||||||
@@ -1015,9 +1021,9 @@ class workspaceTools {
|
|||||||
else
|
else
|
||||||
throw new Exception("Destination workspace already exist (use -o to overwrite)");
|
throw new Exception("Destination workspace already exist (use -o to overwrite)");
|
||||||
|
|
||||||
if (file_exists($workspace->path))
|
if (file_exists($workspace->path)) {
|
||||||
G::rm_dir($workspace->path);
|
G::rm_dir($workspace->path);
|
||||||
|
}
|
||||||
foreach ($metadata->directories as $dir) {
|
foreach ($metadata->directories as $dir) {
|
||||||
CLI::logging("+> Restoring directory '$dir'\n");
|
CLI::logging("+> Restoring directory '$dir'\n");
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class Process extends BaseProcess {
|
|||||||
if ($this->pro_title !== $v || $v === '') {
|
if ($this->pro_title !== $v || $v === '') {
|
||||||
$this->pro_title = $v;
|
$this->pro_title = $v;
|
||||||
$lang = defined ( 'SYS_LANG') ? SYS_LANG : 'en';
|
$lang = defined ( 'SYS_LANG') ? SYS_LANG : 'en';
|
||||||
|
|
||||||
$res = Content::addContent( 'PRO_TITLE', '', $this->getProUid(), $lang, $this->pro_title );
|
$res = Content::addContent( 'PRO_TITLE', '', $this->getProUid(), $lang, $this->pro_title );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,6 +191,9 @@ class Process extends BaseProcess {
|
|||||||
$this->setProDescription ( 'Default Process Description' );
|
$this->setProDescription ( 'Default Process Description' );
|
||||||
|
|
||||||
$con->commit();
|
$con->commit();
|
||||||
|
|
||||||
|
$this->memcachedDelete();
|
||||||
|
|
||||||
return $this->getProUid();
|
return $this->getProUid();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -393,7 +396,7 @@ class Process extends BaseProcess {
|
|||||||
if (isset($aData['PRO_DYNAFORMS']) && is_array($aData['PRO_DYNAFORMS'])) {
|
if (isset($aData['PRO_DYNAFORMS']) && is_array($aData['PRO_DYNAFORMS'])) {
|
||||||
$aData['PRO_DYNAFORMS'] = @serialize($aData['PRO_DYNAFORMS']);
|
$aData['PRO_DYNAFORMS'] = @serialize($aData['PRO_DYNAFORMS']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$con = Propel::getConnection( ProcessPeer::DATABASE_NAME );
|
$con = Propel::getConnection( ProcessPeer::DATABASE_NAME );
|
||||||
try {
|
try {
|
||||||
$con->begin();
|
$con->begin();
|
||||||
@@ -513,8 +516,11 @@ class Process extends BaseProcess {
|
|||||||
$oPro = ProcessPeer::retrieveByPK( $ProUid );
|
$oPro = ProcessPeer::retrieveByPK( $ProUid );
|
||||||
if (!is_null($oPro))
|
if (!is_null($oPro))
|
||||||
{
|
{
|
||||||
Content::removeContent('PRO_TITLE', '', $oPro->getProUid());
|
Content::removeContent('PRO_TITLE', '', $oPro->getProUid());
|
||||||
Content::removeContent('PRO_DESCRIPTION', '', $oPro->getProUid());
|
Content::removeContent('PRO_DESCRIPTION', '', $oPro->getProUid());
|
||||||
|
|
||||||
|
$this->memcachedDelete();
|
||||||
|
|
||||||
return $oPro->delete();
|
return $oPro->delete();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -715,7 +721,7 @@ class Process extends BaseProcess {
|
|||||||
|
|
||||||
$memcache = & PMmemcached::getSingleton(SYS_SYS);
|
$memcache = & PMmemcached::getSingleton(SYS_SYS);
|
||||||
$memkey = 'getCasesCountInAllProcesses';
|
$memkey = 'getCasesCountInAllProcesses';
|
||||||
if ( ($aProcesses = $memcache->get( $memkey )) === false ) {
|
if ( ($aProcesses = $memcache->get( $memkey )) === false ) {
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||||
$oCriteria->addSelectColumn(ApplicationPeer::APP_STATUS);
|
$oCriteria->addSelectColumn(ApplicationPeer::APP_STATUS);
|
||||||
@@ -732,7 +738,7 @@ class Process extends BaseProcess {
|
|||||||
$aProcesses[$row['PRO_UID']][$row['APP_STATUS']] = $row['CNT'];
|
$aProcesses[$row['PRO_UID']][$row['APP_STATUS']] = $row['CNT'];
|
||||||
}
|
}
|
||||||
$memcache->set( $memkey , $aProcesses, PMmemcached::ONE_HOUR );
|
$memcache->set( $memkey , $aProcesses, PMmemcached::ONE_HOUR );
|
||||||
}
|
}
|
||||||
return $aProcesses;
|
return $aProcesses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,7 +757,23 @@ class Process extends BaseProcess {
|
|||||||
return $aProc;
|
return $aProc;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Process
|
public function memcachedDelete()
|
||||||
|
{
|
||||||
|
//Limit defined in processmaker/workflow/engine/templates/processes/main.js
|
||||||
|
$limit = 25;
|
||||||
|
$start = 0;
|
||||||
|
|
||||||
|
$memcache = &PMmemcached::getSingleton(SYS_SYS);
|
||||||
|
|
||||||
|
for ($start = 0; $start <= 50 - 1; $start++) {
|
||||||
|
$memkey = "processList-allProcesses-" . ($start * $limit) . "-" . $limit;
|
||||||
|
$memkeyTotal = $memkey . "-total";
|
||||||
|
|
||||||
|
$r = $memcache->delete($memkey);
|
||||||
|
$r = $memcache->delete($memkeyTotal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //Process
|
||||||
|
|
||||||
function ordProcessByProTitle($a, $b){
|
function ordProcessByProTitle($a, $b){
|
||||||
|
|
||||||
|
|||||||
@@ -192,42 +192,41 @@ class Main extends Controller
|
|||||||
|
|
||||||
$availableLangArray = $this->getLanguagesList();
|
$availableLangArray = $this->getLanguagesList();
|
||||||
|
|
||||||
//$G_PUBLISH = new Publisher ();
|
|
||||||
//$G_PUBLISH->AddContent ('xmlform', 'xmlform', 'login/login', '', $aFields, SYS_URI .
|
|
||||||
//'login/authentication.php');
|
|
||||||
|
|
||||||
G::LoadClass ('serverConfiguration');
|
G::LoadClass ('serverConfiguration');
|
||||||
|
|
||||||
if (($nextBeatDate = $this->memcache->get('nextBeatDate')) === false) {
|
$oServerConf = & serverConf::getSingleton ();
|
||||||
//get the serverconf singleton, and check if we can send the heartbeat
|
$flagHeartBeat = '';
|
||||||
$oServerConf = & serverConf::getSingleton ();
|
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
|
||||||
|
$sflag = (trim($sflag) != '') ? $sflag : '1';
|
||||||
|
|
||||||
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION','HEART_BEAT_CONF');
|
//get date of next beat
|
||||||
$sflag = (trim($sflag)!='')?$sflag:'1';
|
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||||
|
|
||||||
//get date of next beat
|
//if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
|
||||||
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF');
|
if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
|
||||||
$this->memcache->set('nextBeatDate', $nextBeatDate, 1*3600);
|
//To do: we need to change to ExtJs
|
||||||
|
$this->setJSVar('flagHeartBeat', ($flagHeartBeat == 1));
|
||||||
|
} else {
|
||||||
|
$this->setJSVar('flagHeartBeat', ($flagHeartBeat == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sflag = 1;
|
|
||||||
//check if we show the panel with the getting started info
|
//check if we show the panel with the getting started info
|
||||||
if (($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false) {
|
require_once 'classes/model/Configuration.php';
|
||||||
require_once 'classes/model/Configuration.php';
|
$oConfiguration = new Configuration ();
|
||||||
$oConfiguration = new Configuration ();
|
$oCriteria = new Criteria ('workflow');
|
||||||
$oCriteria = new Criteria ('workflow');
|
$oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted');
|
||||||
$oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted');
|
$oCriteria->add (ConfigurationPeer::OBJ_UID, '');
|
||||||
$oCriteria->add (ConfigurationPeer::OBJ_UID, '');
|
$oCriteria->add (ConfigurationPeer::CFG_VALUE, '1');
|
||||||
$oCriteria->add (ConfigurationPeer::CFG_VALUE, '1');
|
$oCriteria->add (ConfigurationPeer::PRO_UID, '');
|
||||||
$oCriteria->add (ConfigurationPeer::PRO_UID, '');
|
$oCriteria->add (ConfigurationPeer::USR_UID, '');
|
||||||
$oCriteria->add (ConfigurationPeer::USR_UID, '');
|
$oCriteria->add (ConfigurationPeer::APP_UID, '');
|
||||||
$oCriteria->add (ConfigurationPeer::APP_UID, '');
|
$flagGettingStarted = ConfigurationPeer::doCount ($oCriteria);
|
||||||
$flagGettingStarted = ConfigurationPeer::doCount ($oCriteria);
|
if ($flagGettingStarted == 0) {
|
||||||
$this->memcache->set('flagGettingStarted', $flagGettingStarted, 8*3600) ;
|
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 1));
|
||||||
|
} else {
|
||||||
|
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
|
|
||||||
|
|
||||||
G::loadClass('configuration');
|
G::loadClass('configuration');
|
||||||
$oConf = new Configurations;
|
$oConf = new Configurations;
|
||||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
||||||
|
|||||||
@@ -318,6 +318,8 @@
|
|||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
||||||
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_POST['DYN_UID'];
|
||||||
|
|
||||||
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
||||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view');
|
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view');
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,18 @@ try {
|
|||||||
require_once 'classes/model/Dynaform.php';
|
require_once 'classes/model/Dynaform.php';
|
||||||
require_once 'classes/model/Process.php';
|
require_once 'classes/model/Process.php';
|
||||||
|
|
||||||
|
$currentDynUid = '';
|
||||||
|
if (isset($_GET['DYNUIDPRINT']) && $_GET['DYNUIDPRINT'] != '') {
|
||||||
|
$currentDynUid = $_GET['DYNUIDPRINT'];
|
||||||
|
} elseif (isset($_SESSION['DYN_UID_PRINT'])) {
|
||||||
|
$currentDynUid = $_SESSION['DYN_UID_PRINT'];
|
||||||
|
} elseif (isset($_SESSION['CURRENT_DYN_UID'])) {
|
||||||
|
$currentDynUid = $_SESSION['CURRENT_DYN_UID'];
|
||||||
|
}
|
||||||
|
|
||||||
$oDynaform = new Dynaform();
|
$oDynaform = new Dynaform();
|
||||||
$aDyn = $oDynaform->load($_SESSION['CURRENT_DYN_UID']);
|
$aDyn = $oDynaform->load($currentDynUid);
|
||||||
|
|
||||||
G::LoadClass('case');
|
G::LoadClass('case');
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
|
|
||||||
@@ -75,9 +83,7 @@ try {
|
|||||||
$array['PROCESS'] = G::LoadTranslation('ID_PROCESS');
|
$array['PROCESS'] = G::LoadTranslation('ID_PROCESS');
|
||||||
$array['DATELABEL'] = G::LoadTranslation('DATE_LABEL');
|
$array['DATELABEL'] = G::LoadTranslation('DATE_LABEL');
|
||||||
|
|
||||||
$aDyn['DYN_UID'] = (isset($_SESSION['DYN_UID_PRINT']) && $_SESSION['DYN_UID_PRINT'] != '')
|
$aDyn['DYN_UID'] = $currentDynUid;
|
||||||
? $_SESSION['DYN_UID_PRINT']
|
|
||||||
: $aDyn['DYN_UID'];
|
|
||||||
if ($noShowTitle == 0) {
|
if ($noShowTitle == 0) {
|
||||||
$G_PUBLISH->AddContent('smarty', 'cases/cases_PrintViewTitle', '', '', $array);
|
$G_PUBLISH->AddContent('smarty', 'cases/cases_PrintViewTitle', '', '', $array);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
/*if (strtoupper($Fields['APP_STATUS']) != 'COMPLETED') {
|
/*if (strtoupper($Fields['APP_STATUS']) != 'COMPLETED') {
|
||||||
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE');
|
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE');
|
||||||
}*/
|
}*/
|
||||||
$aMessage['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED ');
|
$aMessage['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||||
G::RenderPage('publishBlank', 'blank');
|
G::RenderPage('publishBlank', 'blank');
|
||||||
|
|||||||
@@ -207,6 +207,7 @@
|
|||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = $aNextStep['PAGE'];
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = $aNextStep['PAGE'];
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = G::loadTranslation('ID_NEXT_STEP');
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = G::loadTranslation('ID_NEXT_STEP');
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PHPSESSID'] = @session_id();
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PHPSESSID'] = @session_id();
|
||||||
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_GET['UID'];
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher =& headPublisher::getSingleton();
|
||||||
$oHeadPublisher->addScriptCode("
|
$oHeadPublisher->addScriptCode("
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ $sflag = (trim($sflag) != '') ? $sflag : '1';
|
|||||||
|
|
||||||
//get date of next beat
|
//get date of next beat
|
||||||
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||||
$sflag = 1;
|
|
||||||
|
|
||||||
//if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
|
//if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
|
||||||
if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
|
if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ switch($function){
|
|||||||
$_POST['form']['PRO_UID'] = $_GET['PRO_UID'];
|
$_POST['form']['PRO_UID'] = $_GET['PRO_UID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$_POST['form']['PRO_TITLE'] = trim($_POST['form']['PRO_TITLE']);
|
||||||
|
|
||||||
G::LoadClass('processMap');
|
G::LoadClass('processMap');
|
||||||
$oProcessMap = new ProcessMap();
|
$oProcessMap = new ProcessMap();
|
||||||
if (!isset($_POST['form']['PRO_UID'])) {
|
if (!isset($_POST['form']['PRO_UID'])) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ new Ext.KeyMap(document, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/*** global variables **/
|
/*** global variables **/
|
||||||
var storeCases;
|
var storeCases;
|
||||||
var storeReassignCases;
|
var storeReassignCases;
|
||||||
@@ -210,7 +211,7 @@ function pauseCase(date){
|
|||||||
xtype:'checkbox',
|
xtype:'checkbox',
|
||||||
name: 'notifyReason',
|
name: 'notifyReason',
|
||||||
hideLabel: true,
|
hideLabel: true,
|
||||||
boxLabel: _('ID_NOTIFY_USERS_CASE'),
|
boxLabel: _('ID_NOTIFY_USERS_CASE')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ Ext.onReady(function(){
|
|||||||
xtype:'checkbox',
|
xtype:'checkbox',
|
||||||
name: 'notifyReason',
|
name: 'notifyReason',
|
||||||
hideLabel: true,
|
hideLabel: true,
|
||||||
boxLabel: _('ID_NOTIFY_USERS_CASE'),
|
boxLabel: _('ID_NOTIFY_USERS_CASE')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -688,7 +688,7 @@ Ext.onReady(function(){
|
|||||||
id: 'notifyReason',
|
id: 'notifyReason',
|
||||||
xtype:'checkbox',
|
xtype:'checkbox',
|
||||||
name: 'notifyReason',
|
name: 'notifyReason',
|
||||||
fieldLabel: _('ID_NOTIFY_USERS_CASE'),
|
fieldLabel: _('ID_NOTIFY_USERS_CASE')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
buttons : [
|
buttons : [
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ var Login = function() {
|
|||||||
if (flagGettingStarted) {
|
if (flagGettingStarted) {
|
||||||
this.gettingStartedWindow.show();
|
this.gettingStartedWindow.show();
|
||||||
}
|
}
|
||||||
|
if (flagHeartBeat) {
|
||||||
|
processHbInfo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
@@ -374,6 +377,19 @@ Login.initComponents = function()
|
|||||||
//Ext.getCmp('login-form').hide();
|
//Ext.getCmp('login-form').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processHbInfo = function() {
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url : '../services/processHeartBeat_Ajax' ,
|
||||||
|
params : {action:'processInformation'},
|
||||||
|
success: function ( result, request ) {
|
||||||
|
//console.info("");
|
||||||
|
},
|
||||||
|
failure: function ( result, request) {
|
||||||
|
//Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Login.forgotPassword = function()
|
Login.forgotPassword = function()
|
||||||
{
|
{
|
||||||
this.window.hide();
|
this.window.hide();
|
||||||
|
|||||||
@@ -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];
|
|
||||||
//}
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
<PREVIOUS_ACTION type="private"/>
|
<PREVIOUS_ACTION type="private"/>
|
||||||
<NEXT_ACTION type="private"/>
|
<NEXT_ACTION type="private"/>
|
||||||
<PHPSESSID type="private"/>
|
<PHPSESSID type="private"/>
|
||||||
<PRINT_PREVIEW_ACTION type="private" defaultValue="../cases/cases_PrintView?PHPSESSID=@#PHPSESSID"/>
|
<DYNUIDPRINT type="private"/>
|
||||||
|
<PRINT_PREVIEW_ACTION type="private" defaultValue="../cases/cases_PrintView?PHPSESSID=@#PHPSESSID&DYNUIDPRINT=@#DYNUIDPRINT"/>
|
||||||
<MNUP type="print" colWidth="20" title="" value='' colAlign="left" link="@#PRINT_PREVIEW_ACTION" width="800" height="600" left="0" top="0" resizable="1">
|
<MNUP type="print" colWidth="20" title="" value='' colAlign="left" link="@#PRINT_PREVIEW_ACTION" width="800" height="600" left="0" top="0" resizable="1">
|
||||||
<en>Print form</en>
|
<en>Print form</en>
|
||||||
</MNUP>
|
</MNUP>
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
<tr style="display: none;">
|
<tr style="display: none;">
|
||||||
<td colspan="2">{$form.THETYPE}</td>
|
<td colspan="2">{$form.THETYPE}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr style="display: none;">
|
||||||
|
<td colspan="2">{$form.SYS_LANG} {$form.PRO_VALIDATE_TITLE}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="FormLabel" width="{$form_labelWidth}"><font color="red">* </font>{$PRO_TITLE}</td>
|
<td class="FormLabel" width="{$form_labelWidth}"><font color="red">* </font>{$PRO_TITLE}</td>
|
||||||
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PRO_TITLE}</td>
|
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PRO_TITLE}</td>
|
||||||
|
|||||||
@@ -9,10 +9,24 @@
|
|||||||
|
|
||||||
<THETYPE type="hidden"/>
|
<THETYPE type="hidden"/>
|
||||||
|
|
||||||
<PRO_TITLE type="text" size="50" maxlength="255" defaultvalue="" required="1" group="1" dependentfields="" linkfield="" strto="" readonly="0" noshowingrid="0" readonlyingrid="0" totalizeable="0" sqlconnection="">
|
<SYS_LANG type="text"/>
|
||||||
|
|
||||||
|
<PRO_TITLE type="text" size="50" maxlength="255" defaultvalue="" required="1" group="1" dependentfields="PRO_VALIDATE_TITLE" linkfield="" strto="" readonly="0" noshowingrid="0" readonlyingrid="0" totalizeable="0" sqlconnection="">
|
||||||
<en>Title</en>
|
<en>Title</en>
|
||||||
</PRO_TITLE>
|
</PRO_TITLE>
|
||||||
|
|
||||||
|
<PRO_VALIDATE_TITLE type="text">
|
||||||
|
SELECT
|
||||||
|
PRO_UID
|
||||||
|
FROM
|
||||||
|
PROCESS
|
||||||
|
INNER JOIN CONTENT ON (CONTENT.CON_ID = PROCESS.PRO_UID)
|
||||||
|
WHERE
|
||||||
|
CON_LANG = @@SYS_LANG AND
|
||||||
|
CON_VALUE = TRIM(@@PRO_TITLE)
|
||||||
|
<en>Title</en>
|
||||||
|
</PRO_VALIDATE_TITLE>
|
||||||
|
|
||||||
<PRO_DESCRIPTION type="textarea" rows="8" cols="60">
|
<PRO_DESCRIPTION type="textarea" rows="8" cols="60">
|
||||||
<en>Description</en>
|
<en>Description</en>
|
||||||
</PRO_DESCRIPTION>
|
</PRO_DESCRIPTION>
|
||||||
@@ -66,30 +80,56 @@
|
|||||||
|
|
||||||
<JS type="javascript" replacetags="1">
|
<JS type="javascript" replacetags="1">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
var validateNameProcess = true;
|
||||||
|
var naProcess = new input(getField('PRO_TITLE'));
|
||||||
|
naProcess.passed();
|
||||||
|
|
||||||
var verifyProcessInformation = function(oForm) {
|
var verifyProcessInformation = function(oForm) {
|
||||||
var oAux;
|
if (validateNameProcess) {
|
||||||
var bContinue = true;
|
var oAux;
|
||||||
oAux = oForm.elements['form[PRO_TITLE]'];
|
var bContinue = true;
|
||||||
if (oAux.value == '') {
|
oAux = oForm.elements['form[PRO_TITLE]'];
|
||||||
alert('@G::LoadTranslation(ID_PROCESS_TITLE_REQUIRED)');
|
if (oAux.value == '') {
|
||||||
oAux.focus();
|
alert('@G::LoadTranslation(ID_PROCESS_TITLE_REQUIRED)');
|
||||||
bContinue = false;
|
oAux.focus();
|
||||||
}
|
bContinue = false;
|
||||||
|
}
|
||||||
|
|
||||||
var regExp = /^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\..*)(\..+)?$)[^\x00-\x1f\\?*:\";|/]+$/;
|
var regExp = /^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\..*)(\..+)?$)[^\x00-\x1f\\?*:\";|/]+$/;
|
||||||
if (oAux.value.search(regExp)==-1) {
|
|
||||||
alert('@G::LoadTranslation(ID_INVALID_PROCESS_NAME)');
|
if (oAux.value.search(regExp)==-1) {
|
||||||
oAux.focus();
|
alert('@G::LoadTranslation(ID_INVALID_PROCESS_NAME)');
|
||||||
bContinue = false;
|
oAux.focus();
|
||||||
}
|
bContinue = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (bContinue) {
|
if (bContinue) {
|
||||||
ajax_post(oForm.action, oForm, 'POST');
|
ajax_post(oForm.action, oForm, 'POST');
|
||||||
Pm.data.db.title.label = Pm.data.db.title.object.elements.label.innerHTML = getField('PRO_TITLE').value.escapeHTML();
|
Pm.data.db.title.label = Pm.data.db.title.object.elements.label.innerHTML = getField('PRO_TITLE').value.escapeHTML();
|
||||||
Pm.tmp.editProcessPanel.remove();
|
Pm.tmp.editProcessPanel.remove();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
var nProcess = new input(getField('PRO_TITLE'));
|
||||||
|
nProcess.focus();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
leimnud.event.add(getField('PRO_TITLE'), 'change', function() {
|
||||||
|
var nProcess = new input(getField('PRO_TITLE'));
|
||||||
|
getField('PRO_TITLE').value = getField('PRO_TITLE').value.replace(/^\s*|\s*$/g,"");
|
||||||
|
|
||||||
|
if ( (getField('PRO_VALIDATE_TITLE').value == '') ||
|
||||||
|
(getField('PRO_VALIDATE_TITLE').value == getField('PRO_UID').value)
|
||||||
|
) {
|
||||||
|
validateNameProcess = true;
|
||||||
|
nProcess.passed();
|
||||||
|
} else {
|
||||||
|
validateNameProcess = false;
|
||||||
|
nProcess.failed();
|
||||||
|
nProcess.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function cancel() {
|
function cancel() {
|
||||||
Pm.tmp.editProcessPanel.remove();
|
Pm.tmp.editProcessPanel.remove();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user