Merged colosa/processmaker into master
This commit is contained in:
@@ -129,6 +129,14 @@ class WebApplication
|
||||
switch ($type) {
|
||||
case self::SERVICE_API:
|
||||
$request = $this->parseApiRequestUri();
|
||||
|
||||
if ($request["version"] != $this->getApiVersion()) {
|
||||
$rest = new \Maveriks\Extension\Restler();
|
||||
$rest->setMessage(new RestException(Api::STAT_APP_EXCEPTION, "Invalid API version."));
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$this->loadEnvironment($request["workspace"]);
|
||||
|
||||
Util\Logger::log("REST API Dispatching url: ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]);
|
||||
@@ -554,4 +562,23 @@ class WebApplication
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getApiVersion()
|
||||
{
|
||||
try {
|
||||
$arrayConfig = array();
|
||||
|
||||
//$apiIniFile - Contains file name of api ini configuration
|
||||
$apiIniFile = $this->workflowDir . "engine" . DS . "src" . DS . "ProcessMaker" . DS . "Services" . DS . "api.ini";
|
||||
|
||||
if (file_exists($apiIniFile)) {
|
||||
$arrayConfig = Util\Common::parseIniFile($apiIniFile);
|
||||
}
|
||||
|
||||
return (isset($arrayConfig["api"]["version"]))? $arrayConfig["api"]["version"] : "1.0";
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,14 @@ class Cases
|
||||
$rs = TaskPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$countTaskLabel = 1;
|
||||
while ($row = $rs->getRow()) {
|
||||
if($row['TAS_TITLE'] != ''){
|
||||
$taskTitleLabel = $row['TAS_TITLE'];
|
||||
} else {
|
||||
$taskTitleLabel = G::LoadTranslation('ID_UNTITLED_TASK').' '.$countTaskLabel;
|
||||
$countTaskLabel++;
|
||||
}
|
||||
if ($typeView == 'category') {
|
||||
$taskTitle = TaskPeer::retrieveByPK($row['TAS_UID']);
|
||||
$row['TAS_TITLE'] = $taskTitle->getTasTitle();
|
||||
@@ -356,7 +363,7 @@ class Cases
|
||||
G::LoadTranslation('ID_PROCESS_NOCATEGORY') : $row['CATEGORY_NAME'];
|
||||
$rows[] = array(
|
||||
'uid' => $row['TAS_UID'],
|
||||
'value' => $row['PRO_TITLE'] . ' (' . $row['TAS_TITLE'] . ')',
|
||||
'value' => $row['PRO_TITLE'] . ' (' . $taskTitleLabel . ')',
|
||||
'pro_uid' => $row['PRO_UID'],
|
||||
'cat' => $row['PRO_CATEGORY'],
|
||||
'catname' => $row['CATEGORY_NAME']
|
||||
@@ -364,7 +371,7 @@ class Cases
|
||||
} else {
|
||||
$rows[] = array(
|
||||
'uid' => $row['TAS_UID'],
|
||||
'value' => $row['PRO_TITLE'] . ' (' . $row['TAS_TITLE'] . ')',
|
||||
'value' => $row['PRO_TITLE'] . ' (' . $taskTitleLabel . ')',
|
||||
'pro_uid' => $row['PRO_UID']
|
||||
);
|
||||
}
|
||||
|
||||
@@ -831,7 +831,7 @@ function getEmailConfiguration ()
|
||||
* @param array | $aAttachment = array() | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email.
|
||||
* @param boolean | $showMessage = true | Show message | Optional parameter. Set to TRUE to show the message in the case's message history.
|
||||
* @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case.
|
||||
* @param array | $config = array() | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure).
|
||||
* @param string(100) | $config = '' | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure) Or String: UID of Email server .
|
||||
* @return int | | result | Result of sending email
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -923,6 +923,18 @@ class wsBase
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!empty($config) && $licensedFeatures->verifyfeature('nKaNTNuT1MzK0RsMEtXTnYzR09ucHF2WGNuS0hRdDBBak42WXJhNVVOOG1INEVoaU1EaTllbjBBeEJNeG9wRVJ6NmxQelhyVTBvdThzPQ==')) {
|
||||
if(!is_array($config)){
|
||||
$emailServer = new EmailServer();
|
||||
$criteria = $emailServer->getSelAllColumns();
|
||||
$criteria->add(EmailServerPeer::MESS_UID, $config, CRITERIA::EQUAL);
|
||||
$criteria = EmailServerPeer::doSelectRS($criteria);
|
||||
$criteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
while ($criteria->next()) {
|
||||
$row = $criteria->getRow();
|
||||
$config = $row;
|
||||
$config['SMTPSecure'] = $row['SMTPSECURE'];
|
||||
}
|
||||
}
|
||||
$aSetup = $config;
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
<?php
|
||||
class EmailServer extends BaseEmailServer
|
||||
{
|
||||
/**
|
||||
* Get all columns by EMAIL_SERVER
|
||||
*
|
||||
* @return object criteria
|
||||
*/
|
||||
public function getSelAllColumns(){
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_UID);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_ENGINE);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_SERVER);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_PORT);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_RAUTH);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_ACCOUNT);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_PASSWORD);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_FROM_MAIL);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_FROM_NAME);
|
||||
$criteria->addSelectColumn( EmailServerPeer::SMTPSECURE);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_TRY_SEND_INMEDIATLY);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MAIL_TO);
|
||||
$criteria->addSelectColumn( EmailServerPeer::MESS_DEFAULT);
|
||||
return $criteria;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -565,6 +565,11 @@ class TriggerWizard
|
||||
break;
|
||||
case "bool":
|
||||
case "boolean":
|
||||
$paramValue = 'true';
|
||||
if($arrayParamData["input"][$paramName]!=''){
|
||||
$paramValue = $arrayParamData["input"][$paramName];
|
||||
}
|
||||
break;
|
||||
case "array":
|
||||
$paramValue = trim($arrayParamData["input"][$paramName]);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user