Merged in release/3.3 (pull request #6606)
HOR-4843 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
42
thirdparty/tcpdf/config/tcpdf_config.php
vendored
42
thirdparty/tcpdf/config/tcpdf_config.php
vendored
@@ -40,47 +40,21 @@
|
||||
|
||||
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
|
||||
|
||||
// DOCUMENT_ROOT fix for IIS Webserver
|
||||
if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
|
||||
if(isset($_SERVER['SCRIPT_FILENAME'])) {
|
||||
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
|
||||
} elseif(isset($_SERVER['PATH_TRANSLATED'])) {
|
||||
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
|
||||
} else {
|
||||
// define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
|
||||
$_SERVER['DOCUMENT_ROOT'] = '/';
|
||||
}
|
||||
}
|
||||
|
||||
// Automatic calculation for the following K_PATH_MAIN constant
|
||||
$k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
|
||||
if (substr($k_path_main, -1) != '/') {
|
||||
$k_path_main .= '/';
|
||||
}
|
||||
/**
|
||||
* Path of tcpdf library.
|
||||
*/
|
||||
define ('K_PATH_MAIN', PATH_THIRDPARTY . 'tcpdf' . PATH_SEP);
|
||||
|
||||
/**
|
||||
* Installation path (/var/www/tcpdf/).
|
||||
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
|
||||
* Build the URL
|
||||
*/
|
||||
define ('K_PATH_MAIN', $k_path_main);
|
||||
|
||||
// Automatic calculation for the following K_PATH_URL constant
|
||||
$k_path_url = $k_path_main; // default value for console mode
|
||||
if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
|
||||
if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
|
||||
$k_path_url = 'https://';
|
||||
} else {
|
||||
$k_path_url = 'http://';
|
||||
}
|
||||
$k_path_url .= $_SERVER['HTTP_HOST'];
|
||||
$k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
|
||||
}
|
||||
$protocol = G::is_https() ? "https://" : "http://";
|
||||
$host = $_SERVER["SERVER_NAME"] . ($_SERVER["SERVER_PORT"] != "80" ? ":" . $_SERVER["SERVER_PORT"] : "");
|
||||
|
||||
/**
|
||||
* URL path to tcpdf installation folder (http://localhost/tcpdf/).
|
||||
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
|
||||
*/
|
||||
define ('K_PATH_URL', $k_path_url);
|
||||
define ('K_PATH_URL', $protocol . $host . "/tcpdf/");
|
||||
|
||||
/**
|
||||
* path for PDF fonts
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\BusinessModel\EmailEvent;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
class Processes
|
||||
@@ -4183,26 +4184,19 @@ class Processes
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function createEmailEvent($processUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
$emailEvent = new \ProcessMaker\BusinessModel\EmailEvent();
|
||||
|
||||
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();
|
||||
$arrayEmailServerDefault = $emailServer->getEmailServerDefault();
|
||||
|
||||
$emailEvent = new EmailEvent();
|
||||
foreach ($arrayData as $value) {
|
||||
if (isset($value['__EMAIL_SERVER_UID_PRESERVED__']) && $value['__EMAIL_SERVER_UID_PRESERVED__'] === true) {
|
||||
unset($value['__EMAIL_SERVER_UID_PRESERVED__']);
|
||||
} else {
|
||||
} elseif(!EmailServer::exists($value['EMAIL_SERVER_UID'])) {
|
||||
unset($value['EMAIL_EVENT_FROM']);
|
||||
unset($value['EMAIL_SERVER_UID']);
|
||||
if (!empty($arrayEmailServerDefault)) {
|
||||
$value['EMAIL_EVENT_FROM'] = $arrayEmailServerDefault['MESS_ACCOUNT'];
|
||||
$value['EMAIL_SERVER_UID'] = $arrayEmailServerDefault['MESS_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
$emailEventData = $emailEvent->save($processUid, $value);
|
||||
|
||||
@@ -336,8 +336,13 @@ class CaseScheduler extends BaseCaseScheduler
|
||||
|
||||
$testConnection = true;
|
||||
try {
|
||||
@$client = new SoapClient("http://" . $url);
|
||||
$client = new SoapClient("http://" . $url);
|
||||
} catch (SoapFault $fault) {
|
||||
/* Laravel register a exception handler that catch the exception throwed by the class SoapClient,
|
||||
* by this reason now the "Error Control Operator @" doesn't works when a exception is throwed,
|
||||
* so, we need to clear the last error catched.
|
||||
*/
|
||||
error_clear_last();
|
||||
$testConnection = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,46 @@
|
||||
<?php
|
||||
|
||||
class EmailServer extends BaseEmailServer
|
||||
{
|
||||
/**
|
||||
* Get the evn_description column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function loadDefaultAccount ()
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
/**
|
||||
* Load the default account
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function loadDefaultAccount()
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(EmailServerPeer::MESS_ACCOUNT);
|
||||
$c->add(EmailServerPeer::MESS_DEFAULT, 1);
|
||||
$rs = EmailServerPeer::doSelectRS($c, Propel::getDBConnection('workflow_ro'));
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$response = $rs->getRow();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( EmailServerPeer::MESS_ACCOUNT );
|
||||
return $response;
|
||||
}
|
||||
|
||||
$c->add( EmailServerPeer::MESS_DEFAULT, 1 );
|
||||
/**
|
||||
* Check if the MESS_UID exist
|
||||
*
|
||||
* @param string $emailServerUid
|
||||
*
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function exists($emailServerUid)
|
||||
{
|
||||
try {
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(EmailServerPeer::MESS_UID, $emailServerUid, Criteria::EQUAL);
|
||||
$dataset = EmailServerPeer::doSelectOne($criteria);
|
||||
|
||||
$rs = EmailServerPeer::doSelectRS( $c, Propel::getDBConnection('workflow_ro') );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$response=$row;
|
||||
return !is_null($dataset);
|
||||
|
||||
return $response;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -466,8 +466,17 @@ class EmailEvent
|
||||
}
|
||||
$arrayData = $this->existsEvent($prj_uid, $eventUid);
|
||||
if (sizeof($arrayData)) {
|
||||
$oEmailServer = new EmailServer();
|
||||
$configEmailData = $oEmailServer->getEmailServer($arrayData[7]);
|
||||
$emailServer = new EmailServer();
|
||||
if (empty($arrayData[7])){
|
||||
$configEmailData = $emailServer->getEmailServerDefault();
|
||||
//We will to show a message, if is not defined the email server default
|
||||
if(empty($configEmailData)){
|
||||
$emailServer->throwExceptionIfNotExistsEmailServer('', 'MESS_UID');
|
||||
}
|
||||
} else {
|
||||
$configEmailData = $emailServer->getEmailServer($arrayData[7]);
|
||||
}
|
||||
|
||||
$emailGroupTo = [];
|
||||
$emailTo = '';
|
||||
$prfUid = $arrayData[6];
|
||||
|
||||
@@ -7,6 +7,7 @@ use AppDelegation;
|
||||
use AppDelegationPeer;
|
||||
use Criteria;
|
||||
use Exception;
|
||||
use ListUnassigned;
|
||||
use Luracast\Restler\RestException;
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
use ProcessMaker\BusinessModel\User as BmUser;
|
||||
@@ -118,15 +119,14 @@ class Cases extends Api
|
||||
|
||||
return $user->userCanReassign($usrUid, $arrayApplicationData['PRO_UID']);
|
||||
break;
|
||||
case "doGetCaseInfo" :
|
||||
case 'doGetCaseInfo':
|
||||
$appUid = $this->parameters[$arrayArgs['app_uid']];
|
||||
$usrUid = $this->getUserId();
|
||||
//Check if the user is supervisor process
|
||||
|
||||
$case = new BmCases();
|
||||
$user = new BmUser();
|
||||
$arrayApplicationData = $case->getApplicationRecordByPk($appUid, [], false);
|
||||
if (!empty($arrayApplicationData)) {
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$criteria->add(AppDelegationPeer::USR_UID, $usrUid);
|
||||
@@ -134,11 +134,26 @@ class Cases extends Api
|
||||
$rsCriteria = AppDelegationPeer::doSelectRS($criteria);
|
||||
if ($rsCriteria->next()) {
|
||||
return true;
|
||||
} else {
|
||||
$supervisor = new BmProcessSupervisor();
|
||||
$flagps = $supervisor->isUserProcessSupervisor($arrayApplicationData['PRO_UID'], $usrUid);
|
||||
return $flagps;
|
||||
}
|
||||
|
||||
//verify unassigned
|
||||
$list = new ListUnassigned();
|
||||
$data = $list->loadList($usrUid, ['search' => $appUid, 'caseLink' => true, 'limit' => 1]);
|
||||
|
||||
if ($data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Check if the user is a process supervisor or has summary form view permission
|
||||
$userCanAccess = $case->userAuthorization(
|
||||
$usrUid,
|
||||
$arrayApplicationData['PRO_UID'],
|
||||
$appUid,
|
||||
[],
|
||||
['SUMMARY_FORM' => 'VIEW']
|
||||
);
|
||||
|
||||
return $userCanAccess['supervisor'] || $userCanAccess['objectPermissions']['SUMMARY_FORM'];
|
||||
}
|
||||
break;
|
||||
case 'doDownloadInputDocument':
|
||||
|
||||
Reference in New Issue
Block a user