Merge branch 'master' of github.com:colosa/processmaker

Conflicts:
	workflow/engine/classes/model/Process.php
This commit is contained in:
Erik Amaru Ortiz
2014-01-23 21:26:44 -04:00
18 changed files with 112 additions and 88 deletions

View File

@@ -1727,7 +1727,7 @@ class G
* @param type Array $aFields
* @return type String
*/
public function replaceDataGridField($sContent, $aFields)
public function replaceDataGridField($sContent, $aFields, $nl2brRecursive = true)
{
$nrt = array("\n", "\r", "\t");
$nrthtml = array("(n /)", "(r /)", "(t /)");
@@ -1760,6 +1760,13 @@ class G
if (isset($aFields[$grdName]) && is_array($aFields[$grdName])) {
foreach ($aFields[$grdName] as $aRow) {
if ($nl2brRecursive) {
foreach ($aRow as $sKey => $vValue) {
if (!is_array($vValue)) {
$aRow[$sKey] = nl2br($aRow[$sKey]);
}
}
}
$strData = $strData . G::replaceDataField($arrayMatch2[2], $aRow);
}
}
@@ -1778,6 +1785,14 @@ class G
$sContent = $strContentAux;
if ($nl2brRecursive) {
foreach ($aFields as $sKey => $vValue) {
if (!is_array($vValue)) {
$aFields[$sKey] = nl2br($aFields[$sKey]);
}
}
}
$sContent = G::replaceDataField($sContent, $aFields);
return $sContent;

View File

@@ -4409,8 +4409,8 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
} else {
$isRequired = '0';
}
if ($v == 'today') {
$mask = str_replace( "%", "", $this->mask );
$mask = str_replace( "%", "", $this->mask );
if (trim($v) !== "") {
$v = date( masktophp($mask, $v) );
}
$html = '<input ' . $this->NSRequiredValue() . ' class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" pm:required="' . $isRequired . '" style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" ' . $this->NSGridType() . '/>' . htmlentities( $v, ENT_COMPAT, 'utf-8' );

View File

@@ -3,10 +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
$mem_limit = (int) ini_get('memory_limit');
if ( !defined('PATH_SEP') ) {
define('PATH_SEP', ( substr(PHP_OS, 0, 3) == 'WIN' ) ? '\\' : '/');

View File

@@ -3,10 +3,6 @@
* cron_single.php
* @package workflow-engine-bin
*/
ini_set('display_errors', 1);
error_reporting(E_ALL);
ini_set("memory_limit", "256M");
if (!defined('SYS_LANG')) {
define('SYS_LANG', 'en');
@@ -823,11 +819,11 @@ function executeCaseSelfService()
$taskSelfServiceTimeUnit = $row["TAS_SELFSERVICE_TIME_UNIT"];
$taskSelfServiceTriggerUid = $row["TAS_SELFSERVICE_TRIGGER_UID"];
if ($calendar->pmCalendarUid == '') {
$calendar->getCalendar(null, $appcacheProUid, $taskUid);
$calendar->getCalendarData();
if ($calendar->pmCalendarUid == '') {
$calendar->getCalendar(null, $appcacheProUid, $taskUid);
$calendar->getCalendarData();
}
$dueDate = $calendar->calculateDate(
$appcacheDelDelegateDate,
$taskSelfServiceTime,

View File

@@ -3906,12 +3906,12 @@ class Cases
if (AppDelegationPeer::doCount($oCriteria) == 1) {
$aFields['APP_STATUS'] = 'CANCELLED';
$oApplication->update($aFields);
G::LoadClass('reportTables');
require_once 'classes/model/AdditionalTables.php';
G::LoadClass('reportTables');
require_once 'classes/model/AdditionalTables.php';
$oReportTables = new ReportTables();
$addtionalTables = new additionalTables();
$oReportTables->updateTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $aFields['APP_DATA']);
$addtionalTables = new additionalTables();
$oReportTables->updateTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $aFields['APP_DATA']);
$addtionalTables->updateReportTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $aFields['APP_DATA'], $aFields['APP_STATUS']);
}
$this->CloseCurrentDelegation($sApplicationUID, $iIndex);
@@ -4932,9 +4932,9 @@ class Cases
throw (new Exception("Template file \"$fileTemplate\" does not exist."));
}
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $aFields);
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $aFields, false);
} else {
$sBody = nl2br(G::replaceDataGridField($aTaskInfo["TAS_DEF_MESSAGE"], $aFields));
$sBody = nl2br(G::replaceDataGridField($aTaskInfo["TAS_DEF_MESSAGE"], $aFields, false));
}
G::LoadClass("tasks");
@@ -5910,7 +5910,7 @@ class Cases
$oCriteria->add(AppMessagePeer::APP_MSG_SHOW_MESSAGE, 1);
}
$oCriteria->addAscendingOrderByColumn(AppMessagePeer::APP_MSG_DATE);
$oDataset = AppMessagePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
@@ -6759,27 +6759,27 @@ class Cases
}
}
public function ordProcess ($a, $b)
public function ordProcess ($a, $b)
{
if ($this->sort == '') {
$this->sort = 'APP_MSG_DATE';
}
if ($this->dir=='ASC') {
if ($a[$this->sort] > $b[$this->sort]) {
return 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
return - 1;
} else {
return 0;
}
} else {
if ($a[$this->sort] > $b[$this->sort]) {
return - 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
return 1;
} else {
return 0;
}
}
}
if ($this->dir=='ASC') {
if ($a[$this->sort] > $b[$this->sort]) {
return 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
return - 1;
} else {
return 0;
}
} else {
if ($a[$this->sort] > $b[$this->sort]) {
return - 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
return 1;
} else {
return 0;
}
}
}
}

