Merge pull request #860 from Jennydmz/master

CODE STYLE changes...
This commit is contained in:
julceslauhub
2012-10-22 15:11:53 -07:00
9 changed files with 3117 additions and 3095 deletions

View File

@@ -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;
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@@ -6,46 +6,44 @@ require_once ('Base.php');
*
* @property $facetGroupName: The name of the facet (field name in solr index)
* @property $facetGroupPrintName: The print name of the facet (Human readable
* description)
* description)
* @property $facetGroupType: The type of facet group, field, daterange, filter,
* range
* range
* @property $facetGroupId: An identifier to find group information
* @property $facetItems: array of facet items
* @author dev-HebertSaak
*
*
*/
class Entity_FacetGroup extends Entity_Base
{
public $facetGroupName = '';
public $facetGroupPrintName = '';
public $facetGroupType = ''; // field, daterange, query
public $facetGroupId = '';
public $facetItems = array ();
private function __construct()
{
}
static function createEmpty()
{
$obj = new Entity_FacetGroup ();
return $obj;
}
static function createForInsert($data)
{
$obj = new Entity_FacetGroup ();
$obj->initializeObject ($data);
$requiredFields = array (
"facetGroupName",
"facetItems"
);
$obj->validateRequiredFields ($requiredFields);
return $obj;
}
public $facetGroupName = '';
public $facetGroupPrintName = '';
public $facetGroupType = ''; // field, daterange, query
public $facetGroupId = '';
public $facetItems = array ();
private function __construct ()
{
}
static function createEmpty ()
{
$obj = new Entity_FacetGroup();
return $obj;
}
static function createForInsert ($data)
{
$obj = new Entity_FacetGroup();
$obj->initializeObject( $data );
$requiredFields = array ("facetGroupName","facetItems"
);
$obj->validateRequiredFields( $requiredFields );
return $obj;
}
}
}

View File

@@ -3,33 +3,31 @@ require_once ('Base.php');
class Entity_SolrUpdateDocument extends Entity_Base
{
var $workspace = '';
var $document = '';
private function __construct()
{
}
static function createEmpty()
{
$obj = new Entity_SolrUpdateDocument ();
return $obj;
}
static function createForRequest($data)
{
$obj = new Entity_SolrUpdateDocument ();
$obj->initializeObject ($data);
$requiredFields = array (
"workspace",
"document"
);
$obj->validateRequiredFields ($requiredFields);
return $obj;
}
var $workspace = '';
var $document = '';
private function __construct ()
{
}
static function createEmpty ()
{
$obj = new Entity_SolrUpdateDocument();
return $obj;
}
static function createForRequest ($data)
{
$obj = new Entity_SolrUpdateDocument();
$obj->initializeObject( $data );
$requiredFields = array ("workspace","document"
);
$obj->validateRequiredFields( $requiredFields );
return $obj;
}
}
}

View File

@@ -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,43 +39,48 @@
* @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'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($client, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
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'] );
}
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:'
) );
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($client, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
$params[0] = "";
foreach ($params as $paramO) {
$params[] = "--context_param" . $paramO[0] . "=" . $paramO[1];
}
curl_setopt($client, CURLOPT_HTTPHEADER, array('Expect:'));
}
$result = $client->__SoapCall( 'runJob', array ($params
) );
$params[0]="";
foreach($params as $paramO){
$params[]="--context_param".$paramO[0]."=".$paramO[1];
}
$result = $client->__SoapCall('runJob', array($params));
/*
$params[1]="--context_param nb_line=".@=Quantity;
/*
$params[1]="--context_param nb_line=".@=Quantity;
$result = $client->__SoapCall('runJob', array($params));
foreach ($result->item as $keyItem => $item){
$gridRow=$keyItem+1;
@=USERSINFO[$gridRow]['NAME']=$item->item[1];
@=USERSINFO[$gridRow]['LASTNAME']=$item->item[2];
@=USERSINFO[$gridRow]['DATE']=$item->item[0];
@=USERSINFO[$gridRow]['STREET']=$item->item[3];
@=USERSINFO[$gridRow]['CITY']=$item->item[4];
@=USERSINFO[$gridRow]['STATE']=$item->item[5];
@=USERSINFO[$gridRow]['STATEID']=$item->item[6];
$result = $client->__SoapCall('runJob', array($params));
foreach ($result->item as $keyItem => $item){
$gridRow=$keyItem+1;
@=USERSINFO[$gridRow]['NAME']=$item->item[1];
@=USERSINFO[$gridRow]['LASTNAME']=$item->item[2];
@=USERSINFO[$gridRow]['DATE']=$item->item[0];
@=USERSINFO[$gridRow]['STREET']=$item->item[3];
@=USERSINFO[$gridRow]['CITY']=$item->item[4];
@=USERSINFO[$gridRow]['STATE']=$item->item[5];
@=USERSINFO[$gridRow]['STATEID']=$item->item[6];
}
*/
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");
}

View File

@@ -1,59 +1,56 @@
<?php
try {
try {
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = '';
$G_ID_MENU_SELECTED = 'FOLDERS';
$G_ID_SUB_MENU_SELECTED = '';
$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");
$oAppDocument = new AppDocument();
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];
//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];
}
}
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>
openPMFolder('<?php echo $rootFolder ?>','<?php echo $rootFolder ?>');
</script>
</script>

View File

@@ -29,13 +29,13 @@ try {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}*/
break;
}*/
$oJSON = new Services_JSON();
if (isset( $_REQUEST['data'] )) {
$oData = $oJSON->decode( stripslashes( $_REQUEST['data'] ) );
@@ -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'];
@@ -457,17 +450,17 @@ try {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_FileEdit', '', $aData );
G::RenderPage( 'publish', 'raw' );
/*}else{ echo 'krlos';
$aMessage['MESSAGE'] = G::loadTranslation( 'HTML_FILES' );
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/showMessage', '',$aMessage );
}*/
$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':
@@ -493,26 +486,25 @@ try {
$oProcessMap->eventsList( $oData->pro_uid, $oData->type );
break;
/*
case 'saveFile':
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
case 'saveFile':
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
$fp = fopen($sDirectory, 'w');
$content = stripslashes($_REQUEST['fcontent']);
$content = str_replace("@amp@", "&", $content);
fwrite($fp, $content);
fclose($fp);
echo 'saved: '. $sDirectory;
break;
*/
$fp = fopen($sDirectory, 'w');
$content = stripslashes($_REQUEST['fcontent']);
$content = str_replace("@amp@", "&", $content);
fwrite($fp, $content);
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' );