Merge remote branch 'upstream/master'
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 );
|
||||
|
||||
@@ -139,8 +139,9 @@ class Report
|
||||
//$aAux1 = explode('-', $from); date('Y-m-d H:i:s', mktime(0, 0, 0, $aAux1[1], $aAux1[2], $aAux1[0]))
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL )->addAnd( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL ) ) );
|
||||
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
}
|
||||
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addGroupByColumn( 'C1.CON_VALUE' );
|
||||
@@ -155,11 +156,11 @@ class Report
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
}
|
||||
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => ApplicationPeer::doCount( $oCriteria ),'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'TOTALDUR' => number_format( $aRow['TOTALDUR'], 2 ),'PROMEDIO' => number_format( $aRow['PROMEDIO'], 2 )
|
||||
);
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => ApplicationPeer::doCount( $oCriteria ),'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'TOTALDUR' => number_format( $aRow['TOTALDUR'], 2 ),'PROMEDIO' => number_format( $aRow['PROMEDIO'], 2 ));
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
@@ -379,8 +380,9 @@ class Report
|
||||
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL )->addAnd( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL ) ) );
|
||||
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( AppDelegationPeer::USR_UID, $startedby );
|
||||
}
|
||||
|
||||
$oCriteria->add( AppDelegationPeer::PRO_UID, $PRO_UID );
|
||||
|
||||
@@ -428,8 +430,9 @@ class Report
|
||||
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL )->addAnd( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL ) ) );
|
||||
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( AppDelegationPeer::USR_UID, $startedby );
|
||||
}
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
@@ -439,16 +442,16 @@ class Report
|
||||
$lastmonth = date( 'Y-m-d', mktime( 0, 0, 0, date( "m" ) - 2, date( "d" ), date( "Y" ) ) );
|
||||
$day = mktime( 0, 0, 0, date( "m" ), date( "d" ) - 1, date( "Y" ) );
|
||||
$lastday = mktime( 0, 0, 0, date( "m" ), date( "d" ) - 2, date( "Y" ) );
|
||||
$aProcess[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','CASELASTMONTH' => 'integer','CASELASTDAY' => 'integer'
|
||||
);
|
||||
$aProcess[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','CASELASTMONTH' => 'integer','CASELASTDAY' => 'integer');
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
}
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
@@ -462,8 +465,9 @@ class Report
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $lastmonth, Criteria::GREATER_EQUAL );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $month, Criteria::LESS_EQUAL );
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
}
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
@@ -477,8 +481,9 @@ class Report
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $lastday, Criteria::GREATER_EQUAL );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $day, Criteria::LESS_EQUAL );
|
||||
if ($startedby != '')
|
||||
if ($startedby != '') {
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
}
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
@@ -492,8 +497,7 @@ class Report
|
||||
'CASELASTMONTH' => $cant1,
|
||||
'CASELASTDAY' => $cant2
|
||||
);*/
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => $cant,'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'CASELASTMONTH' => number_format( $cant1, 2 ),'CASELASTDAY' => number_format( $cant2, 2 )
|
||||
);
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => $cant,'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'CASELASTMONTH' => number_format( $cant1, 2 ),'CASELASTDAY' => number_format( $cant2, 2 ));
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
@@ -539,12 +543,10 @@ class Report
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
$ROW[] = array ('FECHA' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
);
|
||||
$ROW[] = array ('FECHA' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float');
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('FECHA' => $rs->getString( 'FECHA' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 )
|
||||
);
|
||||
$ROW[] = array ('FECHA' => $rs->getString( 'FECHA' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 ));
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
@@ -600,12 +602,10 @@ class Report
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$rs = $stmt->executeQuery();
|
||||
$ROW[] = array ('FECHA' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
);
|
||||
$ROW[] = array ('FECHA' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float');
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('FECHA' => $rs->getString( 'FECHA' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 )
|
||||
);
|
||||
$ROW[] = array ('FECHA' => $rs->getString( 'FECHA' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 ));
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
@@ -902,11 +902,11 @@ class Report
|
||||
$aData['DEL_INDEX'] = $aRow['DEL_INDEX'];
|
||||
$aData['DEL_DELEGATE_DATE'] = $aRow['DEL_DELEGATE_DATE'];
|
||||
|
||||
if ($aRow['DEL_INIT_DATE'] == NULL)
|
||||
if ($aRow['DEL_INIT_DATE'] == null) {
|
||||
$aData['DEL_INIT_DATE'] = $aRow['DEL_DELEGATE_DATE'];
|
||||
else
|
||||
} else {
|
||||
$aData['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE'];
|
||||
|
||||
}
|
||||
//$aData['DEL_FINISH_DATE']=$aRow['DEL_FINISH_DATE'];
|
||||
if ($aRow['DEL_DURATION'] != 0) {
|
||||
G::LoadClass( 'dates' );
|
||||
@@ -920,5 +920,5 @@ class Report
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}// end Report class
|
||||
@@ -40,8 +40,7 @@ class ReportTables
|
||||
private $aDef = array ('mysql' => array ('number' => 'DOUBLE','char' => 'VARCHAR(255)','text' => 'TEXT','date' => 'DATETIME'
|
||||
),'pgsql' => array ('number' => 'DOUBLE','char' => 'VARCHAR(255)','text' => 'TEXT','date' => 'DATETIME'
|
||||
),'mssql' => array ('number' => 'FLOAT','char' => 'NVARCHAR(255)','text' => 'TEXT','date' => 'CHAR(19)'
|
||||
) /* Changed DATETIME CHAR(19) for compatibility issues. */
|
||||
);
|
||||
) /* Changed DATETIME CHAR(19) for compatibility issues. */ );
|
||||
//private $sPrefix = 'REP_';
|
||||
private $sPrefix = '';
|
||||
|
||||
@@ -146,7 +145,6 @@ class ReportTables
|
||||
$sQuery .= ' DEFAULT CHARSET=utf8;';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
$sQuery = 'CREATE TABLE [' . $sTableName . '] (';
|
||||
if ($bDefaultFields) {
|
||||
@@ -569,7 +567,6 @@ class ReportTables
|
||||
$con = Propel::getConnection( $PropelDatabase );
|
||||
$stmt = $con->createStatement();
|
||||
switch (DB_ADAPTER) {
|
||||
|
||||
case 'mysql':
|
||||
$aTableFields = $this->getTableVars( $aRow['REP_TAB_UID'], true );
|
||||
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
|
||||
@@ -814,12 +811,16 @@ class ReportTables
|
||||
{
|
||||
$repTabConnection = trim( strtoupper( $TabConnectionk ) );
|
||||
$PropelDatabase = 'rp';
|
||||
if ($repTabConnection == '' || $repTabConnection == 'REPORT')
|
||||
if ($repTabConnection == '' || $repTabConnection == 'REPORT') {
|
||||
$PropelDatabase = 'rp';
|
||||
if ($repTabConnection == 'RBAC')
|
||||
}
|
||||
if ($repTabConnection == 'RBAC') {
|
||||
$PropelDatabase = 'rbac';
|
||||
if ($repTabConnection == 'WF')
|
||||
}
|
||||
if ($repTabConnection == 'WF') {
|
||||
$PropelDatabase = 'workflow';
|
||||
}
|
||||
return ($PropelDatabase);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,14 +38,12 @@ class Entity_FacetGroup extends Entity_Base
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array (
|
||||
"facetGroupName",
|
||||
"facetItems"
|
||||
$requiredFields = array ("facetGroupName","facetItems"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,14 +22,12 @@ class Entity_SolrUpdateDocument extends Entity_Base
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array (
|
||||
"workspace",
|
||||
"document"
|
||||
$requiredFields = array ("workspace","document"
|
||||
);
|
||||
|
||||
$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,8 +39,10 @@
|
||||
* @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();
|
||||
@@ -53,14 +54,16 @@ function executeTalendWebservice($wsdl,$params=array(), $message){
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
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];
|
||||
}
|
||||
$result = $client->__SoapCall('runJob', array($params));
|
||||
$result = $client->__SoapCall( 'runJob', array ($params
|
||||
) );
|
||||
|
||||
/*
|
||||
$params[1]="--context_param nb_line=".@=Quantity;
|
||||
@@ -80,3 +83,4 @@ function executeTalendWebservice($wsdl,$params=array(), $message){
|
||||
*/
|
||||
G::SendMessageText( "<font color='blue'>Information from Talend ETL webservice</font><font color='darkgray'><br>" . $wsdl . "</font>", "INFO" );
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
$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");
|
||||
@@ -27,9 +26,8 @@
|
||||
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);
|
||||
$aFields = array ('APP_DOC_UID' => $keyDocArray[0],'DOC_VERSION' => $keyDocArray[1],'FOLDER_UID' => $folderUid
|
||||
);
|
||||
$oAppDocument->update( $aFields );
|
||||
}
|
||||
}
|
||||
@@ -44,9 +42,8 @@ $rootFolder='0';
|
||||
$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::RenderPage( 'publish', 'blank' );
|
||||
|
||||
@@ -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':
|
||||
@@ -512,7 +505,6 @@ try {
|
||||
$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' );
|
||||
|
||||
@@ -7,7 +7,8 @@ $oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'reportTables/edit', true );
|
||||
$oHeadPublisher->assign( 'ADD_TAB_UID', $id );
|
||||
|
||||
if ($id) { // if is a edit request
|
||||
if ($id) {
|
||||
// if is a edit request
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
require_once 'classes/model/Fields.php';
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
@@ -32,8 +33,7 @@ if ($id) { // if is a edit request
|
||||
foreach ($fields as $field) {
|
||||
//select to not assigned fields for available grid
|
||||
if (! in_array( $field['sName'], $tableFields )) {
|
||||
$fieldsList[] = array ('FIELD_UID' => $field['sName'] . '-' . $field['sType'],'FIELD_NAME' => $field['sName']
|
||||
);
|
||||
$fieldsList[] = array ('FIELD_UID' => $field['sName'] . '-' . $field['sType'],'FIELD_NAME' => $field['sName']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -44,8 +44,7 @@ if ($id) { // if is a edit request
|
||||
|
||||
foreach ($gridFields as $gfield) {
|
||||
if (! in_array( $gfield['sName'], $tableFields )) {
|
||||
$fieldsList[] = array ('FIELD_UID' => $gfield['sName'] . '-' . $gfield['sType'],'FIELD_NAME' => $gfield['sName']
|
||||
);
|
||||
$fieldsList[] = array ('FIELD_UID' => $gfield['sName'] . '-' . $gfield['sType'],'FIELD_NAME' => $gfield['sName']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,3 +72,4 @@ $oHeadPublisher->assign( 'PRO_UID', isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID']
|
||||
$oHeadPublisher->assign( 'TABLE', $table );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -56,3 +56,4 @@ $oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
$oHeadPublisher->assign( 'PRO_UID', isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : false );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ $action = $_REQUEST['action'];
|
||||
unset( $_POST['action'] );
|
||||
|
||||
switch ($action) {
|
||||
|
||||
case 'availableFieldsReportTables':
|
||||
G::LoadClass( 'reportTables' );
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
@@ -75,7 +74,6 @@ switch ($action) {
|
||||
echo G::json_encode( $resultList );
|
||||
|
||||
break;
|
||||
|
||||
case 'fieldsList':
|
||||
|
||||
G::LoadClass( 'reportTables' );
|
||||
@@ -100,7 +98,6 @@ switch ($action) {
|
||||
$result->data = $aResultFields;
|
||||
echo G::json_encode( $result );
|
||||
break;
|
||||
|
||||
case 'getDbConnectionsList':
|
||||
G::LoadClass( 'dbConnections' );
|
||||
$proUid = $_POST['PRO_UID'];
|
||||
@@ -114,14 +111,12 @@ switch ($action) {
|
||||
echo G::json_encode( array_merge( $defaultConnections, $dbConnections ) );
|
||||
|
||||
break;
|
||||
|
||||
case 'getProcessList':
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$process = new Process();
|
||||
echo G::json_encode( $process->getAll() );
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
require_once 'classes/model/Fields.php';
|
||||
@@ -147,7 +142,8 @@ switch ($action) {
|
||||
|
||||
$columns = $data['columns'];
|
||||
|
||||
if ($data['REP_TAB_UID'] == '') { //new report table
|
||||
if ($data['REP_TAB_UID'] == '') {
|
||||
//new report table
|
||||
//setting default columns
|
||||
$defaultColumns = array ();
|
||||
$application = new stdClass(); //APPLICATION KEY
|
||||
@@ -179,7 +175,8 @@ switch ($action) {
|
||||
array_push( $defaultColumns, $application );
|
||||
|
||||
//if it is a grid report table
|
||||
if ($data['REP_TAB_TYPE'] == 'GRID') { //GRID INDEX
|
||||
if ($data['REP_TAB_TYPE'] == 'GRID') {
|
||||
//GRID INDEX
|
||||
$gridIndex = new stdClass();
|
||||
$gridIndex->uid = '';
|
||||
$gridIndex->field_dyn = '';
|
||||
@@ -209,7 +206,8 @@ switch ($action) {
|
||||
//create record
|
||||
$addTabUid = $oAdditionalTables->create( $repTabData );
|
||||
|
||||
} else { //editing report table
|
||||
} else {
|
||||
//editing report table
|
||||
$addTabUid = $data['REP_TAB_UID'];
|
||||
//loading old data before update
|
||||
$addTabBeforeData = $oAdditionalTables->load( $addTabUid, true );
|
||||
@@ -236,23 +234,26 @@ switch ($action) {
|
||||
$editFieldsList = array ();
|
||||
|
||||
foreach ($columns as $i => $column) {
|
||||
$field = array ('FLD_UID' => $column->uid,'FLD_INDEX' => $i,'ADD_TAB_UID' => $addTabUid,'FLD_NAME' => $column->field_name,'FLD_DESCRIPTION' => $column->field_label,'FLD_TYPE' => $column->field_type,'FLD_SIZE' => $column->field_size,'FLD_NULL' => (isset( $column->field_null ) ? $column->field_null : 1),'FLD_AUTO_INCREMENT' => 0,'FLD_KEY' => (isset( $column->field_key ) ? $column->field_key : 0),'FLD_FOREIGN_KEY' => 0,'FLD_FOREIGN_KEY_TABLE' => '','FLD_DYN_NAME' => $column->field_dyn,'FLD_DYN_UID' => $column->field_uid,'FLD_FILTER' => (isset( $column->field_filter ) && $column->field_filter ? 1 : 0)
|
||||
);
|
||||
$field = array ('FLD_UID' => $column->uid,'FLD_INDEX' => $i,'ADD_TAB_UID' => $addTabUid,'FLD_NAME' => $column->field_name,'FLD_DESCRIPTION' => $column->field_label,'FLD_TYPE' => $column->field_type,'FLD_SIZE' => $column->field_size,'FLD_NULL' => (isset( $column->field_null ) ? $column->field_null : 1),'FLD_AUTO_INCREMENT' => 0,'FLD_KEY' => (isset( $column->field_key ) ? $column->field_key : 0),'FLD_FOREIGN_KEY' => 0,'FLD_FOREIGN_KEY_TABLE' => '','FLD_DYN_NAME' => $column->field_dyn,'FLD_DYN_UID' => $column->field_uid,'FLD_FILTER' => (isset( $column->field_filter ) && $column->field_filter ? 1 : 0));
|
||||
|
||||
$fieldUid = $oFields->create( $field );
|
||||
$fieldsList[] = $field;
|
||||
|
||||
if ($data['REP_TAB_UID'] == '') { //new
|
||||
if ($data['REP_TAB_UID'] == '') {
|
||||
//new
|
||||
$aFields[] = array ('sType' => $column->field_type,'iSize' => $column->field_size,'sFieldName' => $column->field_name,'bNull' => (isset( $column->field_null ) ? $column->field_null : 1),'bAI' => 0,'bPrimaryKey' => (isset( $column->field_key ) ? $column->field_key : 0)
|
||||
);
|
||||
} else { //editing
|
||||
} else {
|
||||
//editing
|
||||
$field['FLD_UID'] = $fieldUid;
|
||||
$aFields[$fieldUid] = $field;
|
||||
}
|
||||
}
|
||||
if ($data['REP_TAB_UID'] == '') { //create a new report table
|
||||
if ($data['REP_TAB_UID'] == '') {
|
||||
//create a new report table
|
||||
$oAdditionalTables->createTable( $data['REP_TAB_NAME'], $data['REP_TAB_CONNECTION'], $aFields );
|
||||
} else { //editing
|
||||
} else {
|
||||
//editing
|
||||
//print_R($aFields);
|
||||
$oAdditionalTables->updateTable( $data['REP_TAB_NAME'], $data['REP_TAB_CONNECTION'], $aFields, $oldFields );
|
||||
}
|
||||
@@ -270,7 +271,6 @@ switch ($action) {
|
||||
|
||||
echo G::json_encode( $result );
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
G::LoadClass( 'reportTables' );
|
||||
@@ -293,7 +293,6 @@ switch ($action) {
|
||||
}
|
||||
echo G::json_encode( $result );
|
||||
break;
|
||||
|
||||
case 'list':
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
G::LoadClass( 'configuration' );
|
||||
@@ -325,15 +324,13 @@ switch ($action) {
|
||||
$addTab['count'] += count( $reportTablesOldList );
|
||||
|
||||
foreach ($reportTablesOldList as $i => $oldRepTab) {
|
||||
$addTab['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC'
|
||||
);
|
||||
$addTab['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo G::json_encode( $addTab );
|
||||
break;
|
||||
|
||||
case 'updateTag':
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
@@ -377,11 +374,9 @@ function getDynafields ($proUid, $type = 'xmlform')
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
|
||||
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript'
|
||||
);
|
||||
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript');
|
||||
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno'
|
||||
);
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno');
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
|
||||
@@ -390,13 +385,11 @@ function getDynafields ($proUid, $type = 'xmlform')
|
||||
if ($G_FORM->type == 'xmlform' || $G_FORM->type == '') {
|
||||
foreach ($G_FORM->fields as $fieldName => $fieldNode) {
|
||||
if (! in_array( $fieldNode->type, $excludeFieldsList ) && ! in_array( $fieldName, $fieldsNames )) {
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label');
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -413,11 +406,9 @@ function getGridDynafields ($proUid, $gridId)
|
||||
{
|
||||
$fields = array ();
|
||||
$fieldsNames = array ();
|
||||
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript'
|
||||
);
|
||||
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript');
|
||||
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno'
|
||||
);
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno');
|
||||
|
||||
$G_FORM = new Form( $proUid . '/' . $gridId, PATH_DYNAFORM, SYS_LANG, false );
|
||||
|
||||
@@ -429,8 +420,7 @@ function getGridDynafields ($proUid, $gridId)
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label');
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -457,8 +447,7 @@ function getGridFields ($proUid)
|
||||
foreach ($G_FORM->fields as $k => $v) {
|
||||
if ($v->type == 'grid') {
|
||||
if (! in_array( $k, $aFieldsNames )) {
|
||||
$aFields[] = array ('name' => $k,'xmlform' => str_replace( $proUid . '/', '', $v->xmlGrid )
|
||||
);
|
||||
$aFields[] = array ('name' => $k,'xmlform' => str_replace( $proUid . '/', '', $v->xmlGrid ));
|
||||
$aFieldsNames[] = $k;
|
||||
}
|
||||
}
|
||||
@@ -474,8 +463,7 @@ function getAllFields ($filepath, $includeTypes = array(), $excludeTypes = array
|
||||
$G_FORM = new Form( $filepath, PATH_DYNAFORM, SYS_LANG );
|
||||
$fields = array ();
|
||||
$fieldsNames = array ();
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno'
|
||||
);
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno');
|
||||
|
||||
if ($G_FORM->type == 'xmlform' || $G_FORM->type == '') {
|
||||
|
||||
@@ -486,13 +474,11 @@ function getAllFields ($filepath, $includeTypes = array(), $excludeTypes = array
|
||||
|
||||
if (count( $includeTypes ) > 0) {
|
||||
if (in_array( $fieldNode->type, $includeTypes ) && ! in_array( $fieldName, $fieldsNames )) {
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label');
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -501,20 +487,16 @@ function getAllFields ($filepath, $includeTypes = array(), $excludeTypes = array
|
||||
|
||||
if (! in_array( $fieldName, $fieldsNames )) {
|
||||
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label');
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
G::LoadClass( 'reportTables' );
|
||||
try {
|
||||
$oReportTables = new ReportTables();
|
||||
@@ -34,4 +35,4 @@ try {
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode( $result );
|
||||
?>
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
G::LoadClass( 'reportTables' );
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
$aFields['FIELDS'] = array ();
|
||||
@@ -66,4 +67,4 @@ $aFields['LANG'] = SYS_LANG;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reportTables/reportTables_Edit', '', $aFields, '../reportTables/reportTables_Save' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
?>
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
|
||||
}
|
||||
G::LoadClass( 'reportTables' );
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
if (isset( $_POST['form'] )) {
|
||||
$values = $_POST['form']; //For Old processmap
|
||||
else {
|
||||
} else {
|
||||
$values = $_POST; //For extjs,since we are not using form
|
||||
$values['FIELDS'] = explode( ',', $_POST['FIELDS'] );
|
||||
}
|
||||
@@ -96,4 +96,4 @@ foreach ($values['FIELDS'] as $sField) {
|
||||
$oReportTables->dropTable( $sOldTableName, $sOldConnection );
|
||||
$oReportTables->createTable( $values['REP_TAB_NAME'], $values['REP_TAB_CONNECTION'], $values['REP_TAB_TYPE'], $aFields );
|
||||
$oReportTables->populateTable( $values['REP_TAB_NAME'], $values['REP_TAB_CONNECTION'], $values['REP_TAB_TYPE'], $aFields, $values['PRO_UID'], $values['REP_TAB_GRID'] );
|
||||
?>
|
||||
|
||||
|
||||
@@ -122,4 +122,4 @@ $oCriteria->setDBArrayTable( 'reports' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/reportsList', $oCriteria );
|
||||
G::RenderPage( 'publish' );
|
||||
?>
|
||||
|
||||
|
||||
@@ -58,4 +58,4 @@ switch ($_GET['sType']) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -65,4 +65,4 @@ $G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/reports_Description', $c );
|
||||
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'reports/reports_Description_search', '', $fields);
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
?>
|
||||
|
||||
|
||||
@@ -47,8 +47,9 @@ while ($aRow = $oDataset->getRow()) {
|
||||
$oDataseti->next();
|
||||
$b = 0;
|
||||
while ($aRows = $oDataseti->getRow()) {
|
||||
if (TaskPeer::doCount( $oCriteria ) == 1)
|
||||
if (TaskPeer::doCount( $oCriteria ) == 1) {
|
||||
$b = 1;
|
||||
}
|
||||
$oDataseti->next();
|
||||
}
|
||||
|
||||
@@ -87,5 +88,3 @@ while ($aRow = $oDataset->getRow()) {
|
||||
|
||||
//G::header('location: reportsList');
|
||||
|
||||
|
||||
?>
|
||||
@@ -58,8 +58,9 @@ try {
|
||||
case 1:
|
||||
$sw = 0;
|
||||
if (isset( $_POST['form'] )) {
|
||||
if ($_POST['form']['FROM'] != '0000-00-00' || $_POST['form']['TO'] != '0000-00-00')
|
||||
if ($_POST['form']['FROM'] != '0000-00-00' || $_POST['form']['TO'] != '0000-00-00') {
|
||||
$sw = 1;
|
||||
}
|
||||
$fields['FROM'] = $_POST['form']['FROM'];
|
||||
$fields['TO'] = $_POST['form']['TO'];
|
||||
$fields['STARTEDBY'] = $_POST['form']['STARTEDBY'];
|
||||
@@ -70,30 +71,30 @@ try {
|
||||
|
||||
G::LoadClass( 'report' );
|
||||
$oReport = new Report();
|
||||
if ($sw == 0)
|
||||
if ($sw == 0) {
|
||||
$c = $oReport->generatedReport1();
|
||||
else
|
||||
} else {
|
||||
$c = $oReport->generatedReport1_filter( $_POST['form']['FROM'], $_POST['form']['TO'], $_POST['form']['STARTEDBY'] );
|
||||
|
||||
}
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/reports/reports.js' );
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/report1', $c );
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
if (isset( $_POST['form'] )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report1_search', '', $fields );
|
||||
else
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report1_search' );
|
||||
|
||||
}
|
||||
G::RenderPage( 'publish' );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$sw = 0;
|
||||
if (isset( $_POST['form'] )) {
|
||||
if ($_POST['form']['FROM'] != '0000-00-00' || $_POST['form']['TO'] != '0000-00-00')
|
||||
if ($_POST['form']['FROM'] != '0000-00-00' || $_POST['form']['TO'] != '0000-00-00') {
|
||||
$sw = 1;
|
||||
}
|
||||
$fields['FROM'] = $_POST['form']['FROM'];
|
||||
$fields['TO'] = $_POST['form']['TO'];
|
||||
$fields['STARTEDBY'] = $_POST['form']['STARTEDBY'];
|
||||
@@ -105,24 +106,24 @@ try {
|
||||
G::LoadClass( 'report' );
|
||||
$oReport = new Report();
|
||||
|
||||
if ($sw == 0)
|
||||
if ($sw == 0) {
|
||||
$c = $oReport->generatedReport2();
|
||||
else
|
||||
} else {
|
||||
$c = $oReport->generatedReport2_filter( $_POST['form']['FROM'], $_POST['form']['TO'], $_POST['form']['STARTEDBY'] );
|
||||
|
||||
}
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/reports/reports.js' );
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/report2', $c );
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
if (isset( $_POST['form'] )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report1_search', '', $fields );
|
||||
else
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report1_search' );
|
||||
}
|
||||
G::RenderPage( 'publish' );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$sw = 0;
|
||||
if (isset( $_POST['form'] )) {
|
||||
@@ -137,25 +138,24 @@ try {
|
||||
G::LoadClass( 'report' );
|
||||
$oReport = new Report();
|
||||
|
||||
if ($sw == 0)
|
||||
if ($sw == 0) {
|
||||
$c = $oReport->generatedReport3();
|
||||
else
|
||||
} else {
|
||||
$c = $oReport->generatedReport3_filter( $_POST['form']['PROCESS'], $_POST['form']['TASKS'] );
|
||||
|
||||
}
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/reports/reports.js' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
if (isset( $_POST['form'] )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report_filter', '', $fields );
|
||||
else
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report_filter' );
|
||||
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/report3', $c );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$sw = 0;
|
||||
if (isset( $_POST['form'] )) {
|
||||
@@ -167,25 +167,24 @@ try {
|
||||
G::LoadClass( 'report' );
|
||||
$oReport = new Report();
|
||||
|
||||
if ($sw == 0)
|
||||
if ($sw == 0) {
|
||||
$c = $oReport->generatedReport4();
|
||||
else
|
||||
} else {
|
||||
$c = $oReport->generatedReport4_filter( $_POST['form']['PROCESS'], $_POST['form']['TASKS'] );
|
||||
|
||||
}
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/reports/reports.js' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
if (isset( $_POST['form'] )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report_filter', '', $fields );
|
||||
else
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report_filter' );
|
||||
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/report4', $c );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$sw = 0;
|
||||
if (isset( $_POST['form'] )) {
|
||||
@@ -197,25 +196,24 @@ try {
|
||||
G::LoadClass( 'report' );
|
||||
$oReport = new Report();
|
||||
|
||||
if ($sw == 0)
|
||||
if ($sw == 0) {
|
||||
$c = $oReport->generatedReport5();
|
||||
else
|
||||
} else {
|
||||
$c = $oReport->generatedReport5_filter( $_POST['form']['PROCESS'], $_POST['form']['TASKS'] );
|
||||
|
||||
}
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/reports/reports.js' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
if (isset( $_POST['form'] )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report_filter', '', $fields );
|
||||
else
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'reports/report_filter' );
|
||||
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'reports/report5', $c );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
break;
|
||||
|
||||
default:
|
||||
$foundReport = false;
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
@@ -257,9 +255,10 @@ try {
|
||||
}
|
||||
closedir( $handle );
|
||||
}
|
||||
if (! $foundReport)
|
||||
if (! $foundReport) {
|
||||
throw (new Exception( "Call to an nonexistent member function " . $RPT_UID . "() " ));
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
Reference in New Issue
Block a user