CODE STYLE, changes
FILES: gulliver/system/class.database_mssql.php gulliver/system/class.database_mysql.php workflow/engine/classes/class.cli.php workflow/engine/classes/class.pluginRegistry.php workflow/engine/classes/entities/FacetGroup.php workflow/engine/classes/entities/SolrUpdateDocument.php workflow/engine/classes/triggers/class.pmTalendFunctions.php workflow/engine/methods/appFolder/appFolderList.php workflow/engine/methods/processes/processes_Ajax.php
This commit is contained in:
@@ -184,8 +184,9 @@ class database extends database_base
|
||||
if (isset( $aParameters['Default'] )) {
|
||||
if (trim( $aParameters['Default'] == '' ) && $aParameters['Type'] == 'datetime') {
|
||||
//do nothing
|
||||
} else
|
||||
} else {
|
||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||
}
|
||||
//}
|
||||
}
|
||||
if (! isset( $aParameters['Default'] ) && isset( $aParameters['Null'] ) && $aParameters['Null'] == 'YES') {
|
||||
@@ -363,8 +364,9 @@ class database extends database_base
|
||||
|
||||
public function isConnected ()
|
||||
{
|
||||
if (! $this->oConnection)
|
||||
if (! $this->oConnection) {
|
||||
return false;
|
||||
}
|
||||
return $this->executeQuery( 'USE ' . $this->sDataBase );
|
||||
}
|
||||
|
||||
@@ -372,14 +374,18 @@ class database extends database_base
|
||||
{
|
||||
try {
|
||||
$found = false;
|
||||
if (substr( $sQuery, 0, 6 ) == 'SELECT')
|
||||
if (substr( $sQuery, 0, 6 ) == 'SELECT') {
|
||||
$found = true;
|
||||
if (substr( $sQuery, 0, 4 ) == 'SHOW')
|
||||
}
|
||||
if (substr( $sQuery, 0, 4 ) == 'SHOW') {
|
||||
$found = true;
|
||||
if (substr( $sQuery, 0, 4 ) == 'DESC')
|
||||
}
|
||||
if (substr( $sQuery, 0, 4 ) == 'DESC') {
|
||||
$found = true;
|
||||
if (substr( $sQuery, 0, 4 ) == 'USE ')
|
||||
}
|
||||
if (substr( $sQuery, 0, 4 ) == 'USE ') {
|
||||
$found = true;
|
||||
}
|
||||
if (! $found) {
|
||||
$logFile = PATH_DATA . 'log' . PATH_SEP . 'query.log';
|
||||
$fp = fopen( $logFile, 'a+' );
|
||||
@@ -544,7 +550,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sConcat
|
||||
*/
|
||||
function concatString()
|
||||
public function concatString ()
|
||||
{
|
||||
$nums = func_num_args();
|
||||
$vars = func_get_args();
|
||||
@@ -552,10 +558,11 @@ class database extends database_base
|
||||
for ($i = 0; $i < $nums; $i ++) {
|
||||
if (isset( $vars[$i] )) {
|
||||
$sConcat .= $vars[$i];
|
||||
if (($i + 1) < $nums)
|
||||
if (($i + 1) < $nums) {
|
||||
$sConcat .= " + ";
|
||||
}
|
||||
}
|
||||
}
|
||||
return $sConcat;
|
||||
}
|
||||
|
||||
@@ -572,7 +579,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sCompare
|
||||
*/
|
||||
function getCaseWhen($compareValue, $trueResult, $falseResult)
|
||||
public function getCaseWhen ($compareValue, $trueResult, $falseResult)
|
||||
{
|
||||
$sCompare = " CASE WHEN " . $compareValue . " THEN " . $trueResult . " ELSE " . $falseResult . " END ";
|
||||
return $sCompare;
|
||||
@@ -586,7 +593,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function createTableObjectPermission()
|
||||
public function createTableObjectPermission ()
|
||||
{
|
||||
$sql = "IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='OBJECT_PERMISSION' AND xtype='U')
|
||||
CREATE TABLE OBJECT_PERMISSION (
|
||||
@@ -616,7 +623,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport4()
|
||||
public function getSelectReport4 ()
|
||||
{
|
||||
|
||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||
@@ -645,7 +652,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport4Filter($var)
|
||||
public function getSelectReport4Filter ($var)
|
||||
{
|
||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
||||
@@ -673,7 +680,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport5()
|
||||
public function getSelectReport5 ()
|
||||
{
|
||||
|
||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||
@@ -702,7 +709,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport5Filter($var)
|
||||
public function getSelectReport5Filter ($var)
|
||||
{
|
||||
|
||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||
@@ -726,11 +733,12 @@ class database extends database_base
|
||||
* query functions for class class.net.php
|
||||
*
|
||||
*/
|
||||
function getServerVersion($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
||||
public function getServerVersion ($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
||||
{
|
||||
|
||||
if (strlen( trim( $dbIP ) ) <= 0)
|
||||
if (strlen( trim( $dbIP ) ) <= 0) {
|
||||
$dbIP = DB_HOST;
|
||||
}
|
||||
if ($link = @mssql_connect( $dbIP, $dbUser, $dbPasswd )) {
|
||||
@mssql_select_db( DB_NAME, $link );
|
||||
$oResult = @mssql_query( "select substring(@@version, 21, 6) + ' (' + CAST(SERVERPROPERTY ('productlevel') as varchar(10)) + ') ' + CAST(SERVERPROPERTY('productversion') AS VARCHAR(15)) + ' ' + CAST(SERVERPROPERTY ('edition') AS VARCHAR(25)) as version; ", $link );
|
||||
@@ -748,13 +756,13 @@ class database extends database_base
|
||||
* query functions for class class.net.php
|
||||
*
|
||||
*/
|
||||
function getDropTable($sTableName)
|
||||
public function getDropTable ($sTableName)
|
||||
{
|
||||
$sql = "IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='" . $sTableName . "' AND xtype='U') " . "DROP TABLE ['" . $sTableName . "']";
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function getTableDescription($sTableName)
|
||||
public function getTableDescription ($sTableName)
|
||||
{
|
||||
$sql = " select column_name as Field,
|
||||
data_type + ' ' +
|
||||
@@ -776,13 +784,13 @@ class database extends database_base
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function getFieldNull()
|
||||
public function getFieldNull ()
|
||||
{
|
||||
$fieldName = "AsNull";
|
||||
return $fieldName;
|
||||
}
|
||||
|
||||
function getValidate($validate)
|
||||
public function getValidate ($validate)
|
||||
{
|
||||
$oValidate = true;
|
||||
return $oValidate;
|
||||
@@ -792,7 +800,7 @@ class database extends database_base
|
||||
* Determines whether a table exists
|
||||
* It is part of class.reportTables.php
|
||||
*/
|
||||
function reportTableExist()
|
||||
public function reportTableExist ()
|
||||
{
|
||||
$bExists = true;
|
||||
$oConnection = mssql_connect( DB_HOST, DB_USER, DB_PASS );
|
||||
@@ -805,7 +813,7 @@ class database extends database_base
|
||||
/**
|
||||
* It is part of class.pagedTable.php
|
||||
*/
|
||||
function getLimitRenderTable($nCurrentPage, $nRowsPerPage)
|
||||
public function getLimitRenderTable ($nCurrentPage, $nRowsPerPage)
|
||||
{
|
||||
$sql = "";
|
||||
return $sql;
|
||||
@@ -814,7 +822,7 @@ class database extends database_base
|
||||
/**
|
||||
* Determining the existence of a table
|
||||
*/
|
||||
function tableExists($table, $db)
|
||||
public function tableExists ($table, $db)
|
||||
{
|
||||
$sql = "SELECT * FROM sysobjects WHERE name='" . $table . "' AND type='u'";
|
||||
$bExists = true;
|
||||
|
||||
@@ -204,8 +204,9 @@ class database extends database_base
|
||||
if (isset( $aParameters['Default'] )) {
|
||||
if (trim( $aParameters['Default'] ) == '' && $aParameters['Type'] == 'datetime') {
|
||||
//do nothing
|
||||
} else
|
||||
} else {
|
||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||
}
|
||||
//}
|
||||
}
|
||||
if (! isset( $aParameters['Default'] ) && isset( $aParameters['Null'] ) && $aParameters['Null'] == 'YES') {
|
||||
@@ -384,8 +385,9 @@ class database extends database_base
|
||||
*/
|
||||
public function isConnected ()
|
||||
{
|
||||
if (! $this->oConnection)
|
||||
if (! $this->oConnection) {
|
||||
return false;
|
||||
}
|
||||
return $this->executeQuery( 'USE ' . $this->sDataBase );
|
||||
}
|
||||
|
||||
@@ -399,19 +401,25 @@ class database extends database_base
|
||||
{
|
||||
try {
|
||||
$found = false;
|
||||
if (substr( $sQuery, 0, 6 ) == 'SELECT')
|
||||
if (substr( $sQuery, 0, 6 ) == 'SELECT') {
|
||||
$found = true;
|
||||
if (substr( $sQuery, 0, 4 ) == 'SHOW')
|
||||
}
|
||||
if (substr( $sQuery, 0, 4 ) == 'SHOW') {
|
||||
$found = true;
|
||||
if (substr( $sQuery, 0, 4 ) == 'DESC')
|
||||
}
|
||||
if (substr( $sQuery, 0, 4 ) == 'DESC') {
|
||||
$found = true;
|
||||
if (substr( $sQuery, 0, 4 ) == 'USE ')
|
||||
}
|
||||
if (substr( $sQuery, 0, 4 ) == 'USE ') {
|
||||
$found = true;
|
||||
}
|
||||
if (! $found) {
|
||||
$logDir = PATH_DATA . 'log';
|
||||
if (! file_exists( $logDir ))
|
||||
if (! mkdir( $logDir ))
|
||||
if (! file_exists( $logDir )) {
|
||||
if (! mkdir( $logDir )) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
$logFile = "$logDir/query.log";
|
||||
$fp = fopen( $logFile, 'a+' );
|
||||
if ($fp !== false) {
|
||||
@@ -600,7 +608,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sConcat
|
||||
*/
|
||||
function concatString ()
|
||||
public function concatString ()
|
||||
{
|
||||
$nums = func_num_args();
|
||||
$vars = func_get_args();
|
||||
@@ -609,10 +617,11 @@ class database extends database_base
|
||||
for ($i = 0; $i < $nums; $i ++) {
|
||||
if (isset( $vars[$i] )) {
|
||||
$sConcat .= $vars[$i];
|
||||
if (($i + 1) < $nums)
|
||||
if (($i + 1) < $nums) {
|
||||
$sConcat .= ", ";
|
||||
}
|
||||
}
|
||||
}
|
||||
$sConcat .= ")";
|
||||
|
||||
return $sConcat;
|
||||
@@ -632,7 +641,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sCompare
|
||||
*/
|
||||
function getCaseWhen ($compareValue, $trueResult, $falseResult)
|
||||
public function getCaseWhen ($compareValue, $trueResult, $falseResult)
|
||||
{
|
||||
$sCompare = "IF(" . $compareValue . ", " . $trueResult . ", " . $falseResult . ") ";
|
||||
return $sCompare;
|
||||
@@ -647,7 +656,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function createTableObjectPermission ()
|
||||
public function createTableObjectPermission ()
|
||||
{
|
||||
$sql = "CREATE TABLE IF NOT EXISTS `OBJECT_PERMISSION` (
|
||||
`OP_UID` varchar(32) NOT NULL,
|
||||
@@ -677,7 +686,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport4 ()
|
||||
public function getSelectReport4 ()
|
||||
{
|
||||
|
||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||
@@ -706,7 +715,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport4Filter ($var)
|
||||
public function getSelectReport4Filter ($var)
|
||||
{
|
||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||
$sqlGroupBy = " USER ";
|
||||
@@ -734,7 +743,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport5 ()
|
||||
public function getSelectReport5 ()
|
||||
{
|
||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||
$sqlGroupBy = " USER ";
|
||||
@@ -762,7 +771,7 @@ class database extends database_base
|
||||
*
|
||||
* @return string $sql
|
||||
*/
|
||||
function getSelectReport5Filter ($var)
|
||||
public function getSelectReport5Filter ($var)
|
||||
{
|
||||
|
||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||
@@ -786,7 +795,7 @@ class database extends database_base
|
||||
* query functions for class class.net.php
|
||||
*
|
||||
*/
|
||||
function getServerVersion ($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
||||
public function getServerVersion ($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
||||
{
|
||||
|
||||
if ($link = @mysql_connect( $dbIP, $dbUser, $dbPasswd )) {
|
||||
@@ -802,25 +811,25 @@ class database extends database_base
|
||||
* query functions for class class.net.php, class.reportTables.php
|
||||
*
|
||||
*/
|
||||
function getDropTable ($sTableName)
|
||||
public function getDropTable ($sTableName)
|
||||
{
|
||||
$sql = 'DROP TABLE IF EXISTS `' . $sTableName . '`';
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function getTableDescription ($sTableName)
|
||||
public function getTableDescription ($sTableName)
|
||||
{
|
||||
$sql = "DESC " . $sTableName;
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function getFieldNull ()
|
||||
public function getFieldNull ()
|
||||
{
|
||||
$fieldName = "Null";
|
||||
return $fieldName;
|
||||
}
|
||||
|
||||
function getValidate ($validate)
|
||||
public function getValidate ($validate)
|
||||
{
|
||||
$oValidate = $validate;
|
||||
return $oValidate;
|
||||
@@ -830,7 +839,7 @@ class database extends database_base
|
||||
* Determines whether a table exists
|
||||
* It is part of class.reportTables.php
|
||||
*/
|
||||
function reportTableExist ()
|
||||
public function reportTableExist ()
|
||||
{
|
||||
$bExists = true;
|
||||
$oConnection = mysql_connect( DB_HOST, DB_USER, DB_PASS );
|
||||
@@ -843,7 +852,7 @@ class database extends database_base
|
||||
/**
|
||||
* It is part of class.pagedTable.php
|
||||
*/
|
||||
function getLimitRenderTable ($nCurrentPage, $nRowsPerPage)
|
||||
public function getLimitRenderTable ($nCurrentPage, $nRowsPerPage)
|
||||
{
|
||||
$sql = ' LIMIT ' . (($nCurrentPage - 1) * $nRowsPerPage) . ', ' . $nRowsPerPage;
|
||||
return $sql;
|
||||
@@ -852,17 +861,18 @@ class database extends database_base
|
||||
/**
|
||||
* Determining the existence of a table
|
||||
*/
|
||||
function tableExists ($tableName, $database)
|
||||
public function tableExists ($tableName, $database)
|
||||
{
|
||||
@mysql_select_db( $database );
|
||||
$tables = array ();
|
||||
$tablesResult = mysql_query( "SHOW TABLES FROM $database;" );
|
||||
while ($row = @mysql_fetch_row( $tablesResult ))
|
||||
while ($row = @mysql_fetch_row( $tablesResult )) {
|
||||
$tables[] = $row[0];
|
||||
if (in_array( $tableName, $tables )) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
if (in_array( $tableName, $tables )) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
class CLI
|
||||
{
|
||||
public static $tasks = array ();
|
||||
public static $currentTask = NULL;
|
||||
public static $currentTask = null;
|
||||
|
||||
/**
|
||||
* Adds a new task defined by it's name.
|
||||
@@ -46,7 +46,7 @@ class CLI
|
||||
public static function taskName ($name)
|
||||
{
|
||||
self::$currentTask = $name;
|
||||
self::$tasks[$name] = array ('name' => $name,'description' => NULL,'args' => array (),'function' => NULL,'opt' => array ('short' => '','long' => array (),'descriptions' => array ()
|
||||
self::$tasks[$name] = array ('name' => $name,'description' => null,'args' => array (),'function' => null,'opt' => array ('short' => '','long' => array (),'descriptions' => array ()
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class CLI
|
||||
*/
|
||||
public static function taskDescription ($description)
|
||||
{
|
||||
assert( self::$currentTask !== NULL );
|
||||
assert( self::$currentTask !== null );
|
||||
self::$tasks[self::$currentTask]["description"] = $description;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class CLI
|
||||
*/
|
||||
public static function taskArg ($name, $optional = true, $multiple = false)
|
||||
{
|
||||
assert( self::$currentTask !== NULL );
|
||||
assert( self::$currentTask !== null );
|
||||
self::$tasks[self::$currentTask]["args"][$name] = array ('optional' => $optional,'multiple' => $multiple
|
||||
);
|
||||
}
|
||||
@@ -87,14 +87,16 @@ class CLI
|
||||
* @param string $short short options
|
||||
* @param array $long long options
|
||||
*/
|
||||
public static function taskOpt ($name, $description, $short, $long = NULL)
|
||||
public static function taskOpt ($name, $description, $short, $long = null)
|
||||
{
|
||||
assert( self::$currentTask !== NULL );
|
||||
assert( self::$currentTask !== null );
|
||||
$opts = self::$tasks[self::$currentTask]["opt"];
|
||||
if ($short)
|
||||
if ($short) {
|
||||
$opts['short'] .= $short;
|
||||
if ($long)
|
||||
}
|
||||
if ($long) {
|
||||
$opts['long'][] = $long;
|
||||
}
|
||||
$opts['descriptions'][$name] = array ('short' => $short,'long' => $long,'description' => $description
|
||||
);
|
||||
self::$tasks[self::$currentTask]["opt"] = $opts;
|
||||
@@ -107,7 +109,7 @@ class CLI
|
||||
*/
|
||||
public static function taskRun ($function)
|
||||
{
|
||||
assert( self::$currentTask !== NULL );
|
||||
assert( self::$currentTask !== null );
|
||||
self::$tasks[self::$currentTask]["function"] = $function;
|
||||
}
|
||||
|
||||
@@ -117,14 +119,15 @@ class CLI
|
||||
* @param array $args if defined, the task name should be argument 0
|
||||
* @param array $opts options as returned by getopt
|
||||
*/
|
||||
public static function help ($args, $opts = NULL)
|
||||
public static function help ($args, $opts = null)
|
||||
{
|
||||
global $argv;
|
||||
$scriptName = $argv[0];
|
||||
if (is_array( $args ))
|
||||
if (is_array( $args )) {
|
||||
$taskName = $args[0];
|
||||
else
|
||||
} else {
|
||||
$taskName = $args;
|
||||
}
|
||||
|
||||
if (! $taskName) {
|
||||
echo "usage: $scriptName <task> [options] [args]\n";
|
||||
@@ -142,10 +145,12 @@ class CLI
|
||||
$valid_args = array ();
|
||||
foreach (self::$tasks[$taskName]['args'] as $arg => $data) {
|
||||
$arg = strtoupper( $arg );
|
||||
if ($data['multiple'])
|
||||
if ($data['multiple']) {
|
||||
$arg = "$arg...";
|
||||
if ($data['optional'])
|
||||
}
|
||||
if ($data['optional']) {
|
||||
$arg = "[$arg]";
|
||||
}
|
||||
$valid_args[] = $arg;
|
||||
}
|
||||
$valid_args = join( " ", $valid_args );
|
||||
@@ -162,10 +167,12 @@ EOT;
|
||||
$valid_options = array ();
|
||||
foreach (self::$tasks[$taskName]['opt']['descriptions'] as $opt => $data) {
|
||||
$optString = array ();
|
||||
if ($data['short'])
|
||||
if ($data['short']) {
|
||||
$optString[] = "-{$data['short']}";
|
||||
if ($data['long'])
|
||||
}
|
||||
if ($data['long']) {
|
||||
$optString[] = "--{$data['long']}";
|
||||
}
|
||||
$valid_options[] = " " . join( ", ", $optString ) . "\n\t" . wordwrap( $data['description'], 70, "\n\t" );
|
||||
}
|
||||
$valid_options = join( "\n", $valid_options );
|
||||
@@ -194,14 +201,15 @@ EOT;
|
||||
$args = $argv;
|
||||
$cliname = array_shift( $args );
|
||||
$taskName = array_shift( $args );
|
||||
while ($taskName{0} == '-')
|
||||
while ($taskName{0} == '-') {
|
||||
$taskName = array_shift( $args );
|
||||
}
|
||||
if (! $taskName) {
|
||||
echo self::error( "Specify a task from the list below." ) . "\n\n";
|
||||
self::help( NULL, NULL );
|
||||
self::help( null, null );
|
||||
return;
|
||||
}
|
||||
$taskData = NULL;
|
||||
$taskData = null;
|
||||
foreach (self::$tasks as $name => $data) {
|
||||
if (strcasecmp( $name, $taskName ) === 0) {
|
||||
$taskData = $data;
|
||||
@@ -210,7 +218,7 @@ EOT;
|
||||
}
|
||||
if (! $taskData) {
|
||||
echo self::error( "Command not found: '$taskName'" ) . "\n\n";
|
||||
self::help( NULL, NULL );
|
||||
self::help( null, null );
|
||||
return;
|
||||
}
|
||||
G::LoadThirdParty( 'pear/Console', 'Getopt' );
|
||||
@@ -238,12 +246,15 @@ EOT;
|
||||
self::help( $taskName );
|
||||
return;
|
||||
}
|
||||
if (strpos( $optName, '--' ) === 0)
|
||||
if (strpos( $optName, '--' ) === 0) {
|
||||
$optName = substr( $optName, 2 );
|
||||
if (! array_key_exists( $optName, $validOpts ))
|
||||
}
|
||||
if (! array_key_exists( $optName, $validOpts )) {
|
||||
throw new Exception( "option not found: $optName" );
|
||||
if (array_key_exists( $validOpts[$optName], $taskOpts ))
|
||||
}
|
||||
if (array_key_exists( $validOpts[$optName], $taskOpts )) {
|
||||
throw new Exception( "'$optName' specified more then once" );
|
||||
}
|
||||
$taskOpts[$validOpts[$optName]] = $optArg;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -323,18 +334,18 @@ EOT;
|
||||
* @param string $message the message to display
|
||||
* @param string $filename the log file to write messages
|
||||
*/
|
||||
public static function logging ($message, $filename = NULL)
|
||||
public static function logging ($message, $filename = null)
|
||||
{
|
||||
static $log_file = NULL;
|
||||
static $log_file = null;
|
||||
if (isset( $filename )) {
|
||||
$log_file = fopen( $filename, "a" );
|
||||
fwrite( $log_file, " -- " . date( "c" ) . " " . $message . " --\n" );
|
||||
} else {
|
||||
if (isset( $log_file ))
|
||||
if (isset( $log_file )) {
|
||||
fwrite( $log_file, $message );
|
||||
}
|
||||
echo $message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -126,7 +126,7 @@ class PMPluginRegistry
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function &getSingleton ()
|
||||
public function &getSingleton ()
|
||||
{
|
||||
if (self::$instance == null) {
|
||||
self::$instance = new PMPluginRegistry();
|
||||
@@ -490,7 +490,8 @@ class PMPluginRegistry
|
||||
}
|
||||
|
||||
///////
|
||||
$this->uninstallPluginWorkspaces( array ($sNamespace) );
|
||||
$this->uninstallPluginWorkspaces( array ($sNamespace
|
||||
) );
|
||||
///////
|
||||
break;
|
||||
}
|
||||
@@ -512,6 +513,7 @@ class PMPluginRegistry
|
||||
//Here we are loading all plug-ins registered
|
||||
//The singleton has a list of enabled plug-ins
|
||||
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry->unSerializeInstance( file_get_contents( $wsPathDataSite . "plugin.singleton" ) );
|
||||
|
||||
@@ -1189,6 +1191,7 @@ class PMPluginRegistry
|
||||
$oData = null;
|
||||
return $this->executeMethod( $sNamespace, 'getFieldsForPageSetup', $oData );
|
||||
}
|
||||
|
||||
/**
|
||||
* this function updates Fields For Page on Setup
|
||||
*
|
||||
@@ -1261,10 +1264,11 @@ class PMPluginRegistry
|
||||
public function registerCaseSchedulerPlugin ($sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields)
|
||||
{
|
||||
$found = false;
|
||||
foreach ($this->_aCaseSchedulerPlugin as $row => $detail)
|
||||
foreach ($this->_aCaseSchedulerPlugin as $row => $detail) {
|
||||
if ($sActionId == $detail->sActionId && $sNamespace == $detail->sNamespace) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $found) {
|
||||
$this->_aCaseSchedulerPlugin[] = new caseSchedulerPlugin( $sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields );
|
||||
|
||||
@@ -22,30 +22,28 @@ class Entity_FacetGroup extends Entity_Base
|
||||
public $facetGroupId = '';
|
||||
public $facetItems = array ();
|
||||
|
||||
private function __construct()
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_FacetGroup ();
|
||||
$obj = new Entity_FacetGroup();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForInsert($data)
|
||||
static function createForInsert ($data)
|
||||
{
|
||||
$obj = new Entity_FacetGroup ();
|
||||
$obj = new Entity_FacetGroup();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array (
|
||||
"facetGroupName",
|
||||
"facetItems"
|
||||
$requiredFields = array ("facetGroupName","facetItems"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,30 +6,28 @@ class Entity_SolrUpdateDocument extends Entity_Base
|
||||
var $workspace = '';
|
||||
var $document = '';
|
||||
|
||||
private function __construct()
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_SolrUpdateDocument ();
|
||||
$obj = new Entity_SolrUpdateDocument();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_SolrUpdateDocument ();
|
||||
$obj = new Entity_SolrUpdateDocument();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array (
|
||||
"workspace",
|
||||
"document"
|
||||
$requiredFields = array ("workspace","document"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.pmTalend.pmFunctions.php
|
||||
*
|
||||
@@ -19,17 +20,15 @@
|
||||
/**
|
||||
* Talend ETL Integration
|
||||
* @class pmTalend
|
||||
*
|
||||
* @name Talend ETL Integration
|
||||
* @icon /images/triggers/TalendOpenStudio.gif
|
||||
* @className class.pmTalend.pmFunctions.php
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @method
|
||||
*
|
||||
* Executes a Talend Web Service..
|
||||
* @method Executes a Talend Web Service..
|
||||
*
|
||||
* @name executeTalendWebservice
|
||||
* @label Executes a Talend Web Service.
|
||||
@@ -40,27 +39,31 @@
|
||||
* @return array | $return | Talend Array
|
||||
*
|
||||
*/
|
||||
function executeTalendWebservice($wsdl,$params=array(), $message){
|
||||
$client = new SoapClient($wsdl,array('trace' => 1));
|
||||
function executeTalendWebservice ($wsdl, $message, $params = array())
|
||||
{
|
||||
$client = new SoapClient( $wsdl, array ('trace' => 1
|
||||
) );
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($client, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
curl_setopt( $client, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : '') );
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($client, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
curl_setopt( $client, CURLOPT_PROXYPORT, $sysConf['proxy_port'] );
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($client, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
curl_setopt( $client, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
|
||||
}
|
||||
curl_setopt($client, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
curl_setopt( $client, CURLOPT_HTTPHEADER, array ('Expect:'
|
||||
) );
|
||||
}
|
||||
|
||||
$params[0]="";
|
||||
foreach($params as $paramO){
|
||||
$params[]="--context_param".$paramO[0]."=".$paramO[1];
|
||||
$params[0] = "";
|
||||
foreach ($params as $paramO) {
|
||||
$params[] = "--context_param" . $paramO[0] . "=" . $paramO[1];
|
||||
}
|
||||
$result = $client->__SoapCall('runJob', array($params));
|
||||
$result = $client->__SoapCall( 'runJob', array ($params
|
||||
) );
|
||||
|
||||
/*
|
||||
$params[1]="--context_param nb_line=".@=Quantity;
|
||||
@@ -78,5 +81,6 @@ function executeTalendWebservice($wsdl,$params=array(), $message){
|
||||
|
||||
}
|
||||
*/
|
||||
G::SendMessageText( "<font color='blue'>Information from Talend ETL webservice</font><font color='darkgray'><br>".$wsdl."</font>", "INFO");
|
||||
G::SendMessageText( "<font color='blue'>Information from Talend ETL webservice</font><font color='darkgray'><br>" . $wsdl . "</font>", "INFO" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,57 +1,54 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
try {
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = '';
|
||||
$G_ID_MENU_SELECTED = 'FOLDERS';
|
||||
$G_ID_SUB_MENU_SELECTED = '';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
|
||||
if((isset($_POST['form']['FOLDER_UID']))&&(isset($_POST['form']['MOVE_FOLDER_PATH']))){
|
||||
require_once ( "classes/model/AppDocument.php" );
|
||||
if ((isset( $_POST['form']['FOLDER_UID'] )) && (isset( $_POST['form']['MOVE_FOLDER_PATH'] ))) {
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
$oAppDocument = new AppDocument();
|
||||
|
||||
//Move files to another FOLDER_UID'
|
||||
$folderUid=$_POST['form']['FOLDER_UID'];
|
||||
$filesArrayAux=explode(";",$_POST['form']['MOVE_FOLDER_PATH']);
|
||||
$filesArray=array();
|
||||
foreach($filesArrayAux as $value){
|
||||
if($value!=""){
|
||||
$valueAux=explode("|",$value);
|
||||
$filesArray[$valueAux[1]]=$valueAux[0];
|
||||
$folderUid = $_POST['form']['FOLDER_UID'];
|
||||
$filesArrayAux = explode( ";", $_POST['form']['MOVE_FOLDER_PATH'] );
|
||||
$filesArray = array ();
|
||||
foreach ($filesArrayAux as $value) {
|
||||
if ($value != "") {
|
||||
$valueAux = explode( "|", $value );
|
||||
$filesArray[$valueAux[1]] = $valueAux[0];
|
||||
}
|
||||
}
|
||||
foreach($filesArray as $keyDoc => $sw){
|
||||
if($sw=="true"){
|
||||
$keyDocArray=explode("_",$keyDoc);
|
||||
$aFields = array('APP_DOC_UID' => $keyDocArray[0],
|
||||
'DOC_VERSION' => $keyDocArray[1],
|
||||
'FOLDER_UID' => $folderUid);
|
||||
$oAppDocument->update($aFields);
|
||||
foreach ($filesArray as $keyDoc => $sw) {
|
||||
if ($sw == "true") {
|
||||
$keyDocArray = explode( "_", $keyDoc );
|
||||
$aFields = array ('APP_DOC_UID' => $keyDocArray[0],'DOC_VERSION' => $keyDocArray[1],'FOLDER_UID' => $folderUid
|
||||
);
|
||||
$oAppDocument->update( $aFields );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$rootFolder='5320083284b210ceb511e43070218744';
|
||||
$rootFolder='0';
|
||||
//$rootFolder='4977070264b54bf093aef68069996372';
|
||||
//$rootFolder='5320083284b210ceb511e43070218744';
|
||||
$rootFolder = '0';
|
||||
//$rootFolder='4977070264b54bf093aef68069996372';
|
||||
|
||||
|
||||
$G_PUBLISH->AddContent('view', 'appFolder/appFolderTree' );
|
||||
$G_PUBLISH->AddContent('smarty', 'appFolder/appFolderFileList', '', '', array());
|
||||
G::RenderPage( "publish-treeview" , 'blank');
|
||||
$G_PUBLISH->AddContent( 'view', 'appFolder/appFolderTree' );
|
||||
$G_PUBLISH->AddContent( 'smarty', 'appFolder/appFolderFileList', '', '', array () );
|
||||
G::RenderPage( "publish-treeview", 'blank' );
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ try {
|
||||
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace( ".php", "Post", $form['FILENAME'] ) . ".php" );
|
||||
$oProcessMap->webEntry( $_REQUEST['PRO_UID'] );
|
||||
break;
|
||||
|
||||
case 'webEntry_new':
|
||||
$oProcessMap->webEntry_new( $oData->PRO_UID );
|
||||
break;
|
||||
@@ -125,11 +124,9 @@ try {
|
||||
case 'webEntry':
|
||||
$oProcessMap->webEntry( $oData->pro_uid );
|
||||
break;
|
||||
|
||||
case 'webEntry_Val_Assig':
|
||||
include (PATH_METHODS . 'processes/webEntry_Val_Assig.php');
|
||||
break;
|
||||
|
||||
case 'saveTitlePosition':
|
||||
$sOutput = $oProcessMap->saveTitlePosition( $oData->pro_uid, $oData->position->x, $oData->position->y );
|
||||
break;
|
||||
@@ -149,15 +146,12 @@ try {
|
||||
case 'users':
|
||||
$oProcessMap->users( $oData->pro_uid, $oData->tas_uid );
|
||||
break;
|
||||
|
||||
case 'users_adhoc':
|
||||
$oProcessMap->users_adhoc( $oData->pro_uid, $oData->tas_uid );
|
||||
break;
|
||||
|
||||
case 'addTask':
|
||||
$sOutput = $oProcessMap->addTask( $oData->uid, $oData->position->x, $oData->position->y );
|
||||
break;
|
||||
|
||||
case 'addSubProcess':
|
||||
$sOutput = $oProcessMap->addSubProcess( $oData->uid, $oData->position->x, $oData->position->y );
|
||||
break;
|
||||
@@ -427,16 +421,15 @@ try {
|
||||
$oJSON = new Services_JSON();
|
||||
echo $oJSON->encode( $oResponse );
|
||||
break;
|
||||
|
||||
case 'editFile':
|
||||
//echo $_REQUEST['filename'];
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
///-- $sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
$sDir = "";
|
||||
if (isset( $_SESSION['PFMDirectory'] ))
|
||||
if (isset( $_SESSION['PFMDirectory'] )) {
|
||||
$sDir = $_SESSION['PFMDirectory'];
|
||||
|
||||
}
|
||||
switch ($sDir) {
|
||||
case 'mailTemplates':
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
@@ -460,14 +453,14 @@ try {
|
||||
$aMessage['MESSAGE'] = G::loadTranslation( 'HTML_FILES' );
|
||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/showMessage', '',$aMessage );
|
||||
}*/
|
||||
|
||||
break;
|
||||
case 'saveFile':
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$sDir = "";
|
||||
if (isset( $_REQUEST['MAIN_DIRECTORY'] ))
|
||||
if (isset( $_REQUEST['MAIN_DIRECTORY'] )) {
|
||||
$sDir = $_REQUEST['MAIN_DIRECTORY'];
|
||||
}
|
||||
|
||||
switch ($sDir) {
|
||||
case 'mailTemplates':
|
||||
@@ -505,14 +498,13 @@ try {
|
||||
fclose($fp);
|
||||
echo 'saved: '. $sDirectory;
|
||||
break;
|
||||
*/
|
||||
*/
|
||||
case 'emptyFileOptions':
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_FileEditCreateEmpty', '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
|
||||
case "taskCases":
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
|
||||
Reference in New Issue
Block a user