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');

View File

@@ -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");

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) {

View File

@@ -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");

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" ) );

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,11 +98,13 @@ 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();

View File

@@ -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>