BUG 0000 Adjustment for the standardization of code. CODE_STYLE
This commit is contained in:
@@ -24,12 +24,15 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
if (! defined( 'JAVA_BRIDGE_PATH' ))
|
||||
if (! defined( 'JAVA_BRIDGE_PATH' )) {
|
||||
define( 'JAVA_BRIDGE_PATH', 'JavaBridgePM' );
|
||||
if (! defined( 'JAVA_BRIDGE_PORT' ))
|
||||
}
|
||||
if (! defined( 'JAVA_BRIDGE_PORT' )) {
|
||||
define( 'JAVA_BRIDGE_PORT', '8080' );
|
||||
if (! defined( 'JAVA_BRIDGE_HOST' ))
|
||||
}
|
||||
if (! defined( 'JAVA_BRIDGE_HOST' )) {
|
||||
define( 'JAVA_BRIDGE_HOST', '127.0.0.1' );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -37,9 +40,9 @@ if (! defined( 'JAVA_BRIDGE_HOST' ))
|
||||
*/
|
||||
class JavaBridgePM
|
||||
{
|
||||
var $JavaBridgeDir = JAVA_BRIDGE_PATH;
|
||||
var $JavaBridgePort = JAVA_BRIDGE_PORT;
|
||||
var $JavaBridgeHost = JAVA_BRIDGE_HOST;
|
||||
public $JavaBridgeDir = JAVA_BRIDGE_PATH;
|
||||
public $JavaBridgePort = JAVA_BRIDGE_PORT;
|
||||
public $JavaBridgeHost = JAVA_BRIDGE_HOST;
|
||||
|
||||
/**
|
||||
* checkJavaExtension
|
||||
@@ -48,7 +51,7 @@ class JavaBridgePM
|
||||
*
|
||||
* @return true or false
|
||||
*/
|
||||
function checkJavaExtension ()
|
||||
public function checkJavaExtension ()
|
||||
{
|
||||
try {
|
||||
if (! extension_loaded( 'java' )) {
|
||||
@@ -58,9 +61,10 @@ class JavaBridgePM
|
||||
$includedFiles = get_included_files();
|
||||
$found = false;
|
||||
foreach ($includedFiles as $filename) {
|
||||
if ($urlJavaInc == $filename)
|
||||
if ($urlJavaInc == $filename) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if (! $found) {
|
||||
throw new Exception( 'The PHP/Java Bridge is not defined' );
|
||||
}
|
||||
@@ -86,7 +90,7 @@ class JavaBridgePM
|
||||
* @param string $className
|
||||
* @return s boolean success
|
||||
*/
|
||||
function convertValue ($value, $className)
|
||||
public function convertValue ($value, $className)
|
||||
{
|
||||
// if we are a string, just use the normal conversion
|
||||
// methods from the java extension...
|
||||
@@ -119,7 +123,7 @@ class JavaBridgePM
|
||||
* @param object $template
|
||||
* @return void
|
||||
*/
|
||||
function generateJrxmlFromDynaform ($outDocUid, $dynaformUid, $template)
|
||||
public function generateJrxmlFromDynaform ($outDocUid, $dynaformUid, $template)
|
||||
{
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
$dyn = new Dynaform();
|
||||
@@ -129,9 +133,10 @@ class JavaBridgePM
|
||||
$reportTpl = PATH_TPL . 'javaBridgePM/classic.xml';
|
||||
$reportFilename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $outDocUid . '.jrxml';
|
||||
foreach ($xmlFields as $key => $val) {
|
||||
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle')
|
||||
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle') {
|
||||
unset( $xmlFields[$key] );
|
||||
}
|
||||
}
|
||||
|
||||
//$sqlSentence = 'SELECT * from ' . $tableName;
|
||||
$sqlSentence = 'dynaform/';
|
||||
@@ -168,6 +173,5 @@ class JavaBridgePM
|
||||
$iSize = file_put_contents( $reportFilename, $content );
|
||||
printf( "saved %s bytes in file %s \n", $iSize, $reportFilename );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Utility functions to manage a workspace.
|
||||
*
|
||||
* @author Alexandre Rosenfeld
|
||||
*/
|
||||
|
||||
G::LoadSystem('dbMaintenance');
|
||||
G::LoadClass("cli");
|
||||
G::LoadClass("multipleFilesBackup");
|
||||
@@ -14,17 +14,16 @@ G::LoadClass( "multipleFilesBackup" );
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class workspaceTools
|
||||
{
|
||||
var $name = null;
|
||||
var $path = null;
|
||||
var $db = null;
|
||||
var $dbPath = null;
|
||||
var $dbInfo = null;
|
||||
var $dbInfoRegExp = "/( *define *\( *'(?P<key>.*?)' *, *\n* *')(?P<value>.*?)(' *\) *;.*)/";
|
||||
var $initPropel = false;
|
||||
var $initPropelRoot = false;
|
||||
public $name = null;
|
||||
public $path = null;
|
||||
public $db = null;
|
||||
public $dbPath = null;
|
||||
public $dbInfo = null;
|
||||
public $dbInfoRegExp = "/( *define *\( *'(?P<key>.*?)' *, *\n* *')(?P<value>.*?)(' *\) *;.*)/";
|
||||
public $initPropel = false;
|
||||
public $initPropelRoot = false;
|
||||
|
||||
/**
|
||||
* Create a workspace tools object.
|
||||
@@ -36,7 +35,7 @@ class workspaceTools
|
||||
* @access public
|
||||
* @param string $workspaceName name of the workspace
|
||||
*/
|
||||
function __construct ($workspaceName)
|
||||
public function __construct($workspaceName)
|
||||
{
|
||||
$this->name = $workspaceName;
|
||||
$this->path = PATH_DB . $this->name;
|
||||
@@ -131,12 +130,10 @@ class workspaceTools
|
||||
* $matches will contain several groups:
|
||||
* ((define('(<key>)2', ')1 (<value>)3 (');)4 )0
|
||||
*/
|
||||
$dbPrefix = array ('DB_NAME' => 'wf_','DB_USER' => 'wf_','DB_RBAC_NAME' => 'rb_','DB_RBAC_USER' => 'rb_','DB_REPORT_NAME' => 'rp_','DB_REPORT_USER' => 'rp_'
|
||||
);
|
||||
$dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'rb_', 'DB_RBAC_USER' => 'rb_', 'DB_REPORT_NAME' => 'rp_', 'DB_REPORT_USER' => 'rp_');
|
||||
$key = $matches['key'];
|
||||
$value = $matches['value'];
|
||||
if (array_search( $key, array ('DB_HOST','DB_RBAC_HOST','DB_REPORT_HOST'
|
||||
) ) !== false) {
|
||||
if (array_search($key, array('DB_HOST', 'DB_RBAC_HOST', 'DB_REPORT_HOST')) !== false) {
|
||||
/* Change the database hostname for these keys */
|
||||
$value = $this->newHost;
|
||||
} elseif (array_key_exists($key, $dbPrefix)) {
|
||||
@@ -188,8 +185,7 @@ class workspaceTools
|
||||
* This regular expression will match any "define ('<key>', '<value>');"
|
||||
* with any combination of whitespace between words.
|
||||
*/
|
||||
$sNewDbFile = preg_replace_callback( "/( *define *\( *'(?P<key>.*?)' *, *\n* *')(?P<value>.*?)(' *\) *;.*)/", array (&$this,'resetDBInfoCallback'
|
||||
), $sDbFile );
|
||||
$sNewDbFile = preg_replace_callback("/( *define *\( *'(?P<key>.*?)' *, *\n* *')(?P<value>.*?)(' *\) *;.*)/", array(&$this, 'resetDBInfoCallback'), $sDbFile);
|
||||
if (file_put_contents($this->dbPath, $sNewDbFile) === false) {
|
||||
throw new Exception("Could not write database information to db.php");
|
||||
}
|
||||
@@ -209,12 +205,10 @@ class workspaceTools
|
||||
*/
|
||||
public function getDBCredentials($dbName)
|
||||
{
|
||||
$prefixes = array ("wf" => "","rp" => "REPORT_","rb" => "RBAC_"
|
||||
);
|
||||
$prefixes = array("wf" => "", "rp" => "REPORT_", "rb" => "RBAC_");
|
||||
$prefix = $prefixes[$dbName];
|
||||
$dbInfo = $this->getDBInfo();
|
||||
return array ('adapter' => $dbInfo["DB_ADAPTER"],'name' => $dbInfo["DB_" . $prefix . "NAME"],'host' => $dbInfo["DB_" . $prefix . "HOST"],'user' => $dbInfo["DB_" . $prefix . "USER"],'pass' => $dbInfo["DB_" . $prefix . "PASS"],'dsn' => sprintf( "%s://%s:%s@%s/%s?encoding=utf8", $dbInfo['DB_ADAPTER'], $dbInfo["DB_" . $prefix . "USER"], $dbInfo["DB_" . $prefix . "PASS"], $dbInfo["DB_" . $prefix . "HOST"], $dbInfo["DB_" . $prefix . "NAME"] )
|
||||
);
|
||||
return array('adapter' => $dbInfo["DB_ADAPTER"], 'name' => $dbInfo["DB_" . $prefix . "NAME"], 'host' => $dbInfo["DB_" . $prefix . "HOST"], 'user' => $dbInfo["DB_" . $prefix . "USER"], 'pass' => $dbInfo["DB_" . $prefix . "PASS"], 'dsn' => sprintf("%s://%s:%s@%s/%s?encoding=utf8", $dbInfo['DB_ADAPTER'], $dbInfo["DB_" . $prefix . "USER"], $dbInfo["DB_" . $prefix . "PASS"], $dbInfo["DB_" . $prefix . "HOST"], $dbInfo["DB_" . $prefix . "NAME"]));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,9 +242,8 @@ class workspaceTools
|
||||
$pass = $dbHash[2];
|
||||
$dbName = $dbInfo["DB_NAME"];
|
||||
|
||||
$rootConfig = array ('datasources' => array ('root' => array ('connection' => "mysql://$user:$pass@$host/$dbName?encoding=utf8",'adapter' => "mysql"
|
||||
)
|
||||
)
|
||||
$rootConfig = array(
|
||||
'datasources' => array('root' => array('connection' => "mysql://$user:$pass@$host/$dbName?encoding=utf8", 'adapter' => "mysql"))
|
||||
);
|
||||
|
||||
$config["datasources"] = array_merge($config["datasources"], $rootConfig["datasources"]);
|
||||
@@ -434,7 +427,6 @@ class workspaceTools
|
||||
$lang = "en";
|
||||
|
||||
//require_once ('classes/model/AppCacheView.php');
|
||||
|
||||
//check the language, if no info in config about language, the default is 'en'
|
||||
G::LoadClass("configuration");
|
||||
|
||||
@@ -480,8 +472,7 @@ class workspaceTools
|
||||
//build using the method in AppCacheView Class
|
||||
$res = $appCache->fillAppCacheView($lang);
|
||||
//set status in config table
|
||||
$confParams = Array ('LANG' => $lang,'STATUS' => 'active'
|
||||
);
|
||||
$confParams = Array('LANG' => $lang, 'STATUS' => 'active');
|
||||
}
|
||||
$oConf->aConfig = $confParams;
|
||||
$oConf->saveConfig('APP_CACHE_VIEW_ENGINE', '', '', '');
|
||||
@@ -489,8 +480,7 @@ class workspaceTools
|
||||
// removing casesList configuration records. TODO: removing these lines that resets all the configurations records
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->add(ConfigurationPeer::CFG_UID, "casesList");
|
||||
$oCriteria->add( ConfigurationPeer::OBJ_UID, array ("todo","draft","sent","unassigned","paused","cancelled"
|
||||
), Criteria::NOT_IN );
|
||||
$oCriteria->add(ConfigurationPeer::OBJ_UID, array("todo", "draft", "sent", "unassigned", "paused", "cancelled"), Criteria::NOT_IN);
|
||||
ConfigurationPeer::doDelete($oCriteria);
|
||||
// end of reset
|
||||
}
|
||||
@@ -713,7 +703,13 @@ class workspaceTools
|
||||
{
|
||||
$fields = System::getSysInfo();
|
||||
|
||||
$info = array ('ProcessMaker Version' => $fields['PM_VERSION'],'System' => $fields['SYSTEM'],'PHP Version' => $fields['PHP'],'Server Address' => $fields['SERVER_ADDR'],'Client IP Address' => $fields['IP'],'Plugins' => (count( $fields['PLUGINS_LIST'] ) > 0) ? $fields['PLUGINS_LIST'][0] : 'None'
|
||||
$info = array(
|
||||
'ProcessMaker Version' => $fields['PM_VERSION'],
|
||||
'System' => $fields['SYSTEM'],
|
||||
'PHP Version' => $fields['PHP'],
|
||||
'Server Address' => $fields['SERVER_ADDR'],
|
||||
'Client IP Address' => $fields['IP'],
|
||||
'Plugins' => (count($fields['PLUGINS_LIST']) > 0) ? $fields['PLUGINS_LIST'][0] : 'None'
|
||||
);
|
||||
|
||||
foreach ($fields['PLUGINS_LIST'] as $k => $v) {
|
||||
@@ -779,8 +775,7 @@ class workspaceTools
|
||||
public function exportDatabase($path)
|
||||
{
|
||||
$dbInfo = $this->getDBInfo();
|
||||
$databases = array ("wf","rp","rb"
|
||||
);
|
||||
$databases = array("wf", "rp", "rb");
|
||||
$dbNames = array();
|
||||
foreach ($databases as $db) {
|
||||
$dbInfo = $this->getDBCredentials($db);
|
||||
@@ -810,8 +805,6 @@ class workspaceTools
|
||||
//foreach (glob($filename . "/*") as $item) {
|
||||
// $this->addToBackup($backup, $item, $pathRoot, $archiveRoot);
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -868,8 +861,7 @@ class workspaceTools
|
||||
$metadata = $this->getMetadata();
|
||||
CLI::logging("Backing up database...\n");
|
||||
$metadata["databases"] = $this->exportDatabase($tempDirectory);
|
||||
$metadata["directories"] = array ("{$this->name}.files"
|
||||
);
|
||||
$metadata["directories"] = array("{$this->name}.files");
|
||||
$metadata["version"] = 1;
|
||||
$metaFilename = "$tempDirectory/{$this->name}.meta";
|
||||
/* Write metadata to file, but make it prettier before. The metadata is just
|
||||
@@ -992,8 +984,7 @@ class workspaceTools
|
||||
foreach ($backup->listContent() as $backupFile) {
|
||||
$filename = $backupFile["filename"];
|
||||
if (strpos($filename, "/") === false && substr_compare($filename, ".meta", - 5, 5, true) === 0) {
|
||||
if (! $backup->extractList( array ($filename
|
||||
), $tempDirectory )) {
|
||||
if (!$backup->extractList(array($filename), $tempDirectory)) {
|
||||
throw new Exception("Could not extract backup");
|
||||
}
|
||||
$metafiles[] = "$tempDirectory/$filename";
|
||||
@@ -1007,7 +998,6 @@ class workspaceTools
|
||||
$workspaceData = G::json_decode($data);
|
||||
CLI::logging("\n");
|
||||
workspaceTools::printInfo((array) $workspaceData);
|
||||
|
||||
}
|
||||
|
||||
G::rm_dir($tempDirectory);
|
||||
@@ -1115,7 +1105,6 @@ class workspaceTools
|
||||
if (!rename("$tempDirectory/$dir", $workspace->path)) {
|
||||
throw new Exception("There was an error copying the backup files ($tempDirectory/$dir) to the workspace directory {$workspace->path}.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CLI::logging("> Changing file permissions\n");
|
||||
@@ -1148,7 +1137,6 @@ class workspaceTools
|
||||
$workspace->upgradeCacheView(false);
|
||||
|
||||
mysql_close($link);
|
||||
|
||||
}
|
||||
|
||||
CLI::logging("Removing temporary files\n");
|
||||
|
||||
@@ -34,7 +34,6 @@ class Zimbra
|
||||
protected $_idm; // IDMObject
|
||||
protected $_username; // the user we are operating as
|
||||
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
@@ -65,7 +64,6 @@ class Zimbra
|
||||
|
||||
// end __construct
|
||||
|
||||
|
||||
/**
|
||||
* sso
|
||||
*
|
||||
@@ -92,7 +90,6 @@ class Zimbra
|
||||
|
||||
// end sso
|
||||
|
||||
|
||||
/**
|
||||
* createAccount
|
||||
*
|
||||
@@ -100,7 +97,7 @@ class Zimbra
|
||||
* @param string $password password
|
||||
* @return string account id
|
||||
*/
|
||||
function createAccount ($name, $password)
|
||||
public function createAccount($name, $password)
|
||||
{
|
||||
$option_string = '';
|
||||
|
||||
@@ -144,7 +141,6 @@ class Zimbra
|
||||
|
||||
// end getPreAuth
|
||||
|
||||
|
||||
/**
|
||||
* hmacsha1
|
||||
*
|
||||
@@ -172,7 +168,6 @@ class Zimbra
|
||||
|
||||
// end hmacsha1
|
||||
|
||||
|
||||
/**
|
||||
* connect
|
||||
*
|
||||
@@ -205,8 +200,7 @@ class Zimbra
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($this->_curl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt( $this->_curl, CURLOPT_HTTPHEADER, array ('Expect:'
|
||||
) );
|
||||
curl_setopt($this->_curl, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$preauth = $this->getPreAuth($this->_username);
|
||||
@@ -244,7 +238,6 @@ class Zimbra
|
||||
|
||||
// end connect
|
||||
|
||||
|
||||
/**
|
||||
* administerUser
|
||||
*
|
||||
@@ -282,7 +275,6 @@ class Zimbra
|
||||
|
||||
// end administerUser
|
||||
|
||||
|
||||
/**
|
||||
* getInfo
|
||||
*
|
||||
@@ -310,7 +302,6 @@ class Zimbra
|
||||
|
||||
// end getInfo
|
||||
|
||||
|
||||
/**
|
||||
* getMessages
|
||||
*
|
||||
@@ -340,7 +331,6 @@ class Zimbra
|
||||
|
||||
// end getMessages
|
||||
|
||||
|
||||
/**
|
||||
* getContacts
|
||||
*
|
||||
@@ -430,7 +420,6 @@ class Zimbra
|
||||
|
||||
// end getTasks
|
||||
|
||||
|
||||
/**
|
||||
* getMessageContent
|
||||
*
|
||||
@@ -490,7 +479,6 @@ class Zimbra
|
||||
|
||||
// end getSubscribedCalendars
|
||||
|
||||
|
||||
/**
|
||||
* getSubscribedTaskLists
|
||||
*
|
||||
@@ -515,7 +503,6 @@ class Zimbra
|
||||
|
||||
// end getSubscribedCalendars
|
||||
|
||||
|
||||
/**
|
||||
* getFolder
|
||||
*
|
||||
@@ -552,7 +539,6 @@ class Zimbra
|
||||
|
||||
// end getFolder
|
||||
|
||||
|
||||
/**
|
||||
* getPrefrences
|
||||
*
|
||||
@@ -581,7 +567,6 @@ class Zimbra
|
||||
|
||||
// end getPreferences
|
||||
|
||||
|
||||
/**
|
||||
* setPrefrences
|
||||
*
|
||||
@@ -613,7 +598,6 @@ class Zimbra
|
||||
|
||||
// end setPreferences
|
||||
|
||||
|
||||
/**
|
||||
* emailChannel
|
||||
*
|
||||
@@ -696,7 +680,6 @@ class Zimbra
|
||||
|
||||
// end emailChannel
|
||||
|
||||
|
||||
/**
|
||||
* builOptionString
|
||||
*
|
||||
@@ -718,7 +701,6 @@ class Zimbra
|
||||
|
||||
// end buildOptionString
|
||||
|
||||
|
||||
/**
|
||||
* extractAuthToken
|
||||
*
|
||||
@@ -760,7 +742,6 @@ class Zimbra
|
||||
|
||||
// end extractSessionID
|
||||
|
||||
|
||||
/**
|
||||
* extractErrorCode
|
||||
*
|
||||
@@ -781,7 +762,6 @@ class Zimbra
|
||||
|
||||
// end extractErrorCode
|
||||
|
||||
|
||||
/**
|
||||
* makeBytesPretty
|
||||
*
|
||||
@@ -811,7 +791,6 @@ class Zimbra
|
||||
|
||||
// end makeBytesPretty
|
||||
|
||||
|
||||
/**
|
||||
* message
|
||||
*
|
||||
@@ -830,7 +809,6 @@ class Zimbra
|
||||
|
||||
// end message
|
||||
|
||||
|
||||
/**
|
||||
* soapRequest
|
||||
*
|
||||
@@ -884,7 +862,6 @@ class Zimbra
|
||||
|
||||
// end soapRequest
|
||||
|
||||
|
||||
/**
|
||||
* getNumSOAPCalls
|
||||
*
|
||||
@@ -901,7 +878,6 @@ class Zimbra
|
||||
|
||||
// end getNumSOAPCalls
|
||||
|
||||
|
||||
/**
|
||||
* makeXMLTree
|
||||
*
|
||||
@@ -961,7 +937,6 @@ class Zimbra
|
||||
|
||||
// end makeXMLTree
|
||||
|
||||
|
||||
/**
|
||||
* &composeArray
|
||||
*
|
||||
@@ -994,7 +969,6 @@ class Zimbra
|
||||
|
||||
// end composeArray
|
||||
|
||||
|
||||
/**
|
||||
* noop
|
||||
*
|
||||
@@ -1089,7 +1063,6 @@ class Zimbra
|
||||
|
||||
// end addAppointments
|
||||
|
||||
|
||||
/**
|
||||
* addTask
|
||||
*
|
||||
@@ -1152,7 +1125,6 @@ class Zimbra
|
||||
|
||||
// end addTask
|
||||
|
||||
|
||||
/**
|
||||
* addContacts
|
||||
*
|
||||
@@ -1211,7 +1183,6 @@ class Zimbra
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public function addFolder($serializeOp1)
|
||||
{
|
||||
$unserializeOp1 = unserialize($serializeOp1);
|
||||
@@ -1249,7 +1220,6 @@ class Zimbra
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public function upload($folderId, $UploadId, $fileVersion = '', $docId = '')
|
||||
{
|
||||
if ($fileVersion == '' && $docId == '') {
|
||||
@@ -1280,7 +1250,6 @@ class Zimbra
|
||||
|
||||
// end uploadDocument
|
||||
|
||||
|
||||
/**
|
||||
* getDocId
|
||||
*
|
||||
@@ -1321,7 +1290,6 @@ class Zimbra
|
||||
// I don't know how to make usort calls to internal OO functions
|
||||
// if someone knows how, please fix this :)
|
||||
|
||||
|
||||
/**
|
||||
* zimbra_startSort
|
||||
*
|
||||
|
||||
@@ -14,20 +14,20 @@ class wscaller
|
||||
private $auth;
|
||||
private $clientStream;
|
||||
|
||||
function setAuthUser ($auth)
|
||||
public function setAuthUser($auth)
|
||||
{
|
||||
//print "<br>- auth Setup";
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
function setwsdlurl ($wsdl)
|
||||
public function setwsdlurl($wsdl)
|
||||
{
|
||||
//print "<br>- wsdl Setup";
|
||||
$this->wsdlurl = $wsdl;
|
||||
//var_dump($wsdl);
|
||||
}
|
||||
|
||||
function loadSOAPClient ()
|
||||
public function loadSOAPClient()
|
||||
{
|
||||
try {
|
||||
// we unregister the current HTTP wrapper
|
||||
@@ -38,8 +38,7 @@ class wscaller
|
||||
stream_wrapper_register('http', 'PMServiceProviderNTLMStream') or die("Failed to register protocol");
|
||||
|
||||
// $this->client = new PMServiceNTLMSoapClient($this->wsdlurl, array('trace' => 1, 'auth' => $this->auth));// Hugo's code
|
||||
$this->client = new PMServiceNTLMSoapClient( $this->wsdlurl, array ('trace' => 1
|
||||
) ); // Ankit's Code
|
||||
$this->client = new PMServiceNTLMSoapClient($this->wsdlurl, array('trace' => 1)); // Ankit's Code
|
||||
$this->client->setAuthClient($this->auth);
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
@@ -48,7 +47,7 @@ class wscaller
|
||||
}
|
||||
}
|
||||
|
||||
function callWsMethod ($methodName, $paramArray)
|
||||
public function callWsMethod($methodName, $paramArray)
|
||||
{
|
||||
|
||||
try {
|
||||
@@ -71,7 +70,6 @@ class wscaller
|
||||
|
||||
class DestinationUrlCollection
|
||||
{
|
||||
|
||||
public $string;
|
||||
}
|
||||
|
||||
@@ -88,7 +86,8 @@ class FieldInformationCollection
|
||||
|
||||
class pmTrSharepointClass
|
||||
{
|
||||
function __construct ($server, $auth)
|
||||
|
||||
public function __construct($server, $auth)
|
||||
{
|
||||
set_include_path(PATH_PLUGINS . 'pmTrSharepoint' . PATH_SEPARATOR . get_include_path());
|
||||
$this->server = $server;
|
||||
@@ -97,15 +96,14 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->setAuthUser($this->auth);
|
||||
}
|
||||
|
||||
function createDWS ($name, $users, $title, $documents)
|
||||
public function createDWS($name, $users, $title, $documents)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . "/_vti_bin/Dws.asmx?WSDL");
|
||||
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$paramArray = array ('name' => '','users' => '','title' => $name,'documents' => ''
|
||||
);
|
||||
$paramArray = array('name' => '', 'users' => '', 'title' => $name, 'documents' => '');
|
||||
|
||||
$methodName = 'CreateDws';
|
||||
|
||||
@@ -127,7 +125,7 @@ class pmTrSharepointClass
|
||||
return $result; */
|
||||
}
|
||||
|
||||
function deleteDWS ($dwsname)
|
||||
public function deleteDWS($dwsname)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$url = $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL";
|
||||
@@ -139,10 +137,9 @@ class pmTrSharepointClass
|
||||
$result = $this->dwsObj->callWsMethod($methodName, $paramArray = null);
|
||||
var_dump($result);
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
function createFolderDWS ($dwsname, $dwsFolderName)
|
||||
public function createFolderDWS($dwsname, $dwsFolderName)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL");
|
||||
@@ -150,8 +147,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$url = "Shared Documents/$dwsFolderName";
|
||||
$paramArray = array ('url' => $url
|
||||
);
|
||||
$paramArray = array('url' => $url);
|
||||
|
||||
# $paramArray = array('name' => '', 'users' => '', 'title' => $name, 'documents' => '');
|
||||
|
||||
@@ -163,7 +159,7 @@ class pmTrSharepointClass
|
||||
return $result;
|
||||
}
|
||||
|
||||
function deleteFolderDWS ($dwsname, $folderName)
|
||||
public function deleteFolderDWS($dwsname, $folderName)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL");
|
||||
@@ -171,8 +167,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$url = "Shared Documents/$folderName";
|
||||
$paramArray = array ('url' => $url
|
||||
);
|
||||
$paramArray = array('url' => $url);
|
||||
|
||||
# $paramArray = array('name' => '', 'users' => '', 'title' => $name, 'documents' => '');
|
||||
|
||||
@@ -184,15 +179,14 @@ class pmTrSharepointClass
|
||||
return $result;
|
||||
}
|
||||
|
||||
function findDWSdoc ($dwsname, $guid)
|
||||
public function findDWSdoc($dwsname, $guid)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . $dwsName . "/_vti_bin/Dws.asmx?WSDL");
|
||||
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$paramArray = array ('id' => '$guid'
|
||||
);
|
||||
$paramArray = array('id' => '$guid');
|
||||
|
||||
$methodName = 'FindDwsDoc';
|
||||
|
||||
@@ -200,15 +194,14 @@ class pmTrSharepointClass
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function getDWSData ($newFileName, $dwsname, $lastUpdate)
|
||||
public function getDWSData($newFileName, $dwsname, $lastUpdate)
|
||||
{
|
||||
//print "<br>- Method getDWSData<br />";
|
||||
$url = $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL";
|
||||
$this->dwsObj->setwsdlurl($url);
|
||||
if ($this->dwsObj->loadSOAPClient()) {
|
||||
$doc = "Shared Documents";
|
||||
$paramArray = array ('document' => '','lastUpdate' => ''
|
||||
);
|
||||
$paramArray = array('document' => '', 'lastUpdate' => '');
|
||||
$methodName = 'GetDwsData';
|
||||
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
|
||||
var_dump($result);
|
||||
@@ -223,7 +216,7 @@ class pmTrSharepointClass
|
||||
}
|
||||
}
|
||||
|
||||
function uploadDocumentDWS ($dwsname, $folderName, $sourceUrl, $filename)
|
||||
public function uploadDocumentDWS($dwsname, $folderName, $sourceUrl, $filename)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$url = $this->server . "/" . $dwsname . "/_vti_bin/Copy.asmx?WSDL";
|
||||
@@ -263,7 +256,7 @@ class pmTrSharepointClass
|
||||
}
|
||||
}
|
||||
|
||||
function getDWSMetaData ($newFileName, $dwsname, $id)
|
||||
public function getDWSMetaData($newFileName, $dwsname, $id)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$url = $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL";
|
||||
@@ -272,8 +265,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$doc = "Shared Documents/$newFileName";
|
||||
$paramArray = array ('document' => $doc,'id' => '','minimal' => false
|
||||
);
|
||||
$paramArray = array('document' => $doc, 'id' => '', 'minimal' => false);
|
||||
|
||||
$methodName = 'GetDwsMetaData';
|
||||
|
||||
@@ -289,7 +281,7 @@ class pmTrSharepointClass
|
||||
}
|
||||
}
|
||||
|
||||
function getDWSDocumentVersions ($newFileName, $dwsname)
|
||||
public function getDWSDocumentVersions($newFileName, $dwsname)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL");
|
||||
@@ -297,8 +289,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$doc = "Shared Documents/$newFileName";
|
||||
$paramArray = array ('fileName' => $doc
|
||||
);
|
||||
$paramArray = array('fileName' => $doc);
|
||||
|
||||
$methodName = 'GetVersions';
|
||||
|
||||
@@ -307,7 +298,7 @@ class pmTrSharepointClass
|
||||
return $result;
|
||||
}
|
||||
|
||||
function deleteDWSDocVersion ($newFileName, $dwsname, $versionNum)
|
||||
public function deleteDWSDocVersion($newFileName, $dwsname, $versionNum)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL");
|
||||
@@ -315,8 +306,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$doc = "Shared Documents/$newFileName";
|
||||
$paramArray = array ('fileName' => $doc,'fileVersion' => $versionNum
|
||||
);
|
||||
$paramArray = array('fileName' => $doc, 'fileVersion' => $versionNum);
|
||||
|
||||
$methodName = 'DeleteVersion';
|
||||
|
||||
@@ -343,7 +333,7 @@ class pmTrSharepointClass
|
||||
}
|
||||
}
|
||||
|
||||
function deleteAllDWSDocVersion ($newFileName, $dwsname)
|
||||
public function deleteAllDWSDocVersion($newFileName, $dwsname)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL");
|
||||
@@ -351,8 +341,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$doc = "Shared Documents/$newFileName";
|
||||
$paramArray = array ('fileName' => $doc
|
||||
);
|
||||
$paramArray = array('fileName' => $doc);
|
||||
|
||||
$methodName = 'DeleteAllVersions';
|
||||
|
||||
@@ -368,7 +357,7 @@ class pmTrSharepointClass
|
||||
}
|
||||
}
|
||||
|
||||
function getDWSFolderItems ($dwsname, $strFolderUrl)
|
||||
public function getDWSFolderItems($dwsname, $strFolderUrl)
|
||||
{
|
||||
$pmTrSharepointClassObj = new pmTrSharepointClass();
|
||||
//print "<br>- Method getDWSFolderItems";
|
||||
@@ -378,8 +367,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
#$doc = "Shared Documents/$newFileName";
|
||||
$paramArray = array ('strFolderUrl' => $strFolderUrl
|
||||
);
|
||||
$paramArray = array('strFolderUrl' => $strFolderUrl);
|
||||
|
||||
$methodName = 'EnumerateFolder';
|
||||
|
||||
@@ -408,7 +396,7 @@ class pmTrSharepointClass
|
||||
return "There is some error";
|
||||
}
|
||||
|
||||
function downloadDocumentDWS ($dwsname, $fileName, $fileLocation)
|
||||
public function downloadDocumentDWS($dwsname, $fileName, $fileLocation)
|
||||
{
|
||||
//print "<br>- Method createDWS";
|
||||
$url = $this->server . "/" . $dwsname . "/_vti_bin/Copy.asmx?WSDL";
|
||||
@@ -417,8 +405,7 @@ class pmTrSharepointClass
|
||||
$this->dwsObj->loadSOAPClient();
|
||||
|
||||
$CompleteUrl = $this->server . "/" . $dwsname . "/Shared Documents/" . $fileName;
|
||||
$paramArray = array ('Url' => $CompleteUrl
|
||||
);
|
||||
$paramArray = array('Url' => $CompleteUrl);
|
||||
|
||||
$methodName = 'GetItem';
|
||||
|
||||
@@ -437,7 +424,7 @@ class pmTrSharepointClass
|
||||
return $content;
|
||||
}
|
||||
|
||||
function getFolderUrlContent ($newResult)
|
||||
public function getFolderUrlContent($newResult)
|
||||
{
|
||||
$needleStart = '/';
|
||||
$needleCount = substr_count($newResult, $needleStart);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* clases_Test.php
|
||||
*
|
||||
@@ -22,7 +23,6 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
G::LoadClass("derivation");
|
||||
|
||||
$dbc = new DBConnection;
|
||||
@@ -47,7 +47,6 @@
|
||||
*/
|
||||
/* CREANDO UN NUEVO CASO END */
|
||||
/** Application */
|
||||
|
||||
//$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
/* $frm['APP_PARENT'] ='135165FDS54654FD';
|
||||
$frm['PRO_UID'] ='SSDDSFSE32DD23S';
|
||||
@@ -88,7 +87,7 @@
|
||||
$frm['PRO_UID']='746B67A9CC9A0E';
|
||||
//$frm['TAS_TYPE'] ='332';
|
||||
$frm['TAS_TITLE'] ='titulito MAUI13ss';
|
||||
$frm['TAS_DESCRIPTION'] ='Descripci<63>n MAUI13';
|
||||
$frm['TAS_DESCRIPTION'] ='Descripci<63>n MAUI13';
|
||||
$frm['TAS_DEF_TITLE'] = "13";
|
||||
$frm['TAS_DEF_DESCRIPTION'] = "23";
|
||||
$frm['TAS_DEF_PROC_CODE'] = "33";
|
||||
@@ -120,13 +119,12 @@
|
||||
$frm['PRO_PARENT']='746B67A9CC9ADDDDDDDD0E'; */
|
||||
|
||||
/** END PROCESS */
|
||||
|
||||
/* MESSAGE */
|
||||
/*
|
||||
$frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['MESS_UID'] = '146CDAC097D35A';
|
||||
$frm['MESS_TYPE'] = 'HTMLS';
|
||||
$frm['MESS_TITLE'] = 't<>tulo del mensaje';
|
||||
$frm['MESS_TITLE'] = 't<>tulo del mensaje';
|
||||
$frm['MESS_DESCRIPTION'] = 'estimado SrS.';
|
||||
|
||||
/** END MESSAGE */
|
||||
@@ -139,9 +137,7 @@
|
||||
$frm['STEP_UID_OBJ'] = 'estimado SrS.';
|
||||
*/
|
||||
/** END MESSAGE */
|
||||
|
||||
/** Delegation */
|
||||
|
||||
//$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
/* $frm['APP_UID'] ='135165FDS54654FD';
|
||||
$frm['APP_PARENT'] ='135165FDS54654FD';
|
||||
@@ -160,4 +156,4 @@
|
||||
|
||||
die("eliminado YA - ".$prouid);
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* methodsPermissions.php
|
||||
*
|
||||
@@ -21,7 +22,6 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('view', 'tools/methodsPermissions');
|
||||
|
||||
|
||||
@@ -39,17 +39,11 @@
|
||||
selectPermissions('Set Permission', 'setDirPermission("' . $path . '",this);') .
|
||||
selectPermissions('Remove Permission', 'removeDirPermission("' . $path . '",this);');
|
||||
$tree->contracted = true;
|
||||
foreach(glob($path.'*',GLOB_MARK) as $file)
|
||||
{
|
||||
if (is_dir($file))
|
||||
{
|
||||
foreach (glob($path . '*', GLOB_MARK) as $file) {
|
||||
if (is_dir($file)) {
|
||||
reView($file, $tree->addChild($file, $file));
|
||||
}
|
||||
elseif (substr($file,-4,4)==='.php')
|
||||
{
|
||||
$nodeFile=&$tree->addChild
|
||||
(
|
||||
$file, $file . ' '.
|
||||
} elseif (substr($file, -4, 4) === '.php') {
|
||||
$nodeFile = &$tree->addChild($file, $file . ' ' .
|
||||
selectPermissions('Set Permission', 'setPermission("' . $file . '",this);') .
|
||||
selectPermissions('Remove Permission', 'removePermission("' . $file . '",this);')
|
||||
);
|
||||
@@ -59,6 +53,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selectPermissions($label, $onchange)
|
||||
{
|
||||
return '<select onchange="' . htmlentities($onchange, ENT_QUOTES, 'UTF-8') . '">' .
|
||||
@@ -70,6 +65,7 @@
|
||||
'<option value="PM_SETUP">PM_SETUP</option>' .
|
||||
'</select>';
|
||||
}
|
||||
|
||||
function setHeader($label, $onchange)
|
||||
{
|
||||
return '<input type="button" onclick="' . htmlentities($onchange, ENT_QUOTES, 'UTF-8') . '" value="set header"/>';
|
||||
|
||||
Reference in New Issue
Block a user