Merged in release/3.2 (pull request #5472)
Release/3.2 Approved-by: Paula Quispe
This commit is contained in:
@@ -67,7 +67,7 @@ class RolesPermissions extends BaseRolesPermissions
|
|||||||
if (is_array($aRow)) {
|
if (is_array($aRow)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$this->permission_name = $aData['PER_NAME'];
|
$this->permission_name = isset($aData['PER_NAME']) ? $aData['PER_NAME'] : '';
|
||||||
|
|
||||||
$oRolesPermissions = new RolesPermissions();
|
$oRolesPermissions = new RolesPermissions();
|
||||||
$oRolesPermissions->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
$oRolesPermissions->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||||
|
|||||||
@@ -2039,7 +2039,7 @@ class Cases
|
|||||||
* @return Fields
|
* @return Fields
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array())
|
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
|
||||||
{
|
{
|
||||||
if ($sTasUid != '') {
|
if ($sTasUid != '') {
|
||||||
try {
|
try {
|
||||||
@@ -2182,15 +2182,16 @@ class Cases
|
|||||||
if(!$isSubprocess){
|
if(!$isSubprocess){
|
||||||
$Fields['APP_STATUS'] = 'DRAFT';
|
$Fields['APP_STATUS'] = 'DRAFT';
|
||||||
}
|
}
|
||||||
|
|
||||||
$inbox = new ListInbox();
|
$inbox = new ListInbox();
|
||||||
$inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication);
|
$inbox->newRow($Fields, $sUsrUid, $isSelfService);
|
||||||
|
|
||||||
//Multiple Instance
|
//Multiple Instance
|
||||||
foreach($aUserFields as $rowUser){
|
foreach($aUserFields as $rowUser){
|
||||||
$Fields["USR_UID"] = $rowUser["USR_UID"];
|
$Fields["USR_UID"] = $rowUser["USR_UID"];
|
||||||
$Fields["DEL_INDEX"] = $rowUser["DEL_INDEX"];
|
$Fields["DEL_INDEX"] = $rowUser["DEL_INDEX"];
|
||||||
$inbox = new ListInbox();
|
$inbox = new ListInbox();
|
||||||
$inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication);
|
$inbox->newRow($Fields, $sUsrUid, $isSelfService);
|
||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
@@ -4528,11 +4529,11 @@ class Cases
|
|||||||
|
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
$this->getExecuteTriggerProcess($sApplicationUID, 'REASSIGNED');
|
$this->getExecuteTriggerProcess($sApplicationUID, 'REASSIGNED');
|
||||||
|
|
||||||
//Delete record of the table LIST_UNASSIGNED
|
//Delete record of the table LIST_UNASSIGNED
|
||||||
$unassigned = new ListUnassigned();
|
$unassigned = new ListUnassigned();
|
||||||
$unassigned->remove($sApplicationUID, $iDelegation);
|
$unassigned->remove($sApplicationUID, $iDelegation);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -822,7 +822,7 @@ class Derivation
|
|||||||
$arrayApplicationData2["REMOVED_LIST"] = $removeList;
|
$arrayApplicationData2["REMOVED_LIST"] = $removeList;
|
||||||
|
|
||||||
$inbox = new ListInbox();
|
$inbox = new ListInbox();
|
||||||
$inbox->newRow($arrayApplicationData2, $arrayApplicationData["CURRENT_USER_UID"], false, array(), (($arrayNextDelegationData["TAS_ASSIGN_TYPE"] == "SELF_SERVICE")? true : false));
|
$inbox->newRow($arrayApplicationData2, $arrayApplicationData["CURRENT_USER_UID"], (($arrayNextDelegationData["TAS_ASSIGN_TYPE"] == "SELF_SERVICE")? true : false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1435,9 +1435,14 @@ class Derivation
|
|||||||
|
|
||||||
//if there are subprocess to create
|
//if there are subprocess to create
|
||||||
if (isset( $aSP )) {
|
if (isset( $aSP )) {
|
||||||
|
//Check if is Selfservice the task in the subprocess
|
||||||
|
$isSelfservice = false;
|
||||||
|
if (empty($aSP['USR_UID'])) {
|
||||||
|
$isSelfservice = true;
|
||||||
|
}
|
||||||
//Create the new case in the sub-process
|
//Create the new case in the sub-process
|
||||||
// set the initial date to null the time its created
|
//Set the initial date to null the time its created
|
||||||
$aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields);
|
$aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields, $isSelfservice);
|
||||||
|
|
||||||
$taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process
|
$taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class pmDynaform
|
|||||||
private $dataSources = null;
|
private $dataSources = null;
|
||||||
private $databaseProviders = null;
|
private $databaseProviders = null;
|
||||||
private $propertiesToExclude = array();
|
private $propertiesToExclude = array();
|
||||||
|
public static $prefixs = array("@@", "@#", "@%", "@?", "@$", "@=");
|
||||||
|
|
||||||
public function __construct($fields = array())
|
public function __construct($fields = array())
|
||||||
{
|
{
|
||||||
@@ -194,7 +195,7 @@ class pmDynaform
|
|||||||
$fn($json, $key, $value);
|
$fn($json, $key, $value);
|
||||||
}
|
}
|
||||||
//set properties from trigger
|
//set properties from trigger
|
||||||
$prefixs = array("@@", "@#", "@%", "@?", "@$", "@=");
|
$prefixs = self::$prefixs;
|
||||||
if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) {
|
if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) {
|
||||||
$triggerValue = substr($value, 2);
|
$triggerValue = substr($value, 2);
|
||||||
if (isset($this->fields["APP_DATA"][$triggerValue])) {
|
if (isset($this->fields["APP_DATA"][$triggerValue])) {
|
||||||
|
|||||||
@@ -2452,35 +2452,36 @@ class workspaceTools
|
|||||||
CLI::logging("> Completed table LIST_PARTICIPATED_HISTORY\n");
|
CLI::logging("> Completed table LIST_PARTICIPATED_HISTORY\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function regenerateListParticipatedLast(){
|
public function regenerateListParticipatedLast()
|
||||||
|
{
|
||||||
$this->initPropel(true);
|
$this->initPropel(true);
|
||||||
$query = 'INSERT INTO '.$this->dbName.'.LIST_PARTICIPATED_LAST
|
$query = 'INSERT INTO ' . $this->dbName . '.LIST_PARTICIPATED_LAST
|
||||||
(
|
(
|
||||||
APP_UID,
|
APP_UID,
|
||||||
USR_UID,
|
USR_UID,
|
||||||
DEL_INDEX,
|
DEL_INDEX,
|
||||||
TAS_UID,
|
TAS_UID,
|
||||||
PRO_UID,
|
PRO_UID,
|
||||||
APP_NUMBER,
|
APP_NUMBER,
|
||||||
APP_TITLE,
|
APP_TITLE,
|
||||||
APP_PRO_TITLE,
|
APP_PRO_TITLE,
|
||||||
APP_TAS_TITLE,
|
APP_TAS_TITLE,
|
||||||
APP_STATUS,
|
APP_STATUS,
|
||||||
DEL_PREVIOUS_USR_UID,
|
DEL_PREVIOUS_USR_UID,
|
||||||
DEL_PREVIOUS_USR_USERNAME,
|
DEL_PREVIOUS_USR_USERNAME,
|
||||||
DEL_PREVIOUS_USR_FIRSTNAME,
|
DEL_PREVIOUS_USR_FIRSTNAME,
|
||||||
DEL_PREVIOUS_USR_LASTNAME,
|
DEL_PREVIOUS_USR_LASTNAME,
|
||||||
DEL_CURRENT_USR_USERNAME,
|
DEL_CURRENT_USR_USERNAME,
|
||||||
DEL_CURRENT_USR_FIRSTNAME,
|
DEL_CURRENT_USR_FIRSTNAME,
|
||||||
DEL_CURRENT_USR_LASTNAME,
|
DEL_CURRENT_USR_LASTNAME,
|
||||||
DEL_DELEGATE_DATE,
|
DEL_DELEGATE_DATE,
|
||||||
DEL_INIT_DATE,
|
DEL_INIT_DATE,
|
||||||
DEL_DUE_DATE,
|
DEL_DUE_DATE,
|
||||||
DEL_CURRENT_TAS_TITLE,
|
DEL_CURRENT_TAS_TITLE,
|
||||||
DEL_PRIORITY,
|
DEL_PRIORITY,
|
||||||
DEL_THREAD_STATUS)
|
DEL_THREAD_STATUS)
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
ACV.APP_UID,
|
ACV.APP_UID,
|
||||||
ACV.USR_UID,
|
ACV.USR_UID,
|
||||||
ACV.DEL_INDEX,
|
ACV.DEL_INDEX,
|
||||||
@@ -2491,45 +2492,74 @@ class workspaceTools
|
|||||||
ACV.APP_PRO_TITLE,
|
ACV.APP_PRO_TITLE,
|
||||||
ACV.APP_TAS_TITLE,
|
ACV.APP_TAS_TITLE,
|
||||||
ACV.APP_STATUS,
|
ACV.APP_STATUS,
|
||||||
PRE_USR.USR_UID AS DEL_PREVIOUS_USR_UID,
|
DEL_PREVIOUS_USR_UID,
|
||||||
PRE_USR.USR_USERNAME AS DEL_PREVIOUS_USR_USERNAME,
|
IFNULL(PRE_USR.USR_USERNAME, CUR_USR.USR_USERNAME) AS DEL_PREVIOUS_USR_USERNAME,
|
||||||
PRE_USR.USR_FIRSTNAME AS DEL_PREVIOUS_USR_FIRSTNAME,
|
IFNULL(PRE_USR.USR_FIRSTNAME, CUR_USR.USR_FIRSTNAME) AS DEL_PREVIOUS_USR_USERNAME,
|
||||||
PRE_USR.USR_LASTNAME AS DEL_PREVIOUS_USR_LASTNAME,
|
IFNULL(PRE_USR.USR_LASTNAME, CUR_USR.USR_LASTNAME) AS DEL_PREVIOUS_USR_USERNAME,
|
||||||
CUR_USR.USR_USERNAME AS DEL_CURRENT_USR_USERNAME,
|
CUR_USR.USR_USERNAME AS DEL_CURRENT_USR_USERNAME,
|
||||||
CUR_USR.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME,
|
CUR_USR.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME,
|
||||||
CUR_USR.USR_LASTNAME AS DEL_CURRENT_USR_LASTNAME,
|
CUR_USR.USR_LASTNAME AS DEL_CURRENT_USR_LASTNAME,
|
||||||
ACV.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
|
ACV.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
|
||||||
ACV.DEL_INIT_DATE AS DEL_INIT_DATE,
|
ACV.DEL_INIT_DATE AS DEL_INIT_DATE,
|
||||||
ACV.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
|
ACV.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
|
||||||
CURR_USER_ACV.APP_TAS_TITLE AS DEL_CURRENT_TAS_TITLE,
|
ACV.APP_TAS_TITLE AS DEL_CURRENT_TAS_TITLE,
|
||||||
ACV.DEL_PRIORITY,
|
ACV.DEL_PRIORITY,
|
||||||
ACV.DEL_THREAD_STATUS
|
ACV.DEL_THREAD_STATUS
|
||||||
FROM
|
FROM
|
||||||
(SELECT
|
(
|
||||||
*, MAX(ACV_INT.DEL_INDEX) MAX_DEL_INDEX
|
SELECT
|
||||||
FROM
|
CASE WHEN ACV1.PREVIOUS_USR_UID = \'\' AND ACV1.DEL_INDEX = 1
|
||||||
'.$this->dbName.'.APP_CACHE_VIEW ACV_INT
|
THEN ACV1.USR_UID
|
||||||
GROUP BY ACV_INT.APP_UID , ACV_INT.USR_UID) ACV
|
ELSE ACV1.PREVIOUS_USR_UID END AS DEL_PREVIOUS_USR_UID,
|
||||||
INNER JOIN
|
ACV1.*
|
||||||
(SELECT
|
FROM ' . $this->dbName . '.APP_CACHE_VIEW ACV1
|
||||||
ACV.APP_UID, ACV.USR_UID, ACV.APP_TAS_TITLE, ACV.PREVIOUS_USR_UID, ACV.DEL_INDEX
|
JOIN
|
||||||
FROM
|
(SELECT
|
||||||
APP_CACHE_VIEW ACV
|
ACV_INT.APP_UID,
|
||||||
INNER JOIN
|
MAX(ACV_INT.DEL_INDEX) MAX_DEL_INDEX
|
||||||
(SELECT
|
FROM
|
||||||
ACV_INT.APP_UID, MAX(ACV_INT.DEL_INDEX) DEL_INDEX
|
' . $this->dbName . '.APP_CACHE_VIEW ACV_INT
|
||||||
FROM
|
GROUP BY
|
||||||
'.$this->dbName.'.APP_CACHE_VIEW ACV_INT
|
ACV_INT.USR_UID,
|
||||||
GROUP BY ACV_INT.APP_UID) LAST_ACV ON LAST_ACV.APP_UID = ACV.APP_UID
|
ACV_INT.APP_UID
|
||||||
AND LAST_ACV.DEL_INDEX = ACV.DEL_INDEX) CURR_USER_ACV ON CURR_USER_ACV.APP_UID = ACV.APP_UID
|
) ACV2
|
||||||
LEFT JOIN
|
ON ACV2.APP_UID = ACV1.APP_UID AND ACV2.MAX_DEL_INDEX = ACV1.DEL_INDEX
|
||||||
'.$this->dbName.'.USERS PRE_USR ON CURR_USER_ACV.PREVIOUS_USR_UID = PRE_USR.USR_UID
|
) ACV
|
||||||
LEFT JOIN
|
LEFT JOIN ' . $this->dbName . '.USERS PRE_USR ON ACV.PREVIOUS_USR_UID = PRE_USR.USR_UID
|
||||||
'.$this->dbName.'.USERS CUR_USR ON CURR_USER_ACV.USR_UID = CUR_USR.USR_UID
|
LEFT JOIN ' . $this->dbName . '.USERS CUR_USR ON ACV.USR_UID = CUR_USR.USR_UID';
|
||||||
';
|
|
||||||
$con = Propel::getConnection("workflow");
|
$con = Propel::getConnection("workflow");
|
||||||
$stmt = $con->createStatement();
|
$stmt = $con->createStatement();
|
||||||
$stmt->executeQuery($query);
|
$stmt->executeQuery($query);
|
||||||
|
CLI::logging("> Inserted data into table LIST_PARTICIPATED_LAST\n");
|
||||||
|
$query = 'UPDATE ' . $this->dbName . '.LIST_PARTICIPATED_LAST LPL, (
|
||||||
|
SELECT
|
||||||
|
TASK.TAS_TITLE,
|
||||||
|
CUR_USER.APP_UID,
|
||||||
|
USERS.USR_UID,
|
||||||
|
USERS.USR_USERNAME,
|
||||||
|
USERS.USR_FIRSTNAME,
|
||||||
|
USERS.USR_LASTNAME
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
APP_UID,
|
||||||
|
TAS_UID,
|
||||||
|
DEL_INDEX,
|
||||||
|
USR_UID
|
||||||
|
FROM ' . $this->dbName . '.APP_DELEGATION
|
||||||
|
WHERE DEL_LAST_INDEX = 1
|
||||||
|
) CUR_USER
|
||||||
|
LEFT JOIN ' . $this->dbName . '.USERS ON CUR_USER.USR_UID = USERS.USR_UID
|
||||||
|
LEFT JOIN ' . $this->dbName . '.TASK ON CUR_USER.TAS_UID = TASK.TAS_UID) USERS_VALUES
|
||||||
|
SET
|
||||||
|
LPL.DEL_CURRENT_USR_USERNAME = USERS_VALUES.USR_USERNAME,
|
||||||
|
LPL.DEL_CURRENT_USR_FIRSTNAME = USERS_VALUES.USR_FIRSTNAME,
|
||||||
|
LPL.DEL_CURRENT_USR_LASTNAME = USERS_VALUES.USR_LASTNAME,
|
||||||
|
LPL.DEL_CURRENT_TAS_TITLE = USERS_VALUES.TAS_TITLE
|
||||||
|
WHERE LPL.APP_UID = USERS_VALUES.APP_UID';
|
||||||
|
$con = Propel::getConnection("workflow");
|
||||||
|
$stmt = $con->createStatement();
|
||||||
|
CLI::logging("> Updating the current users data on table LIST_PARTICIPATED_LAST\n");
|
||||||
|
$stmt->executeQuery($query);
|
||||||
CLI::logging("> Completed table LIST_PARTICIPATED_LAST\n");
|
CLI::logging("> Completed table LIST_PARTICIPATED_LAST\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,20 @@ class ListInbox extends BaseListInbox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newRow ($data, $delPreviusUsrUid, $isInitSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
|
/**
|
||||||
|
* Define the variables before created the row
|
||||||
|
*
|
||||||
|
* This method is used before create the new data
|
||||||
|
* we completed the information about some variables
|
||||||
|
* for create the record
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
* @param string $delPreviusUsrUid Uid from the user previous
|
||||||
|
* @param boolean $isSelfService this value define if the case is Unassigned
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function newRow ($data, $delPreviusUsrUid, $isSelfService = false)
|
||||||
{
|
{
|
||||||
$removeList = true;
|
$removeList = true;
|
||||||
if (isset($data['REMOVED_LIST'])) {
|
if (isset($data['REMOVED_LIST'])) {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
public function newRow ($data, $delPreviusUsrUid)
|
public function newRow ($data, $delPreviusUsrUid)
|
||||||
{
|
{
|
||||||
$data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
|
$data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
|
||||||
$data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE'];
|
$data['DEL_DUE_DATE'] = isset($data['DEL_TASK_DUE_DATE']) ? $data['DEL_TASK_DUE_DATE'] : '';
|
||||||
|
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
$criteria->addSelectColumn( ApplicationPeer::APP_NUMBER );
|
$criteria->addSelectColumn( ApplicationPeer::APP_NUMBER );
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
sleep( 1 );
|
|
||||||
global $RBAC;
|
sleep(1);
|
||||||
if ( $RBAC->userCanAccess('PM_FACTORY') == 1) {
|
global $RBAC;
|
||||||
if (isset( $_SESSION['processes_upload'] )) {
|
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||||
$form = $_SESSION['processes_upload'];
|
if (isset($_SESSION['processes_upload'])) {
|
||||||
G::LoadClass('processes');
|
$form = $_SESSION['processes_upload'];
|
||||||
$app = new Processes();
|
G::LoadClass('processes');
|
||||||
if (!$app->processExists($form['PRO_UID'])) {
|
$app = new Processes();
|
||||||
$result = 0;
|
if (!$app->processExists($form['PRO_UID'])) {
|
||||||
$msg = G::LoadTranslation('ID_PROCESS_UID_NOT_DEFINED');
|
$result = 0;
|
||||||
echo "{'result': $result, 'msg':'$msg'}";
|
$msg = G::LoadTranslation('ID_PROCESS_UID_NOT_DEFINED');
|
||||||
die;
|
echo "{'result': $result, 'msg':'$msg'}";
|
||||||
}
|
die;
|
||||||
|
}
|
||||||
switch ($form['MAIN_DIRECTORY']) {
|
switch ($form['MAIN_DIRECTORY']) {
|
||||||
case 'mailTemplates':
|
case 'mailTemplates':
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $form['PRO_UID'] . PATH_SEP . ($form['CURRENT_DIRECTORY'] != '' ? $form['CURRENT_DIRECTORY'] . PATH_SEP : '');
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $form['PRO_UID'] . PATH_SEP . ($form['CURRENT_DIRECTORY'] != '' ? $form['CURRENT_DIRECTORY'] . PATH_SEP : '');
|
||||||
break;
|
break;
|
||||||
case 'public':
|
case 'public':
|
||||||
@@ -22,18 +23,29 @@ if ( $RBAC->userCanAccess('PM_FACTORY') == 1) {
|
|||||||
default:
|
default:
|
||||||
die();
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_FILES['form']['error'] == "0") {
|
$fileName = $_FILES['form']['name'];
|
||||||
G::uploadFile( $_FILES['form']['tmp_name'], $sDirectory, $_FILES['form']['name'] );
|
$canUploadPhpFile = true;
|
||||||
$msg = "Uploaded (" . (round( (filesize( $sDirectory . $_FILES['form']['name'] ) / 1024) * 10 ) / 10) . " kb)";
|
$extension = pathinfo($fileName, PATHINFO_EXTENSION);
|
||||||
|
if (\Bootstrap::getDisablePhpUploadExecution() === 1 && $extension === 'php') {
|
||||||
|
$message = \G::LoadTranslation('THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED');
|
||||||
|
\Bootstrap::registerMonologPhpUploadExecution('phpUpload', 550, $message, $fileName);
|
||||||
|
$canUploadPhpFile = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_FILES['form']['error'] == "0" && $canUploadPhpFile) {
|
||||||
|
G::uploadFile($_FILES['form']['tmp_name'], $sDirectory, $fileName);
|
||||||
|
$msg = "Uploaded (" . (round((filesize($sDirectory . $fileName) / 1024) * 10) / 10) . " kb)";
|
||||||
$result = 1;
|
$result = 1;
|
||||||
//echo $sDirectory.$_FILES['form']['name'];
|
|
||||||
} else {
|
} else {
|
||||||
$msg = "Failed";
|
$msg = "Failed";
|
||||||
|
if ($canUploadPhpFile === false) {
|
||||||
|
$msg = $message;
|
||||||
|
}
|
||||||
$result = 0;
|
$result = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "{'result': $result, 'msg':'$msg'}";
|
echo "{'result': $result, 'msg':'$msg'}";
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
ini_set( "soap.wsdl_cache_enabled", "0" ); //disabling WSDL cache
|
ini_set("soap.wsdl_cache_enabled", 0); //disabling WSDL cache
|
||||||
|
|
||||||
|
|
||||||
define( 'WEB_SERVICE_VERSION', '2.0' );
|
define( 'WEB_SERVICE_VERSION', '2.0' );
|
||||||
@@ -1240,7 +1240,10 @@ function claimCase($params)
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
$server = new SoapServer($wsdl);
|
$options = array(
|
||||||
|
'cache_wsdl' => WSDL_CACHE_NONE
|
||||||
|
);
|
||||||
|
$server = new SoapServer($wsdl, $options);
|
||||||
|
|
||||||
$server->addFunction("Login");
|
$server->addFunction("Login");
|
||||||
$server->addFunction("ProcessList");
|
$server->addFunction("ProcessList");
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$filewsdl = PATH_METHODS . 'services' . PATH_SEP . 'pmos2.wsdl';
|
$filewsdl = PATH_METHODS . 'services' . PATH_SEP . 'pmos2.wsdl';
|
||||||
$content = file_get_contents( $filewsdl );
|
$content = file_get_contents($filewsdl);
|
||||||
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
|
|
||||||
|
|
||||||
$http = (isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
|
$http = G::is_https() ? 'https' : 'http';
|
||||||
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . $lang . '/classic/services/soap2';
|
$port = $_SERVER['SERVER_PORT'] === '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
|
||||||
|
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
|
||||||
|
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . SYS_SYS . '/' . $lang . '/neoclassic/services/soap2';
|
||||||
|
|
||||||
$content = str_replace( "___SOAP_ADDRESS___", $endpoint, $content );
|
$content = str_replace("___SOAP_ADDRESS___", $endpoint, $content);
|
||||||
|
|
||||||
header( "Content-Type: application/xml;" );
|
|
||||||
|
|
||||||
|
header("Content-Type: application/xml;");
|
||||||
print $content;
|
print $content;
|
||||||
|
|
||||||
|
|||||||
@@ -1698,19 +1698,29 @@ class Cases
|
|||||||
|
|
||||||
if (isset($field['type'])) {
|
if (isset($field['type'])) {
|
||||||
if ($field['type'] != 'form') {
|
if ($field['type'] != 'form') {
|
||||||
if (isset($field['name']) && isset($appData[$field['name']])) {
|
foreach ($field as &$val) {
|
||||||
if (isset($field['dataType']) && $field['dataType'] != 'grid') {
|
if (is_string($val) && in_array(substr($val, 0, 2), \pmDynaform::$prefixs)) {
|
||||||
$caseVariable[$field['name']] = $appData[$field['name']];
|
$val = substr($val, 2);
|
||||||
|
|
||||||
if (isset($appData[$field['name'] . '_label'])) {
|
|
||||||
$caseVariable[$field['name'] . '_label'] = $appData[$field['name'] . '_label'];
|
|
||||||
} else {
|
|
||||||
$caseVariable[$field['name'] . '_label'] = '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$caseVariable[$field['name']] = $appData[$field['name']];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach ($appData as $key => $valueKey) {
|
||||||
|
if (in_array($key, $field, true) != false) {
|
||||||
|
$keyname = array_search($key, $field);
|
||||||
|
if (isset($field['dataType']) && $field['dataType'] != 'grid') {
|
||||||
|
$caseVariable[$field[$keyname]] = $appData[$field[$keyname]];
|
||||||
|
|
||||||
|
if (isset($appData[$field[$keyname] . '_label'])) {
|
||||||
|
$caseVariable[$field[$keyname] . '_label'] = $appData[$field[$keyname] . '_label'];
|
||||||
|
} else {
|
||||||
|
$caseVariable[$field[$keyname] . '_label'] = '';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$caseVariable[$field[$keyname]] = $appData[$field[$keyname]];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$caseVariableAux = $this->__getFieldsAndValuesByDynaFormAndAppData($field, $appData, $caseVariable);
|
$caseVariableAux = $this->__getFieldsAndValuesByDynaFormAndAppData($field, $appData, $caseVariable);
|
||||||
$caseVariable = array_merge($caseVariable, $caseVariableAux);
|
$caseVariable = array_merge($caseVariable, $caseVariableAux);
|
||||||
|
|||||||
@@ -84,12 +84,13 @@ class FilesManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($aFiles as $aFile) {
|
foreach ($aFiles as $aFile) {
|
||||||
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE']);
|
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE'], $aFile['FILE']);
|
||||||
$fcontent = "";
|
$fcontent = "";
|
||||||
if ($getContent === true) {
|
if ($getContent === true) {
|
||||||
$fcontent = file_get_contents($sDirectory . $aFile['FILE']);
|
$fcontent = file_get_contents($sDirectory . $aFile['FILE']);
|
||||||
}
|
}
|
||||||
$fileUid = $arrayFileUid["PRF_UID"];
|
$fileUid = isset($arrayFileUid["PRF_UID"]) ? $arrayFileUid["PRF_UID"] : '';
|
||||||
|
$derivationScreen = isset($arrayFileUid["DERIVATION_SCREEN_TPL"]) ? true : false;
|
||||||
if ($fileUid != null) {
|
if ($fileUid != null) {
|
||||||
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
||||||
$editable = $oProcessFiles->getPrfEditable();
|
$editable = $oProcessFiles->getPrfEditable();
|
||||||
@@ -107,7 +108,8 @@ class FilesManager
|
|||||||
'prf_editable' => $editable,
|
'prf_editable' => $editable,
|
||||||
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
||||||
'prf_update_date' => $oProcessFiles->getPrfUpdateDate(),
|
'prf_update_date' => $oProcessFiles->getPrfUpdateDate(),
|
||||||
'prf_content' => $fcontent);
|
'prf_content' => $fcontent,
|
||||||
|
'prf_derivation_screen' => $derivationScreen);
|
||||||
} else {
|
} else {
|
||||||
$extention = end(explode(".", $aFile['FILE']));
|
$extention = end(explode(".", $aFile['FILE']));
|
||||||
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp'
|
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp'
|
||||||
@@ -125,7 +127,8 @@ class FilesManager
|
|||||||
'prf_editable' => $editable,
|
'prf_editable' => $editable,
|
||||||
'prf_create_date' => '',
|
'prf_create_date' => '',
|
||||||
'prf_update_date' => '',
|
'prf_update_date' => '',
|
||||||
'prf_content' => $fcontent);
|
'prf_content' => $fcontent,
|
||||||
|
'prf_derivation_screen' => false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $aTheFiles;
|
return $aTheFiles;
|
||||||
@@ -389,13 +392,14 @@ class FilesManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get data of unique ids of a file
|
* Get data of unique ids of a file and if the template is used in a derivation screen
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
|
* @param string $fileName the name of template
|
||||||
*
|
*
|
||||||
* return array
|
* return array
|
||||||
*/
|
*/
|
||||||
public function getFileManagerUid($path)
|
public function getFileManagerUid($path, $fileName = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
@@ -406,11 +410,25 @@ class FilesManager
|
|||||||
$baseName2 = $path[count($path)-2]."/".$path[count($path)-1];
|
$baseName2 = $path[count($path)-2]."/".$path[count($path)-1];
|
||||||
$criteria = new \Criteria("workflow");
|
$criteria = new \Criteria("workflow");
|
||||||
$criteria->addSelectColumn(\ProcessFilesPeer::PRF_UID);
|
$criteria->addSelectColumn(\ProcessFilesPeer::PRF_UID);
|
||||||
|
$criteria->addSelectColumn(\ProcessPeer::PRO_DERIVATION_SCREEN_TPL);
|
||||||
|
$criteria->addSelectColumn(\TaskPeer::TAS_DERIVATION_SCREEN_TPL);
|
||||||
|
$criteria->addJoin(\ProcessFilesPeer::PRO_UID, \ProcessPeer::PRO_UID);
|
||||||
|
$criteria->addJoin(\ProcessPeer::PRO_UID, \TaskPeer::PRO_UID);
|
||||||
$criteria->add( $criteria->getNewCriterion( \ProcessFilesPeer::PRF_PATH, '%' . $baseName . '%', \Criteria::LIKE )->addOr( $criteria->getNewCriterion( \ProcessFilesPeer::PRF_PATH, '%' . $baseName2 . '%', \Criteria::LIKE )));
|
$criteria->add( $criteria->getNewCriterion( \ProcessFilesPeer::PRF_PATH, '%' . $baseName . '%', \Criteria::LIKE )->addOr( $criteria->getNewCriterion( \ProcessFilesPeer::PRF_PATH, '%' . $baseName2 . '%', \Criteria::LIKE )));
|
||||||
$rsCriteria = \ProcessFilesPeer::doSelectRS($criteria);
|
$rsCriteria = \ProcessFilesPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
$rsCriteria->next();
|
$row = array();
|
||||||
return $rsCriteria->getRow();
|
while ($rsCriteria->next()) {
|
||||||
|
$row = $rsCriteria->getRow();
|
||||||
|
if (!empty($row['PRO_DERIVATION_SCREEN_TPL']) && $row['PRO_DERIVATION_SCREEN_TPL'] == $fileName) {
|
||||||
|
$row['DERIVATION_SCREEN_TPL'] = true;
|
||||||
|
return $row;
|
||||||
|
} elseif (!empty($row['TAS_DERIVATION_SCREEN_TPL']) && $row['TAS_DERIVATION_SCREEN_TPL'] == $fileName) {
|
||||||
|
$row['DERIVATION_SCREEN_TPL'] = true;
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $row;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,19 +68,12 @@ class Light
|
|||||||
$task->setFormatFieldNameInUppercase(false);
|
$task->setFormatFieldNameInUppercase(false);
|
||||||
$task->setArrayParamException(array("taskUid" => "act_uid", "stepUid" => "step_uid"));
|
$task->setArrayParamException(array("taskUid" => "act_uid", "stepUid" => "step_uid"));
|
||||||
|
|
||||||
$webEntryEvent = new \ProcessMaker\BusinessModel\WebEntryEvent();
|
|
||||||
$arrayWebEntryEvent = array();
|
|
||||||
$allWebEntryEvents = $webEntryEvent->getAllWebEntryEvents();
|
|
||||||
foreach ($allWebEntryEvents as $webEntryEvents) {
|
|
||||||
$arrayWebEntryEvent[] = $webEntryEvents["ACT_UID"];
|
|
||||||
}
|
|
||||||
|
|
||||||
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
||||||
$response = array();
|
$response = array();
|
||||||
foreach ($processList as $key => $processInfo) {
|
foreach ($processList as $key => $processInfo) {
|
||||||
$tempTreeChildren = array ();
|
$tempTreeChildren = array ();
|
||||||
foreach ($processList[$key] as $keyChild => $processInfoChild) {
|
foreach ($processList[$key] as $keyChild => $processInfoChild) {
|
||||||
if (!in_array($processInfoChild['uid'], $arrayWebEntryEvent) && in_array($processInfoChild['pro_uid'], $bpmnProjects)) {
|
if (in_array($processInfoChild['pro_uid'], $bpmnProjects)) {
|
||||||
$tempTreeChild['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
|
$tempTreeChild['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
|
||||||
$tempTreeChild['processId'] = $processInfoChild['pro_uid'];
|
$tempTreeChild['processId'] = $processInfoChild['pro_uid'];
|
||||||
$tempTreeChild['taskId'] = $processInfoChild['uid'];
|
$tempTreeChild['taskId'] = $processInfoChild['uid'];
|
||||||
|
|||||||
@@ -1,123 +1,96 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
li {list-style-type: none;margin: 2; padding: 0; }
|
li {list-style-type: none;margin: 2; padding: 0; }
|
||||||
body{
|
body{
|
||||||
background:#fff;
|
background:#fff;
|
||||||
}
|
|
||||||
#uxfiles{
|
|
||||||
font-size:10px;border-width: 1px; border-style: solid; border-color: #000;
|
|
||||||
padding:2px;
|
|
||||||
padding-left:4px;
|
|
||||||
padding-right:4px;
|
|
||||||
width:284px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="/js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
|
|
||||||
<script src="/js/jquery/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript" src="/js/jquery/ajaxupload.3.6.js"></script>
|
|
||||||
|
|
||||||
<script type= "text/javascript">
|
|
||||||
|
|
||||||
var cClient = window.parent.getBrowserClient();
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
/* example 1 */
|
|
||||||
var button = $('#button1'), interval;
|
|
||||||
new AjaxUpload(button,{
|
|
||||||
action: 'processes_doUpload', // I disabled uploads in this example for security reasons
|
|
||||||
//action: 'upload.htm',
|
|
||||||
name: 'form',
|
|
||||||
onSubmit : function(file, ext){
|
|
||||||
|
|
||||||
if(cClient.browser != 'msie'){
|
|
||||||
$("#uxmsg").html('Uploading...');
|
|
||||||
$("#uxmsg").fadeIn(2000);
|
|
||||||
//this.disable();
|
|
||||||
$('#button1').attr('disabled',true);
|
|
||||||
} else {
|
|
||||||
// document.getElementById("uxfiles").style.display = 'block';
|
|
||||||
//$("#uxmsg").html('Uploading....');
|
|
||||||
document.getElementById("uxfiles").innerHTML = 'Uploading...';
|
|
||||||
//document.getElementById("uxfiles").style.display = 'block';
|
|
||||||
}
|
}
|
||||||
|
#uxfiles{
|
||||||
if(cClient.browser != 'msie'){
|
font-size:10px;border-width: 1px; border-style: solid; border-color: #000;
|
||||||
interval = window.setInterval(function(){
|
padding:2px;
|
||||||
|
padding-left:4px;
|
||||||
var text = button.text();
|
padding-right:4px;
|
||||||
if (text.length < 13){
|
width:284px;
|
||||||
button.text(text + '.');
|
|
||||||
} else {
|
|
||||||
button.text('Uploading');
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 200);
|
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
},
|
<script src="/js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
|
||||||
onComplete: function(file, response){
|
<script src="/js/jquery/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript" src="/js/jquery/ajaxupload.3.6.js"></script>
|
||||||
parent.xReaload();
|
<script type= "text/javascript">
|
||||||
|
var cClient = window.parent.getBrowserClient();
|
||||||
if(file.length>24) file = file.substr(0,24) + '..';
|
$(document).ready(function () {
|
||||||
|
var button = $('#button1'), interval;
|
||||||
resp = eval("("+response+")");
|
new AjaxUpload(button, {
|
||||||
xcolor = resp.result? 'green': red;
|
action: 'processes_doUpload', // I disabled uploads in this example for security reasons
|
||||||
if(cClient.browser != 'msie'){
|
name: 'form',
|
||||||
$("#uxmsg").fadeOut(1500, function(){
|
onSubmit: function (file, ext) {
|
||||||
$("#uxmsg").fadeIn(1100);
|
if (cClient.browser != 'msie') {
|
||||||
$("#uxmsg").html('<font color=black>'+file+'</font> <font color='+xcolor+'>'+resp.msg+'<font>');
|
$("#uxmsg").html('Uploading...');
|
||||||
});
|
$("#uxmsg").fadeIn(2000);
|
||||||
|
$('#button1').attr('disabled', true);
|
||||||
|
} else {
|
||||||
|
document.getElementById("uxfiles").innerHTML = 'Uploading...';
|
||||||
|
}
|
||||||
|
if (cClient.browser != 'msie') {
|
||||||
|
interval = window.setInterval(function () {
|
||||||
|
var text = button.text();
|
||||||
|
if (text.length < 13) {
|
||||||
|
button.text(text + '.');
|
||||||
|
} else {
|
||||||
|
button.text('Uploading');
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
onComplete: function (file, response) {
|
||||||
|
parent.xReaload();
|
||||||
|
if (file.length > 24) {
|
||||||
|
file = file.substr(0, 24) + '..';
|
||||||
|
}
|
||||||
|
resp = eval("(" + response + ")");
|
||||||
|
xcolor = resp.result ? 'green' : 'red';
|
||||||
|
if (cClient.browser != 'msie') {
|
||||||
|
$("#uxmsg").fadeOut(1500, function () {
|
||||||
|
$("#uxmsg").fadeIn(1100);
|
||||||
|
$("#uxmsg").html('<font color=black>' + file + '</font> <font color=' + xcolor + '>' + resp.msg + '<font>');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
document.getElementById("uxfiles").innerHTML = '<font color=black>' + file + '</font> <font color=' + xcolor + '>' + resp.msg + '<font>';
|
||||||
|
}
|
||||||
|
button.text('Upload++');
|
||||||
|
window.clearInterval(interval);
|
||||||
|
document.getElementById('button1').disabled = false;
|
||||||
|
$('#button1').attr('disabled', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
var xclear = function () {
|
||||||
|
if (cClient.browser != 'msie') {
|
||||||
|
$("#uxmsg").fadeOut(1500);
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("uxfiles").innerHTML = '<font color=black>'+file+'</font> <font color='+xcolor+'>'+resp.msg+'<font>';
|
$("#uxfiles").html('');
|
||||||
// document.getElementById("uxfiles").style.display = 'block';
|
|
||||||
}
|
}
|
||||||
button.text('Upload++');
|
}
|
||||||
window.clearInterval(interval);
|
</script>
|
||||||
|
</head>
|
||||||
document.getElementById('button1').disabled = false;
|
<body>
|
||||||
$('#button1').attr('disabled',false);
|
<table width="99%">
|
||||||
//alert(document.getElementById('button1').id);
|
<tbody>
|
||||||
//parent.xReaload();
|
<tr>
|
||||||
//setTimeout('xclear()', 4000);
|
<td valign="top">
|
||||||
}
|
<li id="e" class="e">
|
||||||
});
|
<div class="wrapper">
|
||||||
|
<table><tr>
|
||||||
|
<td><input type="button" id="button1" class="button" value="Browse"/></td>
|
||||||
|
<td><div id="uxfiles"> <span id="uxmsg" style="display:none">Select your file</span></div> </td>
|
||||||
|
</tr></table>
|
||||||
});
|
</div>
|
||||||
|
</li>
|
||||||
var xclear = function(){
|
</td>
|
||||||
if(cClient.browser != 'msie'){
|
</tr>
|
||||||
$("#uxmsg").fadeOut(1500);
|
</tbody>
|
||||||
} else {
|
</table>
|
||||||
$("#uxfiles").html('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<table width="99%">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
<li id="e" class="e">
|
|
||||||
<div class="wrapper">
|
|
||||||
<table><tr>
|
|
||||||
<td><input type="button" id="button1" class="button" value="Browse"/></td>
|
|
||||||
<td><div id="uxfiles"> <span id="uxmsg" style="display:none">Select your file</span></div> </td>
|
|
||||||
</tr></table>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -96,33 +96,51 @@ function ws_parser($result) {
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ws_open() {
|
/**
|
||||||
global $sessionId;
|
* Initiates a connection using the SoapClient object, to start a web services
|
||||||
global $client;
|
* session in ProcessMaker.
|
||||||
$endpoint = WS_WSDL_URL;
|
*
|
||||||
$sessionId = '';
|
* @global type $sessionId
|
||||||
|
* @global SoapClient $client
|
||||||
|
* @return int
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
function ws_open()
|
||||||
|
{
|
||||||
|
global $sessionId;
|
||||||
|
global $client;
|
||||||
|
$endpoint = WS_WSDL_URL;
|
||||||
|
$sessionId = '';
|
||||||
|
|
||||||
$client = new SoapClient(
|
$streamContext = stream_context_create(array(
|
||||||
$endpoint,
|
'ssl' => array(
|
||||||
['stream_context' => stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]])]
|
'verify_peer' => false,
|
||||||
);
|
'verify_peer_name' => false,
|
||||||
|
'allow_self_signed' => true
|
||||||
|
))
|
||||||
|
);
|
||||||
|
$options = array(
|
||||||
|
"cache_wsdl" => WSDL_CACHE_NONE,
|
||||||
|
"stream_context" => $streamContext
|
||||||
|
);
|
||||||
|
$client = new SoapClient($endpoint, $options);
|
||||||
|
|
||||||
$user = WS_USER_ID;
|
$user = WS_USER_ID;
|
||||||
$pass = WS_USER_PASS;
|
$pass = WS_USER_PASS;
|
||||||
|
|
||||||
$params = array (
|
$params = array(
|
||||||
'userid' => $user,
|
'userid' => $user,
|
||||||
'password' => $pass
|
'password' => $pass
|
||||||
);
|
);
|
||||||
$result = $client->__SoapCall('login', array (
|
$result = $client->__SoapCall('login', array(
|
||||||
$params
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
$sessionId = $result->message;
|
$sessionId = $result->message;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
throw (new Exception($result->message));
|
throw (new Exception($result->message));
|
||||||
}
|
}
|
||||||
|
|
||||||
function ws_open_with_params($endpoint, $user, $pass) {
|
function ws_open_with_params($endpoint, $user, $pass) {
|
||||||
|
|||||||
Reference in New Issue
Block a user