View File

@@ -213,7 +213,9 @@ class dynaformEditor extends WebResource
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
}
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
if ($Properties["DYN_TYPE"] != "grid") {
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
}
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
//for showHide tab option @Neyek

View File

@@ -970,7 +970,7 @@ class wsBase
$Fields = array_merge( $oldFields['APP_DATA'], $appFields );
}
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $Fields);
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $Fields, false);
$hasEmailFrom = preg_match( '/(.+)@(.+)\.(.+)/', $sFrom, $match );
if (!$hasEmailFrom || strpos($sFrom, $aSetup["MESS_ACCOUNT"]) === false) {
@@ -3288,7 +3288,7 @@ class wsBase
return $result;
}
}
/**
* ClaimCase
*

View File

@@ -141,10 +141,10 @@ class workspaceTools
$this->dbHost = $values["DB_HOST"];
$this->dbUser = $values["DB_USER"];
$this->dbPass = $values["DB_PASS"];
$this->dbRbacHost = $values["DB_RBAC_HOST"];
$this->dbRbacName = $values["DB_RBAC_NAME"];
$this->dbRbacUser = $values["DB_RBAC_USER"];
$this->dbRbacHost = $values["DB_RBAC_HOST"];
$this->dbRbacName = $values["DB_RBAC_NAME"];
$this->dbRbacUser = $values["DB_RBAC_USER"];
$this->dbRbacPass = $values["DB_RBAC_PASS"];
return $this->dbInfo = $values;
@@ -361,7 +361,7 @@ class workspaceTools
}
return $this->db;
}
/**
* Close any database opened with getDatabase
*/
@@ -690,7 +690,7 @@ class workspaceTools
}
$oDataBase = $this->getDatabase($rbac);
$oDataBase->iFetchType = MYSQL_NUM;
$oDataBase->logQuery(count($changes));
@@ -1356,13 +1356,6 @@ class workspaceTools
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Database Upgrade Process took $final seconds.\n");
$start = microtime(true);
CLI::logging("> Updating cases directories structure...\n");
$workspace->upgradeCasesDirectoryStructure($workspaceName);
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Database Upgrade Structure Process took $final seconds.\n");
}
$start = microtime(true);
CLI::logging("> Updating cache view...\n");
@@ -1431,11 +1424,11 @@ class workspaceTools
return $result;
}
public function backupLogFiles()
{
$config = System::getSystemConfiguration();
clearstatcache();
$path = PATH_DATA . "log" . PATH_SEP;
$filePath = $path . "cron.log";

View File

@@ -303,7 +303,7 @@ class Event extends BaseEvent
$oTP = new TemplatePower( PATH_TPL . 'events' . PATH_SEP . 'sendMessage.tpl' );
$oTP->prepare();
$oTP->assign( 'from', 'info@processmaker.com' );
$oTP->assign( 'from', '<info@processmaker.com>' );
$oTP->assign( 'subject', addslashes( $aData['EVN_ACTION_PARAMETERS']['SUBJECT'] ) );
$oTP->assign( 'template', $aData['EVN_ACTION_PARAMETERS']['TEMPLATE'] );
$oTP->assign( 'timestamp', date( "l jS \of F Y h:i:s A" ) );
@@ -504,9 +504,9 @@ class Event extends BaseEvent
$when = (float) $aData['EVN_WHEN'];
$whenOccurs = $aData['EVN_WHEN_OCCURS'];
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
}
if ($whenOccurs == 'AFTER_TIME') {
@@ -620,9 +620,9 @@ class Event extends BaseEvent
$when = (float) $aData['EVN_WHEN'];
$whenOccurs = $aData['EVN_WHEN_OCCURS'];
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
}
if ($whenOccurs == 'AFTER_TIME') {
@@ -880,9 +880,9 @@ class Event extends BaseEvent
$when = $aData['EVN_WHEN']; //how many days
$whenOccurs = $aData['EVN_WHEN_OCCURS']; //time on action (AFTER_TIME/TASK_STARTED)
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
}
if ($whenOccurs == 'TASK_STARTED') {

View File

@@ -477,7 +477,7 @@ class OutputDocument extends BaseOutputDocument
public function generate($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $sTypeDocToGener = 'BOTH', $aProperties = array())
{
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
$sContent = nl2br(G::replaceDataGridField($sContent, $aFields));
$sContent = G::replaceDataGridField($sContent, $aFields);
G::verifyPath($sPath, true);

View File

@@ -725,7 +725,7 @@ class Process extends BaseProcess
$process['PRO_CREATE_DATE'] = date( $creationDateMask, mktime( $h, $i, $s, $m, $d, $y ) );
}
$process['PRO_CATEGORY_LABEL'] = trim( $process['PRO_CATEGORY'] ) != '' ? $process['CATEGORY_NAME'] : G::LoadTranslation( 'ID_PROCESS_NO_CATEGORY' );
$process['PRO_CATEGORY_LABEL'] = trim( $process['PRO_CATEGORY'] ) != '' ? $process['CATEGORY_NAME'] : '- ' . G::LoadTranslation( 'ID_PROCESS_NO_CATEGORY' ) . ' -';
$process['PRO_TITLE'] = $proTitle;
$process['PRO_DESCRIPTION'] = $proDescription;
$process['PRO_DEBUG'] = $process['PRO_DEBUG'];
@@ -885,9 +885,9 @@ class Process extends BaseProcess
if (($this->sort) == '') {
$this->sort = 'PRO_TITLE';
}
if ($a[$this->sort] > $b[$this->sort]) {
if (strtolower($a[$this->sort]) > strtolower($b[$this->sort])) {
return 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
} elseif (strtolower($a[$this->sort]) < strtolower($b[$this->sort])) {
return - 1;
} else {
return 0;
@@ -899,9 +899,9 @@ class Process extends BaseProcess
if (($this->sort) == '') {
$this->sort = 'PRO_TITLE';
}
if ($a[$this->sort] > $b[$this->sort]) {
if (strtolower($a[$this->sort]) > strtolower($b[$this->sort])) {
return - 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
} elseif (strtolower($a[$this->sort]) < strtolower($b[$this->sort])) {
return 1;
} else {
return 0;

View File

@@ -181,7 +181,7 @@ class AppProxy extends HttpProxyController
throw new Exception( G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' ) );
}
if ($httpData->action == 'sent') { // Get the last valid delegation for participated list
if (($httpData->action == 'sent') || ($httpData->action == 'search')){ // Get the last valid delegation for participated list
$criteria = new Criteria();
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$criteria->add(AppDelegationPeer::APP_UID, $httpData->appUid);

View File

@@ -98,16 +98,18 @@ try {
/**
* these routine is to verify if the case was acceded from advaced search list
*/
if ($_action == 'search') {
//verify if the case is with teh current user
$c = new Criteria( 'workflow' );
$c->add( AppDelegationPeer::APP_UID, $sAppUid );
$c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
$c->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
$oDataset = AppDelegationPeer::doSelectRs( $c );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aData = $oDataset->getRow();
if ($aData['USR_UID'] != $_SESSION['USER_LOGGED'] && $aData['USR_UID'] != "") {
//distinct "" for selfservice
//so we show just the resume

View File

@@ -2,12 +2,12 @@
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
try
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
catch (err)
{
parent.location = parent.location;
}
@@ -842,6 +842,7 @@ try {
}
break;
case '': //when this task is the Finish process
case 'nobody':
$userFields = $oDerivation->getUsersFullNameFromArray( $aFields['TASK'][$sKey]['USER_UID'] );
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_UID'] = $userFields['USR_FULLNAME'];
$aFields['TASK'][$sKey]['NEXT_TASK']['ROU_FINISH_FLAG'] = true;

View File

@@ -11,7 +11,7 @@ $user = new Users();
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && $userData['USR_AUTH_TYPE'] === '' ) {
$aSetup = getEmailConfiguration();
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
@@ -27,7 +27,20 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
$rbacUser->update($aData);
$user->update($aData);
*/
$sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>';
if (trim($aSetup["MESS_FROM_NAME"]) === '') {
$aSetup["MESS_FROM_NAME"] = 'PROCESSMAKER';
}
if ($aSetup['MESS_ENGINE'] === 'MAIL') {
$sFrom = $aSetup["MESS_FROM_NAME"] . " <info@" . ((isset($_SERVER["HTTP_HOST"]) && $_SERVER["HTTP_HOST"] != "") ? $_SERVER["HTTP_HOST"] : "processmaker.com") . ">";
} else {
if (trim($aSetup["MESS_ACCOUNT"]) === '') {
$sFrom = $aSetup["MESS_FROM_NAME"] . " <info@" . ((isset($_SERVER["HTTP_HOST"]) && $_SERVER["HTTP_HOST"] != "") ? $_SERVER["HTTP_HOST"] : "processmaker.com") . ">";
} else {
$sFrom = $aSetup["MESS_FROM_NAME"] . " <" . $aSetup["MESS_ACCOUNT"] . ">";
}
}
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
$msg .='<p>'.G::LoadTranslation('ID_YOUR_USERMANE_IS').' : <strong>'.$userData['USR_USERNAME'].'</strong></p>';
@@ -115,7 +128,11 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
G::SendTemporalMessage ($e->getMessage(), "warning", 'string');
}
} else {
$msg = G::LoadTranslation('ID_USER') . ' ' . htmlentities($data['USR_USERNAME'], ENT_QUOTES, 'UTF-8') . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
if ($userData['USR_AUTH_TYPE'] === '') {
$msg = G::LoadTranslation('ID_USER') . ' ' . htmlentities($data['USR_USERNAME'], ENT_QUOTES, 'UTF-8') . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
} else {
$msg = G::LoadTranslation('ID_USER_NOT_FUNCTIONALITY');
}
G::SendTemporalMessage ($msg, "warning", 'string');
G::header('location: forgotPassword');
}

View File

@@ -1,5 +1,6 @@
<?php
/**
*
* processes_ImportFile.php
*
* ProcessMaker Open Source Edition
@@ -20,6 +21,7 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
@@ -58,9 +60,9 @@ try {
) ) ));
}
foreach ($aFiles as $key => $val) {
if ($val['filename'] == $sClassName . '.php')
if (trim($val['filename']) == $sClassName . '.php')
$bMainFile = true;
if ($val['filename'] == $sClassName . PATH_SEP . 'class.' . $sClassName . '.php')
if (trim($val['filename']) == $sClassName . PATH_SEP . 'class.' . $sClassName . '.php')
$bClassFile = true;
}

View File

@@ -274,7 +274,7 @@
} else {
var selectId = "form[TASKS]["+optionSelect+"][USR_UID]";
if (typeof(document.getElementById(selectId)) != 'undefined' && document.getElementById(selectId) != null && userHidden == '') {
if (typeof(document.getElementById(selectId)) != 'undefined' && document.getElementById(selectId) != null && (rouType == 'SELECT' || userHidden == '')) {
var vtext = new input(document.getElementById(selectId));
// verify value select the option select

View File

@@ -18,7 +18,7 @@
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}"></td>
<td>{$form.SEND_EMAIL}</td>
<td>{$form.SEND_EMAIL} {$SEND_EMAIL}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}"><font color="red">* </font>{$TAS_DEF_SUBJECT_MESSAGE}</td>