Merge remote-tracking branch 'origin/develop' into bugfix/HOR-3203

This commit is contained in:
hjonathan
2017-05-19 16:21:37 -04:00
546 changed files with 63670 additions and 17583 deletions

View File

@@ -103,14 +103,6 @@ try {
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = array_column($triggers, 'TRI_TITLE');
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
$arrayInfoTriggerExecutionTime = [];
foreach ($_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_EXECUTION_TIME'] as $key => $value) {
$arrayInfoTriggerExecutionTime[] = ['triUid' => $key, 'triExecutionTime' => $value];
}
//Log
Bootstrap::registerMonolog('triggerExecutionTime', 200, 'Trigger execution time', ['proUid' => $appFields['APP_DATA']['PROCESS'], 'tasUid' => $appFields['APP_DATA']['TASK'], 'appUid' => $appFields['APP_DATA']['APPLICATION'], 'before' => 'ASSIGN_TASK', 'triggerInfo' => $arrayInfoTriggerExecutionTime], SYS_SYS, 'processmaker.log');
}
unset($appFields['APP_STATUS']);
@@ -174,14 +166,6 @@ try {
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = array_column($triggers, 'TRI_TITLE');
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
$arrayInfoTriggerExecutionTimeAux = [];
foreach ($_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_EXECUTION_TIME'] as $key => $value) {
$arrayInfoTriggerExecutionTimeAux[] = ['triUid' => $key, 'triExecutionTime' => $value];
}
//Log
Bootstrap::registerMonolog('triggerExecutionTime', 200, 'Trigger execution time', ['proUid' => $appFields['APP_DATA']['PROCESS'], 'tasUid' => $appFields['APP_DATA']['TASK'], 'appUid' => $appFields['APP_DATA']['APPLICATION'], 'after' => 'ASSIGN_TASK', 'triggerInfo' => $arrayInfoTriggerExecutionTimeAux], SYS_SYS, 'processmaker.log');
}
unset($appFields['APP_STATUS']);
unset($appFields['APP_PROC_STATUS']);

View File

