CODE STYLE, workflow/engine/methods/services/

FILES:
cases_StartExternal.php
demoSoap.php
login_getStarted.php
processHeartBeat_Ajax.php
soap.php
soap2.php
unavailableService.php
upload.php
webdav.php
wsdl.php
wsdl2.php
wso2.php
xpdl.php
This commit is contained in:
jennylee
2012-10-17 14:21:55 -04:00
parent 9b55347f30
commit 665fd4d25d
13 changed files with 1528 additions and 1497 deletions

View File

@@ -15,7 +15,6 @@
$oCase = new Cases();
$aData = $oCase->startCase( $_POST['TASKS'], $deriva['USR_UID'] );
$case = $oCase->loadCase( $aData['APPLICATION'], 1 );
$Fields = array ();
@@ -28,39 +27,31 @@
$oCase->updateCase( $aData['APPLICATION'], $Fields );
$s = 0;
if(isset($_SERVER['HTTP_REFERER']))
{
if (isset( $_SERVER['HTTP_REFERER'] )) {
$dir = explode( '?', $_SERVER['HTTP_REFERER'] );
if($dir[1]=='__flag__=1')
{ $s=1;
}
else
{
if ($dir[1] == '__flag__=1') {
$s = 1;
} else {
$dire = explode( '&', $dir[1] );
for($i=0; $i<=count($dire); $i++)
{
for ($i = 0; $i <= count( $dire ); $i ++) {
if ($dire[$i] == '__flag__=1')
$s = 1;
}
}
//if(strpos($_SERVER['HTTP_REFERER'],'?') !== false)
if($s==1)
{ G::header('location: ' . $_SERVER['HTTP_REFERER']);
if ($s == 1) {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
} else {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] . '?__flag__=1' );
}
else
{ G::header('location: ' . $_SERVER['HTTP_REFERER'] . '?__flag__=1');
}
}
else
} else
echo G::LoadTranslation( 'ID_REQUEST_SENT' );
}
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' );
}
?>

View File

