Merged in release/3.2 (pull request #5470)
Release/3.2 Approved-by: Paula Quispe
This commit is contained in:
@@ -2015,7 +2015,7 @@ class Cases
|
||||
* @return Fields
|
||||
*/
|
||||
|
||||
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array())
|
||||
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
|
||||
{
|
||||
if ($sTasUid != '') {
|
||||
try {
|
||||
@@ -2125,15 +2125,16 @@ class Cases
|
||||
if(!$isSubprocess){
|
||||
$Fields['APP_STATUS'] = 'DRAFT';
|
||||
}
|
||||
|
||||
$inbox = new ListInbox();
|
||||
$inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication);
|
||||
$inbox->newRow($Fields, $sUsrUid, $isSelfService);
|
||||
|
||||
//Multiple Instance
|
||||
foreach($aUserFields as $rowUser){
|
||||
$Fields["USR_UID"] = $rowUser["USR_UID"];
|
||||
$Fields["DEL_INDEX"] = $rowUser["DEL_INDEX"];
|
||||
$inbox = new ListInbox();
|
||||
$inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication);
|
||||
$inbox->newRow($Fields, $sUsrUid, $isSelfService);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} catch (exception $e) {
|
||||
@@ -4433,11 +4434,11 @@ class Cases
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$this->getExecuteTriggerProcess($sApplicationUID, 'REASSIGNED');
|
||||
|
||||
|
||||
//Delete record of the table LIST_UNASSIGNED
|
||||
$unassigned = new ListUnassigned();
|
||||
$unassigned->remove($sApplicationUID, $iDelegation);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -822,7 +822,7 @@ class Derivation
|
||||
$arrayApplicationData2["REMOVED_LIST"] = $removeList;
|
||||
|
||||
$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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1405,9 +1405,14 @@ class Derivation
|
||||
|
||||
//if there are subprocess to create
|
||||
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
|
||||
// set the initial date to null the time its created
|
||||
$aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields);
|
||||
//Set the initial date to null the time its created
|
||||
$aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields, $isSelfservice);
|
||||
|
||||
$taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ class pmDynaform
|
||||
private $dataSources = null;
|
||||
private $databaseProviders = null;
|
||||
private $propertiesToExclude = array();
|
||||
public static $prefixs = array("@@", "@#", "@%", "@?", "@$", "@=");
|
||||
|
||||
public function __construct($fields = array())
|
||||
{
|
||||
@@ -194,7 +195,7 @@ class pmDynaform
|
||||
$fn($json, $key, $value);
|
||||
}
|
||||
//set properties from trigger
|
||||
$prefixs = array("@@", "@#", "@%", "@?", "@$", "@=");
|
||||
$prefixs = self::$prefixs;
|
||||
if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) {
|
||||
$triggerValue = substr($value, 2);
|
||||
if (isset($this->fields["APP_DATA"][$triggerValue])) {
|
||||
|
||||
@@ -2439,35 +2439,36 @@ class workspaceTools
|
||||
CLI::logging("> Completed table LIST_PARTICIPATED_HISTORY\n");
|
||||
}
|
||||
|
||||
public function regenerateListParticipatedLast(){
|
||||
public function regenerateListParticipatedLast()
|
||||
{
|
||||
$this->initPropel(true);
|
||||
$query = 'INSERT INTO '.$this->dbName.'.LIST_PARTICIPATED_LAST
|
||||
$query = 'INSERT INTO ' . $this->dbName . '.LIST_PARTICIPATED_LAST
|
||||
(
|
||||
APP_UID,
|
||||
USR_UID,
|
||||
DEL_INDEX,
|
||||
TAS_UID,
|
||||
PRO_UID,
|
||||
APP_NUMBER,
|
||||
APP_TITLE,
|
||||
APP_PRO_TITLE,
|
||||
APP_TAS_TITLE,
|
||||
APP_STATUS,
|
||||
DEL_PREVIOUS_USR_UID,
|
||||
DEL_PREVIOUS_USR_USERNAME,
|
||||
DEL_PREVIOUS_USR_FIRSTNAME,
|
||||
DEL_PREVIOUS_USR_LASTNAME,
|
||||
DEL_CURRENT_USR_USERNAME,
|
||||
DEL_CURRENT_USR_FIRSTNAME,
|
||||
DEL_CURRENT_USR_LASTNAME,
|
||||
DEL_DELEGATE_DATE,
|
||||
DEL_INIT_DATE,
|
||||
DEL_DUE_DATE,
|
||||
DEL_CURRENT_TAS_TITLE,
|
||||
DEL_PRIORITY,
|
||||
DEL_THREAD_STATUS)
|
||||
|
||||
SELECT
|
||||
APP_UID,
|
||||
USR_UID,
|
||||
DEL_INDEX,
|
||||
TAS_UID,
|
||||
PRO_UID,
|
||||
APP_NUMBER,
|
||||
APP_TITLE,
|
||||
APP_PRO_TITLE,
|
||||
APP_TAS_TITLE,
|
||||
APP_STATUS,
|
||||
DEL_PREVIOUS_USR_UID,
|
||||
DEL_PREVIOUS_USR_USERNAME,
|
||||
DEL_PREVIOUS_USR_FIRSTNAME,
|
||||
DEL_PREVIOUS_USR_LASTNAME,
|
||||
DEL_CURRENT_USR_USERNAME,
|
||||
DEL_CURRENT_USR_FIRSTNAME,
|
||||
DEL_CURRENT_USR_LASTNAME,
|
||||
DEL_DELEGATE_DATE,
|
||||
DEL_INIT_DATE,
|
||||
DEL_DUE_DATE,
|
||||
DEL_CURRENT_TAS_TITLE,
|
||||
DEL_PRIORITY,
|
||||
DEL_THREAD_STATUS)
|
||||
|
||||
SELECT
|
||||
ACV.APP_UID,
|
||||
ACV.USR_UID,
|
||||
ACV.DEL_INDEX,
|
||||
@@ -2478,45 +2479,74 @@ class workspaceTools
|
||||
ACV.APP_PRO_TITLE,
|
||||
ACV.APP_TAS_TITLE,
|
||||
ACV.APP_STATUS,
|
||||
PRE_USR.USR_UID AS DEL_PREVIOUS_USR_UID,
|
||||
PRE_USR.USR_USERNAME AS DEL_PREVIOUS_USR_USERNAME,
|
||||
PRE_USR.USR_FIRSTNAME AS DEL_PREVIOUS_USR_FIRSTNAME,
|
||||
PRE_USR.USR_LASTNAME AS DEL_PREVIOUS_USR_LASTNAME,
|
||||
CUR_USR.USR_USERNAME AS DEL_CURRENT_USR_USERNAME,
|
||||
CUR_USR.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME,
|
||||
CUR_USR.USR_LASTNAME AS DEL_CURRENT_USR_LASTNAME,
|
||||
ACV.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
|
||||
ACV.DEL_INIT_DATE AS DEL_INIT_DATE,
|
||||
ACV.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
|
||||
CURR_USER_ACV.APP_TAS_TITLE AS DEL_CURRENT_TAS_TITLE,
|
||||
DEL_PREVIOUS_USR_UID,
|
||||
IFNULL(PRE_USR.USR_USERNAME, CUR_USR.USR_USERNAME) AS DEL_PREVIOUS_USR_USERNAME,
|
||||
IFNULL(PRE_USR.USR_FIRSTNAME, CUR_USR.USR_FIRSTNAME) AS DEL_PREVIOUS_USR_USERNAME,
|
||||
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_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME,
|
||||
CUR_USR.USR_LASTNAME AS DEL_CURRENT_USR_LASTNAME,
|
||||
ACV.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
|
||||
ACV.DEL_INIT_DATE AS DEL_INIT_DATE,
|
||||
ACV.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
|
||||
ACV.APP_TAS_TITLE AS DEL_CURRENT_TAS_TITLE,
|
||||
ACV.DEL_PRIORITY,
|
||||
ACV.DEL_THREAD_STATUS
|
||||
FROM
|
||||
(SELECT
|
||||
*, MAX(ACV_INT.DEL_INDEX) MAX_DEL_INDEX
|
||||
FROM
|
||||
'.$this->dbName.'.APP_CACHE_VIEW ACV_INT
|
||||
GROUP BY ACV_INT.APP_UID , ACV_INT.USR_UID) ACV
|
||||
INNER JOIN
|
||||
(SELECT
|
||||
ACV.APP_UID, ACV.USR_UID, ACV.APP_TAS_TITLE, ACV.PREVIOUS_USR_UID, ACV.DEL_INDEX
|
||||
FROM
|
||||
APP_CACHE_VIEW ACV
|
||||
INNER JOIN
|
||||
(SELECT
|
||||
ACV_INT.APP_UID, MAX(ACV_INT.DEL_INDEX) DEL_INDEX
|
||||
FROM
|
||||
'.$this->dbName.'.APP_CACHE_VIEW ACV_INT
|
||||
GROUP BY ACV_INT.APP_UID) LAST_ACV ON LAST_ACV.APP_UID = ACV.APP_UID
|
||||
AND LAST_ACV.DEL_INDEX = ACV.DEL_INDEX) CURR_USER_ACV ON CURR_USER_ACV.APP_UID = ACV.APP_UID
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.USERS PRE_USR ON CURR_USER_ACV.PREVIOUS_USR_UID = PRE_USR.USR_UID
|
||||
LEFT JOIN
|
||||
'.$this->dbName.'.USERS CUR_USR ON CURR_USER_ACV.USR_UID = CUR_USR.USR_UID
|
||||
';
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
CASE WHEN ACV1.PREVIOUS_USR_UID = \'\' AND ACV1.DEL_INDEX = 1
|
||||
THEN ACV1.USR_UID
|
||||
ELSE ACV1.PREVIOUS_USR_UID END AS DEL_PREVIOUS_USR_UID,
|
||||
ACV1.*
|
||||
FROM ' . $this->dbName . '.APP_CACHE_VIEW ACV1
|
||||
JOIN
|
||||
(SELECT
|
||||
ACV_INT.APP_UID,
|
||||
MAX(ACV_INT.DEL_INDEX) MAX_DEL_INDEX
|
||||
FROM
|
||||
' . $this->dbName . '.APP_CACHE_VIEW ACV_INT
|
||||
GROUP BY
|
||||
ACV_INT.USR_UID,
|
||||
ACV_INT.APP_UID
|
||||
) ACV2
|
||||
ON ACV2.APP_UID = ACV1.APP_UID AND ACV2.MAX_DEL_INDEX = ACV1.DEL_INDEX
|
||||
) ACV
|
||||
LEFT JOIN ' . $this->dbName . '.USERS PRE_USR ON ACV.PREVIOUS_USR_UID = PRE_USR.USR_UID
|
||||
LEFT JOIN ' . $this->dbName . '.USERS CUR_USR ON ACV.USR_UID = CUR_USR.USR_UID';
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
$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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
if (isset($data['REMOVED_LIST'])) {
|
||||
|
||||
@@ -99,7 +99,7 @@ class ListUnassigned extends BaseListUnassigned
|
||||
public function newRow ($data, $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->addSelectColumn( ApplicationPeer::APP_NUMBER );
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
sleep( 1 );
|
||||
global $RBAC;
|
||||
if ( $RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
if (isset( $_SESSION['processes_upload'] )) {
|
||||
$form = $_SESSION['processes_upload'];
|
||||
G::LoadClass('processes');
|
||||
$app = new Processes();
|
||||
if (!$app->processExists($form['PRO_UID'])) {
|
||||
$result = 0;
|
||||
$msg = G::LoadTranslation('ID_PROCESS_UID_NOT_DEFINED');
|
||||
echo "{'result': $result, 'msg':'$msg'}";
|
||||
die;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
if (isset($_SESSION['processes_upload'])) {
|
||||
$form = $_SESSION['processes_upload'];
|
||||
G::LoadClass('processes');
|
||||
$app = new Processes();
|
||||
if (!$app->processExists($form['PRO_UID'])) {
|
||||
$result = 0;
|
||||
$msg = G::LoadTranslation('ID_PROCESS_UID_NOT_DEFINED');
|
||||
echo "{'result': $result, 'msg':'$msg'}";
|
||||
die;
|
||||
}
|
||||
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 : '');
|
||||
break;
|
||||
case 'public':
|
||||
@@ -22,18 +23,29 @@ if ( $RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
default:
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($_FILES['form']['error'] == "0") {
|
||||
G::uploadFile( $_FILES['form']['tmp_name'], $sDirectory, $_FILES['form']['name'] );
|
||||
$msg = "Uploaded (" . (round( (filesize( $sDirectory . $_FILES['form']['name'] ) / 1024) * 10 ) / 10) . " kb)";
|
||||
$fileName = $_FILES['form']['name'];
|
||||
$canUploadPhpFile = true;
|
||||
$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;
|
||||
//echo $sDirectory.$_FILES['form']['name'];
|
||||
} else {
|
||||
$msg = "Failed";
|
||||
if ($canUploadPhpFile === false) {
|
||||
$msg = $message;
|
||||
}
|
||||
$result = 0;
|
||||
}
|
||||
|
||||
echo "{'result': $result, 'msg':'$msg'}";
|
||||
|
||||
echo "{'result': $result, 'msg':'$msg'}";
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?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' );
|
||||
@@ -1240,7 +1240,10 @@ function claimCase($params)
|
||||
return $res;
|
||||
}
|
||||
|
||||
$server = new SoapServer($wsdl);
|
||||
$options = array(
|
||||
'cache_wsdl' => WSDL_CACHE_NONE
|
||||
);
|
||||
$server = new SoapServer($wsdl, $options);
|
||||
|
||||
$server->addFunction("Login");
|
||||
$server->addFunction("ProcessList");
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
$filewsdl = PATH_METHODS . 'services' . PATH_SEP . 'pmos2.wsdl';
|
||||
$content = file_get_contents( $filewsdl );
|
||||
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
|
||||
$content = file_get_contents($filewsdl);
|
||||
|
||||
$http = (isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
|
||||
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . $lang . '/classic/services/soap2';
|
||||
$http = G::is_https() ? 'https' : 'http';
|
||||
$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 );
|
||||
|
||||
header( "Content-Type: application/xml;" );
|
||||
$content = str_replace("___SOAP_ADDRESS___", $endpoint, $content);
|
||||
|
||||
header("Content-Type: application/xml;");
|
||||
print $content;
|
||||
|
||||
|
||||
@@ -1698,19 +1698,29 @@ class Cases
|
||||
|
||||
if (isset($field['type'])) {
|
||||
if ($field['type'] != 'form') {
|
||||
if (isset($field['name']) && isset($appData[$field['name']])) {
|
||||
if (isset($field['dataType']) && $field['dataType'] != 'grid') {
|
||||
$caseVariable[$field['name']] = $appData[$field['name']];
|
||||
|
||||
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 ($field as &$val) {
|
||||
if (is_string($val) && in_array(substr($val, 0, 2), \pmDynaform::$prefixs)) {
|
||||
$val = substr($val, 2);
|
||||
}
|
||||
}
|
||||
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 {
|
||||
$caseVariableAux = $this->__getFieldsAndValuesByDynaFormAndAppData($field, $appData, $caseVariable);
|
||||
$caseVariable = array_merge($caseVariable, $caseVariableAux);
|
||||
|
||||
@@ -84,12 +84,13 @@ class FilesManager
|
||||
}
|
||||
}
|
||||
foreach ($aFiles as $aFile) {
|
||||
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE']);
|
||||
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE'], $aFile['FILE']);
|
||||
$fcontent = "";
|
||||
if ($getContent === true) {
|
||||
$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) {
|
||||
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
||||
$editable = $oProcessFiles->getPrfEditable();
|
||||
@@ -107,7 +108,8 @@ class FilesManager
|
||||
'prf_editable' => $editable,
|
||||
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
||||
'prf_update_date' => $oProcessFiles->getPrfUpdateDate(),
|
||||
'prf_content' => $fcontent);
|
||||
'prf_content' => $fcontent,
|
||||
'prf_derivation_screen' => $derivationScreen);
|
||||
} else {
|
||||
$extention = end(explode(".", $aFile['FILE']));
|
||||
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp'
|
||||
@@ -125,7 +127,8 @@ class FilesManager
|
||||
'prf_editable' => $editable,
|
||||
'prf_create_date' => '',
|
||||
'prf_update_date' => '',
|
||||
'prf_content' => $fcontent);
|
||||
'prf_content' => $fcontent,
|
||||
'prf_derivation_screen' => false);
|
||||
}
|
||||
}
|
||||
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 $fileName the name of template
|
||||
*
|
||||
* return array
|
||||
*/
|
||||
public function getFileManagerUid($path)
|
||||
public function getFileManagerUid($path, $fileName = '')
|
||||
{
|
||||
try {
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
@@ -406,11 +410,25 @@ class FilesManager
|
||||
$baseName2 = $path[count($path)-2]."/".$path[count($path)-1];
|
||||
$criteria = new \Criteria("workflow");
|
||||
$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 )));
|
||||
$rsCriteria = \ProcessFilesPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->next();
|
||||
return $rsCriteria->getRow();
|
||||
$row = array();
|
||||
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) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -68,19 +68,12 @@ class Light
|
||||
$task->setFormatFieldNameInUppercase(false);
|
||||
$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();
|
||||
$response = array();
|
||||
foreach ($processList as $key => $processInfo) {
|
||||
$tempTreeChildren = array ();
|
||||
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['processId'] = $processInfoChild['pro_uid'];
|
||||
$tempTreeChild['taskId'] = $processInfoChild['uid'];
|
||||
|
||||
@@ -1,123 +1,96 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
li {list-style-type: none;margin: 2; padding: 0; }
|
||||
body{
|
||||
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';
|
||||
<head>
|
||||
<style>
|
||||
li {list-style-type: none;margin: 2; padding: 0; }
|
||||
body{
|
||||
background:#fff;
|
||||
}
|
||||
|
||||
if(cClient.browser != 'msie'){
|
||||
interval = window.setInterval(function(){
|
||||
|
||||
var text = button.text();
|
||||
if (text.length < 13){
|
||||
button.text(text + '.');
|
||||
} else {
|
||||
button.text('Uploading');
|
||||
}
|
||||
|
||||
}, 200);
|
||||
#uxfiles{
|
||||
font-size:10px;border-width: 1px; border-style: solid; border-color: #000;
|
||||
padding:2px;
|
||||
padding-left:4px;
|
||||
padding-right:4px;
|
||||
width:284px;
|
||||
}
|
||||
|
||||
},
|
||||
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>');
|
||||
});
|
||||
</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 () {
|
||||
var button = $('#button1'), interval;
|
||||
new AjaxUpload(button, {
|
||||
action: 'processes_doUpload', // I disabled uploads in this example for security reasons
|
||||
name: 'form',
|
||||
onSubmit: function (file, ext) {
|
||||
if (cClient.browser != 'msie') {
|
||||
$("#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 {
|
||||
document.getElementById("uxfiles").innerHTML = '<font color=black>'+file+'</font> <font color='+xcolor+'>'+resp.msg+'<font>';
|
||||
// document.getElementById("uxfiles").style.display = 'block';
|
||||
$("#uxfiles").html('');
|
||||
}
|
||||
button.text('Upload++');
|
||||
window.clearInterval(interval);
|
||||
|
||||
document.getElementById('button1').disabled = false;
|
||||
$('#button1').attr('disabled',false);
|
||||
//alert(document.getElementById('button1').id);
|
||||
//parent.xReaload();
|
||||
//setTimeout('xclear()', 4000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
var xclear = function(){
|
||||
if(cClient.browser != 'msie'){
|
||||
$("#uxmsg").fadeOut(1500);
|
||||
} else {
|
||||
$("#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>
|
||||
}
|
||||
</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>
|
||||
</body>
|
||||
|
||||
@@ -96,33 +96,51 @@ function ws_parser($result) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
function ws_open() {
|
||||
global $sessionId;
|
||||
global $client;
|
||||
$endpoint = WS_WSDL_URL;
|
||||
$sessionId = '';
|
||||
/**
|
||||
* Initiates a connection using the SoapClient object, to start a web services
|
||||
* session in ProcessMaker.
|
||||
*
|
||||
* @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(
|
||||
$endpoint,
|
||||
['stream_context' => stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]])]
|
||||
);
|
||||
$streamContext = stream_context_create(array(
|
||||
'ssl' => array(
|
||||
'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;
|
||||
$pass = WS_USER_PASS;
|
||||
$user = WS_USER_ID;
|
||||
$pass = WS_USER_PASS;
|
||||
|
||||
$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) {
|
||||
$sessionId = $result->message;
|
||||
return 1;
|
||||
}
|
||||
throw (new Exception($result->message));
|
||||
if ($result->status_code == 0) {
|
||||
$sessionId = $result->message;
|
||||
return 1;
|
||||
}
|
||||
throw (new Exception($result->message));
|
||||
}
|
||||
|
||||
function ws_open_with_params($endpoint, $user, $pass) {
|
||||
|
||||
Reference in New Issue
Block a user