Merge remote branch 'upstream/master' into BUG-12374
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
* cron.php
|
||||
* @package workflow-engine-bin
|
||||
*/
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
ini_set('memory_limit', '300M'); // nore: this may need to be higher for many projects
|
||||
@@ -58,15 +57,24 @@ $bCronIsRunning = false;
|
||||
$sLastExecution = null;
|
||||
$processcTimeProcess = 0;
|
||||
$processcTimeStart = 0;
|
||||
|
||||
if (file_exists(PATH_DATA . "cron")) {
|
||||
$force = false;
|
||||
for ($i = 1; $i <= count($argv) - 1; $i++) {
|
||||
if (strpos($argv[$i], "+force") !== false) {
|
||||
$force = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$force) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$bCronIsRunning = (boolean)($arrayCron["bCronIsRunning"]);
|
||||
$sLastExecution = $arrayCron["sLastExecution"];
|
||||
$processcTimeProcess = (isset($arrayCron["processcTimeProcess"]))? intval($arrayCron["processcTimeProcess"]) : 10; //Minutes
|
||||
$processcTimeStart = (isset($arrayCron["processcTimeStart"]))? $arrayCron["processcTimeStart"] : 0;
|
||||
} else {
|
||||
G::rm_dir(PATH_DATA . "cron");
|
||||
}
|
||||
}
|
||||
|
||||
if ($bCronIsRunning && $processcTimeStart != 0) {
|
||||
if ((time() - $processcTimeStart) > ($processcTimeProcess * 60)) {
|
||||
//Cron finished his execution for some reason
|
||||
@@ -138,5 +146,6 @@ if (!$bCronIsRunning) {
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
} else {
|
||||
eprintln("The cron is running, please wait for it to finish.\nStarted in $sLastExecution");
|
||||
eprintln("If do you want force the execution use the option '+force', example: php -f +wworkflow +force" ,"green");
|
||||
}
|
||||
|
||||
|
||||
@@ -4920,10 +4920,10 @@ class Cases
|
||||
case "SELF_SERVICE":
|
||||
if ($swtplDefault == 1) {
|
||||
G::verifyPath($pathEmail, true); //Create if it does not exist
|
||||
$fileTemplate = $pathEmail . "unassignedMessage.html";
|
||||
$fileTemplate = $pathEmail . G::LoadTranslation('ID_UNASSIGNED_MESSAGE');
|
||||
|
||||
if (!file_exists($fileTemplate)) {
|
||||
@copy(PATH_TPL . "mails" . PATH_SEP . "unassignedMessage.html", $fileTemplate);
|
||||
@copy(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'), $fileTemplate);
|
||||
}
|
||||
|
||||
$sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields);
|
||||
@@ -5932,6 +5932,7 @@ class Cases
|
||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
|
||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
|
||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_INDEX);
|
||||
$oCriteria->addSelectColumn(AppDocumentPeer::DOC_VERSION);
|
||||
|
||||
$oCriteria->add(ApplicationPeer::PRO_UID, $PRO_UID);
|
||||
$oCriteria->addJoin(ApplicationPeer::APP_UID, AppDocumentPeer::APP_UID);
|
||||
|
||||
@@ -3866,7 +3866,11 @@ class Processes
|
||||
}
|
||||
|
||||
if (! file_exists( $dir . "unassignedMessage.html" )) {
|
||||
@copy( PATH_TPL . "mails" . PATH_SEP . "unassignedMessage.html", $dir . "unassignedMessage.html" );
|
||||
if (defined('PARTNER_FLAG')) {
|
||||
@copy( PATH_TPL . "mails" . PATH_SEP . "unassignedMessagePartner.html", $dir . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'));
|
||||
} else {
|
||||
@copy( PATH_TPL . "mails" . PATH_SEP . "unassignedMessage.html", $dir . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'));
|
||||
}
|
||||
}
|
||||
|
||||
$files = glob( $dir . "*.*" );
|
||||
@@ -3874,9 +3878,8 @@ class Processes
|
||||
foreach ($files as $file) {
|
||||
$fileName = basename( $file );
|
||||
|
||||
if ($fileName != "alert_message.html" && $fileName != "unassignedMessage.html") {
|
||||
$filesList[] = array ("filepath" => $file,"filename" => $fileName
|
||||
);
|
||||
if ($fileName != "alert_message.html" && $fileName != G::LoadTranslation('ID_UNASSIGNED_MESSAGE')) {
|
||||
$filesList[] = array ("filepath" => $file,"filename" => $fileName);
|
||||
}
|
||||
}
|
||||
return $filesList;
|
||||
|
||||
@@ -974,9 +974,14 @@ class wsBase
|
||||
|
||||
$hasEmailFrom = preg_match( '/(.+)@(.+)\.(.+)/', $sFrom, $match );
|
||||
|
||||
if (! $hasEmailFrom || strpos( $sFrom, $aSetup['MESS_ACCOUNT'] ) === false) {
|
||||
$sFrom = '"' . stripslashes( $sFrom ) . '" <' . $aSetup['MESS_ACCOUNT'] . ">";
|
||||
if (!$hasEmailFrom || strpos($sFrom, $aSetup["MESS_ACCOUNT"]) === false) {
|
||||
if (trim($aSetup["MESS_ACCOUNT"]) != "") {
|
||||
$sFrom = "\"" . stripslashes($sFrom) . "\" <" . $aSetup["MESS_ACCOUNT"] . ">";
|
||||
} else {
|
||||
$sFrom = "<info@" . $_SERVER["HTTP_HOST"] . ">";
|
||||
}
|
||||
}
|
||||
|
||||
$showMessage = ($showMessage) ? 1 : 0 ;
|
||||
|
||||
$messageArray = array(
|
||||
|
||||
@@ -672,6 +672,7 @@ class OutputDocument extends BaseOutputDocument
|
||||
$html2pdf->pdf->SetAuthor($aFields['USR_USERNAME']);
|
||||
$html2pdf->pdf->SetTitle('Processmaker');
|
||||
$html2pdf->pdf->SetSubject($sFilename);
|
||||
$html2pdf->pdf->SetCompression(true);
|
||||
|
||||
//$html2pdf->pdf->SetKeywords('HTML2PDF, TCPDF, processmaker');
|
||||
|
||||
@@ -798,6 +799,7 @@ class OutputDocument extends BaseOutputDocument
|
||||
$pdf->SetAuthor($aFields['USR_USERNAME']);
|
||||
$pdf->SetTitle('Processmaker');
|
||||
$pdf->SetSubject($sFilename);
|
||||
$pdf->SetCompression(true);
|
||||
|
||||
$margins = $aProperties['margins'];
|
||||
$margins["left"] = ($margins["left"] >= 0) ? $margins["left"] : PDF_MARGIN_LEFT;
|
||||
@@ -906,7 +908,7 @@ class OutputDocument extends BaseOutputDocument
|
||||
'margins' => array('left' => 15, 'right' => 15, 'top' => 15, 'bottom' => 15,),
|
||||
'encoding' => '',
|
||||
'ps2pdf' => false,
|
||||
'compress' => false,
|
||||
'compress' => true,
|
||||
'output' => 2,
|
||||
'pdfversion' => '1.3',
|
||||
'transparency_workaround' => false,
|
||||
|
||||
@@ -736,7 +736,7 @@ class Installer extends Controller
|
||||
|
||||
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
|
||||
$this->setPartner();
|
||||
$this->setConfiguration();
|
||||
//$this->setConfiguration();
|
||||
}
|
||||
|
||||
// Create the triggers
|
||||
@@ -1506,11 +1506,13 @@ class Installer extends Controller
|
||||
$dataPlugin = pathinfo($value);
|
||||
$namePlugin = $dataPlugin['filename'];
|
||||
if ($value != 'enterprise') {
|
||||
$db_host = trim( $_REQUEST['db_hostname'] );
|
||||
$db_hostname = trim( $_REQUEST['db_hostname'] );
|
||||
$db_port = trim( $_REQUEST['db_port'] );
|
||||
$db_username = trim( $_REQUEST['db_username'] );
|
||||
$db_password = trim( $_REQUEST['db_password'] );
|
||||
$wf = trim( $_REQUEST['wfDatabase'] );
|
||||
|
||||
$db_host = ($db_port != '' && $db_port != 3306) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
$link = @mysql_connect( $db_host, $db_username, $db_password );
|
||||
@mysql_select_db($wf, $link);
|
||||
$res = mysql_query( "SELECT STORE_ID FROM ADDONS_MANAGER WHERE ADDON_NAME = '" . $namePlugin . "'", $link );
|
||||
|
||||
@@ -68,8 +68,73 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
}
|
||||
}
|
||||
//now build the menu in xml format
|
||||
$xml = '<menu_cases>';
|
||||
|
||||
// Build xml nodes for a specific child node by its "id" on var "$_POST['node']" passed in a POST request
|
||||
if (isset($_POST['node']) && in_array($_POST['node'], array_keys($menuCases))) {
|
||||
$xml = new SimpleXMLElement('<?xml version="1.0" standalone="yes"?><menu_cases />');
|
||||
|
||||
if (array_key_exists('blockItems', $menuCases[$_POST['node']]) && is_array($menuCases[$_POST['node']]['blockItems'])) {
|
||||
foreach ($menuCases[$_POST['node']]['blockItems'] as $key => $item) {
|
||||
$option = $xml->addChild('option');
|
||||
$option->addAttribute('id', $key);
|
||||
$option->addAttribute('title', $item['label']);
|
||||
$option->addAttribute('url', $item['link']);
|
||||
|
||||
if (! empty($item['cases_count'])) {
|
||||
$option->addAttribute('cases_count', $item['cases_count']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo $xml->asXML();
|
||||
die;
|
||||
}
|
||||
|
||||
// Build xml document for all tree nodes
|
||||
$xml = new SimpleXMLElement('<?xml version="1.0" standalone="yes"?><menu_cases />');
|
||||
foreach ($menuCases as $menuId => $menuBlock) {
|
||||
if (isset($menuBlock['blockItems']) && count($menuBlock['blockItems']) > 0) {
|
||||
// adding "menu_block" node
|
||||
$menuBlockNode = $xml->addChild('menu_block');
|
||||
$menuBlockNode->addAttribute('id', $menuId);
|
||||
$menuBlockNode->addAttribute('blockTitle', $menuBlock['blockTitle']);
|
||||
|
||||
if (! empty($menuBlock['link'])) {
|
||||
$menuBlockNode->addAttribute('url', $menuBlock['link']);
|
||||
}
|
||||
|
||||
// adding "menu_block" childs nodes
|
||||
foreach ($menuBlock['blockItems'] as $id => $menu)
|
||||
{
|
||||
$option = $menuBlockNode->addChild('option');
|
||||
$option->addAttribute('id', $id);
|
||||
$option->addAttribute('title', $menu['label']);
|
||||
$option->addAttribute('url', $menu['link']);
|
||||
|
||||
if (! empty($menu['cases_count'])) {
|
||||
$option->addAttribute('cases_count', $menu['cases_count']);
|
||||
}
|
||||
}
|
||||
} elseif (isset($menuBlock['blockType']) && $menuBlock['blockType'] == "blockNestedTree") {
|
||||
$menuBlockNode = $xml->addChild('menu_block');
|
||||
$menuBlockNode->addAttribute('id', $menuId);
|
||||
$menuBlockNode->addAttribute('folderId', "0");
|
||||
$menuBlockNode->addAttribute('blockTitle', $menuBlock['blockTitle']);
|
||||
$menuBlockNode->addAttribute('blockNestedTree', $menuBlock['loaderurl']);
|
||||
} elseif (isset($menuBlock['blockType']) && $menuBlock['blockType'] == "blockHeaderNoChild") {
|
||||
$menuBlockNode = $xml->addChild('menu_block');
|
||||
$menuBlockNode->addAttribute('id', $menuId);
|
||||
$menuBlockNode->addAttribute('blockTitle', $menuBlock['blockTitle']);
|
||||
$menuBlockNode->addAttribute('blockHeaderNoChild', "blockHeaderNoChild");
|
||||
$menuBlockNode->addAttribute('url', $menuBlock['link']);
|
||||
}
|
||||
}
|
||||
|
||||
echo $xml->asXML();
|
||||
die;
|
||||
|
||||
// Build xml document for all tree nodes
|
||||
/*$xml = '<menu_cases>';
|
||||
$i = 0;
|
||||
foreach ($menuCases as $menu => $aMenuBlock) {
|
||||
if (isset( $aMenuBlock['blockItems'] ) && sizeof( $aMenuBlock['blockItems'] ) > 0) {
|
||||
@@ -100,7 +165,7 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
$xml .= '</menu_cases>';
|
||||
|
||||
print $xml;
|
||||
print $xml;*/
|
||||
}
|
||||
|
||||
// get the process summary of specific case list type,
|
||||
|
||||
@@ -86,7 +86,7 @@ try {
|
||||
$result->msg .= G::LoadTranslation("ID_FAILED_RECORD") . ($importResults->recordsCount - $importResults->recordsCountSuccess) . "\n";
|
||||
|
||||
if ($importResults->errMsg != '') {
|
||||
$result->msg .= "Errors registered: \n" . $importResults->errMsg . "\n";
|
||||
$result->msg .= G::LoadTranslation("ID_ERROR_REGISTERED"). " \n" . $importResults->errMsg . "\n";
|
||||
}
|
||||
|
||||
//$result->msg = htmlentities($result->msg);
|
||||
|
||||
@@ -20,6 +20,8 @@ var NOTIFIER_FLAG = false;
|
||||
var result;
|
||||
var _action = '';
|
||||
var _CASE_TITLE;
|
||||
//@var treeMenuItemsLoaded -> added to flag the "treeMenuItems" tree, to ensure that its onload event is executed just once
|
||||
var treeMenuItemsLoaded = false;
|
||||
|
||||
Ext.onReady(function(){
|
||||
new Ext.KeyMap(document, {
|
||||
@@ -229,11 +231,13 @@ Ext.onReady(function(){
|
||||
|
||||
var loader = treeMenuItems.getLoader();
|
||||
loader.on("load", function() {
|
||||
// it was added since the feature to reload a specific node of tree is now working
|
||||
if (! treeMenuItemsLoaded) { // this section of code should be executed once
|
||||
document.getElementById('casesSubFrame').src = defaultOption;
|
||||
|
||||
// check if a case was open directly
|
||||
if (defaultOption.indexOf('open') > -1) {
|
||||
//if it is, then update cases tree
|
||||
//if it is, then update cases trees
|
||||
updateCasesTree();
|
||||
}
|
||||
|
||||
@@ -248,6 +252,9 @@ Ext.onReady(function(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
treeMenuItemsLoaded = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<table width="100%" cellpadding="10" cellspacing="0" style="background: #FFFFFF; font: 11px arial, verdana, helvetica, sans-serif;">
|
||||
<tr>
|
||||
<td style="font-size: 14px;">
|
||||
<strong>CASO NAO ATRIBUÍDOS</strong>
|
||||
<hr />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
O caso <strong>#@#APP_NUMBER</strong> está disponível na lista não atribuído.
|
||||
<br />
|
||||
<br />
|
||||
Nota: Se você quer reivindicar o caso e ele não está disponível na lista, pode ser já tomadas.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<hr />
|
||||
Este processo de negócio é alimentado por DocSystem
|
||||
<br />
|
||||
<a href="http://www.docsystemcorp.com" style="color: #C40000;">www.docsystemcorp.com</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -47,6 +47,7 @@ Ext.onReady(function(){
|
||||
handler: newPMTable
|
||||
});
|
||||
}
|
||||
var flagProcessmap = (typeof('flagProcessmap') != 'undefined') ? flagProcessmap : 0;
|
||||
|
||||
newMenuOptions.push({
|
||||
text: _('ID_NEW_REPORT_TABLE'),
|
||||
@@ -414,7 +415,6 @@ DoNothing = function(){};
|
||||
|
||||
//Load New PM Table Forms
|
||||
NewReportTable = function() {
|
||||
var flagProcessmap = (typeof('flagProcessmap') != 'undefined') ? flagProcessmap : 0;
|
||||
if(PRO_UID !== false) {
|
||||
location.href = 'pmTables/edit?PRO_UID='+PRO_UID+'&tableType=report&flagProcessmap='+flagProcessmap;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user