Merge remote-tracking branch 'origin/feature/HOR-3559' into feature/HOR-3629
This commit is contained in:
@@ -1503,7 +1503,7 @@ function get_infoOnPM($workspace) {
|
||||
$dbNetView = new NET(DB_HOST);
|
||||
$dbNetView->loginDbServer(DB_USER, DB_PASS);
|
||||
|
||||
$dbConns = new dbConnections('');
|
||||
$dbConns = new DbConnections('');
|
||||
$availdb = '';
|
||||
foreach( $dbConns->getDbServicesAvailables() as $key => $val ) {
|
||||
if( $availdb != '' )
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
$xmlfile = '{className}/{className}OnTransitList';
|
||||
/* Render page */
|
||||
|
||||
//require_once ( 'classes/class.extendGulliver.php' );
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent( 'propeltable', '{className}/paged-table', '{className}/{className}OnTransitList', $Criteria );
|
||||
G::RenderPage( "publish" );
|
||||
|
||||
@@ -14,6 +14,27 @@ class Bootstrap
|
||||
|
||||
//below here only approved methods
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function autoloadClass($class)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function registerClass($className, $includePath)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function registerDir($name, $dir)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* these functions still under revision
|
||||
*/
|
||||
@@ -22,6 +43,12 @@ class Bootstrap
|
||||
{
|
||||
return PmSystem::getSystemConfiguration($globalIniFile, $wsIniFile, $wsName);
|
||||
}
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function registerSystemClasses()
|
||||
{
|
||||
}
|
||||
|
||||
//below this line, still not approved methods
|
||||
|
||||
@@ -122,6 +149,13 @@ class Bootstrap
|
||||
$smarty->display($template);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function LoadSystem($strClass)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the temporal directory path on differents O.S.
|
||||
* i.e. /temp -> linux, C:/Temp -> win
|
||||
@@ -411,6 +445,19 @@ class Bootstrap
|
||||
|
||||
return $content;
|
||||
}
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function LoadClass($strClass)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function LoadThirdParty($sPath, $sFile)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function LoadTranslationObject
|
||||
@@ -1948,6 +1995,13 @@ class Bootstrap
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public function getModel($model)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an encrypted unique identifier based on $id and the selected scope id.
|
||||
*
|
||||
@@ -2427,6 +2481,13 @@ class Bootstrap
|
||||
return strtoupper(PHP_OS) == "LINUX";
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function initVendors()
|
||||
{
|
||||
}
|
||||
|
||||
public static function parseIniFile($filename)
|
||||
{
|
||||
$data = @parse_ini_file($filename, true);
|
||||
@@ -2516,18 +2577,37 @@ class Bootstrap
|
||||
return $var;
|
||||
}
|
||||
|
||||
public function verifyHashPassword ($pass, $userPass)
|
||||
/**
|
||||
* Verify Hash password with password entered
|
||||
*
|
||||
* @param string $pass password
|
||||
* @param string $userPass hash of password
|
||||
* @return bool true or false
|
||||
*/
|
||||
public function verifyHashPassword($pass, $userPass)
|
||||
{
|
||||
global $RBAC;
|
||||
$passwordHashConfig = Bootstrap::getPasswordHashConfig();
|
||||
$hashTypeCurrent = $passwordHashConfig['current'];
|
||||
$hashTypePrevious = $passwordHashConfig['previous'];
|
||||
if ((Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass) || ($pass === $hashTypeCurrent . ':' . $userPass)) {
|
||||
return true;
|
||||
$acceptance = false;
|
||||
|
||||
if ($RBAC->loginWithHash()) {
|
||||
//To enable compatibility with soap login
|
||||
if ((Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass) || ($pass === $hashTypeCurrent . ':' . $userPass)) {
|
||||
$acceptance = true;
|
||||
} else if ((Bootstrap::hashPassword($pass, $hashTypePrevious) == $userPass) || ($pass === $hashTypePrevious . ':' . $userPass)) {
|
||||
$acceptance = true;
|
||||
}
|
||||
} else {
|
||||
if (Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass) {
|
||||
$acceptance = true;
|
||||
} else if (Bootstrap::hashPassword($pass, $hashTypePrevious) == $userPass) {
|
||||
$acceptance = true;
|
||||
}
|
||||
}
|
||||
if ((Bootstrap::hashPassword($pass, $hashTypePrevious) == $userPass) || ($pass === $hashTypePrevious . ':' . $userPass)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return $acceptance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* @description This class is a Dynaform handler for modify directly into file
|
||||
* @package gulliver.system
|
||||
*/
|
||||
class dynaFormHandler
|
||||
class DynaformHandler
|
||||
{
|
||||
|
||||
private $xmlfile;
|
||||
|
||||
@@ -46,11 +46,7 @@ class G
|
||||
public static $httpHost;
|
||||
|
||||
/**
|
||||
* Load Gulliver Classes
|
||||
* @access public
|
||||
* @param string $strClass
|
||||
* @return void
|
||||
* @deprecated 08-04-2017
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function LoadSystem($strClass)
|
||||
{
|
||||
@@ -58,11 +54,7 @@ class G
|
||||
}
|
||||
|
||||
/**
|
||||
* Load System Classes
|
||||
* @access public
|
||||
* @param string $strClass
|
||||
* @return void
|
||||
* @deprecated 08-04-2017
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public function LoadSystemExist($strClass)
|
||||
{
|
||||
@@ -70,11 +62,7 @@ class G
|
||||
}
|
||||
|
||||
/**
|
||||
* Include javascript files
|
||||
* @access public
|
||||
* @param string $strClass
|
||||
* @return void
|
||||
* @deprecated 08-04-2017
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public function LoadInclude($strClass)
|
||||
{
|
||||
@@ -82,11 +70,7 @@ class G
|
||||
}
|
||||
|
||||
/**
|
||||
* public function LoadClassRBAC
|
||||
* @access public
|
||||
* @param string $strClass
|
||||
* @return void
|
||||
* @deprecated 08-04-2017
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public function LoadClassRBAC($strClass)
|
||||
{
|
||||
@@ -94,12 +78,7 @@ class G
|
||||
}
|
||||
|
||||
/**
|
||||
* If the class is not defined by the aplication, it
|
||||
* attempt to load the class from gulliver.system
|
||||
* @access public
|
||||
* @param string $strClass
|
||||
* @return void
|
||||
* @deprecated 08-04-2017
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function LoadClass($strClass)
|
||||
{
|
||||
@@ -107,12 +86,7 @@ class G
|
||||
}
|
||||
|
||||
/**
|
||||
* public function LoadThirdParty
|
||||
* @access public
|
||||
* @param string $sPath
|
||||
* @param string $sFile
|
||||
* @return void
|
||||
* @deprecated 08-04-2017
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
public static function LoadThirdParty($sPath, $sFile)
|
||||
{
|
||||
|
||||
@@ -75,6 +75,12 @@ class RBAC
|
||||
private static $instance = null;
|
||||
public $authorizedActions = array();
|
||||
|
||||
/**
|
||||
* To enable compatibility with soap login.
|
||||
* @var bool
|
||||
*/
|
||||
private $enableLoginHash = false;
|
||||
|
||||
public function __construct ()
|
||||
{
|
||||
$this->authorizedActions = array(
|
||||
@@ -1572,5 +1578,31 @@ class RBAC
|
||||
throw new RBACException('ID_ACCESS_DENIED', 403);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable compatibility with hash login
|
||||
*/
|
||||
public function enableLoginWithHash()
|
||||
{
|
||||
$this->enableLoginHash = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable compatibility with hash login
|
||||
*/
|
||||
public function disableLoginWithHash()
|
||||
{
|
||||
$this->enableLoginHash = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return status login with hash
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function loginWithHash()
|
||||
{
|
||||
return $this->enableLoginHash;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,12 +77,13 @@ class RbacUsers extends BaseRbacUsers
|
||||
try {
|
||||
$c = new Criteria('rbac');
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $sUsername);
|
||||
/* @var $rs RbacUsers[] */
|
||||
$rs = RbacUsersPeer::doSelect($c, Propel::getDbConnection('rbac_ro'));
|
||||
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
||||
$aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
//verify password with md5, and md5 format
|
||||
if (mb_strtoupper($sUsername, 'utf-8') === mb_strtoupper($aFields['USR_USERNAME'], 'utf-8')) {
|
||||
if( Bootstrap::verifyHashPassword($sPassword, $aFields['USR_PASSWORD']) ) {
|
||||
if( Bootstrap::verifyHashPassword($sPassword, $rs[0]->getUsrPassword()) ) {
|
||||
if ($aFields['USR_DUE_DATE'] < date('Y-m-d')) {
|
||||
return -4;
|
||||
}
|
||||
@@ -319,6 +320,25 @@ class RbacUsers extends BaseRbacUsers
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc} except USR_PASSWORD, for security reasons.
|
||||
*
|
||||
* @param string $keyType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return an associative array containing the field names (as keys) and field values
|
||||
*/
|
||||
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$key = RbacUsersPeer::translateFieldName(
|
||||
RbacUsersPeer::USR_PASSWORD,
|
||||
BasePeer::TYPE_COLNAME,
|
||||
$keyType
|
||||
);
|
||||
$array = parent::toArray($keyType);
|
||||
unset($array[$key]);
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
// Users
|
||||
|
||||
2
thirdparty/propel/Propel.php
vendored
2
thirdparty/propel/Propel.php
vendored
@@ -488,7 +488,7 @@ class Propel {
|
||||
* @date: 27-05-08 11:48 *
|
||||
* @Description: this was added for the additional database connections *
|
||||
***********************************************************************/
|
||||
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
|
||||
$oDbConnections = new DbConnections($_SESSION['PROCESS']);
|
||||
$oDbConnections->loadAdditionalConnections();
|
||||
$dsn = isset(self::$configuration['datasources'][$name]['connection']) ? self::$configuration['datasources'][$name]['connection'] : null;
|
||||
} else {
|
||||
|
||||
@@ -66,7 +66,6 @@ class PmBootstrap extends Bootstrap
|
||||
// pm workflow classes (static load)
|
||||
$this->autoloader->registerClass('System', PATH_CORE . 'classes/class.system');
|
||||
|
||||
//$this->autoloader->registerClass('Services_JSON', PATH_THIRDPARTY .'pear/json/class.json');
|
||||
$this->autoloader->registerClass('Smarty', PATH_THIRDPARTY . 'smarty/libs/Smarty.class');
|
||||
|
||||
$this->autoloader->registerClass('Propel', PATH_THIRDPARTY . 'propel/Propel');
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
require_once(__DIR__ . '/../../../bootstrap/autoload.php');
|
||||
try {
|
||||
//Set variables
|
||||
$cronName = pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_FILENAME);
|
||||
@@ -72,7 +73,6 @@ try {
|
||||
$classLoader->add(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'src' . PATH_SEP, 'ProcessMaker');
|
||||
$classLoader->add(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'src' . PATH_SEP);
|
||||
$classLoader->addClass('Bootstrap', PATH_TRUNK . 'gulliver' . PATH_SEP . 'system' . PATH_SEP . 'class.bootstrap.php');
|
||||
Bootstrap::initVendors();
|
||||
|
||||
$classLoader->addModelClassPath(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP);
|
||||
//Load classes
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
require_once(__DIR__ . '/../../../bootstrap/autoload.php');
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
@@ -93,38 +94,6 @@ try {
|
||||
|
||||
spl_autoload_register(['Bootstrap', 'autoloadClass']);
|
||||
|
||||
//DATABASE propel classes used in 'Cases' Options
|
||||
Bootstrap::registerClass('AuthenticationSourcePeer', PATH_RBAC . 'model' . PATH_SEP . 'AuthenticationSourcePeer.php');
|
||||
Bootstrap::registerClass('BaseAuthenticationSource', PATH_RBAC . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseAuthenticationSource.php');
|
||||
Bootstrap::registerClass('AuthenticationSource', PATH_RBAC . 'model' . PATH_SEP . 'AuthenticationSource.php');
|
||||
Bootstrap::registerClass('RolesPeer', PATH_RBAC . 'model' . PATH_SEP . 'RolesPeer.php');
|
||||
Bootstrap::registerClass('BaseRoles', PATH_RBAC . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseRoles.php');
|
||||
Bootstrap::registerClass('Roles', PATH_RBAC . 'model' . PATH_SEP . 'Roles.php');
|
||||
|
||||
require_once(PATH_RBAC . 'model' . PATH_SEP . 'UsersRolesPeer.php');
|
||||
require_once(PATH_RBAC . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseUsersRoles.php');
|
||||
require_once(PATH_RBAC . 'model' . PATH_SEP . 'UsersRoles.php');
|
||||
|
||||
Bootstrap::registerClass('PMLicensedFeatures', PATH_CLASSES . 'class.licensedFeatures.php');
|
||||
Bootstrap::registerClass('serverConf', PATH_CLASSES . 'class.serverConfiguration.php');
|
||||
Bootstrap::registerClass('calendar', PATH_CLASSES . 'class.calendar.php');
|
||||
Bootstrap::registerClass('groups', PATH_CLASSES . 'class.groups.php');
|
||||
|
||||
Bootstrap::registerClass('Entity_Base', PATH_HOME . 'engine/classes/entities/Base.php');
|
||||
Bootstrap::registerClass('Entity_AppSolrQueue', PATH_HOME . 'engine/classes/entities/AppSolrQueue.php');
|
||||
Bootstrap::registerClass('XMLDB', PATH_HOME . 'engine/classes/class.xmlDb.php');
|
||||
Bootstrap::registerClass('dynaFormHandler', PATH_GULLIVER . 'class.dynaformhandler.php');
|
||||
Bootstrap::registerClass('DynaFormField', PATH_HOME . 'engine/classes/class.dynaFormField.php');
|
||||
Bootstrap::registerClass('SolrRequestData', PATH_HOME . 'engine/classes/entities/SolrRequestData.php');
|
||||
Bootstrap::registerClass('SolrUpdateDocument', PATH_HOME . 'engine/classes/entities/SolrUpdateDocument.php');
|
||||
Bootstrap::registerClass('Xml_Node', PATH_GULLIVER . 'class.xmlDocument.php');
|
||||
Bootstrap::registerClass('wsResponse', PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.wsResponse.php');
|
||||
Bootstrap::initVendors();
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
Bootstrap::registerClass('dashboards', PATH_HOME . 'engine/classes/class.dashboards.php');
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Set variables
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dateInit = null;
|
||||
|
||||
@@ -115,7 +115,6 @@ if (! defined ('PATH_HOME')) {
|
||||
define( 'PATH_CLASSES', PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP );
|
||||
|
||||
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
||||
}
|
||||
|
||||
|
||||
@@ -86,8 +86,6 @@ if (! defined ('PATH_HOME')) {
|
||||
|
||||
require_once PATH_TRUNK . "framework/src/Maveriks/Util/ClassLoader.php";
|
||||
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
Bootstrap::registerSystemClasses();
|
||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
||||
|
||||
|
||||
|
||||
@@ -2365,7 +2365,7 @@ class AppSolr
|
||||
foreach ($dynaformFileNames as $dynaformFileName) {
|
||||
if (is_file(PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&
|
||||
filesize(PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml') >0 ) {
|
||||
$dyn = new dynaFormHandler (PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml');
|
||||
$dyn = new DynaformHandler (PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml');
|
||||
$dynaformFields [] = $dyn->getFields ();
|
||||
}
|
||||
if (is_file(PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&
|
||||
|
||||
@@ -239,14 +239,6 @@ class Applications
|
||||
$dateFrom = isset($dateFrom)? $dateFrom : "";
|
||||
$dateTo = isset($dateTo)? $dateTo : "";
|
||||
|
||||
//require_once ("classes/model/AppCacheView.php");
|
||||
//require_once ("classes/model/AppDelegation.php");
|
||||
//require_once ("classes/model/AdditionalTables.php");
|
||||
//require_once ("classes/model/AppDelay.php");
|
||||
//require_once ("classes/model/Fields.php");
|
||||
//require_once ("classes/model/Users.php");
|
||||
//require_once ("classes/model/Process.php");
|
||||
|
||||
$oAppCache = new AppCacheView();
|
||||
|
||||
if ($configuration == true) {
|
||||
|
||||
@@ -21,7 +21,7 @@ require_once 'model/Content.php';
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/
|
||||
class dbConnections
|
||||
class DbConnections
|
||||
{
|
||||
private $PRO_UID;
|
||||
public $connections;
|
||||
|
||||
@@ -179,7 +179,7 @@ class DynaFormField extends DBTable
|
||||
|
||||
public function saveField($Fields, $attributes = array(), $options = array())
|
||||
{
|
||||
$dynaform = new dynaFormHandler($this->getFileName());
|
||||
$dynaform = new DynaformHandler($this->getFileName());
|
||||
if ($Fields['TYPE'] === 'javascript') {
|
||||
$Fields['XMLNODE_VALUE'] = $Fields['CODE'];
|
||||
unset($Fields['CODE']);
|
||||
|
||||
@@ -664,7 +664,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
|
||||
|
||||
|
||||
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . "{$file}.xml", 'path');
|
||||
$dynaform = new dynaFormHandler($pathFile);
|
||||
$dynaform = new DynaformHandler($pathFile);
|
||||
$dynaform->replace($fieldName, $fieldName, Array('type' => 'javascript', 'meta' => $meta, '#cdata' => $sCode
|
||||
));
|
||||
|
||||
@@ -734,7 +734,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
|
||||
self::_setTmpData($tmp);
|
||||
}
|
||||
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . "{$file}.xml", 'path');
|
||||
$dynaform = new dynaFormHandler($pathFile);
|
||||
$dynaform = new DynaformHandler($pathFile);
|
||||
$dbc2 = new DBConnection($pathFile, '', '', '', 'myxml');
|
||||
$ses2 = new DBSession($dbc2);
|
||||
//if (!isset($Fields['ENABLETEMPLATE'])) $Fields['ENABLETEMPLATE'] ="0";
|
||||
@@ -804,7 +804,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
|
||||
// $ses2 = new DBSession( $dbc2 );
|
||||
// $ses2->execute( "UPDATE . SET ENABLETEMPLATE = '$value'" );
|
||||
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . "{$file}.xml", 'path');
|
||||
$dynaform = new dynaFormHandler($pathFile);
|
||||
$dynaform = new DynaformHandler($pathFile);
|
||||
$dynaform->modifyHeaderAttribute('enabletemplate', $value);
|
||||
|
||||
return $value;
|
||||
|
||||
@@ -203,9 +203,6 @@ class PMPluginRegistry
|
||||
*/
|
||||
public function registerPlugin ($sNamespace, $sFilename = null)
|
||||
{
|
||||
//require_once ($sFilename);
|
||||
|
||||
|
||||
$sClassName = $sNamespace . "plugin";
|
||||
$plugin = new $sClassName( $sNamespace, $sFilename );
|
||||
|
||||
@@ -278,7 +275,6 @@ class PMPluginRegistry
|
||||
$pluginSrcDir = PATH_PLUGINS . $detail->sNamespace . PATH_SEP . 'src';
|
||||
|
||||
if (is_dir($pluginSrcDir)) {
|
||||
//Bootstrap::registerDir($detail->sNamespace.'/src', $pluginSrcDir);
|
||||
$loader = \Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add($pluginSrcDir);
|
||||
}
|
||||
|
||||
@@ -3916,3 +3916,287 @@ function PMFSendMessageToGroup(
|
||||
//Return
|
||||
return 1;
|
||||
}
|
||||
|
||||
//Start - Private functions
|
||||
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return string
|
||||
*/
|
||||
function pmToString($vValue)
|
||||
{
|
||||
return (string)$vValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to integer
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return integer
|
||||
*/
|
||||
function pmToInteger($vValue)
|
||||
{
|
||||
return (int)$vValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to float
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return float
|
||||
*/
|
||||
function pmToFloat($vValue)
|
||||
{
|
||||
return (float)$vValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to Url
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return url
|
||||
*/
|
||||
function pmToUrl($vValue)
|
||||
{
|
||||
return urlencode($vValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to data base escaped string
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return string
|
||||
*/
|
||||
function pmSqlEscape($vValue)
|
||||
{
|
||||
return G::sqlEscape($vValue);
|
||||
}
|
||||
|
||||
//End - Private functions
|
||||
|
||||
|
||||
/* * *************************************************************************
|
||||
* Error handler
|
||||
* author: Julio Cesar Laura Avenda<64>o <juliocesar@colosa.com>
|
||||
* date: 2009-10-01
|
||||
* ************************************************************************* */
|
||||
/**
|
||||
* @param $errno
|
||||
* @param $errstr
|
||||
* @param $errfile
|
||||
* @param $errline
|
||||
*/
|
||||
function handleErrors($errno, $errstr, $errfile, $errline)
|
||||
{
|
||||
if ($errno != 2048 && isset($_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'])) {
|
||||
G::logTriggerExecution($_SESSION, $errstr, '', round(microtime(true) -
|
||||
$_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'], 5));
|
||||
}
|
||||
|
||||
if ($errno != '' && ($errno != 8) && ($errno != 2048)) {
|
||||
if (isset($_SESSION['_CODE_'])) {
|
||||
$sCode = $_SESSION['_CODE_'];
|
||||
unset($_SESSION['_CODE_']);
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oCase = new Cases();
|
||||
$oPMScript->aFields['__ERROR__'] = $errstr;
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
registerError(1, $errstr, $errline - 1, $sCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle Fatal Errors
|
||||
* @param variant $buffer
|
||||
* @return buffer
|
||||
*/
|
||||
|
||||
function handleFatalErrors($buffer)
|
||||
{
|
||||
if (!empty($buffer)) {
|
||||
G::logTriggerExecution($_SESSION, $buffer, 'FATAL_ERROR');
|
||||
}
|
||||
|
||||
if (preg_match('/(error<\/b>:)(.+)(<br)/', $buffer, $regs)) {
|
||||
$oCase = new Cases();
|
||||
$err = preg_replace('/<.*?>/', '', $regs[2]);
|
||||
$aAux = explode(' in ', $err);
|
||||
$sCode = isset($_SESSION['_CODE_']) ? $_SESSION['_CODE_'] : null;
|
||||
unset($_SESSION['_CODE_']);
|
||||
registerError(2, $aAux[0], 0, $sCode);
|
||||
if (strpos($_SERVER['REQUEST_URI'], '/cases/cases_Step') !== false) {
|
||||
if (strpos($_SERVER['REQUEST_URI'], '&ACTION=GENERATE') !== false) {
|
||||
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oPMScript->aFields['__ERROR__'] = $aAux[0];
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
G::header('Location: ' . $aNextStep['PAGE']);
|
||||
die();
|
||||
}
|
||||
$_SESSION['_NO_EXECUTE_TRIGGERS_'] = 1;
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oPMScript->aFields['__ERROR__'] = $aAux[0];
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
G::header('Location: ' . $_SERVER['REQUEST_URI']);
|
||||
die();
|
||||
} else {
|
||||
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
|
||||
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
if (strpos($aNextStep['PAGE'], 'TYPE=ASSIGN_TASK&UID=-1') !== false) {
|
||||
G::SendMessageText('Fatal error in trigger', 'error');
|
||||
}
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oPMScript->aFields['__ERROR__'] = $aAux[0];
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
G::header('Location: ' . $aNextStep['PAGE']);
|
||||
die();
|
||||
}
|
||||
}
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
* Register Error
|
||||
* @param string $iType
|
||||
* @param string $sError
|
||||
* @param string $iLine
|
||||
* @param string $sCode
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function registerError($iType, $sError, $iLine, $sCode)
|
||||
{
|
||||
$sType = ($iType == 1 ? 'ERROR' : 'FATAL');
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'][][$sType] = $sError . ($iLine > 0 ? ' (line ' . $iLine . ')' : '') . ':<br /><br />' . $sCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain engine Data Base name
|
||||
*
|
||||
* @param type $connection
|
||||
* @return type
|
||||
*/
|
||||
function getEngineDataBaseName($connection)
|
||||
{
|
||||
$aDNS = $connection->getDSN();
|
||||
return $aDNS["phptype"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute Queries for Oracle Database
|
||||
*
|
||||
* @param type $sql
|
||||
* @param type $connection
|
||||
*/
|
||||
function executeQueryOci($sql, $connection, $aParameter = array(), $dbsEncode = "")
|
||||
{
|
||||
$aDNS = $connection->getDSN();
|
||||
|
||||
$sUsername = $aDNS["username"];
|
||||
$sPassword = $aDNS["password"];
|
||||
$sHostspec = $aDNS["hostspec"];
|
||||
$sDatabse = $aDNS["database"];
|
||||
$sPort = $aDNS["port"];
|
||||
|
||||
if ($sPort != "1521") {
|
||||
$flagTns = ($sDatabse == "" && ($sPort . "" == "" || $sPort . "" == "0")) ? 1 : 0;
|
||||
|
||||
if ($flagTns == 0) {
|
||||
// if not default port
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse, $dbsEncode);
|
||||
} else {
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec, $dbsEncode);
|
||||
}
|
||||
} else {
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec . "/" . $sDatabse, $dbsEncode);
|
||||
}
|
||||
|
||||
if (!$conn) {
|
||||
$e = oci_error();
|
||||
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
|
||||
return $e;
|
||||
}
|
||||
|
||||
switch (true) {
|
||||
case preg_match("/^(SELECT|SHOW|DESCRIBE|DESC|WITH)\s/i", $sql):
|
||||
$stid = oci_parse($conn, $sql);
|
||||
|
||||
if (count($aParameter) > 0) {
|
||||
foreach ($aParameter as $key => $val) {
|
||||
oci_bind_by_name($stid, $key, $val);
|
||||
}
|
||||
}
|
||||
oci_execute($stid, OCI_DEFAULT);
|
||||
|
||||
$result = Array();
|
||||
$i = 1;
|
||||
while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
|
||||
$result[$i++] = $row;
|
||||
}
|
||||
oci_free_statement($stid);
|
||||
oci_close($conn);
|
||||
return $result;
|
||||
break;
|
||||
case preg_match("/^(INSERT|UPDATE|DELETE)\s/i", $sql):
|
||||
$stid = oci_parse($conn, $sql);
|
||||
$isValid = true;
|
||||
if (count($aParameter) > 0) {
|
||||
foreach ($aParameter as $key => $val) {
|
||||
oci_bind_by_name($stid, $key, $val);
|
||||
}
|
||||
}
|
||||
$objExecute = oci_execute($stid, OCI_DEFAULT);
|
||||
$result = oci_num_rows($stid);
|
||||
if ($objExecute) {
|
||||
oci_commit($conn);
|
||||
} else {
|
||||
oci_rollback($conn);
|
||||
$isValid = false;
|
||||
}
|
||||
oci_free_statement($stid);
|
||||
oci_close($conn);
|
||||
if ($isValid) {
|
||||
return $result;
|
||||
} else {
|
||||
return oci_error();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Stored procedures
|
||||
$stid = oci_parse($conn, $sql);
|
||||
$aParameterRet = array();
|
||||
if (count($aParameter) > 0) {
|
||||
foreach ($aParameter as $key => $val) {
|
||||
$aParameterRet[$key] = $val;
|
||||
// The third parameter ($aParameterRet[$key]) returned a value by reference.
|
||||
oci_bind_by_name($stid, $key, $aParameterRet[$key]);
|
||||
}
|
||||
}
|
||||
$objExecute = oci_execute($stid, OCI_DEFAULT);
|
||||
oci_free_statement($stid);
|
||||
oci_close($conn);
|
||||
return $aParameterRet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,287 +641,3 @@ class PMScript
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Start - Private functions
|
||||
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return string
|
||||
*/
|
||||
function pmToString ($vValue)
|
||||
{
|
||||
return (string) $vValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to integer
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return integer
|
||||
*/
|
||||
function pmToInteger ($vValue)
|
||||
{
|
||||
return (int) $vValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to float
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return float
|
||||
*/
|
||||
function pmToFloat ($vValue)
|
||||
{
|
||||
return (float) $vValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to Url
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return url
|
||||
*/
|
||||
function pmToUrl ($vValue)
|
||||
{
|
||||
return urlencode( $vValue );
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to data base escaped string
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return string
|
||||
*/
|
||||
function pmSqlEscape ($vValue)
|
||||
{
|
||||
return G::sqlEscape( $vValue );
|
||||
}
|
||||
|
||||
//End - Private functions
|
||||
|
||||
|
||||
/* * *************************************************************************
|
||||
* Error handler
|
||||
* author: Julio Cesar Laura Avenda<64>o <juliocesar@colosa.com>
|
||||
* date: 2009-10-01
|
||||
* ************************************************************************* */
|
||||
/**
|
||||
* @param $errno
|
||||
* @param $errstr
|
||||
* @param $errfile
|
||||
* @param $errline
|
||||
*/
|
||||
function handleErrors($errno, $errstr, $errfile, $errline)
|
||||
{
|
||||
if ($errno != 2048 && isset($_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'])) {
|
||||
G::logTriggerExecution($_SESSION, $errstr, '', round(microtime(true) -
|
||||
$_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'], 5));
|
||||
}
|
||||
|
||||
if ($errno != '' && ($errno != 8) && ($errno != 2048)) {
|
||||
if (isset( $_SESSION['_CODE_'] )) {
|
||||
$sCode = $_SESSION['_CODE_'];
|
||||
unset( $_SESSION['_CODE_'] );
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oCase = new Cases();
|
||||
$oPMScript->aFields['__ERROR__'] = $errstr;
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
registerError( 1, $errstr, $errline - 1, $sCode );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle Fatal Errors
|
||||
* @param variant $buffer
|
||||
* @return buffer
|
||||
*/
|
||||
|
||||
function handleFatalErrors ($buffer)
|
||||
{
|
||||
if (!empty($buffer)) {
|
||||
G::logTriggerExecution($_SESSION, $buffer, 'FATAL_ERROR');
|
||||
}
|
||||
|
||||
if (preg_match( '/(error<\/b>:)(.+)(<br)/', $buffer, $regs )) {
|
||||
$oCase = new Cases();
|
||||
$err = preg_replace( '/<.*?>/', '', $regs[2] );
|
||||
$aAux = explode( ' in ', $err );
|
||||
$sCode = isset($_SESSION['_CODE_']) ? $_SESSION['_CODE_'] : null;
|
||||
unset( $_SESSION['_CODE_'] );
|
||||
registerError( 2, $aAux[0], 0, $sCode );
|
||||
if (strpos( $_SERVER['REQUEST_URI'], '/cases/cases_Step' ) !== false) {
|
||||
if (strpos( $_SERVER['REQUEST_URI'], '&ACTION=GENERATE' ) !== false) {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oPMScript->aFields['__ERROR__'] = $aAux[0];
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
G::header( 'Location: ' . $aNextStep['PAGE'] );
|
||||
die();
|
||||
}
|
||||
$_SESSION['_NO_EXECUTE_TRIGGERS_'] = 1;
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oPMScript->aFields['__ERROR__'] = $aAux[0];
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
G::header( 'Location: ' . $_SERVER['REQUEST_URI'] );
|
||||
die();
|
||||
} else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
if (strpos( $aNextStep['PAGE'], 'TYPE=ASSIGN_TASK&UID=-1' ) !== false) {
|
||||
G::SendMessageText( 'Fatal error in trigger', 'error' );
|
||||
}
|
||||
global $oPMScript;
|
||||
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
|
||||
$oPMScript->aFields['__ERROR__'] = $aAux[0];
|
||||
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
|
||||
}
|
||||
G::header( 'Location: ' . $aNextStep['PAGE'] );
|
||||
die();
|
||||
}
|
||||
}
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
* Register Error
|
||||
* @param string $iType
|
||||
* @param string $sError
|
||||
* @param string $iLine
|
||||
* @param string $sCode
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function registerError ($iType, $sError, $iLine, $sCode)
|
||||
{
|
||||
$sType = ($iType == 1 ? 'ERROR' : 'FATAL');
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'][][$sType] = $sError . ($iLine > 0 ? ' (line ' . $iLine . ')' : '') . ':<br /><br />' . $sCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain engine Data Base name
|
||||
*
|
||||
* @param type $connection
|
||||
* @return type
|
||||
*/
|
||||
function getEngineDataBaseName ($connection)
|
||||
{
|
||||
$aDNS = $connection->getDSN();
|
||||
return $aDNS["phptype"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute Queries for Oracle Database
|
||||
*
|
||||
* @param type $sql
|
||||
* @param type $connection
|
||||
*/
|
||||
function executeQueryOci ($sql, $connection, $aParameter = array(), $dbsEncode = "")
|
||||
{
|
||||
$aDNS = $connection->getDSN();
|
||||
|
||||
$sUsername = $aDNS["username"];
|
||||
$sPassword = $aDNS["password"];
|
||||
$sHostspec = $aDNS["hostspec"];
|
||||
$sDatabse = $aDNS["database"];
|
||||
$sPort = $aDNS["port"];
|
||||
|
||||
if ($sPort != "1521") {
|
||||
$flagTns = ($sDatabse == "" && ($sPort . "" == "" || $sPort . "" == "0"))? 1 : 0;
|
||||
|
||||
if ($flagTns == 0) {
|
||||
// if not default port
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse, $dbsEncode);
|
||||
} else {
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec, $dbsEncode);
|
||||
}
|
||||
} else {
|
||||
$conn = oci_connect( $sUsername, $sPassword, $sHostspec . "/" . $sDatabse, $dbsEncode);
|
||||
}
|
||||
|
||||
if (! $conn) {
|
||||
$e = oci_error();
|
||||
trigger_error( htmlentities( $e['message'], ENT_QUOTES ), E_USER_ERROR );
|
||||
return $e;
|
||||
}
|
||||
|
||||
switch (true) {
|
||||
case preg_match( "/^(SELECT|SHOW|DESCRIBE|DESC|WITH)\s/i", $sql ):
|
||||
$stid = oci_parse( $conn, $sql );
|
||||
|
||||
if (count( $aParameter ) > 0) {
|
||||
foreach ($aParameter as $key => $val) {
|
||||
oci_bind_by_name( $stid, $key, $val );
|
||||
}
|
||||
}
|
||||
oci_execute( $stid, OCI_DEFAULT );
|
||||
|
||||
$result = Array ();
|
||||
$i = 1;
|
||||
while ($row = oci_fetch_array( $stid, OCI_ASSOC + OCI_RETURN_NULLS )) {
|
||||
$result[$i ++] = $row;
|
||||
}
|
||||
oci_free_statement( $stid );
|
||||
oci_close( $conn );
|
||||
return $result;
|
||||
break;
|
||||
case preg_match( "/^(INSERT|UPDATE|DELETE)\s/i", $sql ):
|
||||
$stid = oci_parse( $conn, $sql );
|
||||
$isValid = true;
|
||||
if (count( $aParameter ) > 0) {
|
||||
foreach ($aParameter as $key => $val) {
|
||||
oci_bind_by_name( $stid, $key, $val );
|
||||
}
|
||||
}
|
||||
$objExecute = oci_execute( $stid, OCI_DEFAULT );
|
||||
$result = oci_num_rows ($stid);
|
||||
if ($objExecute) {
|
||||
oci_commit( $conn );
|
||||
} else {
|
||||
oci_rollback( $conn );
|
||||
$isValid = false;
|
||||
}
|
||||
oci_free_statement( $stid );
|
||||
oci_close( $conn );
|
||||
if ($isValid) {
|
||||
return $result;
|
||||
} else {
|
||||
return oci_error();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Stored procedures
|
||||
$stid = oci_parse( $conn, $sql );
|
||||
$aParameterRet = array ();
|
||||
if (count( $aParameter ) > 0) {
|
||||
foreach ($aParameter as $key => $val) {
|
||||
$aParameterRet[$key] = $val;
|
||||
// The third parameter ($aParameterRet[$key]) returned a value by reference.
|
||||
oci_bind_by_name( $stid, $key, $aParameterRet[$key] );
|
||||
}
|
||||
}
|
||||
$objExecute = oci_execute( $stid, OCI_DEFAULT );
|
||||
oci_free_statement( $stid );
|
||||
oci_close( $conn );
|
||||
return $aParameterRet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ class serverConf
|
||||
$dbNetView = new NET(DB_HOST);
|
||||
$dbNetView->loginDbServer(DB_USER, DB_PASS);
|
||||
|
||||
$dbConns = new dbConnections('');
|
||||
$dbConns = new DbConnections('');
|
||||
$availdb = '';
|
||||
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
|
||||
if ($availdb != '') {
|
||||
|
||||
@@ -65,6 +65,12 @@ class wsBase
|
||||
global $RBAC;
|
||||
|
||||
try {
|
||||
//To enable compatibility with hash login, method Enable.
|
||||
//It's necessary to enable the hash start session because there are use cases in both,
|
||||
//the web entry and in the case planner, where the password is still used in the hash
|
||||
//format so that is possible to start a session. Thiw way we will mantain the
|
||||
//compatibility with this type of loggin.
|
||||
$RBAC->enableLoginWithHash();
|
||||
$uid = $RBAC->VerifyLogin( $userid, $password );
|
||||
|
||||
switch ($uid) {
|
||||
@@ -113,14 +119,13 @@ class wsBase
|
||||
$session->Save();
|
||||
|
||||
//save the session in DataBase
|
||||
|
||||
|
||||
return $wsResponse;
|
||||
} catch (Exception $e) {
|
||||
$wsResponse = unserialize( $e->getMessage() );
|
||||
|
||||
return $wsResponse;
|
||||
}
|
||||
|
||||
//To enable compatibility with hash login, method disable.
|
||||
$RBAC->disableLoginWithHash();
|
||||
return $wsResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -475,7 +475,6 @@ class workspaceTools
|
||||
foreach ($information as $key => $value) {
|
||||
$arrayLang[] = trim($value['LOCALE']);
|
||||
}
|
||||
//require_once ('classes/model/Content.php');
|
||||
$regenerateContent = new Content();
|
||||
$regenerateContent->regenerateContent($arrayLang, $workSpace);
|
||||
}
|
||||
@@ -670,7 +669,6 @@ class workspaceTools
|
||||
{
|
||||
$this->initPropel(true);
|
||||
|
||||
//require_once ('classes/model/AppCacheView.php');
|
||||
//check the language, if no info in config about language, the default is 'en'
|
||||
|
||||
$oConf = new Configurations();
|
||||
|
||||
@@ -531,7 +531,7 @@ function getVarsGrid ($proUid, $dynUid)
|
||||
$dynaformFields = array ();
|
||||
|
||||
if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) {
|
||||
$dyn = new dynaFormHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
|
||||
$dyn = new DynaformHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
|
||||
$dynaformFields[] = $dyn->getFields();
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class FieldCondition extends BaseFieldCondition
|
||||
$oDynaform = DynaformPeer::retrieveByPk( $DYN_UID );
|
||||
$PRO_UID = $oDynaform->getProUid();
|
||||
|
||||
$this->oDynaformHandler = new dynaFormHandler( PATH_DYNAFORM . "$PRO_UID/$DYN_UID" . '.xml' );
|
||||
$this->oDynaformHandler = new DynaformHandler( PATH_DYNAFORM . "$PRO_UID/$DYN_UID" . '.xml' );
|
||||
$aDynaformFields = $this->oDynaformHandler->getFieldNames();
|
||||
for ($i = 0; $i < count( $aDynaformFields ); $i ++) {
|
||||
$aDynaformFields[$i] = "'$aDynaformFields[$i]'";
|
||||
|
||||
@@ -247,7 +247,7 @@ class Language extends BaseLanguage
|
||||
}
|
||||
|
||||
|
||||
$dynaform = new dynaFormHandler( PATH_XMLFORM . $xmlForm );
|
||||
$dynaform = new DynaformHandler( PATH_XMLFORM . $xmlForm );
|
||||
$fieldName = $match[2];
|
||||
|
||||
$codes = explode( '-', $reference );
|
||||
@@ -460,7 +460,7 @@ class Language extends BaseLanguage
|
||||
$xmlFormFile = str_replace( chr( 92 ), '/', $xmlFormPath );
|
||||
$xmlFormFile = str_replace( PATH_XMLFORM, '', $xmlFormPath );
|
||||
|
||||
$dynaForm = new dynaFormHandler( $xmlFormPath );
|
||||
$dynaForm = new DynaformHandler( $xmlFormPath );
|
||||
|
||||
$dynaNodes = $dynaForm->getFields();
|
||||
|
||||
@@ -635,7 +635,7 @@ class Language extends BaseLanguage
|
||||
}
|
||||
|
||||
|
||||
$dynaform = new dynaFormHandler( PATH_PLUGINS . $plugin . PATH_SEP . $xmlForm );
|
||||
$dynaform = new DynaformHandler( PATH_PLUGINS . $plugin . PATH_SEP . $xmlForm );
|
||||
$fieldName = $match[2];
|
||||
|
||||
$codes = explode( '-', $reference );
|
||||
@@ -753,7 +753,7 @@ class Language extends BaseLanguage
|
||||
foreach ($aXMLForms as $xmlFormPath) {
|
||||
$xmlFormFile = str_replace( chr( 92 ), '/', $xmlFormPath );
|
||||
$xmlFormFile = str_replace( PATH_PLUGINS . $plugin . PATH_SEP , '', $xmlFormPath );
|
||||
$dynaForm = new dynaFormHandler( $xmlFormPath );
|
||||
$dynaForm = new DynaformHandler( $xmlFormPath );
|
||||
$dynaNodes = $dynaForm->getFields();
|
||||
//get all fields of each xmlform
|
||||
foreach ($dynaNodes as $oNode) {
|
||||
|
||||
@@ -374,7 +374,7 @@ class Step extends BaseStep
|
||||
while ($oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
//print_r($aRow1);
|
||||
$dynHandler = new dynaFormHandler(PATH_DYNAFORM . $sproUid . PATH_SEP . $aRow1["DYN_UID"] . ".xml");
|
||||
$dynHandler = new DynaformHandler(PATH_DYNAFORM . $sproUid . PATH_SEP . $aRow1["DYN_UID"] . ".xml");
|
||||
$dynFields = $dynHandler->getFields();
|
||||
$sxmlgrid = '';
|
||||
$sType = '';
|
||||
@@ -477,7 +477,7 @@ class Step extends BaseStep
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($aRow['DYN_TYPE'] == 'xmlform') {
|
||||
$dynHandler = new dynaFormHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml" );
|
||||
$dynHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml" );
|
||||
$dynFields = $dynHandler->getFields();
|
||||
$sxmlgrid = '';
|
||||
$sType = '';
|
||||
@@ -547,7 +547,7 @@ class Step extends BaseStep
|
||||
while ($oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
|
||||
$dynHandler = new dynaFormHandler( PATH_DYNAFORM . $sproUid . "/" . $sObjUID . ".xml" );
|
||||
$dynHandler = new DynaformHandler( PATH_DYNAFORM . $sproUid . "/" . $sObjUID . ".xml" );
|
||||
$dynFields = $dynHandler->getFields();
|
||||
$sxmlgrid = '';
|
||||
$sType = '';
|
||||
|
||||
@@ -490,4 +490,23 @@ class Users extends BaseUsers
|
||||
$criteria->add(UsersPeer::USR_ID, $id);
|
||||
return UsersPeer::doSelect($criteria)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc} except USR_PASSWORD, for security reasons.
|
||||
*
|
||||
* @param string $keyType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return an associative array containing the field names (as keys) and field values
|
||||
*/
|
||||
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$key = UsersPeer::translateFieldName(
|
||||
UsersPeer::USR_PASSWORD,
|
||||
BasePeer::TYPE_COLNAME,
|
||||
$keyType
|
||||
);
|
||||
$array = parent::toArray($keyType);
|
||||
unset($array[$key]);
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
// include Gulliver Class
|
||||
require_once( PATH_GULLIVER . PATH_SEP . 'class.g.php');
|
||||
// include Bootstrap Class
|
||||
require_once (PATH_GULLIVER . PATH_SEP . 'class.bootstrap.php');
|
||||
|
||||
if(file_exists(FILE_PATHS_INSTALLED)) {
|
||||
// backward compatibility; parsing old definitions in the compiled path constant
|
||||
|
||||
@@ -14000,6 +14000,12 @@ msgstr "Not Required"
|
||||
msgid "The variable name already exists!"
|
||||
msgstr "The variable name already exists!"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/DYNAFIELD_PHPNAME_ALREADY_EXIST
|
||||
#: LABEL/DYNAFIELD_PHPNAME_ALREADY_EXIST
|
||||
msgid "Name error encountered when creating the variable: {0}. Please rename the variable you are creating with a unique name. Avoid differentiating similarly-named variables with only capitalization and '_' characters."
|
||||
msgstr "Name error encountered when creating the variable: {0}. Please rename the variable you are creating with a unique name. Avoid differentiating similarly-named variables with only capitalization and '_' characters."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/DYNAFIELD_EMPTY
|
||||
#: LABEL/DYNAFIELD_EMPTY
|
||||
|
||||
@@ -233,7 +233,7 @@ class Admin extends Controller
|
||||
$dbNetView = new NET( DB_HOST );
|
||||
$dbNetView->loginDbServer( DB_USER, DB_PASS );
|
||||
|
||||
$dbConns = new dbConnections( '' );
|
||||
$dbConns = new DbConnections( '' );
|
||||
$availdb = '';
|
||||
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
|
||||
if ($availdb != '') {
|
||||
|
||||
@@ -91,8 +91,6 @@ class AppProxy extends HttpProxyController
|
||||
);
|
||||
}
|
||||
|
||||
//require_once ("classes/model/AppNotes.php");
|
||||
|
||||
$usrUid = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : "";
|
||||
$appNotes = new AppNotes();
|
||||
$response = $appNotes->getNotesList( $appUid, '', $httpData->start, $httpData->limit );
|
||||
@@ -113,9 +111,6 @@ class AppProxy extends HttpProxyController
|
||||
*/
|
||||
function postNote ($httpData)
|
||||
{
|
||||
//require_once ("classes/model/AppNotes.php");
|
||||
|
||||
//extract(getExtJSParams());
|
||||
if (isset( $httpData->appUid ) && trim( $httpData->appUid ) != "") {
|
||||
$appUid = $httpData->appUid;
|
||||
} else {
|
||||
|
||||
@@ -180,8 +180,6 @@ class Home extends Controller
|
||||
|
||||
public function indexSingle ($httpData)
|
||||
{
|
||||
require_once 'classes/model/Step.php';
|
||||
|
||||
$step = new Step();
|
||||
|
||||
$solrEnabled = false;
|
||||
@@ -377,7 +375,6 @@ class Home extends Controller
|
||||
$sort = "APP_CACHE_VIEW.APP_NUMBER",
|
||||
$category = null)
|
||||
{
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
|
||||
$appNotes = new AppNotes();
|
||||
|
||||
@@ -638,7 +635,6 @@ class Home extends Controller
|
||||
|
||||
function getCategoryArray ()
|
||||
{
|
||||
require_once 'classes/model/ProcessCategory.php';
|
||||
$category = array();
|
||||
$category[] = array ("",G::LoadTranslation( "ID_ALL_CATEGORIES" ));
|
||||
|
||||
|
||||
@@ -698,7 +698,7 @@ class Main extends Controller
|
||||
$dbNetView = new NET( DB_HOST );
|
||||
$dbNetView->loginDbServer( DB_USER, DB_PASS );
|
||||
|
||||
$dbConns = new dbConnections( '' );
|
||||
$dbConns = new DbConnections( '' );
|
||||
$availdb = '';
|
||||
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
|
||||
if ($availdb != '') {
|
||||
|
||||
@@ -122,7 +122,6 @@ class pmTables extends Controller
|
||||
*/
|
||||
public function data ($httpData)
|
||||
{
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$additionalTables = new AdditionalTables();
|
||||
$tableDef = $additionalTables->load( $httpData->id, true );
|
||||
|
||||
|
||||
@@ -451,30 +451,32 @@ class pmTablesProxy extends HttpProxyController
|
||||
$this->message = $this->success ? G::loadTranslation( 'ID_DELETED_SUCCESSFULLY' ) : G::loadTranslation( 'ID_DELETE_FAILED' );
|
||||
}
|
||||
|
||||
public function importCSV ($httpData)
|
||||
/**
|
||||
* Import pmTable from CSV file
|
||||
* @param $httpData
|
||||
*/
|
||||
public function importCSV($httpData)
|
||||
{
|
||||
$filter = new InputFilter();
|
||||
$countRow = 250;
|
||||
$tmpfilename = $_FILES['form']['tmp_name']['CSV_FILE'];
|
||||
//$tmpfilename = $filter->xssFilterHard($tmpfilename, 'path');
|
||||
if (preg_match( '/[\x00-\x08\x0b-\x0c\x0e\x1f]/', file_get_contents( $tmpfilename ) ) === 0) {
|
||||
if (preg_match('/[\x00-\x08\x0b-\x0c\x0e\x1f]/', file_get_contents($tmpfilename)) === 0) {
|
||||
$filename = $_FILES['form']['name']['CSV_FILE'];
|
||||
//$filename = $filter->xssFilterHard($filename, 'path');
|
||||
if ($oFile = fopen( $filter->xssFilterHard($tmpfilename, 'path'), 'r' )) {
|
||||
if ($oFile = fopen($filter->xssFilterHard($tmpfilename, 'path'), 'r')) {
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
$aAdditionalTables = $oAdditionalTables->load( $_POST['form']['ADD_TAB_UID'], true );
|
||||
$aAdditionalTables = $oAdditionalTables->load($_POST['form']['ADD_TAB_UID'], true);
|
||||
$sErrorMessages = '';
|
||||
$i = 1;
|
||||
$conData = 0;
|
||||
$insert = 'REPLACE INTO ' . $aAdditionalTables['ADD_TAB_NAME'] . ' (';
|
||||
$query = '';
|
||||
$swHead = false;
|
||||
while (($aAux = fgetcsv( $oFile, 4096, $_POST['form']['CSV_DELIMITER'] )) !== false) {
|
||||
if (! is_null( $aAux[0] )) {
|
||||
if (count( $aAdditionalTables['FIELDS'] ) > count( $aAux )) {
|
||||
while (($aAux = fgetcsv($oFile, 4096, $_POST['form']['CSV_DELIMITER'], '"', '"')) !== false) {
|
||||
if (!is_null($aAux[0])) {
|
||||
if (count($aAdditionalTables['FIELDS']) > count($aAux)) {
|
||||
$this->success = false;
|
||||
$this->message = G::LoadTranslation( 'INVALID_FILE' );
|
||||
$this->message = G::LoadTranslation('INVALID_FILE');
|
||||
return 0;
|
||||
}
|
||||
if ($i == 1) {
|
||||
@@ -484,7 +486,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
if ($aField['FLD_NAME'] === $aAux[$j]) {
|
||||
$swHead = true;
|
||||
}
|
||||
$j ++;
|
||||
$j++;
|
||||
}
|
||||
$insert = substr($insert, 0, -2);
|
||||
$insert .= ') VALUES ';
|
||||
@@ -495,13 +497,11 @@ class pmTablesProxy extends HttpProxyController
|
||||
$j = 0;
|
||||
foreach ($aAdditionalTables['FIELDS'] as $aField) {
|
||||
$conData++;
|
||||
|
||||
if (array_key_exists($j, $aAux)) {
|
||||
$temp = '"' . addslashes(stripslashes(G::is_utf8($aAux[$j]) ? $aAux[$j] : utf8_encode($aAux[$j]))) . '"';
|
||||
$temp = '"' . addslashes(G::is_utf8($aAux[$j]) ? $aAux[$j] : utf8_encode($aAux[$j])) . '"';
|
||||
} else {
|
||||
$temp = '""';
|
||||
}
|
||||
|
||||
if ($temp == '') {
|
||||
switch ($aField['FLD_TYPE']) {
|
||||
case 'DATE':
|
||||
@@ -510,7 +510,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
break;
|
||||
}
|
||||
}
|
||||
$j ++;
|
||||
$j++;
|
||||
$queryRow .= $temp . ',';
|
||||
}
|
||||
$query .= substr($queryRow, 0, -1) . '),';
|
||||
@@ -522,15 +522,15 @@ class pmTablesProxy extends HttpProxyController
|
||||
$conData = 0;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$sErrorMessages .= G::LoadTranslation( 'ID_ERROR_INSERT_LINE' ) . ': ' . G::LoadTranslation( 'ID_LINE' ) . ' ' . $i . '. ';
|
||||
$sErrorMessages .= G::LoadTranslation('ID_ERROR_INSERT_LINE') . ': ' . G::LoadTranslation('ID_LINE') . ' ' . $i . '. ';
|
||||
}
|
||||
} else {
|
||||
$swHead = false;
|
||||
}
|
||||
$i ++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
fclose( $oFile );
|
||||
fclose($oFile);
|
||||
if ($conData > 0) {
|
||||
$query = substr($query, 0, -1);
|
||||
executeQuery($insert . $query . ';', $aAdditionalTables['DBS_UID']);
|
||||
@@ -541,12 +541,12 @@ class pmTablesProxy extends HttpProxyController
|
||||
$this->message = $sErrorMessages;
|
||||
} else {
|
||||
$this->success = true;
|
||||
$this->message = G::loadTranslation( 'ID_FILE_IMPORTED_SUCCESSFULLY', array ($filename
|
||||
) );
|
||||
$this->message = G::loadTranslation('ID_FILE_IMPORTED_SUCCESSFULLY', array($filename
|
||||
));
|
||||
G::auditLog("ImportTable", $filename);
|
||||
}
|
||||
} else {
|
||||
$sMessage = G::LoadTranslation( 'ID_UPLOAD_VALID_CSV_FILE' );
|
||||
$sMessage = G::LoadTranslation('ID_UPLOAD_VALID_CSV_FILE');
|
||||
$this->success = false;
|
||||
$this->message = $sMessage;
|
||||
}
|
||||
@@ -637,11 +637,11 @@ class pmTablesProxy extends HttpProxyController
|
||||
}
|
||||
|
||||
/**
|
||||
* export a pm tables record to CSV
|
||||
*
|
||||
* @param string $httpData->id
|
||||
* Export pmTable to CSV format
|
||||
* @param $httpData
|
||||
* @return StdClass
|
||||
*/
|
||||
public function exportCSV ($httpData)
|
||||
public function exportCSV($httpData)
|
||||
{
|
||||
$result = new StdClass();
|
||||
try {
|
||||
@@ -653,50 +653,30 @@ class pmTablesProxy extends HttpProxyController
|
||||
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
$aAdditionalTables = $oAdditionalTables->load( $_POST['ADD_TAB_UID'], true );
|
||||
$aAdditionalTables = $oAdditionalTables->load($_POST['ADD_TAB_UID'], true);
|
||||
$sErrorMessages = '';
|
||||
$sDelimiter = $_POST['CSV_DELIMITER'];
|
||||
|
||||
$resultData = $oAdditionalTables->getAllData( $_POST['ADD_TAB_UID'], null, null, false );
|
||||
$resultData = $oAdditionalTables->getAllData($_POST['ADD_TAB_UID'], null, null, false);
|
||||
$rows = $resultData['rows'];
|
||||
$count = $resultData['count'];
|
||||
|
||||
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
|
||||
$filenameOnly = strtolower( $aAdditionalTables['ADD_TAB_NAME'] . "_" . date( "Y-m-d" ) . '_' . date( "Hi" ) . ".csv" );
|
||||
$filenameOnly = strtolower($aAdditionalTables['ADD_TAB_NAME'] . "_" . date("Y-m-d") . '_' . date("Hi") . ".csv");
|
||||
$filename = $PUBLIC_ROOT_PATH . $filenameOnly;
|
||||
$fp = fopen( $filename, "wb" );
|
||||
|
||||
$fp = fopen($filename, "wb");
|
||||
$swColumns = true;
|
||||
foreach ($rows as $keyCol => $cols) {
|
||||
$SDATA = "";
|
||||
$header = "";
|
||||
$cnt = $cntC = count( $cols );
|
||||
foreach ($cols as $key => $val) {
|
||||
if($swColumns){
|
||||
$header .= $key;
|
||||
if (-- $cntC > 0) {
|
||||
$header .= $sDelimiter;
|
||||
} else {
|
||||
$header .= "\n";
|
||||
$bytesSaved += fwrite( $fp, $header );
|
||||
$swColumns = false;
|
||||
}
|
||||
}
|
||||
$SDATA .= addslashes($val);
|
||||
if (-- $cnt > 0) {
|
||||
$SDATA .= $sDelimiter;
|
||||
}
|
||||
if ($swColumns) {
|
||||
fputcsv($fp, array_keys($cols), $sDelimiter, '"', "\\");
|
||||
$swColumns = false;
|
||||
}
|
||||
$SDATA .= "\n";
|
||||
$bytesSaved += fwrite( $fp, $SDATA );
|
||||
fputcsv($fp, $cols, $sDelimiter, '"');
|
||||
}
|
||||
|
||||
fclose( $fp );
|
||||
|
||||
// $filenameLink = "pmTables/streamExported?f=$filenameOnly";
|
||||
fclose($fp);
|
||||
$filenameLink = "streamExported?f=$filenameOnly";
|
||||
$size = round( ($bytesSaved / 1024), 2 ) . " Kb";
|
||||
$filename = $filenameOnly;
|
||||
$size = filesize($filename);
|
||||
$link = $filenameLink;
|
||||
|
||||
$result->success = true;
|
||||
@@ -1269,7 +1249,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
|
||||
$dynaformHandler = new dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
|
||||
$dynaformHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
|
||||
$nodeFieldsList = $dynaformHandler->getFields();
|
||||
|
||||
foreach ($nodeFieldsList as $node) {
|
||||
@@ -1579,7 +1559,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$dynaformHandler = new dynaformHandler(PATH_DYNAFORM . $record['DYN_FILENAME'] . '.xml');
|
||||
$dynaformHandler = new DynaformHandler(PATH_DYNAFORM . $record['DYN_FILENAME'] . '.xml');
|
||||
$nodeFieldsList = $dynaformHandler->getFields();
|
||||
|
||||
foreach ($nodeFieldsList as $node) {
|
||||
|
||||
@@ -3823,6 +3823,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_INSTRUCTIONS','en','Instructions','2014-01-15') ,
|
||||
( 'LABEL','ID_NOT_REQUIRED','en','Not Required','2014-01-15') ,
|
||||
( 'LABEL','DYNAFIELD_ALREADY_EXIST','en','The variable name already exists!','2015-04-24') ,
|
||||
( 'LABEL','DYNAFIELD_PHPNAME_ALREADY_EXIST','en','Name error encountered when creating the variable: {0}. Please rename the variable you are creating with a unique name. Avoid differentiating similarly-named variables with only capitalization and ''_'' characters.','2017-08-09') ,
|
||||
( 'LABEL','DYNAFIELD_EMPTY','en','The Field Name is empty','2014-10-21') ,
|
||||
( 'LABEL','DYNAFIELD_NODENAME_NUMBER','en','The field name should not start with a number','2014-01-15') ,
|
||||
( 'LABEL','ID_EMPTY_NODENAME','en','The name field is empty','2014-01-15') ,
|
||||
|
||||
@@ -162,8 +162,6 @@ function sendJsonResultGeneric($response, $callback)
|
||||
|
||||
function expandNode()
|
||||
{
|
||||
//require_once ("classes/model/AppFolder.php");
|
||||
|
||||
extract(getExtJSParams());
|
||||
|
||||
$oPMFolder = new AppFolder();
|
||||
|
||||
@@ -303,7 +303,6 @@ try {
|
||||
}
|
||||
|
||||
//Save files
|
||||
//require_once ("classes/model/AppDocument.php");
|
||||
|
||||
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
$oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
|
||||
|
||||
@@ -130,8 +130,6 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
}
|
||||
|
||||
if ($indocUid != null) {
|
||||
//require_once ("classes/model/AppFolder.php");
|
||||
//require_once ("classes/model/InputDocument.php");
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load( $indocUid );
|
||||
|
||||
@@ -328,7 +328,7 @@ try {
|
||||
* Added By erik 16-05-08
|
||||
* Description: this was added for the additional database connections
|
||||
*/
|
||||
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections->loadAdditionalConnections();
|
||||
$_SESSION['CURRENT_DYN_UID'] = $_GET['UID'];
|
||||
|
||||
@@ -1137,7 +1137,7 @@ try {
|
||||
* Description: this was added for the additional database connections
|
||||
*/
|
||||
|
||||
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections->loadAdditionalConnections();
|
||||
$stepFilename = "$sNamespace/$sStepName";
|
||||
G::evalJScript( "
|
||||
|
||||
@@ -139,7 +139,7 @@ if (! isset( $_GET['ex'] )) {
|
||||
$_GET['ex'] = $_GET['position'];
|
||||
}
|
||||
|
||||
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections->loadAdditionalConnections();
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
@@ -75,7 +75,7 @@ try {
|
||||
}
|
||||
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
|
||||
$_SESSION['PROCESS'] = $applicationFields['PRO_UID'];
|
||||
$dbConnections = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$dbConnections = new DbConnections( $_SESSION['PROCESS'] );
|
||||
$dbConnections->loadAdditionalConnections();
|
||||
$_SESSION['CURRENT_DYN_UID'] = $_REQUEST['DYN_UID'];
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ switch ($action) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'newDdConnection':
|
||||
$dbs = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$dbs = new DbConnections( $_SESSION['PROCESS'] );
|
||||
$dbServices = $dbs->getDbServicesAvailables();
|
||||
$dbService = $dbs->getEncondeList();
|
||||
|
||||
@@ -115,7 +115,7 @@ switch ($action) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'editDdConnection':
|
||||
$dbs = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$dbs = new DbConnections( $_SESSION['PROCESS'] );
|
||||
$dbServices = $dbs->getDbServicesAvailables();
|
||||
|
||||
$rows[] = array ('uid' => 'char','name' => 'char'
|
||||
@@ -343,7 +343,7 @@ switch ($action) {
|
||||
$engine = $_POST['engine'];
|
||||
|
||||
if ($engine != "0") {
|
||||
$dbs = new dbConnections();
|
||||
$dbs = new DbConnections();
|
||||
$var = Bootstrap::json_encode($dbs->getEncondeList($filter->xssFilterHard($engine)));
|
||||
G::outRes($var);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
if (isset( $_SESSION['PROCESS'] )) {
|
||||
$pro = include (PATH_CORE . "config/databases.php");
|
||||
|
||||
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
|
||||
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
|
||||
foreach ($oDbConnections->connections as $db) {
|
||||
$db['DBS_PASSWORD'] = $oDbConnections->getPassWithoutEncrypt( $db );
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ try {
|
||||
$sFilter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
|
||||
|
||||
//$oJSON = new Services_JSON();
|
||||
$oDynaformHandler = new dynaFormHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
|
||||
$oDynaformHandler = new DynaformHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
|
||||
|
||||
$aFilter = explode( ',', $sFilter );
|
||||
|
||||
@@ -68,7 +68,7 @@ try {
|
||||
$_DYN_FILENAME = $_SESSION['Current_Dynafom']['Parameters']['FILE'];
|
||||
$sFilter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
|
||||
|
||||
$oDynaformHandler = new dynaFormHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
|
||||
$oDynaformHandler = new DynaformHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
|
||||
$aFilter = explode( ',', $sFilter );
|
||||
$aAvailableFields = $oDynaformHandler->getFieldNames( $aFilter );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ switch ($request) {
|
||||
$tmpfilename = $filter->xssFilterHard($tmpfilename);
|
||||
|
||||
|
||||
$o = new dynaFormHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
|
||||
$o = new DynaformHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
|
||||
|
||||
$list_elements = explode( ',', $items );
|
||||
|
||||
@@ -59,7 +59,7 @@ switch ($request) {
|
||||
$tmpfilename = $_SESSION['Current_Dynafom']['Parameters']['FILE'];
|
||||
$tmpfilename = $filter->xssFilterHard($tmpfilename);
|
||||
|
||||
$o = new dynaFormHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
|
||||
$o = new DynaformHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
|
||||
$hidden_items = Array ();
|
||||
|
||||
$has_hidden_items = false;
|
||||
|
||||
@@ -47,8 +47,6 @@ if (isset( $_SESSION['CURRENT_PAGE_INITILIZATION'] )) {
|
||||
eval( $_SESSION['CURRENT_PAGE_INITILIZATION'] );
|
||||
}
|
||||
|
||||
//require_once (PATH_THIRDPARTY . 'pear/json/class.json.php');
|
||||
//$json = new Services_JSON();
|
||||
$G_FORM = new form( G::getUIDName( urlDecode( $_POST['form'] ) ) );
|
||||
$G_FORM->id = urlDecode( $_POST['form'] );
|
||||
$G_FORM->values = $_SESSION[$G_FORM->id];
|
||||
|
||||
@@ -45,9 +45,6 @@ try {
|
||||
// Bootstrap::mylog("post:".$_POST['function']);
|
||||
switch ($sfunction) {
|
||||
case 'lookForNameInput':
|
||||
//require_once ('classes/model/Content.php');
|
||||
//require_once ("classes/model/InputDocument.php");
|
||||
|
||||
$snameInput = urldecode( $_POST['NAMEINPUT'] );
|
||||
$sPRO_UID = urldecode( $_POST['proUid'] );
|
||||
|
||||
|
||||
@@ -901,7 +901,7 @@ try {
|
||||
$proUid = isset($_REQUEST['PRO_UID']) ? $_REQUEST['PRO_UID'] : '';
|
||||
$dynUid = isset($_REQUEST['DYN_UID']) ? $_REQUEST['DYN_UID'] : '';
|
||||
if (is_file(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
|
||||
$dyn = new dynaFormHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
|
||||
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
|
||||
$dynaformFields[] = $dyn->getFields();
|
||||
}
|
||||
foreach ($dynaformFields as $aDynFormFields) {
|
||||
|
||||
@@ -21,6 +21,18 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
use ProcessMaker\Exception\RBACException;
|
||||
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_USERS')) {
|
||||
case -2:
|
||||
throw new RBACException('ID_USER_HAVENT_RIGHTS_SYSTEM', -2);
|
||||
break;
|
||||
case -1:
|
||||
case -3:
|
||||
throw new RBACException('ID_USER_HAVENT_RIGHTS_PAGE', -1);
|
||||
break;
|
||||
}
|
||||
|
||||
$REQUEST = (isset( $_GET['request'] )) ? $_GET['request'] : $_POST['request'];
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
ini_set("soap.wsdl_cache_enabled", 0); //disabling WSDL cache
|
||||
use ProcessMaker\Util\ParseSoapVariableName;
|
||||
|
||||
ini_set("soap.wsdl_cache_enabled", 0); //disabling WSDL cache
|
||||
|
||||
define( 'WEB_SERVICE_VERSION', '2.0' );
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ switch ($_POST['action']) {
|
||||
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aFields['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array($aFields['USR_PASSWORD']))));
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aFields['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array($oUser->getUsrPassword()))));
|
||||
$aFields['USR_LOGGED_NEXT_TIME'] = $aUserProperty['USR_LOGGED_NEXT_TIME'];
|
||||
|
||||
if (array_key_exists('USR_PASSWORD', $aFields)) {
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use G;
|
||||
use UsersPeer;
|
||||
use CasesPeer;
|
||||
use AppDelegation;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use \UsersPeer;
|
||||
use \CasesPeer;
|
||||
use Exception;
|
||||
use wsBase;
|
||||
use RBAC;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
@@ -26,7 +30,7 @@ class Cases
|
||||
{
|
||||
try {
|
||||
$this->formatFieldNameInUppercase = $flag;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -42,7 +46,7 @@ class Cases
|
||||
{
|
||||
try {
|
||||
return ($this->formatFieldNameInUppercase)? strtoupper($fieldName) : strtolower($fieldName);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -57,7 +61,7 @@ class Cases
|
||||
*/
|
||||
private function throwExceptionCaseDoesNotExist($applicationUid, $fieldNameForException)
|
||||
{
|
||||
throw new \Exception(\G::LoadTranslation(
|
||||
throw new Exception(\G::LoadTranslation(
|
||||
'ID_CASE_DOES_NOT_EXIST2', [$fieldNameForException, $applicationUid]
|
||||
));
|
||||
}
|
||||
@@ -87,7 +91,7 @@ class Cases
|
||||
if ($flag) {
|
||||
$this->throwExceptionCaseDoesNotExist($applicationUid, $fieldNameForException);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +126,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return $obj->toArray(\BasePeer::TYPE_FIELDNAME);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +153,7 @@ class Cases
|
||||
|
||||
if (is_null($obj)) {
|
||||
if ($throwException) {
|
||||
throw new \Exception(\G::LoadTranslation(
|
||||
throw new Exception(\G::LoadTranslation(
|
||||
'ID_CASE_DEL_INDEX_DOES_NOT_EXIST',
|
||||
[
|
||||
$arrayVariableNameForException['$applicationUid'],
|
||||
@@ -165,7 +169,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return $obj->toArray(\BasePeer::TYPE_FIELDNAME);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -209,7 +213,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return $arrayListCounter;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -462,11 +466,11 @@ class Cases
|
||||
if (!isset($row)) {
|
||||
continue;
|
||||
}
|
||||
$ws = new \wsBase();
|
||||
$ws = new wsBase();
|
||||
$fields = $ws->getCaseInfo($applicationUid, $row["DEL_INDEX"]);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if ($array ["status_code"] != 0) {
|
||||
throw (new \Exception($array ["message"]));
|
||||
throw (new Exception($array ["message"]));
|
||||
} else {
|
||||
$array['app_uid'] = $array['caseId'];
|
||||
$array['app_number'] = $array['caseNumber'];
|
||||
@@ -526,15 +530,15 @@ class Cases
|
||||
"app_name" => $e->getMessage(),
|
||||
"del_index" => $e->getMessage(),
|
||||
"pro_uid" => $e->getMessage());
|
||||
throw (new \Exception($arrayData));
|
||||
throw (new Exception($arrayData));
|
||||
}
|
||||
} else {
|
||||
$ws = new \wsBase();
|
||||
$ws = new wsBase();
|
||||
$fields = $ws->getCaseInfo($applicationUid, 0);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
|
||||
if ($array ["status_code"] != 0) {
|
||||
throw (new \Exception($array ["message"]));
|
||||
throw (new Exception($array ["message"]));
|
||||
} else {
|
||||
$array['app_uid'] = $array['caseId'];
|
||||
$array['app_number'] = $array['caseNumber'];
|
||||
@@ -592,7 +596,7 @@ class Cases
|
||||
//Return
|
||||
return $oResponse;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -621,7 +625,7 @@ class Cases
|
||||
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CASE_NO_CURRENT_TASKS_BECAUSE_CASE_ITS_COMPLETED", array($this->getFieldNameByFormatFieldName("APP_UID"), $applicationUid)));
|
||||
throw new Exception(\G::LoadTranslation("ID_CASE_NO_CURRENT_TASKS_BECAUSE_CASE_ITS_COMPLETED", array($this->getFieldNameByFormatFieldName("APP_UID"), $applicationUid)));
|
||||
}
|
||||
|
||||
//Get data
|
||||
@@ -629,8 +633,8 @@ class Cases
|
||||
|
||||
$oCriteria = new \Criteria( 'workflow' );
|
||||
$del = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( \AppDelegationPeer::DEL_INDEX );
|
||||
$oCriteria->addSelectColumn( \AppDelegationPeer::TAS_UID );
|
||||
$oCriteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
$oCriteria->addSelectColumn(\AppDelegationPeer::TAS_UID);
|
||||
$oCriteria->addSelectColumn(\AppDelegationPeer::DEL_INIT_DATE);
|
||||
$oCriteria->addSelectColumn(\AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$oCriteria->addSelectColumn(\TaskPeer::TAS_TITLE);
|
||||
@@ -652,11 +656,11 @@ class Cases
|
||||
}
|
||||
//Return
|
||||
if (empty($result)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CASES_INCORRECT_INFORMATION", array($applicationUid)));
|
||||
throw new Exception(\G::LoadTranslation("ID_CASES_INCORRECT_INFORMATION", array($applicationUid)));
|
||||
} else {
|
||||
return $result;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -675,19 +679,19 @@ class Cases
|
||||
{
|
||||
try {
|
||||
|
||||
$ws = new \wsBase();
|
||||
$ws = new wsBase();
|
||||
if ($variables) {
|
||||
$variables = array_shift($variables);
|
||||
}
|
||||
Validator::proUid($processUid, '$pro_uid');
|
||||
$oTask = new \Task();
|
||||
if (! $oTask->taskExists($taskUid)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('tas_uid')));
|
||||
throw new Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('tas_uid')));
|
||||
}
|
||||
$fields = $ws->newCase($processUid, $userUid, $taskUid, $variables);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if ($array ["status_code"] != 0) {
|
||||
throw (new \Exception($array ["message"]));
|
||||
throw (new Exception($array ["message"]));
|
||||
} else {
|
||||
$array['app_uid'] = $array['caseId'];
|
||||
$array['app_number'] = $array['caseNumber'];
|
||||
@@ -700,7 +704,7 @@ class Cases
|
||||
$oResponse = json_decode(json_encode($array), false);
|
||||
//Return
|
||||
return $oResponse;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -719,7 +723,7 @@ class Cases
|
||||
{
|
||||
try {
|
||||
|
||||
$ws = new \wsBase();
|
||||
$ws = new wsBase();
|
||||
if ($variables) {
|
||||
$variables = array_shift($variables);
|
||||
} elseif ($variables == null) {
|
||||
@@ -728,17 +732,17 @@ class Cases
|
||||
Validator::proUid($processUid, '$pro_uid');
|
||||
$user = new \Users();
|
||||
if (! $user->userExists( $userUid )) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('usr_uid')));
|
||||
throw new Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('usr_uid')));
|
||||
}
|
||||
$fields = $ws->newCaseImpersonate($processUid, $userUid, $variables, $taskUid);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if ($array ["status_code"] != 0) {
|
||||
if ($array ["status_code"] == 12) {
|
||||
throw (new \Exception(\G::loadTranslation('ID_NO_STARTING_TASK') . '. tas_uid.'));
|
||||
throw (new Exception(\G::loadTranslation('ID_NO_STARTING_TASK') . '. tas_uid.'));
|
||||
} elseif ($array ["status_code"] == 13) {
|
||||
throw (new \Exception(\G::loadTranslation('ID_MULTIPLE_STARTING_TASKS') . '. tas_uid.'));
|
||||
throw (new Exception(\G::loadTranslation('ID_MULTIPLE_STARTING_TASKS') . '. tas_uid.'));
|
||||
}
|
||||
throw (new \Exception($array ["message"]));
|
||||
throw (new Exception($array ["message"]));
|
||||
} else {
|
||||
$array['app_uid'] = $array['caseId'];
|
||||
$array['app_number'] = $array['caseNumber'];
|
||||
@@ -751,7 +755,7 @@ class Cases
|
||||
$oResponse = json_decode(json_encode($array), false);
|
||||
//Return
|
||||
return $oResponse;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -771,24 +775,24 @@ class Cases
|
||||
{
|
||||
try {
|
||||
if (!$delIndex) {
|
||||
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
|
||||
$delIndex = AppDelegation::getCurrentIndex($applicationUid);
|
||||
}
|
||||
|
||||
$ws = new \wsBase();
|
||||
$ws = new wsBase();
|
||||
$fields = $ws->reassignCase($userUid, $applicationUid, $delIndex, $userUidSource, $userUidTarget);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if (array_key_exists("status_code", $array)) {
|
||||
if ($array ["status_code"] != 0) {
|
||||
throw (new \Exception($array ["message"]));
|
||||
throw (new Exception($array ["message"]));
|
||||
} else {
|
||||
unset($array['status_code']);
|
||||
unset($array['message']);
|
||||
unset($array['timestamp']);
|
||||
}
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CASES_INCORRECT_INFORMATION", array($applicationUid)));
|
||||
throw new Exception(\G::LoadTranslation("ID_CASES_INCORRECT_INFORMATION", array($applicationUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -814,14 +818,14 @@ class Cases
|
||||
Validator::usrUid($usr_uid, '$usr_uid');
|
||||
|
||||
if ($del_index === false) {
|
||||
$del_index = \AppDelegation::getCurrentIndex($app_uid);
|
||||
$del_index = AppDelegation::getCurrentIndex($app_uid);
|
||||
}
|
||||
Validator::isInteger($del_index, '$del_index');
|
||||
|
||||
$case = new \Cases();
|
||||
$fields = $case->loadCase($app_uid);
|
||||
if ($fields['APP_STATUS'] == 'CANCELLED') {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_ALREADY_CANCELED", array($app_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_ALREADY_CANCELED", array($app_uid))));
|
||||
}
|
||||
|
||||
$appCacheView = new \AppCacheView();
|
||||
@@ -840,7 +844,7 @@ class Cases
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_USER_INVALID_CANCEL_CASE", array($usr_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_USER_INVALID_CANCEL_CASE", array($usr_uid))));
|
||||
}
|
||||
|
||||
$case->cancelCase( $app_uid, $del_index, $usr_uid );
|
||||
@@ -868,7 +872,7 @@ class Cases
|
||||
Validator::usrUid($usr_uid, '$usr_uid');
|
||||
|
||||
if ($del_index === false) {
|
||||
$del_index = \AppDelegation::getCurrentIndex($app_uid);
|
||||
$del_index = AppDelegation::getCurrentIndex($app_uid);
|
||||
}
|
||||
|
||||
Validator::isInteger($del_index, '$del_index');
|
||||
@@ -876,13 +880,13 @@ class Cases
|
||||
$case = new \Cases();
|
||||
$fields = $case->loadCase($app_uid);
|
||||
if ($fields['APP_STATUS'] == 'CANCELLED') {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_IS_CANCELED", array($app_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_IS_CANCELED", array($app_uid))));
|
||||
}
|
||||
|
||||
$oDelay = new \AppDelay();
|
||||
|
||||
if ($oDelay->isPaused($app_uid, $del_index)) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_PAUSED", array($app_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_PAUSED", array($app_uid))));
|
||||
}
|
||||
|
||||
$appCacheView = new \AppCacheView();
|
||||
@@ -904,7 +908,7 @@ class Cases
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_USER_INVALID_PAUSED_CASE", array($usr_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_USER_INVALID_PAUSED_CASE", array($usr_uid))));
|
||||
}
|
||||
|
||||
if ($unpaused_date != null) {
|
||||
@@ -934,14 +938,14 @@ class Cases
|
||||
Validator::usrUid($usr_uid, '$usr_uid');
|
||||
|
||||
if ($del_index === false) {
|
||||
$del_index = \AppDelegation::getCurrentIndex($app_uid);
|
||||
$del_index = AppDelegation::getCurrentIndex($app_uid);
|
||||
}
|
||||
Validator::isInteger($del_index, '$del_index');
|
||||
|
||||
$oDelay = new \AppDelay();
|
||||
|
||||
if (!$oDelay->isPaused($app_uid, $del_index)) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_NOT_PAUSED", array($app_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_NOT_PAUSED", array($app_uid))));
|
||||
}
|
||||
|
||||
$appCacheView = new \AppCacheView();
|
||||
@@ -960,7 +964,7 @@ class Cases
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_USER_INVALID_UNPAUSE_CASE", array($usr_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_USER_INVALID_UNPAUSE_CASE", array($usr_uid))));
|
||||
}
|
||||
|
||||
$case = new \Cases();
|
||||
@@ -971,39 +975,45 @@ class Cases
|
||||
* Put execute trigger case
|
||||
*
|
||||
* @access public
|
||||
* @param string $app_uid , Uid for case
|
||||
* @param string $usr_uid , Uid for user
|
||||
* @param bool|string $del_index , Index for case
|
||||
* @param string $appUid, Uid for case
|
||||
* @param string $triUid, Uid for trigger
|
||||
* @param string $userUid, Uid for user
|
||||
* @param bool|string $delIndex, Index for case
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function putExecuteTriggerCase($app_uid, $tri_uid, $usr_uid, $del_index = false)
|
||||
public function putExecuteTriggerCase($appUid, $triUid, $userUid, $delIndex = false)
|
||||
{
|
||||
Validator::isString($app_uid, '$app_uid');
|
||||
Validator::isString($tri_uid, '$tri_uid');
|
||||
Validator::isString($usr_uid, '$usr_uid');
|
||||
Validator::isString($appUid, '$appUid');
|
||||
Validator::isString($triUid, '$triUid');
|
||||
Validator::isString($userUid, '$userUid');
|
||||
|
||||
Validator::appUid($app_uid, '$app_uid');
|
||||
Validator::triUid($tri_uid, '$tri_uid');
|
||||
Validator::usrUid($usr_uid, '$usr_uid');
|
||||
Validator::appUid($appUid, '$appUid');
|
||||
Validator::triUid($triUid, '$triUid');
|
||||
Validator::usrUid($userUid, '$userUid');
|
||||
|
||||
if ($del_index === false) {
|
||||
$del_index = \AppDelegation::getCurrentIndex($app_uid);
|
||||
if ($delIndex === false) {
|
||||
//We need to find the last delIndex open related to the user $usr_uid
|
||||
$delIndex = (integer)$this->getLastParticipatedByUser($appUid, $userUid, 'OPEN');
|
||||
//If the is assigned another user the function will be return 0
|
||||
if ($delIndex === 0) {
|
||||
throw new Exception(G::loadTranslation('ID_CASE_ASSIGNED_ANOTHER_USER'));
|
||||
}
|
||||
}
|
||||
Validator::isInteger($del_index, '$del_index');
|
||||
Validator::isInteger($delIndex, '$del_index');
|
||||
|
||||
global $RBAC;
|
||||
if (!method_exists($RBAC, 'initRBAC')) {
|
||||
$RBAC = \RBAC::getSingleton( PATH_DATA, session_id() );
|
||||
$RBAC = RBAC::getSingleton( PATH_DATA, session_id() );
|
||||
$RBAC->sSystem = 'PROCESSMAKER';
|
||||
}
|
||||
|
||||
$case = new \wsBase();
|
||||
$result = $case->executeTrigger($usr_uid, $app_uid, $tri_uid, $del_index);
|
||||
$case = new wsBase();
|
||||
$result = $case->executeTrigger($userUid, $appUid, $triUid, $delIndex);
|
||||
|
||||
if ($result->status_code != 0) {
|
||||
throw new \Exception($result->message);
|
||||
throw new Exception($result->message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1032,11 +1042,11 @@ class Cases
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
if ($aRow['APP_STATUS'] != 'DRAFT') {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_STATUS")));
|
||||
throw (new Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_STATUS")));
|
||||
}
|
||||
|
||||
if ($aRow['APP_INIT_USER'] != $usr_uid) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_OWNER")));
|
||||
throw (new Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_OWNER")));
|
||||
}
|
||||
|
||||
$case = new \Cases();
|
||||
@@ -1057,26 +1067,26 @@ class Cases
|
||||
{
|
||||
try {
|
||||
if (!$delIndex) {
|
||||
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
|
||||
$delIndex = AppDelegation::getCurrentIndex($applicationUid);
|
||||
//Check if the next task is a subprocess SYNCHRONOUS with a thread Open
|
||||
$subAppData = new \SubApplication();
|
||||
$caseSubprocessPending = $subAppData->isSubProcessWithCasePending($applicationUid, $delIndex);
|
||||
if ($caseSubprocessPending) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASE_ALREADY_DERIVATED")));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASE_ALREADY_DERIVATED")));
|
||||
}
|
||||
}
|
||||
|
||||
$ws = new \wsBase();
|
||||
$ws = new wsBase();
|
||||
$fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $bExecuteTriggersBeforeAssignment = false);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if ($array ["status_code"] != 0) {
|
||||
throw (new \Exception($array ["message"]));
|
||||
throw (new Exception($array ["message"]));
|
||||
} else {
|
||||
unset($array['status_code']);
|
||||
unset($array['message']);
|
||||
unset($array['timestamp']);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1545,7 +1555,7 @@ class Cases
|
||||
try {
|
||||
$aAux1 = $oUser->load($aAux['USR_UID']);
|
||||
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
|
||||
} catch (\Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
$sUser = '(USER DELETED)';
|
||||
}
|
||||
//if both documents were generated, we choose the pdf one, only if doc was
|
||||
@@ -1656,7 +1666,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return $caseVariable;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1755,11 +1765,11 @@ class Cases
|
||||
$arrayResult = $this->getStatusInfo($app_uid);
|
||||
|
||||
if ($arrayResult["APP_STATUS"] == "CANCELLED") {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CASE_CANCELLED", array($app_uid)));
|
||||
throw new Exception(\G::LoadTranslation("ID_CASE_CANCELLED", array($app_uid)));
|
||||
}
|
||||
|
||||
if ($arrayResult["APP_STATUS"] == "COMPLETED") {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CASE_IS_COMPLETED", array($app_uid)));
|
||||
throw new Exception(\G::LoadTranslation("ID_CASE_IS_COMPLETED", array($app_uid)));
|
||||
}
|
||||
|
||||
$appCacheView = new \AppCacheView();
|
||||
@@ -1775,7 +1785,7 @@ class Cases
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED", array($usr_uid))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED", array($usr_uid))));
|
||||
}
|
||||
|
||||
$_SESSION['APPLICATION'] = $app_uid;
|
||||
@@ -1856,11 +1866,11 @@ class Cases
|
||||
$case = new \Cases();
|
||||
$caseLoad = $case->loadCase($app_uid);
|
||||
$pro_uid = $caseLoad['PRO_UID'];
|
||||
$tas_uid = \AppDelegation::getCurrentTask($app_uid);
|
||||
$tas_uid = AppDelegation::getCurrentTask($app_uid);
|
||||
$respView = $case->getAllObjectsFrom( $pro_uid, $app_uid, $tas_uid, $usr_uid, 'VIEW' );
|
||||
$respBlock = $case->getAllObjectsFrom( $pro_uid, $app_uid, $tas_uid, $usr_uid, 'BLOCK' );
|
||||
if ($respView['CASES_NOTES'] == 0 && $respBlock['CASES_NOTES'] == 0) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS")));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS")));
|
||||
}
|
||||
|
||||
if ($sort != 'APP_NOTE.NOTE_DATE') {
|
||||
@@ -1944,7 +1954,7 @@ class Cases
|
||||
|
||||
Validator::isString($note_content, '$note_content');
|
||||
if (strlen($note_content) > 500) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_INVALID_MAX_PERMITTED", array($note_content,'500'))));
|
||||
throw (new Exception(\G::LoadTranslation("ID_INVALID_MAX_PERMITTED", array($note_content,'500'))));
|
||||
}
|
||||
|
||||
Validator::isBoolean($send_mail, '$send_mail');
|
||||
@@ -1952,11 +1962,11 @@ class Cases
|
||||
$case = new \Cases();
|
||||
$caseLoad = $case->loadCase($app_uid);
|
||||
$pro_uid = $caseLoad['PRO_UID'];
|
||||
$tas_uid = \AppDelegation::getCurrentTask($app_uid);
|
||||
$tas_uid = AppDelegation::getCurrentTask($app_uid);
|
||||
$respView = $case->getAllObjectsFrom( $pro_uid, $app_uid, $tas_uid, $usr_uid, 'VIEW' );
|
||||
$respBlock = $case->getAllObjectsFrom( $pro_uid, $app_uid, $tas_uid, $usr_uid, 'BLOCK' );
|
||||
if ($respView['CASES_NOTES'] == 0 && $respBlock['CASES_NOTES'] == 0) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS")));
|
||||
throw (new Exception(\G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS")));
|
||||
}
|
||||
|
||||
$note_content = addslashes($note_content);
|
||||
@@ -1987,7 +1997,7 @@ class Cases
|
||||
$this->getFieldNameByFormatFieldName("USR_FIRSTNAME") => $record["USR_FIRSTNAME"] . "",
|
||||
$this->getFieldNameByFormatFieldName("USR_LASTNAME") => $record["USR_LASTNAME"] . ""
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2255,7 +2265,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return $arrayTask;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2333,7 +2343,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2520,7 +2530,7 @@ class Cases
|
||||
|
||||
//Return
|
||||
return array();
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2542,7 +2552,7 @@ class Cases
|
||||
$response = $case->getProcessListStartCase($usrUid, $typeView);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -2624,7 +2634,7 @@ class Cases
|
||||
}
|
||||
|
||||
return $processList;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -2807,7 +2817,7 @@ class Cases
|
||||
$filterName => (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter']))? $arrayFilterData['filter'] : '',
|
||||
'data' => $arrayUser
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -3180,7 +3190,7 @@ class Cases
|
||||
}
|
||||
}
|
||||
$arrayApplicationData['APP_DATA'][$key] = G::json_encode($files);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog('DeleteFile', 400, $e->getMessage(), $value, SYS_SYS, 'processmaker.log');
|
||||
}
|
||||
}
|
||||
@@ -3244,7 +3254,7 @@ class Cases
|
||||
* @param array $appData
|
||||
* @param array $dataVariable
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getGlobalVariables($appData = array(), $dataVariable = array())
|
||||
{
|
||||
|
||||
@@ -391,7 +391,6 @@ class Dashboard {
|
||||
$data['PRO_UID'] = "";
|
||||
$data['APP_UID'] = "";
|
||||
|
||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Configuration.php");
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$response = $oConfig->create($data);
|
||||
@@ -409,7 +408,6 @@ class Dashboard {
|
||||
*/
|
||||
public function getConfig($usr_uid)
|
||||
{
|
||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Configuration.php");
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$response = array();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \DbSource;
|
||||
use \dbConnections;
|
||||
use G;
|
||||
use DbSource;
|
||||
use DbConnections;
|
||||
|
||||
class DataBaseConnection
|
||||
{
|
||||
@@ -61,7 +61,7 @@ class DataBaseConnection
|
||||
$dbs_uid = $this->validateDbsUid($dbs_uid, $pro_uid);
|
||||
}
|
||||
|
||||
$dbs = new dbConnections($pro_uid);
|
||||
$dbs = new DbConnections($pro_uid);
|
||||
$oDBConnection = new DbSource();
|
||||
$aFields = $oDBConnection->load($dbs_uid, $pro_uid);
|
||||
if ($aFields['DBS_PORT'] == '0') {
|
||||
@@ -162,7 +162,7 @@ class DataBaseConnection
|
||||
|
||||
if (isset($dataDBConnection['DBS_ENCODE'])) {
|
||||
$encodesExists = array();
|
||||
$dbs = new dbConnections();
|
||||
$dbs = new DbConnections();
|
||||
$dbEncodes = $dbs->getEncondeList($dataDBConnection['DBS_TYPE']);
|
||||
foreach ($dbEncodes as $value) {
|
||||
$encodesExists[] = $value['0'];
|
||||
@@ -423,7 +423,7 @@ class DataBaseConnection
|
||||
*/
|
||||
public function getDbEngines ()
|
||||
{
|
||||
$dbs = new dbConnections();
|
||||
$dbs = new DbConnections();
|
||||
$dbServices = $dbs->getDbServicesAvailables();
|
||||
return $dbServices;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
use DynaformHandler;
|
||||
|
||||
class DynaForm
|
||||
{
|
||||
@@ -155,7 +156,7 @@ class DynaForm
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$dataForms = $oDataset->getRow();
|
||||
$dynHandler = new \dynaFormHandler(PATH_DYNAFORM . $proUid . PATH_SEP . $dataForms["DYN_UID"] . ".xml");
|
||||
$dynHandler = new DynaformHandler(PATH_DYNAFORM . $proUid . PATH_SEP . $dataForms["DYN_UID"] . ".xml");
|
||||
$dynFields = $dynHandler->getFields();
|
||||
foreach ($dynFields as $field) {
|
||||
$sType = \Step::getAttribute( $field, 'type' );
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use G;
|
||||
use Criteria;
|
||||
use DynaformHandler;
|
||||
|
||||
class Process
|
||||
{
|
||||
@@ -1676,7 +1677,7 @@ class Process
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (is_file(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml")) {
|
||||
$dyn = new \dynaFormHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
|
||||
$dyn = new DynaformHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
|
||||
|
||||
if ($dyn->getHeaderAttribute("type") !== "xmlform" && $dyn->getHeaderAttribute("type") !== "") {
|
||||
// skip it, if that is not a xmlform
|
||||
@@ -1729,7 +1730,7 @@ class Process
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (is_file(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml")) {
|
||||
$dyn = new \dynaFormHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
|
||||
$dyn = new DynaformHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
|
||||
|
||||
if ($dyn->getHeaderAttribute("type") === "xmlform") {
|
||||
// skip it, if that is not a xmlform
|
||||
@@ -1775,7 +1776,7 @@ class Process
|
||||
$aMultipleSelectionFields = array("listbox", "checkgroup", "grid");
|
||||
|
||||
if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) {
|
||||
$dyn = new \dynaFormHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
|
||||
$dyn = new DynaformHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
|
||||
$dynaformFields[] = $dyn->getFields();
|
||||
|
||||
$fields = $dyn->getFields();
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \AdditionalTables;
|
||||
use \Fields;
|
||||
use G;
|
||||
use AdditionalTables;
|
||||
use Fields;
|
||||
use DynaformHandler;
|
||||
|
||||
class Table
|
||||
{
|
||||
@@ -798,7 +799,7 @@ class Table
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
|
||||
$dynaformHandler = new \dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
|
||||
$dynaformHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
|
||||
$nodeFieldsList = $dynaformHandler->getFields();
|
||||
|
||||
foreach ($nodeFieldsList as $node) {
|
||||
@@ -1052,7 +1053,7 @@ class Table
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
$dynaformHandler = new \dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
|
||||
$dynaformHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
|
||||
$nodeFieldsList = $dynaformHandler->getFields();
|
||||
foreach ($nodeFieldsList as $node) {
|
||||
$arrayNode = $dynaformHandler->getArray( $node );
|
||||
|
||||
@@ -1897,7 +1897,12 @@ class Task
|
||||
}
|
||||
}
|
||||
|
||||
public function getValidateSelfService($data)
|
||||
/**
|
||||
* This method verify if an activity has cases
|
||||
* @param $data
|
||||
* @return \stdclass
|
||||
*/
|
||||
public function hasPendingCases($data)
|
||||
{
|
||||
$paused = false;
|
||||
$data = array_change_key_case($data, CASE_LOWER);
|
||||
|
||||
@@ -785,7 +785,7 @@ class User
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load($userUid);
|
||||
$oUserProperty = new UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array($aUser["USR_PASSWORD"]))));
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array($oUser->getUsrPassword()))));
|
||||
$aUserProperty["USR_LOGGED_NEXT_TIME"] = $arrayData["USR_LOGGED_NEXT_TIME"];
|
||||
$oUserProperty->update($aUserProperty);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use G;
|
||||
use Exception;
|
||||
use AdditionalTables;
|
||||
|
||||
class Variable
|
||||
{
|
||||
@@ -13,25 +15,22 @@ class Variable
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Variable created
|
||||
* @return array, return data of the new Variable created
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($processUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
Validator::proUid($processUid, '$prj_uid');
|
||||
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
|
||||
$this->existsName($processUid, $arrayData["VAR_NAME"], "");
|
||||
|
||||
$this->throwExceptionFieldDefinition($arrayData);
|
||||
|
||||
//Create
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
try {
|
||||
$variable = new \ProcessVariables();
|
||||
|
||||
$sPkProcessVariables = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
$variable->setVarUid($sPkProcessVariables);
|
||||
@@ -43,13 +42,13 @@ class Variable
|
||||
if (isset($arrayData["VAR_NAME"])) {
|
||||
$variable->setVarName($arrayData["VAR_NAME"]);
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_name' )));
|
||||
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_name' )));
|
||||
}
|
||||
if (isset($arrayData["VAR_FIELD_TYPE"])) {
|
||||
$arrayData["VAR_FIELD_TYPE"] = $this->validateVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
||||
$variable->setVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_field_type' )));
|
||||
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_field_type' )));
|
||||
}
|
||||
if (isset($arrayData["VAR_FIELD_SIZE"])) {
|
||||
$variable->setVarFieldSize($arrayData["VAR_FIELD_SIZE"]);
|
||||
@@ -57,7 +56,7 @@ class Variable
|
||||
if (isset($arrayData["VAR_LABEL"])) {
|
||||
$variable->setVarLabel($arrayData["VAR_LABEL"]);
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_label' )));
|
||||
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_label' )));
|
||||
}
|
||||
if (isset($arrayData["VAR_DBCONNECTION"])) {
|
||||
$variable->setVarDbconnection($arrayData["VAR_DBCONNECTION"]);
|
||||
@@ -78,7 +77,7 @@ class Variable
|
||||
$variable->setVarDefault($arrayData["VAR_DEFAULT"]);
|
||||
}
|
||||
if (isset($arrayData["VAR_ACCEPTED_VALUES"])) {
|
||||
$encodeAcceptedValues = \G::json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||
$encodeAcceptedValues = G::json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||
$variable->setVarAcceptedValues($encodeAcceptedValues);
|
||||
}
|
||||
if (isset($arrayData["INP_DOC_UID"])) {
|
||||
@@ -94,10 +93,10 @@ class Variable
|
||||
$msg = $msg . (($msg != "")? "\n" : "") . $validationFailure->getMessage();
|
||||
}
|
||||
|
||||
throw new \Exception(\G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . "\n" . $msg);
|
||||
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . "\n" . $msg);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$cnn->rollback();
|
||||
|
||||
throw $e;
|
||||
@@ -108,7 +107,7 @@ class Variable
|
||||
|
||||
return $variable;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +119,8 @@ class Variable
|
||||
* @param string $variableUid Unique id of Variable
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the Variable updated
|
||||
* @return array,return data of the Variable updated
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($processUid, $variableUid, $arrayData)
|
||||
{
|
||||
@@ -128,7 +128,6 @@ class Variable
|
||||
//Verify data
|
||||
Validator::proUid($processUid, '$prj_uid');
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
|
||||
$this->throwExceptionFieldDefinition($arrayData);
|
||||
|
||||
//Update
|
||||
@@ -150,7 +149,6 @@ class Variable
|
||||
$cnn->begin();
|
||||
if (isset($arrayData["VAR_NAME"])) {
|
||||
$this->existsName($processUid, $arrayData["VAR_NAME"], $variableUid);
|
||||
|
||||
$variable->setVarName($arrayData["VAR_NAME"]);
|
||||
}
|
||||
if (isset($arrayData["VAR_FIELD_TYPE"])) {
|
||||
@@ -176,7 +174,7 @@ class Variable
|
||||
$variable->setVarDefault($arrayData["VAR_DEFAULT"]);
|
||||
}
|
||||
if (isset($arrayData["VAR_ACCEPTED_VALUES"])) {
|
||||
$encodeAcceptedValues = \G::json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||
$encodeAcceptedValues = G::json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||
$variable->setVarAcceptedValues($encodeAcceptedValues);
|
||||
}
|
||||
if (isset($arrayData["INP_DOC_UID"])) {
|
||||
@@ -206,15 +204,15 @@ class Variable
|
||||
$msg = $msg . (($msg != "")? "\n" : "") . $validationFailure->getMessage();
|
||||
}
|
||||
|
||||
throw new \Exception(\G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . "\n" . $msg);
|
||||
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . "\n" . $msg);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$cnn->rollback();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -225,35 +223,31 @@ class Variable
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param string $variableUid Unique id of Variable
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($processUid, $variableUid)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
Validator::proUid($processUid, '$prj_uid');
|
||||
|
||||
$this->throwExceptionIfNotExistsVariable($variableUid);
|
||||
|
||||
//Verify variable
|
||||
$this->throwExceptionIfVariableIsAssociatedAditionalTable($variableUid);
|
||||
|
||||
$variable = $this->getVariable($processUid, $variableUid);
|
||||
|
||||
$pmDynaform = new \pmDynaform();
|
||||
$isUsed = $pmDynaform->isUsed($processUid, $variable);
|
||||
if ($isUsed !== false) {
|
||||
$titleDynaform=$pmDynaform->getDynaformTitle($isUsed);
|
||||
throw new \Exception(\G::LoadTranslation("ID_VARIABLE_IN_USE", array($titleDynaform)));
|
||||
throw new Exception(G::LoadTranslation("ID_VARIABLE_IN_USE", array($titleDynaform)));
|
||||
}
|
||||
//Delete
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid);
|
||||
|
||||
\ProcessVariablesPeer::doDelete($criteria);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -263,19 +257,18 @@ class Variable
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param string $variableUid Unique id of Variable
|
||||
*
|
||||
* return array Return an array with data of a Variable
|
||||
* @return array, return an array with data of a Variable
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getVariable($processUid, $variableUid)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
Validator::proUid($processUid, '$prj_uid');
|
||||
|
||||
$this->throwExceptionIfNotExistsVariable($variableUid);
|
||||
|
||||
//Get data
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::PRJ_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
|
||||
@@ -292,23 +285,18 @@ class Variable
|
||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_PORT);
|
||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_DATABASE_NAME);
|
||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_TYPE);
|
||||
|
||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid, \Criteria::EQUAL);
|
||||
$criteria->addJoin(\ProcessVariablesPeer::VAR_DBCONNECTION, \DbSourcePeer::DBS_UID, \Criteria::LEFT_JOIN);
|
||||
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rsCriteria->next();
|
||||
$arrayVariables = array();
|
||||
|
||||
while ($aRow = $rsCriteria->getRow()) {
|
||||
|
||||
$VAR_ACCEPTED_VALUES = \G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
||||
$VAR_ACCEPTED_VALUES = G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
||||
if(sizeof($VAR_ACCEPTED_VALUES)) {
|
||||
$encodeAcceptedValues = preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", \G::json_encode($VAR_ACCEPTED_VALUES));
|
||||
$encodeAcceptedValues = preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", G::json_encode($VAR_ACCEPTED_VALUES));
|
||||
} else {
|
||||
$encodeAcceptedValues = $aRow['VAR_ACCEPTED_VALUES'];
|
||||
}
|
||||
@@ -331,7 +319,7 @@ class Variable
|
||||
//Return
|
||||
return $arrayVariables;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -342,7 +330,8 @@ class Variable
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
*
|
||||
* return array Return an array with data of a DynaForm
|
||||
* @return array, return an array with data of a DynaForm
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getVariables($processUid)
|
||||
{
|
||||
@@ -352,7 +341,6 @@ class Variable
|
||||
|
||||
//Get data
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::PRJ_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
|
||||
@@ -369,22 +357,17 @@ class Variable
|
||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_PORT);
|
||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_DATABASE_NAME);
|
||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_TYPE);
|
||||
|
||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
|
||||
$criteria->addJoin(\ProcessVariablesPeer::VAR_DBCONNECTION, \DbSourcePeer::DBS_UID . " AND " . \DbSourcePeer::PRO_UID . " = '" . $processUid . "'", \Criteria::LEFT_JOIN);
|
||||
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rsCriteria->next();
|
||||
$arrayVariables = array();
|
||||
|
||||
while ($aRow = $rsCriteria->getRow()) {
|
||||
|
||||
$VAR_ACCEPTED_VALUES = \G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
||||
$VAR_ACCEPTED_VALUES = G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
||||
if(sizeof($VAR_ACCEPTED_VALUES)) {
|
||||
$encodeAcceptedValues = preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", \G::json_encode($VAR_ACCEPTED_VALUES));
|
||||
$encodeAcceptedValues = preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", G::json_encode($VAR_ACCEPTED_VALUES));
|
||||
} else {
|
||||
$encodeAcceptedValues = $aRow['VAR_ACCEPTED_VALUES'];
|
||||
}
|
||||
@@ -407,7 +390,7 @@ class Variable
|
||||
//Return
|
||||
return $arrayVariables;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -416,7 +399,8 @@ class Variable
|
||||
* Verify field definition
|
||||
*
|
||||
* @param array $aData Unique id of Variable to exclude
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function throwExceptionFieldDefinition($aData)
|
||||
{
|
||||
@@ -428,10 +412,6 @@ class Variable
|
||||
if (isset($aData["VAR_FIELD_TYPE"])) {
|
||||
Validator::isString($aData['VAR_FIELD_TYPE'], '$var_field_type');
|
||||
Validator::isNotEmpty($aData['VAR_FIELD_TYPE'], '$var_field_type');
|
||||
/*if ($aData["VAR_FIELD_TYPE"] != 'string' && $aData["VAR_FIELD_TYPE"] != 'integer' && $aData["VAR_FIELD_TYPE"] != 'boolean' && $aData["VAR_FIELD_TYPE"] != 'float' &&
|
||||
$aData["VAR_FIELD_TYPE"] != 'datetime' && $aData["VAR_FIELD_TYPE"] != 'date_of_birth' && $aData["VAR_FIELD_TYPE"] != 'date') {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('$var_field_type')));
|
||||
}*/
|
||||
}
|
||||
if (isset($aData["VAR_FIELD_SIZE"])) {
|
||||
Validator::isInteger($aData["VAR_FIELD_SIZE"], '$var_field_size');
|
||||
@@ -449,10 +429,10 @@ class Variable
|
||||
if (isset($aData["VAR_NULL"])) {
|
||||
Validator::isInteger($aData['VAR_NULL'], '$var_null');
|
||||
if ($aData["VAR_NULL"] != 0 && $aData["VAR_NULL"] !=1 ) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_ONLY_ACCEPTS_VALUES", array('$var_null','0, 1' )));
|
||||
throw new Exception(G::LoadTranslation("ID_INVALID_VALUE_ONLY_ACCEPTS_VALUES", array('$var_null','0, 1' )));
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -460,8 +440,10 @@ class Variable
|
||||
/**
|
||||
* Verify if exists the name of a variable
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param string $variableName Name
|
||||
* @param string $processUid, unique id of Process
|
||||
* @param string $variableName, name of variable
|
||||
* @param string $variableUidToExclude
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function existsName($processUid, $variableName, $variableUidToExclude = "")
|
||||
@@ -471,25 +453,23 @@ class Variable
|
||||
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
|
||||
|
||||
if ($variableUidToExclude != "") {
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUidToExclude, \Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $variableName, \Criteria::EQUAL);
|
||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
if ($variableName == $row["VAR_NAME"]) {
|
||||
throw new \Exception(\G::LoadTranslation("DYNAFIELD_ALREADY_EXIST"));
|
||||
if ($variableName === $row["VAR_NAME"]) {
|
||||
throw new Exception(G::LoadTranslation("DYNAFIELD_ALREADY_EXIST"));
|
||||
}
|
||||
if (AdditionalTables::getPHPName($variableName) === AdditionalTables::getPHPName($row["VAR_NAME"])) {
|
||||
throw new Exception(G::LoadTranslation("DYNAFIELD_PHPNAME_ALREADY_EXIST", array($row["VAR_NAME"])));
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -499,21 +479,20 @@ class Variable
|
||||
*
|
||||
* @param string $sql SQL
|
||||
*
|
||||
* return array Return an array with required variables in the SQL
|
||||
* @return array, return an array with required variables in the SQL
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sqlGetRequiredVariables($sql)
|
||||
{
|
||||
try {
|
||||
$arrayVariableRequired = array();
|
||||
|
||||
preg_match_all("/@[@%#\?\x24\=]([A-Za-z_]\w*)/", $sql, $arrayMatch, PREG_SET_ORDER);
|
||||
|
||||
foreach ($arrayMatch as $value) {
|
||||
$arrayVariableRequired[] = $value[1];
|
||||
}
|
||||
|
||||
return $arrayVariableRequired;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -525,17 +504,17 @@ class Variable
|
||||
* @param string $variableSql SQL
|
||||
* @param array $arrayVariable The variables
|
||||
*
|
||||
* return void Throw exception if some required variable in the SQL is missing in the variables
|
||||
* @return void Throw exception if some required variable in the SQL is missing in the variables
|
||||
* @throws Exception
|
||||
*/
|
||||
public function throwExceptionIfSomeRequiredVariableSqlIsMissingInVariables($variableName, $variableSql, array $arrayVariable)
|
||||
{
|
||||
try {
|
||||
$arrayResult = array_diff(array_unique($this->sqlGetRequiredVariables($variableSql)), array_keys($arrayVariable));
|
||||
|
||||
if (count($arrayResult) > 0) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_PROCESS_VARIABLE_REQUIRED_VARIABLES_FOR_QUERY", array($variableName, implode(", ", $arrayResult))));
|
||||
throw new Exception(G::LoadTranslation("ID_PROCESS_VARIABLE_REQUIRED_VARIABLES_FOR_QUERY", array($variableName, implode(", ", $arrayResult))));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -547,13 +526,14 @@ class Variable
|
||||
* @param string $variableName Variable name
|
||||
* @param array $arrayVariable The variables
|
||||
*
|
||||
* return array Return an array with all records
|
||||
* @return array, return an array with all records
|
||||
* @throws Exception
|
||||
*/
|
||||
public function executeSql($processUid, $variableName, array $arrayVariable = array())
|
||||
{
|
||||
try {
|
||||
return $this->executeSqlControl($processUid, $arrayVariable);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -563,7 +543,8 @@ class Variable
|
||||
*
|
||||
* @param string $variableUid Unique id of variable
|
||||
*
|
||||
* return void Throw exception if does not exist the variable in table PROCESS_VARIABLES
|
||||
* @return void
|
||||
* @throws Exception, throw exception if does not exist the variable in table PROCESS_VARIABLES
|
||||
*/
|
||||
public function throwExceptionIfNotExistsVariable($variableUid)
|
||||
{
|
||||
@@ -571,9 +552,9 @@ class Variable
|
||||
$obj = \ProcessVariablesPeer::retrieveByPK($variableUid);
|
||||
|
||||
if (is_null($obj)) {
|
||||
throw new \Exception('var_uid: '.$variableUid. ' '.\G::LoadTranslation("ID_DOES_NOT_EXIST"));
|
||||
throw new Exception('var_uid: '.$variableUid. ' '.G::LoadTranslation("ID_DOES_NOT_EXIST"));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -584,30 +565,25 @@ class Variable
|
||||
* @param string $variableUid Unique id of variable
|
||||
*
|
||||
* @return void Throw exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function throwExceptionIfVariableIsAssociatedAditionalTable($variableUid)
|
||||
{
|
||||
try {
|
||||
$criteria = new \Criteria('workflow');
|
||||
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
||||
|
||||
$criteria->addJoin(\ProcessVariablesPeer::PRJ_UID, \AdditionalTablesPeer::PRO_UID, \Criteria::INNER_JOIN);
|
||||
|
||||
$arrayCondition = [];
|
||||
$arrayCondition[] = array(\AdditionalTablesPeer::ADD_TAB_UID, \FieldsPeer::ADD_TAB_UID, \Criteria::EQUAL);
|
||||
$arrayCondition[] = array(\ProcessVariablesPeer::VAR_NAME, \FieldsPeer::FLD_NAME, \Criteria::EQUAL);
|
||||
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
|
||||
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
throw new \Exception(\G::LoadTranslation('ID_VARIABLE_ASSOCIATED_WITH_REPORT_TABLE', array($variableUid)));
|
||||
throw new Exception(G::LoadTranslation('ID_VARIABLE_ASSOCIATED_WITH_REPORT_TABLE', array($variableUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -615,8 +591,10 @@ class Variable
|
||||
/**
|
||||
* Verify if the variable is being used in a Dynaform
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param string $variableUid Unique id of Variable
|
||||
* @param string $processUid, Unique id of Process
|
||||
* @param string $variableUid, Unique id of Variable
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function verifyUse($processUid, $variableUid)
|
||||
@@ -631,10 +609,8 @@ class Variable
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$contentDecode = \G::json_decode($row["DYN_CONTENT"], true);
|
||||
$contentDecode = G::json_decode($row["DYN_CONTENT"], true);
|
||||
$content = $contentDecode['items'][0]['items'];
|
||||
if (is_array($content)) {
|
||||
foreach ($content as $key => $value) {
|
||||
@@ -649,14 +625,14 @@ class Variable
|
||||
$rsCriteria->next();
|
||||
|
||||
if ($rsCriteria->getRow()) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_VARIABLE_IN_USE", array($variableUid, $row["DYN_UID"])));
|
||||
throw new Exception(G::LoadTranslation("ID_VARIABLE_IN_USE", array($variableUid, $row["DYN_UID"])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -668,13 +644,14 @@ class Variable
|
||||
* @param string $variableName Variable name
|
||||
* @param array $arrayVariable The variables
|
||||
*
|
||||
* return array Return an array with all records
|
||||
* @return array, return an array with all records
|
||||
* @throws Exception
|
||||
*/
|
||||
public function executeSqlSuggest($processUid, $variableName, array $arrayVariable = array())
|
||||
{
|
||||
try {
|
||||
return $this->executeSqlControl($processUid, $arrayVariable);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -698,7 +675,7 @@ class Variable
|
||||
return sizeof($row) ? $row : false;
|
||||
}
|
||||
return false;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -712,7 +689,8 @@ class Variable
|
||||
* @param bool $throwException Flag to throw the exception if the main parameters are invalid or do not exist
|
||||
* (TRUE: throw the exception; FALSE: returns FALSE)
|
||||
*
|
||||
* @return array Returns an array with Variable record, ThrowTheException/FALSE otherwise
|
||||
* @return array, returns an array with Variable record
|
||||
* @throws Exception, ThrowTheException/FALSE otherwise
|
||||
*/
|
||||
public function getVariableRecordByName(
|
||||
$projectUid,
|
||||
@@ -722,20 +700,17 @@ class Variable
|
||||
) {
|
||||
try {
|
||||
$criteria = new \Criteria('workflow');
|
||||
|
||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $projectUid, \Criteria::EQUAL);
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $variableName, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
$arrayVariableData = $rsCriteria->getRow();
|
||||
} else {
|
||||
if ($throwException) {
|
||||
throw new \Exception(
|
||||
throw new Exception(
|
||||
$arrayVariableNameForException['$variableName'] . ': ' . $variableName. ' ' .
|
||||
\G::LoadTranslation('ID_DOES_NOT_EXIST')
|
||||
G::LoadTranslation('ID_DOES_NOT_EXIST')
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
@@ -744,7 +719,7 @@ class Variable
|
||||
|
||||
//Return
|
||||
return $arrayVariableData;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -753,7 +728,7 @@ class Variable
|
||||
{
|
||||
$vType = strtolower($type);
|
||||
if(!in_array($vType, $this->variableTypes)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED"));
|
||||
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED"));
|
||||
}
|
||||
return $vType;
|
||||
}
|
||||
@@ -774,7 +749,7 @@ class Variable
|
||||
* @param type $proUid
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function executeSqlControl($proUid, array $params = array())
|
||||
{
|
||||
@@ -829,7 +804,7 @@ class Variable
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ class WebEntry
|
||||
$arrayUserData = $user->load($arrayWebEntryData["USR_UID"]);
|
||||
|
||||
$usrUsername = $arrayUserData["USR_USERNAME"];
|
||||
$usrPassword = $arrayUserData["USR_PASSWORD"];
|
||||
$usrPassword = $user->getUsrPassword();
|
||||
|
||||
$dynaForm = new \Dynaform();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use ProcessMaker\Project;
|
||||
|
||||
class ProjectNotFound extends \RuntimeException
|
||||
{
|
||||
const EXCEPTION_CODE = 20;
|
||||
const EXCEPTION_CODE = 400;
|
||||
|
||||
public function __construct(Project\Handler $obj, $uid, $message = "", \Exception $previous = null) {
|
||||
$message = empty($message) ? sprintf("Project \"%s\" with UID: %s, does not exist.", get_class($obj), $uid) : $message;
|
||||
|
||||
@@ -1,39 +1,36 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Project;
|
||||
|
||||
use \BpmnProject as Project;
|
||||
use \BpmnProcess as Process;
|
||||
use \BpmnDiagram as Diagram;
|
||||
use \BasePeer;
|
||||
use \BpmnActivity as Activity;
|
||||
use \BpmnBound as Bound;
|
||||
use \BpmnEvent as Event;
|
||||
use \BpmnGateway as Gateway;
|
||||
use \BpmnFlow as Flow;
|
||||
use \BpmnArtifact as Artifact;
|
||||
|
||||
use \BpmnProjectPeer as ProjectPeer;
|
||||
use \BpmnProcessPeer as ProcessPeer;
|
||||
use \BpmnDiagramPeer as DiagramPeer;
|
||||
|
||||
use \BpmnActivityPeer as ActivityPeer;
|
||||
use \BpmnBoundPeer as BoundPeer;
|
||||
use \BpmnEventPeer as EventPeer;
|
||||
use \BpmnGatewayPeer as GatewayPeer;
|
||||
use \BpmnFlowPeer as FlowPeer;
|
||||
use \BpmnArtifactPeer as ArtifactPeer;
|
||||
use \BpmnParticipant as Participant;
|
||||
use \BpmnParticipantPeer as ParticipantPeer;
|
||||
use \BpmnBound as Bound;
|
||||
use \BpmnBoundPeer as BoundPeer;
|
||||
use \BpmnDiagram as Diagram;
|
||||
use \BpmnDiagramPeer as DiagramPeer;
|
||||
use \BpmnEvent as Event;
|
||||
use \BpmnEventPeer as EventPeer;
|
||||
use \BpmnFlow as Flow;
|
||||
use \BpmnFlowPeer as FlowPeer;
|
||||
use \BpmnGateway as Gateway;
|
||||
use \BpmnGatewayPeer as GatewayPeer;
|
||||
use \BpmnLaneset as Laneset;
|
||||
use \BpmnLanesetPeer as LanesetPeer;
|
||||
use \BpmnLane as Lane;
|
||||
use \BpmnLanePeer as LanePeer;
|
||||
|
||||
use \BasePeer;
|
||||
use \BpmnParticipant as Participant;
|
||||
use \BpmnParticipantPeer as ParticipantPeer;
|
||||
use \BpmnProject as Project;
|
||||
use \BpmnProcess as Process;
|
||||
use \BpmnProjectPeer as ProjectPeer;
|
||||
use \BpmnProcessPeer as ProcessPeer;
|
||||
use \Criteria as Criteria;
|
||||
use \Exception;
|
||||
use \G;
|
||||
use \ResultSet as ResultSet;
|
||||
|
||||
use ProcessMaker\Util\Common;
|
||||
use ProcessMaker\Exception;
|
||||
use \ProcessMaker\Util\Common;
|
||||
|
||||
/**
|
||||
* Class Bpmn
|
||||
@@ -428,9 +425,12 @@ class Bpmn extends Handler
|
||||
self::log("Remove Activity: $actUid");
|
||||
|
||||
$activity = ActivityPeer::retrieveByPK($actUid);
|
||||
$activity->delete();
|
||||
//TODO if the activity was removed, the related flows to that activity must be removed
|
||||
|
||||
if (isset($activity)) {
|
||||
$activity->delete();
|
||||
Flow::removeAllRelated($actUid);
|
||||
} else {
|
||||
throw new Exception(G::LoadTranslation("ID_ACTIVITY_DOES_NOT_EXIST", array("act_uid", $actUid)));
|
||||
}
|
||||
self::log("Remove Activity Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api\Project;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Exception;
|
||||
use \Luracast\Restler\RestException;
|
||||
use \ProcessMaker\BusinessModel\Task;
|
||||
use \ProcessMaker\Project\Adapter\BpmnWorkflow;
|
||||
use \ProcessMaker\Services\Api;
|
||||
|
||||
/**
|
||||
* Project\Activity Api Controller
|
||||
@@ -136,22 +139,32 @@ class Activity extends Api
|
||||
|
||||
|
||||
/**
|
||||
* This method remove an activity and all related components
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $act_uid {@min 32} {@max 32}
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return array
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
* @url DELETE /:prj_uid/activity/:act_uid
|
||||
*/
|
||||
public function doDeleteProjectActivity($prj_uid, $act_uid)
|
||||
{
|
||||
try {
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
$task->deleteTask($prj_uid, $act_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
$task = new Task();
|
||||
$task->setFormatFieldNameInUppercase(false);
|
||||
$task->setArrayParamException(array("taskUid" => "act_uid"));
|
||||
|
||||
$response = $task->hasPendingCases(array("act_uid" => $act_uid, "case_type" => "assigned"));
|
||||
if ($response->result !== false) {
|
||||
$project = new BpmnWorkflow();
|
||||
$prj = $project->load($prj_uid);
|
||||
$prj->removeActivity($act_uid);
|
||||
} else {
|
||||
throw new RestException(403, $response->message);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$resCode = $e->getCode() == 0 ? Api::STAT_APP_EXCEPTION : $e->getCode();
|
||||
throw new RestException($resCode, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +228,7 @@ class Activity extends Api
|
||||
$task->setFormatFieldNameInUppercase(false);
|
||||
$task->setArrayParamException(array("taskUid" => "act_uid"));
|
||||
|
||||
$response = $task->getValidateSelfService($request_data);
|
||||
$response = $task->hasPendingCases($request_data);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -220,7 +220,6 @@ define( 'PATH_RBAC_MSSQL_DATA', PATH_RBAC_CORE . 'data' . PATH_SEP . 'mssql' . P
|
||||
define( 'PATH_CONTROLLERS', PATH_CORE . 'controllers' . PATH_SEP );
|
||||
|
||||
// include Gulliver Class
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
|
||||
if (file_exists( FILE_PATHS_INSTALLED )) {
|
||||
|
||||
@@ -642,8 +641,6 @@ $memcache = & PMmemcached::getSingleton( SYS_SYS );
|
||||
|
||||
// setup propel definitions and logging
|
||||
//changed to autoloader
|
||||
//require_once ("propel/Propel.php");
|
||||
//require_once ("creole/Creole.php");
|
||||
|
||||
if (defined( 'DEBUG_SQL_LOG' ) && DEBUG_SQL_LOG) {
|
||||
define( 'PM_PID', mt_rand( 1, 999999 ) );
|
||||
@@ -795,8 +792,6 @@ if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') {
|
||||
die();
|
||||
}
|
||||
|
||||
Bootstrap::initVendors();
|
||||
|
||||
$isWebEntry = \ProcessMaker\BusinessModel\WebEntry::isWebEntry(SYS_COLLECTION, $phpFile);
|
||||
if (\Bootstrap::getDisablePhpUploadExecution() === 1 && !$isWebEntry) {
|
||||
$message = \G::LoadTranslation('THE_PHP_FILES_EXECUTION_WAS_DISABLED');
|
||||
|
||||
Reference in New Issue
Block a user