@@ -8,21 +8,26 @@ ul.krumo-node {
padding: 0px;
background-color: white;
}
ul.krumo-node ul {
margin-left: 20px;
}
* html ul.krumo-node ul {
margin-left: 24px;
}
div.krumo-root {
border: solid 1px black;
margin: 1em 0em;
text-align: left;
}
ul.krumo-first {
font: normal 11px tahoma, verdana;
border: solid 1px white;
}
li.krumo-child {
display: block;
list-style: none;
@@ -30,22 +35,24 @@ li.krumo-child {
margin: 0px;
overflow: hidden;
}
div.krumo-element {
cursor: default;
display: block;
clear: both;
white-space: nowrap;
background-color: white;
background-image: url(/Krumo/skins/schablon.com/empty.gif);
background-repeat: no-repeat;
background-position: 6px 5px;
padding: 2px 0px 3px 20px;
}
* html div.krumo-element {
padding-bottom: 3px;
line-height: 13px;
}
a.krumo-name {
color: navy;
font: bold 13px courier new;
@@ -67,8 +74,8 @@ a.krumo-name {
<ul class="krumo-node krumo-first">
<div class="krumo-element">
End Point <input type="text" size="80" maxlength="160" name="epr"
value="<?php echo $endpoint ?>" >
<input type="submit" value="change endpoint" name="action">
value="<?php echo $endpoint ?>"> <input type="submit"
value="change endpoint" name="action">
</div>
</ul>
</div>
@@ -79,9 +86,10 @@ a.krumo-name {
<a class="krumo-name">login</a>
<ul class="krumo-node krumo-first">
<div>
User Id <input type="text" size="16" maxlength="20" name="user" value="admin">
Password <input type="text" size="16" maxlength="20" name="pass" value="sample">
<input type="submit" value="login" name="action">
User Id <input type="text" size="16" maxlength="20" name="user"
value="admin"> Password <input type="text" size="16" maxlength="20"
name="pass" value="sample"> <input type="submit" value="login"
name="action">
</div>
</ul>
</div>
@@ -92,20 +100,21 @@ a.krumo-name {
<a class="krumo-name">createUser</a>
<ul class="krumo-node krumo-first">
<div class="krumo-element">
Session Id <input type="text" size="36" maxlength="32" name="sessionid" value="<?php print $sessionId ?>">
Session Id <input type="text" size="36" maxlength="32"
name="sessionid" value="<?php print $sessionId ?>">
</div>
<div class="krumo-element">
User Id <input type="text" size="16" maxlength="20" name="userid" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
First Name <input type="text" size="16" maxlength="20" name="firstname" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
Last Name <input type="text" size="16" maxlength="20" name="lastname" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
Email <input type="text" size="16" maxlength="20" name="email" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
Role <input type="text" size="16" maxlength="20" name="role" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
<input type="submit" value="createUser" name="action">
User Id <input type="text" size="16" maxlength="20" name="userid"
value=""> <img src="/Krumo/skins/schablon.com/empty.gif"> First
Name <input type="text" size="16" maxlength="20" name="firstname"
value=""> <img src="/Krumo/skins/schablon.com/empty.gif"> Last Name
<input type="text" size="16" maxlength="20" name="lastname" value="">
<img src="/Krumo/skins/schablon.com/empty.gif"> Email <input
type="text" size="16" maxlength="20" name="email" value=""> <img
src="/Krumo/skins/schablon.com/empty.gif"> Role <input type="text"
size="16" maxlength="20" name="role" value=""> <img
src="/Krumo/skins/schablon.com/empty.gif"> <input type="submit"
value="createUser" name="action">
</div>
</ul>
</div>
@@ -116,12 +125,13 @@ a.krumo-name {
<a class="krumo-name">assignUserToGroup</a>
<ul class="krumo-node krumo-first">
<div class="krumo-element">
Session Id <input type="text" size="36" maxlength="32" name="sessionid" value="<?php print $sessionId ?>">
Session Id <input type="text" size="36" maxlength="32"
name="sessionid" value="<?php print $sessionId ?>">
</div>
<div class="krumo-element">
User Id <input type="text" size="16" maxlength="20" name="userid" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
Group Id <input type="text" size="16" maxlength="20" name="groupid" value="">
User Id <input type="text" size="16" maxlength="20" name="userid"
value=""> <img src="/Krumo/skins/schablon.com/empty.gif"> Group Id
<input type="text" size="16" maxlength="20" name="groupid" value="">
<input type="submit" value="assignUserToGroup" name="action">
</div>
</ul>
@@ -134,13 +144,15 @@ a.krumo-name {
<a class="krumo-name">newCase</a>
<ul class="krumo-node krumo-first">
<div class="krumo-element">
Session Id <input type="text" size="36" maxlength="32" name="sessionid" value="<?php print $sessionId ?>">
Session Id <input type="text" size="36" maxlength="32"
name="sessionid" value="<?php print $sessionId ?>">
</div>
<div class="krumo-element">
Process Id <input type="text" size="16" maxlength="20" name="processid" value="">
<img src="/Krumo/skins/schablon.com/empty.gif" >
Variables <input type="text" size="16" maxlength="20" name="variables" value="">
<input type="submit" value="newCase" name="action">
Process Id <input type="text" size="16" maxlength="20"
name="processid" value=""> <img
src="/Krumo/skins/schablon.com/empty.gif"> Variables <input
type="text" size="16" maxlength="20" name="variables" value=""> <input
type="submit" value="newCase" name="action">
</div>
</ul>
</div>
@@ -149,29 +161,29 @@ a.krumo-name {
<?php
if (! isset( $_POST["action"] ) or $_POST["action"] == 'change endpoint') {
die;
die();
}
$action = $_POST["action"];
//krumo ($_POST);
ini_set( "soap.wsdl_cache_enabled", "0" ); // disabling WSDL cache
switch ($action) {
case 'login':
$user = $_POST["user"];
$pass = md5( $_POST["pass"] );
$wsdl = $endpoint;
//$client = new SoapClient( $endpoint );
$client = new SoapClient( null, array(
'location' => $endpoint,
'uri' => 'http://www.sugarcrm.com/sugarcrm',
'soap_version' => SOAP_1_1, //SOAP_1_2 - 1.2 not supported by sugar nusoap
'trace' => 1,
'exceptions' => 0,
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5 ) );
$client = new SoapClient( null, array ('location' => $endpoint,'uri' => 'http://www.sugarcrm.com/sugarcrm','soap_version' => SOAP_1_1, //SOAP_1_2 - 1.2 not supported by sugar nusoap
'trace' => 1,'exceptions' => 0,'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5
) );
$params = array('user_name'=>$user, 'password'=>$pass , 'version'=>'1' );
$result = $client->__SoapCall('login', array('user_auth'=>$params, 'application_name'=>'ProcessMaker'));
$params = array ('user_name' => $user,'password' => $pass,'version' => '1'
);
$result = $client->__SoapCall( 'login', array ('user_auth' => $params,'application_name' => 'ProcessMaker'
) );
if ($result->error->number == 0) {
$_SESSION['SESSION_ID'] = $result->id;
$session = $result->id;
@@ -179,10 +191,12 @@ a.krumo-name {
$res = $client->__getFunctions();
krumo( $res );
$params = array('session'=>$result->id);
$res = $client->__SoapCall('is_user_admin', array($session) );
if ( $res == 1 ) print "is Administrator user";
$params = array ('session' => $result->id
);
$res = $client->__SoapCall( 'is_user_admin', array ($session
) );
if ($res == 1)
print "is Administrator user";
$first_name = 'juan';
$last_name = 'perez';
@@ -191,19 +205,19 @@ a.krumo-name {
$companyname = 'ABC company';
$prod_desc = 'descripcion del prod 1 ';
$user_guid = '';
$set_entry_params = array(
'session' => $session,
'module_name' => 'Leads',
'name_value_list'=>array(
array('name'=>'last_name', 'value'=> $last_name ),
array('name'=>'status', 'value'=> 'New' ),
array('name'=>'phone_work', 'value'=> $phone ),
array('name'=>'phone_fax', 'value'=> $fax ),
array('name'=>'account_name', 'value'=> $companyname ),
array('name'=>'lead_source', 'value'=> 'Web Site' ),
array('name'=>'description', 'value'=> $prod_desc ),
array('name'=>'email1', 'value'=> 'juan@colosa.com' ),
array('name'=>'assigned_user_id', 'value'=> $user_guid )));
$set_entry_params = array ('session' => $session,'module_name' => 'Leads',
'name_value_list' => array (array ('name' => 'last_name','value' => $last_name
),array ('name' => 'status','value' => 'New'
),array ('name' => 'phone_work','value' => $phone
),array ('name' => 'phone_fax','value' => $fax
),array ('name' => 'account_name','value' => $companyname
),array ('name' => 'lead_source','value' => 'Web Site'
),array ('name' => 'description','value' => $prod_desc
),array ('name' => 'email1','value' => 'juan@colosa.com'
),array ('name' => 'assigned_user_id','value' => $user_guid
)
)
);
$res = $client->__SoapCall( 'set_entry', $set_entry_params );
krumo( $res );
@@ -211,8 +225,10 @@ a.krumo-name {
//$orderby = 'email1 desc ';
$query = '';
$orderby = '';
$fields = array('id','first_name','last_name','account_name','account_id','email1','phone_work' );
$params = array($session, 'Leads', $query, $orderby, 0, $fields, 100, false );
$fields = array ('id','first_name','last_name','account_name','account_id','email1','phone_work'
);
$params = array ($session,'Leads',$query,$orderby,0,$fields,100,false
);
$res = $client->__SoapCall( 'get_entry_list', $params );
krumo( $res );
}
@@ -221,14 +237,17 @@ a.krumo-name {
$wsdl = PATH_METHODS . "services" . PATH_SEP . "pmos.wsdl";
$endpoint = $wsdl;
$client = new SoapClient( $endpoint );
$params = array('sessionId'=> $sessionId );
$result = $client->__SoapCall('processesList', array($params));
$params = array ('sessionId' => $sessionId
);
$result = $client->__SoapCall( 'processesList', array ($params
) );
krumo( $result );
die;
die();
break;
default:
krumo ( $_POST );die;
krumo( $_POST );
die();
}
?>
@@ -236,23 +255,19 @@ a.krumo-name {
<ul class="krumo-node krumo-first">
<li class="krumo-child">
<div class="krumo-element">
status_code
(<em class="krumo-type">Integer</em>)
<strong class="krumo-integer"><?php echo $result->error->number ?></strong>
status_code (<em class="krumo-type">Integer</em>) <strong
class="krumo-integer"><?php echo $result->error->number ?></strong>
</div>
<div class="krumo-element">
message
(<em class="krumo-type">string</em>)
<strong class="krumo-integer"><?php echo $result->error->name ?></strong>
message (<em class="krumo-type">string</em>) <strong
class="krumo-integer"><?php echo $result->error->name ?></strong>
</div>
<div class="krumo-element">
timestamp
(<em class="krumo-type">string</em>)
<strong class="krumo-integer"><?php echo $result->error->description ?></strong>
timestamp (<em class="krumo-type">string</em>) <strong
class="krumo-integer"><?php echo $result->error->description ?></strong>
</div>
</li>
</ul>
</div>

View File

@@ -20,9 +20,8 @@
*
* 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 = new Publisher();
$oTemplatePower = new TemplatePower( PATH_TPL . 'services/login_getStarted.html' );
$oTemplatePower->prepare();
/*
@@ -34,4 +33,3 @@ $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
G::RenderPage( 'publish', 'raw' );
?>

View File

@@ -24,7 +24,8 @@ switch ($request) {
break;
}
function validateConnectivity($url){
function validateConnectivity ($url)
{
ini_set( 'allow_url_fopen', 1 );
$sContent = file_get_conditional_contents( $url );
$sw_connect = true;
@@ -34,8 +35,9 @@ function validateConnectivity($url){
}
return $sw_connect;
}
function file_get_conditional_contents($szURL){
function file_get_conditional_contents ($szURL)
{
$pCurl = curl_init();
curl_setopt( $pCurl, CURLOPT_URL, $szURL );
@@ -64,7 +66,8 @@ function file_get_conditional_contents($szURL){
if ($sysConf['proxy_user'] != '') {
curl_setopt( $pCurl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
}
curl_setopt($pCurl, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt( $pCurl, CURLOPT_HTTPHEADER, array ('Expect:'
) );
}
$szContents = curl_exec( $pCurl );
@@ -75,15 +78,15 @@ function file_get_conditional_contents($szURL){
$header = substr( $szContents, 0, $headers['header_size'] );
$content = substr( $szContents, $headers['header_size'] );
if($aInfo['http_code'] === 200)
{
if ($aInfo['http_code'] === 200) {
return $content;
}
return false;
}
function buildData(){
function buildData ()
{
require_once ("classes/model/Users.php");
G::LoadClass( "serverConfiguration" );
@@ -145,8 +148,7 @@ function buildData(){
if (file_exists( PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION" )) {
$ee = trim( file_get_contents( PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION" ) );
}
else {
} else {
$pluginRegistry = &PMPluginRegistry::getSingleton();
$details = $pluginRegistry->getPluginDetails( "enterprise.php" );
@@ -166,7 +168,8 @@ function buildData(){
if (file_exists( PATH_DATA_SITE . "ee" )) {
$arrayAddon = unserialize( trim( file_get_contents( PATH_DATA_SITE . "ee" ) ) );
$arrayAddon["enterprise"] = array("sFilename" => "enterprise-1.tar");
$arrayAddon["enterprise"] = array ("sFilename" => "enterprise-1.tar"
);
}
foreach ($arrayAddon as $addon) {
@@ -229,7 +232,9 @@ function buildData(){
///////
return $params;
}
function postHeartBeat($params) {
function postHeartBeat ($params)
{
if (is_array( $params )) {
//No matter what happens with the result let's set the nextBeat to 2 hours from now
G::LoadClass( 'serverConfiguration' );
@@ -266,7 +271,8 @@ function buildData(){
if ($sysConf['proxy_user'] != '') {
curl_setopt( $ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
}
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt( $ch, CURLOPT_HTTPHEADER, array ('Expect:'
) );
}
$response = curl_exec( $ch );
@@ -282,9 +288,11 @@ function buildData(){
$oServerConf->setHeartbeatProperty( 'HB_NEXT_BEAT_DATE', strtotime( "+7 day" ), 'HEART_BEAT_CONF' );
//Reset Errors
} else {
//Catch the error
$oServerConf->setHeartbeatProperty( 'HB_NEXT_BEAT_DATE', strtotime( "+1 day" ), 'HEART_BEAT_CONF' );
}
@@ -330,3 +338,4 @@ function buildData(){
$this->saveSingleton ();
*/
}

View File

@@ -1,6 +1,7 @@
<?php
ini_set( "soap.wsdl_cache_enabled", "0" ); // disabling WSDL cache
$wsdl = PATH_METHODS . "services" . PATH_SEP . "pmos.wsdl";
require_once ("classes/model/Application.php");
@@ -23,14 +24,16 @@
require_once ("classes/model/Session.php");
require_once ("classes/model/Content.php");
function login( $params ) {
function login ($params)
{
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->login( $params->userid, $params->password );
return $res->getPayloadArray();
}
function ProcessList( $params ) {
function ProcessList ($params)
{
$x = ifPermission( $params->sessionId, 'PM_FACTORY' );
//if you are not an admin user, then this function will return only
//your valid process
@@ -49,42 +52,47 @@
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->processList();
return array("processes" => $res );
return array ("processes" => $res
);
}
function RoleList( $params ) {
$x = ifPermission( $params->sessionId, 'PM_USERS');
if($x==0)
function RoleList ($params)
{
$result[] = array ( 'guid' => 24, 'name' => 'You do not have privileges' );
$x = ifPermission( $params->sessionId, 'PM_USERS' );
if ($x == 0) {
$result[] = array ('guid' => 24,'name' => 'You do not have privileges'
);
return $result;
}
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->roleList();
return array("roles" => $res );
return array ("roles" => $res
);
}
function GroupList( $params ) {
$x = ifPermission( $params->sessionId, 'PM_USERS');
if($x==0)
function GroupList ($params)
{
$result[] = array ( 'guid' => 24, 'name' => 'You do not have privileges' );
$x = ifPermission( $params->sessionId, 'PM_USERS' );
if ($x == 0) {
$result[] = array ('guid' => 24,'name' => 'You do not have privileges'
);
return $result;
}
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->groupList();
return array("groups" => $res );
return array ("groups" => $res
);
}
function CaseList( $params ) {
function CaseList ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{
if ($x == 0) {
G::LoadClass( 'wsResponse' );
return new wsResponse( 9, 'Session expired' );
}
@@ -97,48 +105,47 @@
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->caseList( $userId );
return array("cases" => $res );
return array ("cases" => $res
);
}
function UserList( $params ) {
$x = ifPermission( $params->sessionId, 'PM_USERS');
if($x==0)
function UserList ($params)
{
$result[] = array ( 'guid' => 24, 'name' => 'You do not have privileges' );
$x = ifPermission( $params->sessionId, 'PM_USERS' );
if ($x == 0) {
$result[] = array ('guid' => 24,'name' => 'You do not have privileges'
);
return $result;
}
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->userList();
return array("users" => $res );
return array ("users" => $res
);
}
function SendMessage( $params ) {
function SendMessage ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->sendMessage( $params->caseId,
$params->from,
$params->to,
$params->cc,
$params->bcc,
$params->subject,
$params->template);
$res = $ws->sendMessage( $params->caseId, $params->from, $params->to, $params->cc, $params->bcc, $params->subject, $params->template );
return $res->getPayloadArray();
}
function getCaseInfo( $params ) {
function getCaseInfo ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -148,11 +155,12 @@
return $res;
}
function SendVariables( $params ) {
function SendVariables ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -175,11 +183,12 @@
return $res->getPayloadArray();
}
function GetVariables( $params ) {
function GetVariables ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -188,14 +197,16 @@
$ws = new wsBase();
$res = $ws->getVariables( $params->caseId, $params->variables );
return array("variables" => $res );
return array ("variables" => $res
);
}
function DerivateCase( $params ) {
function DerivateCase ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -211,11 +222,12 @@
//return $res->getPayloadArray ( );
}
function executeTrigger ( $params ) {
function executeTrigger ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -230,11 +242,12 @@
return $res->getPayloadArray();
}
function NewCaseImpersonate( $params ) {
function NewCaseImpersonate ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -251,13 +264,13 @@
return $res->getPayloadArray();
}
function NewCase( $params ) {
function NewCase ($params)
{
G::LoadClass( 'wsBase' );
G::LoadClass( 'sessions' );
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
@@ -271,8 +284,7 @@
if (! isset( $params->variables )) {
$variables = array ();
$Fields = array ();
}
else {
} else {
if (is_object( $variables )) {
/*foreach ( $variables as $key=>$val ) {
$name = $val->name;
@@ -286,12 +298,9 @@
foreach ($variables as $key => $val) {
$name = $val->name;
$value = $val->value;
if (!is_object($val->value))
{
if (! is_object( $val->value )) {
eval( '$Fields[ ' . $val->name . ' ]= $val->value ;' );
}
else
{
} else {
if (is_array( $val->value->item )) {
$i = 1;
foreach ($val->value->item as $key1 => $val1) {
@@ -318,19 +327,20 @@
return $res;
}
function AssignUserToGroup( $params ) {
function AssignUserToGroup ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_USERS' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
G::LoadClass( 'sessions' );
$sessions = new Sessions;
$sessions = new Sessions();
$user = $sessions->getSessionUser( $params->sessionId );
if(!is_array($user))
{ G::LoadClass('wsResponse');
if (! is_array( $user )) {
G::LoadClass( 'wsResponse' );
return new wsResponse( 3, 'User not registered in the system' );
}
@@ -340,11 +350,12 @@
return $res->getPayloadArray();
}
function CreateUser( $params ) {
function CreateUser ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_USERS' );
if($x==0)
{ G::LoadClass('wsResponse');
if ($x == 0) {
G::LoadClass( 'wsResponse' );
$result = new wsResponse( 24, "You do not have privileges" );
return $result;
}
@@ -354,11 +365,12 @@
return $res->getPayloadArray();
}
function TaskList( $params ) {
$x = ifPermission( $params->sessionId, 'PM_CASES');
if($x==0)
function TaskList ($params)
{
$result[] = array ( 'guid' => 24, 'name' => 'You do not have privileges' );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if ($x == 0) {
$result[] = array ('guid' => 24,'name' => 'You do not have privileges'
);
return $result;
}
G::LoadClass( 'wsBase' );
@@ -368,24 +380,28 @@
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
$res = $ws->taskList( $userId );
return array("tasks" => $res );
return array ("tasks" => $res
);
}
function TaskCase( $params ) {
function TaskCase ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
$x = ifPermission( $params->sessionId, 'PM_CASES' );
if($x==0)
{
$result[] = array ( 'guid' => 24, 'name' => 'You do not have privileges' );
if ($x == 0) {
$result[] = array ('guid' => 24,'name' => 'You do not have privileges'
);
return $result;
}
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->taskCase( $params->caseId );
return array("taskCases" => $res );
return array ("taskCases" => $res
);
}
function ReassignCase( $params ) {
function ReassignCase ($params)
{
ifSessionExpiredBreakThis( $params->sessionId );
//G::LoadClass('wsResponse');
//return new wsResponse (1, print_r($params,1));
@@ -395,7 +411,8 @@
return $res;
}
function ifSessionExpiredBreakThis($sessionId){ #added By Erik AO <erik@colosa.com> in datetime 26.06.2008 10:00:00
function ifSessionExpiredBreakThis ($sessionId)
{ #added By Erik AO <erik@colosa.com> in datetime 26.06.2008 10:00:00
G::LoadClass( 'sessions' );
$oSessions = new Sessions();
$session = $oSessions->verifySession( $sessionId );
@@ -405,7 +422,8 @@
}
}
function ifPermission( $sessionId, $permission ){
function ifPermission ($sessionId, $permission)
{
global $RBAC;
$RBAC->initRBAC();
G::LoadClass( 'sessions' );
@@ -417,8 +435,7 @@
$aPermissions = $oRBAC->aUserInfo[$oRBAC->sSystem]['PERMISSIONS'];
$sw = 0;
foreach ($aPermissions as $aPermission) {
if ($aPermission['PER_CODE'] == $permission)
{
if ($aPermission['PER_CODE'] == $permission) {
$sw = 1;
}
}

View File

@@ -1,6 +1,7 @@
<?php
ini_set( "soap.wsdl_cache_enabled", "0" ); //disabling WSDL cache
define( 'WEB_SERVICE_VERSION', '2.0' );
//$wsdl = PATH_METHODS . "services" . PATH_SEP . "pmos.wsdl";
@@ -35,11 +36,7 @@ function login($params)
$ws = new wsBase();
$res = $ws->login( $params->userid, $params->password );
return array(
'status_code' => $res->status_code,
'message' => $res->message,
'version' => WEB_SERVICE_VERSION,
'timestamp' => $res->timestamp
return array ('status_code' => $res->status_code,'message' => $res->message,'version' => WEB_SERVICE_VERSION,'timestamp' => $res->timestamp
);
}
@@ -51,24 +48,29 @@ function ProcessList($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("processes" => $o);
return array ("processes" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) != 0) {
$ws = new wsBase();
$res = $ws->processList();
return array("processes" => $res);
return array ("processes" => $res
);
}
if (ifPermission( $params->sessionId, 'PM_FACTORY' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("processes" => $o);
return array ("processes" => $o
);
}
/** if you are not an admin user, then this function will return only your valid process **/
/**
* if you are not an admin user, then this function will return only your valid process *
*/
if (ifPermission( $params->sessionId, 'PM_FACTORY' ) == 0) {
G::LoadClass( 'sessions' );
@@ -79,13 +81,15 @@ function ProcessList($params)
$ws = new wsBase();
$res = $ws->processListVerified( $userId );
return array("processes" => $res);
return array ("processes" => $res
);
}
$ws = new wsBase();
$res = $ws->processList();
return array("processes" => $res);
return array ("processes" => $res
);
}
function RoleList ($params)
@@ -96,20 +100,23 @@ function RoleList($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("roles" => $o);
return array ("roles" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_USERS' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("roles" => $o);
return array ("roles" => $o
);
}
$ws = new wsBase();
$res = $ws->roleList();
return array("roles" => $res);
return array ("roles" => $res
);
}
function GroupList ($params)
@@ -120,20 +127,23 @@ function GroupList($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("groups" => $o);
return array ("groups" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_USERS' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("groups" => $o);
return array ("groups" => $o
);
}
$ws = new wsBase();
$res = $ws->groupList();
return array("groups" => $res);
return array ("groups" => $res
);
}
function DepartmentList ($params)
@@ -144,20 +154,23 @@ function DepartmentList($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("departments" => $o);
return array ("departments" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_USERS' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("departments" => $o);
return array ("departments" => $o
);
}
$ws = new wsBase();
$res = $ws->departmentList();
return array("departments" => $res);
return array ("departments" => $res
);
}
function CaseList ($params)
@@ -171,7 +184,8 @@ function CaseList($params)
$o->delIndex = '';
$o->processId = '';
return array("cases" => $o);
return array ("cases" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
@@ -181,7 +195,8 @@ function CaseList($params)
$o->delIndex = '';
$o->processId = '';
return array("cases" => $o);
return array ("cases" => $o
);
}
G::LoadClass( 'sessions' );
@@ -193,7 +208,8 @@ function CaseList($params)
$ws = new wsBase();
$res = $ws->caseList( $userId );
return array("cases" => $res);
return array ("cases" => $res
);
}
function UnassignedCaseList ($params)
@@ -204,7 +220,8 @@ function UnassignedCaseList($params)
$o->name = '';
$o->delIndex = '';
return array("cases" => $o);
return array ("cases" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
@@ -212,7 +229,8 @@ function UnassignedCaseList($params)
$o->name = '';
$o->delIndex = '';
return array("cases" => $o);
return array ("cases" => $o
);
}
G::LoadClass( 'sessions' );
@@ -224,7 +242,8 @@ function UnassignedCaseList($params)
$ws = new wsBase();
$res = $ws->unassignedCaseList( $userId );
return array("cases" => $res);
return array ("cases" => $res
);
}
function UserList ($params)
@@ -235,20 +254,23 @@ function UserList($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("users" => $o);
return array ("users" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_USERS' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("users" => $o);
return array ("users" => $o
);
}
$ws = new wsBase();
$res = $ws->userList();
return array("users" => $res);
return array ("users" => $res
);
}
function triggerList ($params)
@@ -260,7 +282,8 @@ function triggerList($params)
$o->name = '';
$o->processId = '';
return array("triggers" => $o);
return array ("triggers" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
@@ -268,13 +291,15 @@ function triggerList($params)
$o->name = '';
$o->processId = '';
return array("triggers" => $o);
return array ("triggers" => $o
);
}
$ws = new wsBase();
$res = $ws->triggerList();
return array("triggers" => $res);
return array ("triggers" => $res
);
}
function outputDocumentList ($params)
@@ -292,7 +317,8 @@ function outputDocumentList($params)
$o->index = '';
$o->link = '';
return array("documents" => $o);
return array ("documents" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
@@ -306,7 +332,8 @@ function outputDocumentList($params)
$o->index = '';
$o->link = '';
return array("documents" => $o);
return array ("documents" => $o
);
}
G::LoadClass( 'sessions' );
@@ -318,7 +345,8 @@ function outputDocumentList($params)
$ws = new wsBase();
$res = $ws->outputDocumentList( $params->caseId, $userId );
return array("documents" => $res);
return array ("documents" => $res
);
}
function inputDocumentList ($params)
@@ -336,7 +364,8 @@ function inputDocumentList($params)
$o->index = '';
$o->link = '';
return array("documents" => $o);
return array ("documents" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
@@ -350,7 +379,8 @@ function inputDocumentList($params)
$o->index = '';
$o->link = '';
return array("documents" => $o);
return array ("documents" => $o
);
}
G::LoadClass( 'sessions' );
@@ -362,7 +392,8 @@ function inputDocumentList($params)
$ws = new wsBase();
$res = $ws->inputDocumentList( $params->caseId, $userId );
return array("documents" => $res);
return array ("documents" => $res
);
}
function inputDocumentProcessList ($params)
@@ -374,7 +405,8 @@ function inputDocumentProcessList($params)
$o->name = '';
$o->description = '';
return array("documents" => $o);
return array ("documents" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
@@ -382,13 +414,15 @@ function inputDocumentProcessList($params)
$o->name = '';
$o->description = '';
return array("documents" => $o);
return array ("documents" => $o
);
}
$ws = new wsBase();
$res = $ws->inputDocumentProcessList( $params->processId );
return array("documents" => $res);
return array ("documents" => $res
);
}
function removeDocument ($params)
@@ -426,15 +460,7 @@ function SendMessage($params)
}
$ws = new wsBase();
$res = $ws->sendMessage(
$params->caseId,
$params->from,
$params->to,
$params->cc,
$params->bcc,
$params->subject,
$params->template
);
$res = $ws->sendMessage( $params->caseId, $params->from, $params->to, $params->cc, $params->bcc, $params->subject, $params->template );
return $res->getPayloadArray();
}
@@ -496,7 +522,8 @@ function SendVariables($params)
function GetVariables ($params)
{
if (! is_array( $params->variables )) {
$params->variables = array($params->variables);
$params->variables = array ($params->variables
);
}
$vsResult = isValidSession( $params->sessionId );
@@ -820,16 +847,7 @@ function CreateUser($params)
$ws = new wsBase();
$res = $ws->createUser(
$params->userId,
$params->firstname,
$params->lastname,
$params->email,
$params->role,
$params->password,
((isset($params->dueDate))? $params->dueDate : null),
((isset($params->status))? $params->status : null)
);
$res = $ws->createUser( $params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password, ((isset( $params->dueDate )) ? $params->dueDate : null), ((isset( $params->status )) ? $params->status : null) );
return $res;
}
@@ -850,17 +868,7 @@ function updateUser($params)
$ws = new wsBase();
$result = $ws->updateUser(
$params->userUid,
$params->userName,
((isset($params->firstName))? $params->firstName : null),
((isset($params->lastName))? $params->lastName : null),
((isset($params->email))? $params->email : null),
((isset($params->dueDate))? $params->dueDate : null),
((isset($params->status))? $params->status : null),
((isset($params->role))? $params->role : null),
((isset($params->password))? $params->password : null)
);
$result = $ws->updateUser( $params->userUid, $params->userName, ((isset( $params->firstName )) ? $params->firstName : null), ((isset( $params->lastName )) ? $params->lastName : null), ((isset( $params->email )) ? $params->email : null), ((isset( $params->dueDate )) ? $params->dueDate : null), ((isset( $params->status )) ? $params->status : null), ((isset( $params->role )) ? $params->role : null), ((isset( $params->password )) ? $params->password : null) );
return $result;
}
@@ -915,14 +923,16 @@ function TaskList($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("tasks" => $o);
return array ("tasks" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("tasks" => $o);
return array ("tasks" => $o
);
}
G::LoadClass( 'sessions' );
@@ -933,7 +943,8 @@ function TaskList($params)
$userId = $session['USR_UID'];
$res = $ws->taskList( $userId );
return array("tasks" => $res);
return array ("tasks" => $res
);
}
function TaskCase ($params)
@@ -944,20 +955,23 @@ function TaskCase($params)
$o->guid = $vsResult->status_code . ' ' . $vsResult->message;
$o->name = '';
return array("taskCases" => $o);
return array ("taskCases" => $o
);
}
if (ifPermission( $params->sessionId, 'PM_CASES' ) == 0) {
$o->guid = "2 Insufficient privileges to execute this function";
$o->name = '';
return array("taskCases" => $o);
return array ("taskCases" => $o
);
}
$ws = new wsBase();
$res = $ws->taskCase( $params->caseId );
return array("taskCases" => $res);
return array ("taskCases" => $res
);
}
function ReassignCase ($params)
@@ -968,13 +982,7 @@ function ReassignCase($params)
}
$ws = new wsBase();
$res = $ws->reassignCase(
$params->sessionId,
$params->caseId,
$params->delIndex,
$params->userIdSource,
$params->userIdTarget
);
$res = $ws->reassignCase( $params->sessionId, $params->caseId, $params->delIndex, $params->userIdSource, $params->userIdTarget );
return $res;
}
@@ -1002,13 +1010,7 @@ function importProcessFromLibrary($params)
}
$ws = new wsBase();
$res = $ws->importProcessFromLibrary(
$params->processId ,
$params->version,
$params->importOption,
$params->usernameLibrary,
$params->passwordLibrary
);
$res = $ws->importProcessFromLibrary( $params->processId, $params->version, $params->importOption, $params->usernameLibrary, $params->passwordLibrary );
return $res;
}
@@ -1027,9 +1029,10 @@ function getCaseNotes($params)
return $res;
}
/************
/**
* **********
* #added By Erik AO <erik@colosa.com> in datetime 26.06.2008 10:00:00
# modified 12-01-2010 by erik
* # modified 12-01-2010 by erik
*/
function isValidSession ($sessionId)
{
@@ -1142,12 +1145,7 @@ function pauseCase($params)
$ws = new wsBase();
$result = $ws->pauseCase(
$params->caseUid,
$params->delIndex,
$params->userUid,
((isset($params->unpauseDate))? $params->unpauseDate : null)
);
$result = $ws->pauseCase( $params->caseUid, $params->delIndex, $params->userUid, ((isset( $params->unpauseDate )) ? $params->unpauseDate : null) );
return $result;
}
@@ -1172,10 +1170,6 @@ function unpauseCase($params)
return $result;
}
$server = new SoapServer( $wsdl );
$server->addFunction( "Login" );
$server->addFunction( "ProcessList" );

View File

@@ -2,4 +2,4 @@
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'services/serviceMessage', '', array (), '' );
G::RenderPage( 'publish' );
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
@@ -90,22 +89,11 @@ if (isset($_FILES) && $_FILES["ATTACH_FILE"]["error"] == 0) {
//$aFields["FOLDER_UID"] = $folderId,
//$aFields["APP_DOC_TAGS"] = $fileTags
$aFields["APP_DOC_FIELDNAME"] = $_POST["APP_DOC_FIELDNAME"];
} else {
//New record
$aFields = array(
"APP_UID" => $_POST["APPLICATION"],
"DEL_INDEX" => $_POST["INDEX"],
"USR_UID" => $_POST["USR_UID"],
"DOC_UID" => $_POST["DOC_UID"],
"APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"],
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
"APP_DOC_COMMENT" => (isset($_POST["COMMENT"]))? $_POST["COMMENT"] : "",
"APP_DOC_TITLE" => (isset($_POST["TITLE"]))? $_POST["TITLE"] : "",
"APP_DOC_FILENAME" => (isset($_FILES["ATTACH_FILE"]["name"]))? $_FILES["ATTACH_FILE"]["name"] : "",
"FOLDER_UID" => $folderId,
"APP_DOC_TAGS" => $fileTags,
"APP_DOC_FIELDNAME" => $_POST["APP_DOC_FIELDNAME"]
$aFields = array ("APP_UID" => $_POST["APPLICATION"],"DEL_INDEX" => $_POST["INDEX"],"USR_UID" => $_POST["USR_UID"],"DOC_UID" => $_POST["DOC_UID"],"APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"],"APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => (isset( $_POST["COMMENT"] )) ? $_POST["COMMENT"] : "","APP_DOC_TITLE" => (isset( $_POST["TITLE"] )) ? $_POST["TITLE"] : "","APP_DOC_FILENAME" => (isset( $_FILES["ATTACH_FILE"]["name"] )) ? $_FILES["ATTACH_FILE"]["name"] : "","FOLDER_UID" => $folderId,"APP_DOC_TAGS" => $fileTags,"APP_DOC_FIELDNAME" => $_POST["APP_DOC_FIELDNAME"]
);
}
@@ -136,6 +124,7 @@ if (isset($_FILES) && $_FILES["ATTACH_FILE"]["error"] == 0) {
//$_SESSION["USR_USERNAME"] = $appFields["USR_USERNAME"];
//$_SESSION["STEP_POSITION"] = 0;
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry = &PMPluginRegistry::getSingleton();
@@ -165,3 +154,4 @@ if (isset($_FILES) && $_FILES["ATTACH_FILE"]["error"] == 0) {
print ($e->getMessage()) ;
}
}

View File

@@ -2,7 +2,8 @@
ini_set( "default_charset", "UTF-8" );
function AuthenticationBasicHTTP($realm ) {
function AuthenticationBasicHTTP ($realm)
{
if (empty( $_SERVER['PHP_AUTH_USER'] ) && empty( $_SERVER['REDIRECT_REMOTE_USER'] )) {
header( 'WWW-Authenticate: Basic realm="' . $realm . '"' );
header( 'HTTP/1.0 401 Unauthorized' );
@@ -23,17 +24,17 @@ function AuthenticationBasicHTTP($realm ) {
header( 'WWW-Authenticate: Basic realm="' . $realm . '"' );
header( 'HTTP/1.0 401 ' . $msg );
die( '401 ' . $msg );
return FALSE;
die;
return false;
die();
}
return TRUE;
return true;
}
header( 'WWW-Authenticate: Basic realm="' . $realm . '"' );
header( 'HTTP/1.0 401 Unauthorized' );
die( '401 Unauthorized' );
return FALSE;
return false;
}
$realm = 'ProcessMaker Filesystem for Workspace ' . SYS_SYS;

View File

@@ -3,8 +3,7 @@
$content = file_get_contents( $filewsdl );
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$endpoint = 'http://' .$_SERVER['SERVER_NAME'] . ':' .$_SERVER['SERVER_PORT'] .
'/sys' .SYS_SYS.'/' .$lang . '/classic/services/soap';
$endpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . $lang . '/classic/services/soap';
//print $endpoint; die;
$content = str_replace( "___SOAP_ADDRESS___", $endpoint, $content );

View File

@@ -4,8 +4,7 @@
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$http = (isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$endpoint = $http . '://' .$_SERVER['SERVER_NAME'] . ':' .$_SERVER['SERVER_PORT'] .
'/sys' .SYS_SYS.'/' .$lang . '/classic/services/soap2';
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . $lang . '/classic/services/soap2';
$content = str_replace( "___SOAP_ADDRESS___", $endpoint, $content );

View File

@@ -1,34 +1,35 @@
<?php
function wsBaseLogin( $username, $password ) {
function wsBaseLogin ($username, $password)
{
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$res = $ws->login( $username, $password );
return $res->getPayloadArray();
}
function wsBaseProcessList( $studentName ) {
function wsBaseProcessList ($studentName)
{
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$result = $ws->processList();
//$result[] = array ( 'guid' => 'a' . $studentName , 'name' => 'bc' );
//$result[] = array ( 'guid' => '2a' , 'name' => '2bc' . $studentName );
//$result[] = array ( 'guid' => '2a' , 'name' => '2bc' . $studentName );
return array("processes"=> $result);
return array ("processes" => $result
);
//return array ( "status_code" => 12, "message" => 'abx', "timestamp" => 'aa' );
}
/* Map of the service operation "ExamResult" to php function "ExamResult" */
$operations = array( "processesList" => "wsBaseProcessList",
"login" => "wsBaseLogin"
$operations = array ("processesList" => "wsBaseProcessList","login" => "wsBaseLogin"
);
/* just tell your function parameters should be in mixed format,
that is here parameter will be the string with the name in it*/
$opParams = array("wsBaseProcessList" => "MIXED",
"wsBaseLogin" => "MIXED");
$opParams = array ("wsBaseProcessList" => "MIXED","wsBaseLogin" => "MIXED"
);
//$wsdl = PATH_METHODS . "services" . PATH_SEP . "pmos.wsdl";
$wsdl = "/home/fernando/processmaker/trunk/workflow/engine/methods/services/pmos.wsdl";
@@ -36,11 +37,11 @@ echo $wsdl;
echo file_get_contents( $wsdl );
die();
/* Created the WSService */
$svr = new WSService(array("wsdl" => $wsdl ,
"operations" => $operations,
"opParams" => $opParams));
$svr = new WSService( array ("wsdl" => $wsdl,"operations" => $operations,"opParams" => $opParams
) );
/* Reply the client */
$svr->reply();
die;
die();

View File

@@ -1,4 +1,5 @@
<?php
function addNodox ($obj, $padre, $indice, $contenido = '', $atributos = '')
{
if (is_object( $padre )) {
@@ -34,14 +35,13 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
{
$tam = count( $aRoute );
$c = 0;
switch ($aRoute[$c]['ROU_TYPE'])
{
switch ($aRoute[$c]['ROU_TYPE']) {
case 'SEQUENTIAL':
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'Sequential', '', '' );
$nodo_nexttask = addNodox( $doc, $nodo_routeType, 'NextTask', '', '' );
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '',
array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
) );
} else {
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
}
@@ -49,10 +49,12 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
case 'EVALUATE':
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'Evaluations', '', '' );
while ($c < $tam) {
$nodo_evaluation= addNodox($doc, $nodo_routeType, 'Evaluation', '', array('Condition'=> $aRoute[$c]['ROU_CONDITION']));
$nodo_evaluation = addNodox( $doc, $nodo_routeType, 'Evaluation', '', array ('Condition' => $aRoute[$c]['ROU_CONDITION']
) );
$nodo_nexttask = addNodox( $doc, $nodo_evaluation, 'NextTask', '', '' );
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
) );
} else {
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
}
@@ -62,10 +64,12 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
case 'SELECT':
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'Selections', '', '' );
while ($c < $tam) {
$nodo_selection= addNodox($doc, $nodo_routeType, 'Selection', '', array('Description'=> $aRoute[$c]['ROU_CONDITION']));
$nodo_selection = addNodox( $doc, $nodo_routeType, 'Selection', '', array ('Description' => $aRoute[$c]['ROU_CONDITION']
) );
$nodo_nexttask = addNodox( $doc, $nodo_selection, 'NextTask', '', '' );
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
) );
} else {
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
}
@@ -79,7 +83,8 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
$nodo_nexttask = addNodox( $doc, $nodo_parallelfork, 'NextTask', '', '' );
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
) );
} else {
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
}
@@ -89,10 +94,12 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
case 'PARALLEL-BY-EVALUATION':
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'ParallelForksByEvaluation', '', '' );
while ($c < $tam) {
$nodo_evaluation= addNodox($doc, $nodo_routeType, 'Evaluation', '', array('Condition'=> $aRoute[$c]['ROU_CONDITION']));
$nodo_evaluation = addNodox( $doc, $nodo_routeType, 'Evaluation', '', array ('Condition' => $aRoute[$c]['ROU_CONDITION']
) );
$nodo_nexttask = addNodox( $doc, $nodo_evaluation, 'NextTask', '', '' );
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
) );
} else {
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
}
@@ -103,7 +110,8 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'ParallelJoin', '', '' );
$nodo_nexttask = addNodox( $doc, $nodo_routeType, 'NextTask', '', '' );
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
) );
} else {
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
}
@@ -111,13 +119,16 @@ function derivationRules($aRoute, $doc, $nodo_derivationrule)
}
}
/****-_--__---___----___---__--_-****/
/**
* **-_--__---___----___---__--_-***
*/
G::LoadClass( 'tasks' );
require_once 'classes/model/Process.php';
$doc = new DOMDocument( '1.0', 'UTF-8' );
$nodo_padre = addNodox($doc, '', 'Processes', '', array('xmlns:xsi'=>'http://www.w3.org/2001/XMLSchema-instance','xsi:noNamespaceSchemaLocation'=>'ColosaSchema.xsd'));
$nodo_padre = addNodox( $doc, '', 'Processes', '', array ('xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance','xsi:noNamespaceSchemaLocation' => 'ColosaSchema.xsd'
) );
$aProcesses = array ();
$oCriteria = new Criteria( 'workflow' );
@@ -131,7 +142,8 @@ $oProcess = new Process();
while ($aRow = $oDataset->getRow()) {
$aProcess = $oProcess->load( $aRow['PRO_UID'] );
$nodo_process = addNodox($doc, $nodo_padre, 'Process', '', array('Title'=> $aProcess['PRO_TITLE'],'Description'=> $aProcess['PRO_DESCRIPTION']));
$nodo_process = addNodox( $doc, $nodo_padre, 'Process', '', array ('Title' => $aProcess['PRO_TITLE'],'Description' => $aProcess['PRO_DESCRIPTION']
) );
$nodo_tasks = addNodox( $doc, $nodo_process, 'Tasks', '', '' );
$oTask = new Tasks();
@@ -146,15 +158,18 @@ while ($aRow = $oDataset->getRow()) {
if ($value['TAS_TYPE'] == 'NORMAL') {
$ini = ($value['TAS_START'] == 'TRUE') ? 'true' : 'false';
$nodo_task = addNodox($doc, $nodo_tasks, 'Task', '', array('Title'=> $value['TAS_TITLE'],'Description'=> $value['TAS_DESCRIPTION'],'Id'=> 'ID'.$value['TAS_UID'],'StartingTask'=> $ini));
$nodo_coordinates = addNodox($doc, $nodo_task, 'Coordinates', '', array('XCoordinate'=> $value['TAS_POSX'],'YCoordinate'=> $value['TAS_POSY']));
$nodo_task = addNodox( $doc, $nodo_tasks, 'Task', '', array ('Title' => $value['TAS_TITLE'],'Description' => $value['TAS_DESCRIPTION'],'Id' => 'ID' . $value['TAS_UID'],'StartingTask' => $ini
) );
$nodo_coordinates = addNodox( $doc, $nodo_task, 'Coordinates', '', array ('XCoordinate' => $value['TAS_POSX'],'YCoordinate' => $value['TAS_POSY']
) );
$nodo_derivationrule = addNodox( $doc, $nodo_task, 'DerivationRule', '', '' );
derivationRules( $aRoute, $doc, $nodo_derivationrule );
$nodo_assignmentrules = addNodox( $doc, $nodo_task, 'AssignmentRules', '', '' );
$nodo_cyclicalassignment = addNodox( $doc, $nodo_assignmentrules, 'CyclicalAssignment', '', '' );
$nodo_timingcontrol = addNodox($doc, $nodo_task, 'TimingControl', '', array('TaskDuration'=> $value['TAS_DURATION']));
$nodo_timingcontrol = addNodox( $doc, $nodo_task, 'TimingControl', '', array ('TaskDuration' => $value['TAS_DURATION']
) );
$nodo_permissions = addNodox( $doc, $nodo_task, 'Permissions', '', '' );
$nodo_caselabels = addNodox( $doc, $nodo_task, 'CaseLabels', '', '' );
$nodo_notifications = addNodox( $doc, $nodo_task, 'Notifications', '', '' );
@@ -167,8 +182,10 @@ while ($aRow = $oDataset->getRow()) {
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
$nodo_task = addNodox($doc, $nodo_tasks, 'SubProcess', '', array('Title'=> $value['TAS_TITLE'],'Description'=> $value['TAS_DESCRIPTION'],'Id'=> 'ID'.$value['TAS_UID'], 'ProcessRef'=>$aRow['PRO_UID']));
$nodo_coordinates = addNodox($doc, $nodo_task, 'Coordinates', '', array('XCoordinate'=> $value['TAS_POSX'],'YCoordinate'=> $value['TAS_POSY']));
$nodo_task = addNodox( $doc, $nodo_tasks, 'SubProcess', '', array ('Title' => $value['TAS_TITLE'],'Description' => $value['TAS_DESCRIPTION'],'Id' => 'ID' . $value['TAS_UID'],'ProcessRef' => $aRow['PRO_UID']
) );
$nodo_coordinates = addNodox( $doc, $nodo_task, 'Coordinates', '', array ('XCoordinate' => $value['TAS_POSX'],'YCoordinate' => $value['TAS_POSY']
) );
$nodo_derivationrule = addNodox( $doc, $nodo_task, 'DerivationRule', '', '' );
derivationRules( $aRoute, $doc, $nodo_derivationrule );