BUG 8984 "PMFNewCaseImpersonate(), WSNewCaseImpersonate() and..." SOLVED
- The PMFNewCaseImpersonate(), WSNewCaseImpersonate() and newCaseImpersonate() web service, do not return the UID and number of the new case like PMFNewCase(), WSNewCase() and newCase() - It improved the code of the PMFNewCaseImpersonate method, for to returns the UID of case, as PMFNewCase - It improved the code of the WSNewCaseImpersonate method, for to returns the UID of case, as WSNewCase - Corrections made in the methods "Simple Trigger Web Services", including the files involved
This commit is contained in:
@@ -386,24 +386,37 @@ function evaluateFunction($aGrid, $sExpresion) {
|
|||||||
* @return string | $unique ID | Unique Id |The unique ID for the initiated session.
|
* @return string | $unique ID | Unique Id |The unique ID for the initiated session.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function WSLogin($user, $pass, $endpoint='') {
|
function WSLogin($user, $pass, $endpoint = "") {
|
||||||
$client = wSOpen(true);
|
$client = WSOpen(true);
|
||||||
$params = array('userid'=>$user, 'password'=>$pass);
|
|
||||||
$result = $client->__SoapCall('login', array($params));
|
$params = array("userid" => $user, "password" => $pass);
|
||||||
|
|
||||||
|
$result = $client->__soapCall("login", array($params));
|
||||||
|
|
||||||
if($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
if($endpoint != '') {
|
if ($endpoint != "") {
|
||||||
if(isset($_SESSION['WS_SESSION_ID']))
|
if (isset($_SESSION["WS_SESSION_ID"])) {
|
||||||
$_SESSION['WS_END_POINT'] = $endpoint;
|
$_SESSION["WS_END_POINT"] = $endpoint;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['WS_SESSION_ID']))
|
/*
|
||||||
return $_SESSION['WS_SESSION_ID'] = $result->message;
|
if (isset($_SESSION["WS_SESSION_ID"]))
|
||||||
|
return $_SESSION["WS_SESSION_ID"] = $result->message;
|
||||||
else
|
else
|
||||||
return $result->message;
|
return $result->message;
|
||||||
} else {
|
*/
|
||||||
if(isset($_SESSION['WS_SESSION_ID']))
|
|
||||||
unset($_SESSION['WS_SESSION_ID']);
|
$_SESSION["WS_SESSION_ID"] = $result->message;
|
||||||
$wp = (trim($pass) != "")?'YES':'NO';
|
|
||||||
|
return $result->message;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (isset($_SESSION["WS_SESSION_ID"])) {
|
||||||
|
unset($_SESSION["WS_SESSION_ID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$wp = (trim($pass) != "")? "YES" : "NO";
|
||||||
|
|
||||||
throw new Exception("WSAccess denied! for user $user with password $wp");
|
throw new Exception("WSAccess denied! for user $user with password $wp");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -421,16 +434,20 @@ function WSLogin($user, $pass, $endpoint='') {
|
|||||||
* @return Object Client | $client | SoapClient object | A SoapClient object. If unable to establish a connection, returns NULL.
|
* @return Object Client | $client | SoapClient object | A SoapClient object. If unable to establish a connection, returns NULL.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function WSOpen($force=false) {
|
function WSOpen($force = false) {
|
||||||
if(isset($_SESSION['WS_SESSION_ID']) || $force) {
|
if (isset($_SESSION["WS_SESSION_ID"]) || $force) {
|
||||||
if( !isset ($_SESSION['WS_END_POINT']) ) {
|
if (!isset($_SESSION["WS_END_POINT"])) {
|
||||||
$defaultEndpoint = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].'/sys'.SYS_SYS.'/en/green/services/wsdl';
|
$defaultEndpoint = "http://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . SYS_SYS . "/en/classic/services/wsdl2";
|
||||||
}
|
}
|
||||||
$endpoint = isset( $_SESSION['WS_END_POINT'] ) ? $_SESSION['WS_END_POINT'] : $defaultEndpoint;
|
|
||||||
$client = new SoapClient( $endpoint );
|
$endpoint = isset($_SESSION["WS_END_POINT"])? $_SESSION["WS_END_POINT"] : $defaultEndpoint;
|
||||||
|
|
||||||
|
$client = new SoapClient($endpoint);
|
||||||
|
|
||||||
return $client;
|
return $client;
|
||||||
} else {
|
}
|
||||||
throw new Exception('WS session is not open');
|
else {
|
||||||
|
throw new Exception("WS session is not open");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -449,29 +466,31 @@ function WSOpen($force=false) {
|
|||||||
function WSTaskCase($caseId) {
|
function WSTaskCase($caseId) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
$params = array("sessionId" => $sessionId, "caseId" => $caseId);
|
||||||
$params = array('sessionId'=>$sessionId, 'caseId'=>$caseId);
|
|
||||||
$result = $client->__soapCall('taskCase', array($params));
|
$result = $client->__soapCall("taskCase", array($params));
|
||||||
|
|
||||||
$i = 1;
|
$rows = array();
|
||||||
if(isset ($result->taskCases)) {
|
$i = 0;
|
||||||
foreach ( $result->taskCases as $key=> $item) {
|
|
||||||
if ( isset ($item->item) ) {
|
if (isset($result->taskCases)) {
|
||||||
foreach ( $item->item as $index=> $val ) {
|
//Processing when it is an array
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
if (is_array($result->taskCases)) {
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
foreach ($result->taskCases as $key => $obj) {
|
||||||
}
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
} else {
|
$i = $i + 1;
|
||||||
foreach ( $item as $index=> $val ) {
|
}
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
}
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
else {
|
||||||
}
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->taskCases)) {
|
||||||
|
$rows[$i] = array("guid" => $result->taskCases->guid, "name" => $result->taskCases->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -490,28 +509,31 @@ function WSTaskCase($caseId) {
|
|||||||
function WSTaskList() {
|
function WSTaskList() {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array('sessionId'=>$sessionId );
|
$params = array("sessionId" => $sessionId);
|
||||||
$result = $client->__SoapCall('TaskList', array($params));
|
|
||||||
|
$result = $client->__soapCall("TaskList", array($params));
|
||||||
$i = 1;
|
|
||||||
if(isset ($result->tasks)) {
|
$rows = array();
|
||||||
foreach ( $result->tasks as $key=> $item) {
|
$i = 0;
|
||||||
if ( isset ($item->item) ) {
|
|
||||||
foreach ( $item->item as $index=> $val ) {
|
if (isset($result->tasks)) {
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
//Processing when it is an array
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
if (is_array($result->tasks)) {
|
||||||
}
|
foreach ($result->tasks as $key => $obj) {
|
||||||
} else {
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
foreach ( $item as $index=> $val ) {
|
$i = $i + 1;
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
}
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
}
|
||||||
}
|
else {
|
||||||
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->tasks)) {
|
||||||
|
$rows[$i] = array("guid" => $result->tasks->guid, "name" => $result->tasks->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -529,28 +551,31 @@ function WSTaskList() {
|
|||||||
function WSUserList() {
|
function WSUserList() {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array('sessionId'=>$sessionId );
|
$params = array("sessionId" => $sessionId);
|
||||||
$result = $client->__SoapCall('UserList', array($params));
|
|
||||||
|
$result = $client->__soapCall("UserList", array($params));
|
||||||
$i = 1;
|
|
||||||
if(isset ($result->users)) {
|
$rows = array();
|
||||||
foreach ( $result->users as $key=> $item) {
|
$i = 0;
|
||||||
if ( isset ($item->item) ) {
|
|
||||||
foreach ( $item->item as $index=> $val ) {
|
if (isset($result->users)) {
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
//Processing when it is an array
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
if (is_array($result->users)) {
|
||||||
}
|
foreach ($result->users as $key => $obj) {
|
||||||
} else {
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
foreach ( $item as $index=> $val ) {
|
$i = $i + 1;
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
}
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
}
|
||||||
}
|
else {
|
||||||
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->users)) {
|
||||||
|
$rows[$i] = array("guid" => $result->users->guid, "name" => $result->users->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -568,28 +593,31 @@ function WSUserList() {
|
|||||||
function WSGroupList() {
|
function WSGroupList() {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array('sessionId'=>$sessionId );
|
$params = array("sessionId" => $sessionId);
|
||||||
$result = $client->__SoapCall('GroupList', array($params));
|
|
||||||
|
$result = $client->__soapCall("GroupList", array($params));
|
||||||
|
|
||||||
$i = 1;
|
$rows = array();
|
||||||
if(isset ($result->groups)) {
|
$i = 0;
|
||||||
foreach ( $result->groups as $key=> $item) {
|
|
||||||
if ( isset ($item->item) ) {
|
if (isset($result->groups)) {
|
||||||
foreach ( $item->item as $index=> $val ) {
|
//Processing when it is an array
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
if (is_array($result->groups)) {
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
foreach ($result->groups as $key => $obj) {
|
||||||
}
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
} else {
|
$i = $i + 1;
|
||||||
foreach ( $item as $index=> $val ) {
|
}
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
}
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
else {
|
||||||
}
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->groups)) {
|
||||||
|
$rows[$i] = array("guid" => $result->groups->guid, "name" => $result->groups->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,27 +636,31 @@ function WSGroupList() {
|
|||||||
function WSRoleList() {
|
function WSRoleList() {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array('sessionId'=>$sessionId );
|
$params = array("sessionId" => $sessionId);
|
||||||
$result = $client->__SoapCall('RoleList', array($params));
|
|
||||||
$i = 1;
|
$result = $client->__soapCall("RoleList", array($params));
|
||||||
if(isset ($result->roles)) {
|
|
||||||
foreach ( $result->roles as $key=> $item) {
|
$rows = array();
|
||||||
if ( isset ($item->item) ) {
|
$i = 0;
|
||||||
foreach ( $item->item as $index=> $val ) {
|
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
if (isset($result->roles)) {
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
//Processing when it is an array
|
||||||
}
|
if (is_array($result->roles)) {
|
||||||
} else {
|
foreach ($result->roles as $key => $obj) {
|
||||||
foreach ( $item as $index=> $val ) {
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
$i = $i + 1;
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->roles)) {
|
||||||
|
$rows[$i] = array("guid" => $result->roles->guid, "name" => $result->roles->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -647,29 +679,31 @@ function WSRoleList() {
|
|||||||
function WSCaseList() {
|
function WSCaseList() {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array('sessionId'=>$sessionId );
|
$params = array("sessionId" => $sessionId);
|
||||||
$result = $client->__SoapCall('CaseList', array($params));
|
|
||||||
|
$result = $client->__soapCall("CaseList", array($params));
|
||||||
|
|
||||||
$i = 1;
|
$rows = array();
|
||||||
if(isset ($result->cases)) {
|
$i = 0;
|
||||||
foreach ( $result->cases as $key=> $item) {
|
|
||||||
if ( isset ($item->item) ) {
|
if (isset($result->cases)) {
|
||||||
foreach ( $item->item as $index=> $val ) {
|
//Processing when it is an array
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
if (is_array($result->cases)) {
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
foreach ($result->cases as $key => $obj) {
|
||||||
}
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
} else {
|
$i = $i + 1;
|
||||||
foreach ( $item as $index=> $val ) {
|
}
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
}
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
else {
|
||||||
}
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->cases)) {
|
||||||
|
$rows[$i] = array("guid" => $result->cases->guid, "name" => $result->cases->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -687,28 +721,31 @@ function WSCaseList() {
|
|||||||
function WSProcessList() {
|
function WSProcessList() {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array('sessionId'=>$sessionId );
|
$params = array("sessionId" => $sessionId);
|
||||||
$result = $client->__SoapCall('ProcessList', array($params));
|
|
||||||
|
$result = $client->__soapCall("ProcessList", array($params));
|
||||||
|
|
||||||
$i = 1;
|
$rows = array();
|
||||||
if(isset ($result->processes)) {
|
$i = 0;
|
||||||
foreach ( $result->processes as $key=> $item) {
|
|
||||||
if ( isset ($item->item) ) {
|
if (isset($result->processes)) {
|
||||||
foreach ( $item->item as $index=> $val ) {
|
//Processing when it is an array
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
if (is_array($result->processes)) {
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
foreach ($result->processes as $key => $obj) {
|
||||||
}
|
$rows[$i] = array("guid" => $obj->guid, "name" => $obj->name);
|
||||||
} else {
|
$i = $i + 1;
|
||||||
foreach ( $item as $index=> $val ) {
|
}
|
||||||
if ( $val->key == 'guid' ) $guid = $val->value;
|
}
|
||||||
if ( $val->key == 'name' ) $name = $val->value;
|
else {
|
||||||
}
|
//Processing when it is an object //1 row
|
||||||
|
if (is_object($result->processes)) {
|
||||||
|
$rows[$i] = array("guid" => $result->processes->guid, "name" => $result->processes->name);
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$i++] = array ( 'guid' => $guid, 'name' => $name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -785,18 +822,27 @@ function PMFSendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplat
|
|||||||
*/
|
*/
|
||||||
function WSSendVariables($caseId, $name1, $value1, $name2, $value2) {
|
function WSSendVariables($caseId, $name1, $value1, $name2, $value2) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
|
||||||
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$variables[1]->name = $name1;
|
$v1 = new stdClass();
|
||||||
$variables[1]->value = $value1;
|
$v1->name = $name1;
|
||||||
$variables[2]->name = $name2;
|
$v1->value = $value1;
|
||||||
$variables[2]->value = $value2;
|
|
||||||
$params = array('sessionId'=>$sessionId, 'caseId'=>$caseId, 'variables'=>$variables);
|
$v2 = new stdClass();
|
||||||
$result = $client->__SoapCall('SendVariables', array($params));
|
$v2->name = $name2;
|
||||||
|
$v2->value = $value2;
|
||||||
|
|
||||||
|
$variables = array($v1, $v2);
|
||||||
|
|
||||||
|
$params = array("sessionId" => $sessionId, "caseId" => $caseId, "variables" => $variables);
|
||||||
|
|
||||||
|
$result = $client->__soapCall("SendVariables", array($params));
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
$fields['message'] = $result->message;
|
$fields["message"] = $result->message;
|
||||||
$fields['time_stamp'] = $result->timestamp;
|
$fields["time_stamp"] = $result->timestamp;
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -816,14 +862,17 @@ function WSSendVariables($caseId, $name1, $value1, $name2, $value2) {
|
|||||||
*/
|
*/
|
||||||
function WSDerivateCase($caseId, $delIndex) {
|
function WSDerivateCase($caseId, $delIndex) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
|
||||||
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array('sessionId'=>$sessionId, 'caseId'=>$caseId, 'delIndex'=>$delIndex );
|
$params = array("sessionId" => $sessionId, "caseId" => $caseId, "delIndex" => $delIndex);
|
||||||
$result = $client->__SoapCall('DerivateCase', array($params));
|
|
||||||
|
$result = $client->__soapCall("DerivateCase", array($params));
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
$fields['message'] = $result->message;
|
$fields["message"] = $result->message;
|
||||||
$fields['time_stamp'] = $result->timestamp;
|
$fields["time_stamp"] = $result->timestamp;
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -846,19 +895,29 @@ function WSDerivateCase($caseId, $delIndex) {
|
|||||||
*/
|
*/
|
||||||
function WSNewCaseImpersonate($processId, $userId, $name1, $value1, $name2, $value2) {
|
function WSNewCaseImpersonate($processId, $userId, $name1, $value1, $name2, $value2) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
|
||||||
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$variables[1]->name = $name1;
|
$v1 = new stdClass();
|
||||||
$variables[1]->value = $value1;
|
$v1->name = $name1;
|
||||||
$variables[2]->name = $name2;
|
$v1->value = $value1;
|
||||||
$variables[2]->value = $value2;
|
|
||||||
|
$v2 = new stdClass();
|
||||||
|
$v2->name = $name2;
|
||||||
|
$v2->value = $value2;
|
||||||
|
|
||||||
|
$variables = array($v1, $v2);
|
||||||
|
|
||||||
$params = array('sessionId'=>$sessionId, 'processId'=>$processId, 'userId'=>$userId, 'variables'=>$variables );
|
$params = array("sessionId" => $sessionId, "processId" => $processId, "userId" => $userId, "variables" => $variables);
|
||||||
$result = $client->__SoapCall('NewCaseImpersonate', array($params));
|
|
||||||
|
$result = $client->__soapCall("NewCaseImpersonate", array($params));
|
||||||
|
|
||||||
|
$fields["status_code"] = $result->status_code;
|
||||||
|
$fields["message"] = $result->message;
|
||||||
|
$fields["time_stamp"] = $result->timestamp;
|
||||||
|
$fields["case_id"] = $result->caseId;
|
||||||
|
$fields["case_number"] = $result->caseNumber;
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
|
||||||
$fields['message'] = $result->message;
|
|
||||||
$fields['time_stamp'] = $result->timestamp;
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -882,19 +941,28 @@ function WSNewCaseImpersonate($processId, $userId, $name1, $value1, $name2, $val
|
|||||||
*/
|
*/
|
||||||
function WSNewCase($processId, $taskId, $name1, $value1, $name2, $value2) {
|
function WSNewCase($processId, $taskId, $name1, $value1, $name2, $value2) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$variables[1]->name = $name1;
|
$v1 = new stdClass();
|
||||||
$variables[1]->value = $value1;
|
$v1->name = $name1;
|
||||||
$variables[2]->name = $name2;
|
$v1->value = $value1;
|
||||||
$variables[2]->value = $value2;
|
|
||||||
|
$v2 = new stdClass();
|
||||||
|
$v2->name = $name2;
|
||||||
|
$v2->value = $value2;
|
||||||
|
|
||||||
|
$variables = array($v1, $v2);
|
||||||
|
|
||||||
$params = array('sessionId'=>$sessionId, 'processId'=>$processId, 'taskId'=>$taskId, 'variables'=>$variables );
|
$params = array("sessionId" => $sessionId, "processId" => $processId, "taskId" => $taskId, "variables" => $variables);
|
||||||
$result = $client->__SoapCall('NewCase', array($params));
|
|
||||||
|
$result = $client->__soapCall("NewCase", array($params));
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
$fields['message'] = $result->message;
|
$fields["message"] = $result->message;
|
||||||
$fields['time_stamp'] = $result->timestamp;
|
$fields["time_stamp"] = $result->timestamp;
|
||||||
|
$fields["case_id"] = $result->caseId;
|
||||||
|
$fields["case_number"] = $result->caseNumber;
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -914,14 +982,17 @@ function WSNewCase($processId, $taskId, $name1, $value1, $name2, $value2) {
|
|||||||
*/
|
*/
|
||||||
function WSAssignUserToGroup($userId, $groupId) {
|
function WSAssignUserToGroup($userId, $groupId) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
|
||||||
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array('sessionId'=>$sessionId, 'userId'=>$userId, 'groupId'=>$groupId);
|
$params = array("sessionId" => $sessionId, "userId" => $userId, "groupId" => $groupId);
|
||||||
$result = $client->__SoapCall('AssignUserToGroup', array($params));
|
|
||||||
|
$result = $client->__soapCall("AssignUserToGroup", array($params));
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
$fields['message'] = $result->message;
|
$fields["message"] = $result->message;
|
||||||
$fields['time_stamp'] = $result->timestamp;
|
$fields["time_stamp"] = $result->timestamp;
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -944,13 +1015,16 @@ function WSAssignUserToGroup($userId, $groupId) {
|
|||||||
*/
|
*/
|
||||||
function WSCreateUser($userId, $password, $firstname, $lastname, $email, $role) {
|
function WSCreateUser($userId, $password, $firstname, $lastname, $email, $role) {
|
||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
$sessionId = $_SESSION['WS_SESSION_ID'];
|
|
||||||
$params = array('sessionId'=>$sessionId, 'userId'=>$userId, 'firstname'=>$firstname, 'lastname'=>$lastname, 'email'=>$email, 'role'=>$role, 'password'=>$password);
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$result = $client->__SoapCall('CreateUser', array($params));
|
$params = array("sessionId" => $sessionId, "userId" => $userId, "firstname" => $firstname, "lastname" => $lastname, "email" => $email, "role" => $role, "password" => $password);
|
||||||
|
|
||||||
|
$result = $client->__soapCall("CreateUser", array($params));
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
$fields['message'] = $result->message;
|
$fields["message"] = $result->message;
|
||||||
$fields['time_stamp'] = $result->timestamp;
|
$fields["time_stamp"] = $result->timestamp;
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -966,9 +1040,10 @@ function WSCreateUser($userId, $password, $firstname, $lastname, $email, $role)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function WSGetSession() {
|
function WSGetSession() {
|
||||||
if(isset($_SESSION['WS_SESSION_ID'])) {
|
if (isset($_SESSION["WS_SESSION_ID"])) {
|
||||||
return $_SESSION['WS_SESSION_ID'];
|
return $_SESSION["WS_SESSION_ID"];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
throw new Exception("SW session is not open!");
|
throw new Exception("SW session is not open!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1469,13 +1544,15 @@ function PMFDerivateCase($caseId, $delIndex, $bExecuteTriggersBeforeAssignment =
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function PMFNewCaseImpersonate($processId, $userId, $variables) {
|
function PMFNewCaseImpersonate($processId, $userId, $variables) {
|
||||||
G::LoadClass('wsBase');
|
G::LoadClass("wsBase");
|
||||||
$ws = new wsBase ();
|
|
||||||
|
$ws = new wsBase();
|
||||||
$result = $ws->newCaseImpersonate($processId, $userId, $variables);
|
$result = $ws->newCaseImpersonate($processId, $userId, $variables);
|
||||||
|
|
||||||
if($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
return 1;
|
return $result->caseId;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1366,15 +1366,21 @@ class wsBase
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$case = $oCase->startCase($tasks[0]['TAS_UID'], $userId);
|
$case = $oCase->startCase($tasks[0]['TAS_UID'], $userId);
|
||||||
$caseId = $case['APPLICATION'];
|
$caseId = $case['APPLICATION'];
|
||||||
|
$caseNumber = $case['CASE_NUMBER'];
|
||||||
|
|
||||||
$oldFields = $oCase->loadCase( $caseId );
|
$oldFields = $oCase->loadCase( $caseId );
|
||||||
|
|
||||||
$oldFields['APP_DATA'] = array_merge( $oldFields['APP_DATA'], $Fields);
|
$oldFields['APP_DATA'] = array_merge( $oldFields['APP_DATA'], $Fields);
|
||||||
|
|
||||||
$up_case = $oCase->updateCase($caseId, $oldFields);
|
$up_case = $oCase->updateCase($caseId, $oldFields);
|
||||||
|
|
||||||
$result = new wsResponse (0, G::loadTranslation ('ID_COMMAND_EXECUTED_SUCCESSFULLY'));
|
$result = new wsResponse (0, G::loadTranslation ('ID_COMMAND_EXECUTED_SUCCESSFULLY'));
|
||||||
|
|
||||||
|
$result->caseId = $caseId;
|
||||||
|
$result->caseNumber = $caseNumber;
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -349,6 +349,17 @@
|
|||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<xs:element name="newCaseImpersonateResponse">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="status_code" type="xs:integer"/>
|
||||||
|
<xs:element name="message" type="xs:string"/>
|
||||||
|
<xs:element name="timestamp" type="xs:string"/>
|
||||||
|
<xs:element name="caseId" minOccurs="0" type="xs:string"/>
|
||||||
|
<xs:element name="caseNumber" minOccurs="0" type="xs:string"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
<xs:complexType name="routeListStruct">
|
<xs:complexType name="routeListStruct">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="userId" type="xs:string"/>
|
<xs:element name="userId" type="xs:string"/>
|
||||||
@@ -743,6 +754,9 @@
|
|||||||
<message name="newCaseImpersonateRequest">
|
<message name="newCaseImpersonateRequest">
|
||||||
<part name="parameters" element="xs0:newCaseImpersonateRequest"/>
|
<part name="parameters" element="xs0:newCaseImpersonateRequest"/>
|
||||||
</message>
|
</message>
|
||||||
|
<message name="newCaseImpersonateResponse">
|
||||||
|
<part name="parameters" element="xs0:newCaseImpersonateResponse"/>
|
||||||
|
</message>
|
||||||
<message name="routeCaseRequest">
|
<message name="routeCaseRequest">
|
||||||
<part name="parameters" element="xs0:routeCaseRequest"/>
|
<part name="parameters" element="xs0:routeCaseRequest"/>
|
||||||
</message>
|
</message>
|
||||||
@@ -891,7 +905,7 @@
|
|||||||
</operation>
|
</operation>
|
||||||
<operation name="newCaseImpersonate">
|
<operation name="newCaseImpersonate">
|
||||||
<input message="xs0:newCaseImpersonateRequest"/>
|
<input message="xs0:newCaseImpersonateRequest"/>
|
||||||
<output message="xs0:pmResponse"/>
|
<output message="xs0:newCaseImpersonateResponse"/>
|
||||||
</operation>
|
</operation>
|
||||||
<operation name="routeCase">
|
<operation name="routeCase">
|
||||||
<input message="xs0:routeCaseRequest"/>
|
<input message="xs0:routeCaseRequest"/>
|
||||||
@@ -1096,7 +1110,7 @@
|
|||||||
</output>
|
</output>
|
||||||
</operation>
|
</operation>
|
||||||
<operation name="newCaseImpersonate">
|
<operation name="newCaseImpersonate">
|
||||||
<soap12:operation soapAction="urn:newCase" soapActionRequired="true" style="document"/>
|
<soap12:operation soapAction="urn:newCaseImpersonate" soapActionRequired="true" style="document"/>
|
||||||
<input>
|
<input>
|
||||||
<soap12:body use="literal"/>
|
<soap12:body use="literal"/>
|
||||||
</input>
|
</input>
|
||||||
|
|||||||
@@ -505,56 +505,72 @@
|
|||||||
return $res->getPayloadArray ( );
|
return $res->getPayloadArray ( );
|
||||||
}
|
}
|
||||||
|
|
||||||
function NewCaseImpersonate( $params ) {
|
function NewCaseImpersonate($params) {
|
||||||
$vsResult = isValidSession($params->sessionId);
|
$vsResult = isValidSession($params->sessionId);
|
||||||
if( $vsResult->status_code !== 0 ){
|
|
||||||
|
if ($vsResult->status_code !== 0) {
|
||||||
return $vsResult;
|
return $vsResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
if (ifPermission($params->sessionId, "PM_CASES") == 0) {
|
||||||
$result = new wsResponse (2, "You do not have privileges");
|
$result = new wsResponse(2, "You do not have privileges");
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ws = new wsBase ();
|
///////
|
||||||
$variables = $params->variables;
|
$variables = $params->variables;
|
||||||
foreach ( $variables as $key=>$val ){
|
|
||||||
$name = $val->name;
|
$field = array();
|
||||||
$value = $val->value;
|
|
||||||
eval('$Fields[ ' . $val->name . ' ]= $val->value ;');
|
if (is_object($variables)) {
|
||||||
|
$field[$variables->name] = $variables->value;
|
||||||
}
|
}
|
||||||
$params->variables = $Fields;
|
else {
|
||||||
|
if (is_array($variables)) {
|
||||||
|
foreach ($variables as $index => $obj) {
|
||||||
|
if (is_object($obj) && isset($obj->name) && isset($obj->value)) {
|
||||||
|
$field[$obj->name] = $obj->value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$params->variables = $field;
|
||||||
|
|
||||||
|
///////
|
||||||
|
$ws = new wsBase();
|
||||||
$res = $ws->newCaseImpersonate($params->processId, $params->userId, $params->variables);
|
$res = $ws->newCaseImpersonate($params->processId, $params->userId, $params->variables);
|
||||||
return $res->getPayloadArray ( ) ;
|
|
||||||
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
function NewCase( $params ) {
|
function NewCase($params) {
|
||||||
|
G::LoadClass("sessions");
|
||||||
G::LoadClass('sessions');
|
|
||||||
|
|
||||||
$vsResult = isValidSession($params->sessionId);
|
$vsResult = isValidSession($params->sessionId);
|
||||||
if( $vsResult->status_code !== 0 ){
|
|
||||||
|
if ($vsResult->status_code !== 0) {
|
||||||
return $vsResult;
|
return $vsResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
if (ifPermission($params->sessionId, "PM_CASES") == 0) {
|
||||||
$result = new wsResponse (2, "You do not have privileges");
|
$result = new wsResponse(2, "You do not have privileges");
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oSessions = new Sessions();
|
$oSession = new Sessions();
|
||||||
$session = $oSessions->getSessionUser($params->sessionId);
|
$session = $oSession->getSessionUser($params->sessionId);
|
||||||
$userId = $session['USR_UID'];
|
$userId = $session["USR_UID"];
|
||||||
$variables = $params->variables;
|
$variables = $params->variables;
|
||||||
|
|
||||||
/* this code is for previous version of ws, and apparently this will work for grids inside the variables..
|
/* this code is for previous version of ws, and apparently this will work for grids inside the variables..
|
||||||
if (!isset($params->variables) ) {
|
if (!isset($params->variables) ) {
|
||||||
$variables = array();
|
$variables = array();
|
||||||
$Fields = array();
|
$field = array();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( is_object ($variables) ) {
|
if ( is_object ($variables) ) {
|
||||||
$Fields[ $variables->name ]= $variables->value ;
|
$field[ $variables->name ]= $variables->value ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_array ( $variables) ) {
|
if ( is_array ( $variables) ) {
|
||||||
@@ -563,7 +579,7 @@
|
|||||||
$value = $val->value;
|
$value = $val->value;
|
||||||
if (!is_object($val->value))
|
if (!is_object($val->value))
|
||||||
{
|
{
|
||||||
eval('$Fields[ ' . $val->name . ' ]= $val->value ;');
|
eval('$field[ ' . $val->name . ' ]= $val->value ;');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -573,7 +589,7 @@
|
|||||||
if (isset($val1->value)) {
|
if (isset($val1->value)) {
|
||||||
if (is_array($val1->value->item)) {
|
if (is_array($val1->value->item)) {
|
||||||
foreach ($val1->value->item as $key2 => $val2) {
|
foreach ($val1->value->item as $key2 => $val2) {
|
||||||
$Fields[$val->name][$i][$val2->key] = $val2->value;
|
$field[$val->name][$i][$val2->key] = $val2->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -586,26 +602,28 @@
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
$variables = $params->variables;
|
$variables = $params->variables;
|
||||||
|
|
||||||
|
$field = array();
|
||||||
|
|
||||||
|
if (is_object($variables)) {
|
||||||
if ( is_object ($variables) ) {
|
$field[$variables->name]= $variables->value;
|
||||||
$Fields[ $variables->name ]= $variables->value ;
|
|
||||||
}
|
}
|
||||||
if ( is_array ( $variables) ) {
|
if (is_array($variables)) {
|
||||||
foreach ( $variables as $key=>$val ) {
|
foreach ($variables as $key => $val) {
|
||||||
if (!is_object($val->value)){
|
if (!is_object($val->value)) {
|
||||||
eval('$Fields[ ' . $val->name . ' ]= $val->value ;');
|
eval("\$field[" . $val->name . "]= \$val->value;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$params->variables = $Fields;
|
|
||||||
$ws = new wsBase ();
|
$params->variables = $field;
|
||||||
|
$ws = new wsBase();
|
||||||
$res = $ws->newCase($params->processId, $userId, $params->taskId, $params->variables);
|
$res = $ws->newCase($params->processId, $userId, $params->taskId, $params->variables);
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# we need to register the case id for a stored session variable. like a normal Session.
|
# we need to register the case id for a stored session variable. like a normal Session.
|
||||||
######################################################################
|
######################################################################
|
||||||
$oSessions->registerGlobal('APPLICATION', $res->caseId);
|
$oSession->registerGlobal("APPLICATION", $res->caseId);
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
|
|||||||
Reference in New Issue
Block a user