@@ -90,7 +90,13 @@ try {
case 'DRAFT':
case 'TO_DO':
//Check if the case is in pause, check a valid record in table APP_DELAY
if (AppDelay::isPaused( $sAppUid, $iDelIndex )) {
$isPaused = AppDelay::isPaused($sAppUid, $iDelIndex);
//Check if the case is a waiting for a SYNCHRONOUS subprocess
$subAppData = new \SubApplication();
$caseSubprocessPending = $subAppData->isSubProcessWithCasePending($sAppUid, $iDelIndex);
if ($isPaused || $caseSubprocessPending) {
//the case is paused show only the resume
$_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex;
@@ -109,19 +115,11 @@ try {
if ($_action == 'search') {
//verify if the case is with the current user
$c = new Criteria( 'workflow' );
$c->add( AppDelegationPeer::APP_UID, $sAppUid );
$c->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
$c->add( AppDelegationPeer::DEL_INDEX, $iDelIndex );
$oDataset = AppDelegationPeer::doSelectRs( $c );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aData = $oDataset->getRow();
if ($aData['USR_UID'] !== $_SESSION['USER_LOGGED'] && $aData['USR_UID'] !== '') {
$aData = AppDelegation::getCurrentUsers($sAppUid, $iDelIndex);
if ($aData['USR_UID'] !== $_SESSION['USER_LOGGED'] && !empty($aData['USR_UID'])) {
//distinct "" for selfservice
//so we show just the resume
$_SESSION['alreadyDerivated'] = true;
//the case is paused show only the resume
$_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex;
$_SESSION['PROCESS'] = $aFields['PRO_UID'];

View File

@@ -183,14 +183,6 @@ try {
//Execute after triggers - End
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
$arrayInfoTriggerExecutionTime = [];
foreach ($_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] as $key => $value) {
$arrayInfoTriggerExecutionTime[] = ['triUid' => $key, 'triExecutionTime' => $value];
}
//Log
Bootstrap::registerMonolog('triggerExecutionTime', 200, 'Trigger execution time', ['proUid' => $_SESSION['PROCESS'], 'tasUid' => $_SESSION['TASK'], 'appUid' => $_SESSION['APPLICATION'], 'after' => 'DYNAFORM', 'triggerInfo' => $arrayInfoTriggerExecutionTime], SYS_SYS, 'processmaker.log');
}
//save data in PM Tables if necessary

View File

@@ -219,16 +219,7 @@ if ($flagExecuteBeforeTriggers) {
//Execute before triggers - End
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
$arrayInfoTriggerExecutionTime = [];
foreach ($_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] as $key => $value) {
$arrayInfoTriggerExecutionTime[] = ['triUid' => $key, 'triExecutionTime' => $value];
}
//Log
if(sizeof($arrayInfoTriggerExecutionTime)>0){
Bootstrap::registerMonolog('triggerExecutionTime', 200, 'Trigger execution time', ['proUid' => $Fields['APP_DATA']['PROCESS'], 'tasUid' => $Fields['APP_DATA']['TASK'], 'appUid' => $Fields['APP_DATA']['APPLICATION'], 'before' => $_GET['TYPE'], 'triggerInfo' => $arrayInfoTriggerExecutionTime], SYS_SYS, 'processmaker.log');
}
} else {
unset( $_SESSION['_NO_EXECUTE_TRIGGERS_'] );
}

View File

@@ -1,98 +1,118 @@
<?php
$request = isset( $_POST['request'] ) ? $_POST['request'] : '';
$request = isset($_POST['request']) ? $_POST['request'] : '';
switch ($request) {
case 'getRows':
$fieldname = $_POST['fieldname'];
G::LoadClass( 'case' );
G::LoadClass('case');
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aFields = $oApp->loadCase($_SESSION['APPLICATION']);
$aVars = Array();
$count = count($_SESSION['TRIGGER_DEBUG']['DATA']);
for ($i = 0; $i < $count; $i++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
$aVars = array_merge($aFields['APP_DATA'], $aVars);
$field = $aVars[$fieldname];
$response = new StdClass();
$response->headers = Array ();
$response->columns = Array ();
$response->rows = Array ();
$response->headers = Array();
$response->columns = Array();
$response->rows = Array();
$sw = true;
$j = 0;
if (is_array( $field )) {
if (is_array($field)) {
foreach ($field as $row) {
if ($sw) {
foreach ($row as $key => $value) {
$response->headers[] = Array ('name' => $key);
$response->columns[] = Array ('header' => $key,'width' => 100,'dataIndex' => $key);
$response->headers[] = Array('name' => $key);
$response->columns[] = Array('header' => $key, 'width' => 100, 'dataIndex' => $key);
}
$sw = false;
}
$tmp = Array ();
$tmp = Array();
foreach ($row as $key => $value) {
$tmp[] = $value;
}
$response->rows[$j ++] = $tmp;
$response->rows[$j++] = $tmp;
}
} else {
if (is_object( $field )) {
$response->headers = Array (Array ('name' => 'name'
),Array ('name' => 'value'
)
if (is_object($field)) {
$response->headers = Array(
Array('name' => 'name'),
Array('name' => 'value')
);
$response->columns = Array (Array ('header' => 'Property','width' => 100,'dataIndex' => 'name'
),Array ('header' => 'Value','width' => 100,'dataIndex' => 'value'
)
$response->columns = Array(
Array(
'header' => 'Property',
'width' => 100,
'dataIndex' => 'name'
),
Array(
'header' => 'Value',
'width' => 100,
'dataIndex' => 'value'
)
);
foreach ($field as $key => $value) {
$response->rows[] = Array ($key,$value);
$response->rows[] = Array($key, $value);
}
}
}
echo G::json_encode( $response );
echo G::json_encode($response);
break;
default:
G::LoadClass( 'case' );
G::LoadClass('case');
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aFields = $oApp->loadCase($_SESSION['APPLICATION']);
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars = Array();
$count = count($_SESSION['TRIGGER_DEBUG']['DATA']);
for ($i = 0; $i < $count; $i++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
$aVars = array_merge($aFields['APP_DATA'], $aVars);
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys( G::getSystemConstants() );
$varNames = array_keys( $aVars );
$systemConstants = G::getSystemConstants();
//Add missing items
$systemConstants['PIN'] = $aVars['PIN'];
$systemConstants['APP_NUMBER'] = $aVars['APP_NUMBER'];
//when a case with dynaform is started there are no changed variables, this event is validated
if (isset($aVars['__VAR_CHANGED__'])) {
$systemConstants['__VAR_CHANGED__'] = $aVars['__VAR_CHANGED__'];
}
if (isset($_POST['filter']) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys($systemConstants);
$varNames = array_keys($aVars);
foreach ($varNames as $var) {
if (in_array( $var, $sysVars )) {
unset( $aVars[$var] );
if (in_array($var, $sysVars)) {
unset($aVars[$var]);
}
}
}
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'sys') {
$aVars = G::getSystemConstants();
if (isset($_POST['filter']) && $_POST['filter'] == 'sys') {
$aVars = $systemConstants;
}
ksort( $aVars );
ksort($aVars);
$return_object = new StdClass();
$return_object->totalCount = 1;
foreach ($aVars as $i => $var) {
if (is_array( $var ) || is_object( $var )) {
$aVars[$i] = print_r( $var, true );
if (is_array($var) || is_object($var)) {
$aVars[$i] = print_r($var, true);
}
}
$return_object->data[0] = $aVars;
echo G::json_encode( $return_object );
echo G::json_encode($return_object);
break;
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* pluginsList.php
*
@@ -21,97 +22,8 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
$RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
// lets display the items
//$items = array ( 'id' => 'char', 'title' => 'char', 'type' => 'char', 'creator' => 'char' , 'modifiedBy' => 'char', 'filename' => 'char', 'size' => 'char', 'mime' => 'char');
$items = Array ();
//***************** Plugins **************************
G::LoadClass( 'plugin' );
//here we are loading all plugins registered
//krumo ($items); die;
$aPluginsPP = array ();
if (is_file( PATH_PLUGINS . 'enterprise/data/data' )) {
$aPlugins = unserialize( trim( file_get_contents( PATH_PLUGINS . 'enterprise/data/data' ) ) );
foreach ($aPlugins as $aPlugin) {
$aPluginsPP[] = substr( $aPlugin['sFilename'], 0, strpos( $aPlugin['sFilename'], '-' ) ) . '.php';
}
}
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if ($handle = opendir( PATH_PLUGINS )) {
while (false !== ($file = readdir( $handle ))) {
if (in_array( $file, $aPluginsPP )) {
continue;
}
if (strpos( $file, '.php', 1 ) && is_file( PATH_PLUGINS . $file )) {
include_once (PATH_PLUGINS . $file);
$pluginDetail = $oPluginRegistry->getPluginDetails( $file );
//print_R ($pluginDetail );
//die;
//$status = $pluginDetail->enabled ? 'Enabled' : 'Disabled';
if ($pluginDetail == null)
continue; //When for some reason we gen NULL plugin
$status_label = $pluginDetail->enabled ? G::LoadTranslation( 'ID_ENABLED' ) : G::LoadTranslation( 'ID_DISABLED' );
$status = $pluginDetail->enabled ? 1 : 0;
if (isset( $pluginDetail->aWorkspaces )) {
if (!is_array($pluginDetail->aWorkspaces)) {
$pluginDetail->aWorkspaces = array();
}
if (! in_array( SYS_SYS, $pluginDetail->aWorkspaces ))
continue;
}
$linkEditValue = $pluginDetail->sSetupPage != '' && $pluginDetail->enabled ? G::LoadTranslation( 'ID_SETUP' ) : ' ';
//g::pr($pluginDetail->sSetupPage);
$setup = $pluginDetail->sSetupPage != '' && $pluginDetail->enabled ? '1' : '0';
$link = 'pluginsChange?id=' . $file . '&status=' . $pluginDetail->enabled;
$linkEdit = 'pluginsSetup?id=' . $file;
$pluginName = $pluginDetail->sFriendlyName;
$pluginId = $pluginDetail->sNamespace;
$removePluginMsg = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_REMOVE_PLUGIN' ) );
$linkRemove = 'javascript:showMessage(\'' . $removePluginMsg . '<br>' . $pluginName . ' \',\'' . $pluginId . '\')';
// $linkRemove = 'pluginsRemove?id='.$pluginId.'.php&status=1';
if (isset( $pluginDetail )) {
if (! $pluginDetail->bPrivate) {
$items[] = array ('id' => (count( $items ) + 1),'namespace' => $pluginDetail->sNamespace,'title' => $pluginDetail->sFriendlyName . "\n(" . $pluginDetail->sNamespace . '.php)','className' => $pluginDetail->sNamespace,'description' => $pluginDetail->sDescription,'version' => $pluginDetail->iVersion,'setupPage' => $pluginDetail->sSetupPage,'status_label' => $status_label,'status' => $status,'setup' => $setup,
'sFile' => $file,'sStatusFile' => $pluginDetail->enabled
);
}
}
}
}
closedir( $handle );
}
$folders['items'] = $items;
//g::pr($items);
echo G::json_encode( $items );
die();
$_DBArray['plugins'] = $items;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer' );
$c = new Criteria( 'dbarray' );
$c->setDBArrayTable( 'plugins' );
//$c->addAscendingOrderByColumn ('id');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$G_PUBLISH = new Publisher();
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptFile( '/jscore/setup/pluginList.js' );
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/pluginList', $c );
G::RenderPage( 'publishBlank', 'blank' );
G::LoadClass('plugin');
$items = \PMPlugin::getlist(SYS_SYS);
echo G::json_encode($items);