Merge remote branch 'upstream/master' into PM-1473_16662

This commit is contained in:
marcelo.cuiza
2015-02-05 10:47:33 -04:00
5 changed files with 32 additions and 27 deletions

View File

@@ -533,20 +533,20 @@ function resendEmails()
setExecutionResultMessage("DONE"); setExecutionResultMessage("DONE");
} catch (Exception $e) { } catch (Exception $e) {
$c = new Criteria("workflow"); $c = new Criteria("workflow");
$c->clearSelectColumns(); $c->clearSelectColumns();
$c->addSelectColumn(ConfigurationPeer::CFG_UID); $c->addSelectColumn(ConfigurationPeer::CFG_UID);
$c->add(ConfigurationPeer::CFG_UID, "Emails"); $c->add(ConfigurationPeer::CFG_UID, "Emails");
$result = ConfigurationPeer::doSelectRS($c); $result = ConfigurationPeer::doSelectRS($c);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC); $result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if($result->next()) { if($result->next()) {
setExecutionResultMessage("WARNING", "warning"); setExecutionResultMessage("WARNING", "warning");
$message = "Emails won't send, but the cron will continue with its execution"; $message = "Emails won't be sent, but the cron will continue its execution";
eprintln(" '-" . $message, "yellow"); eprintln(" '-" . $message, "yellow");
} else { } else {
setExecutionResultMessage("WITH ERRORS", "error"); setExecutionResultMessage("WITH ERRORS", "error");
eprintln(" '-" . $e->getMessage(), "red"); eprintln(" '-" . $e->getMessage(), "red");
} }
saveLog("resendEmails", "error", "Error Resending Emails: " . $e->getMessage()); saveLog("resendEmails", "error", "Error Resending Emails: " . $e->getMessage());
} }

View File

@@ -177,6 +177,7 @@ class adminProxy extends HttpProxyController
$httpData=array_unique((array)$httpData); $httpData=array_unique((array)$httpData);
$message = ''; $message = '';
$oldName = isset($_POST['oldName'])? $_POST['oldName']:''; $oldName = isset($_POST['oldName'])? $_POST['oldName']:'';
$uid = isset($_POST['uid'])? $_POST['uid']:'';
switch ($_POST['action']){ switch ($_POST['action']){
case 'calendarName': case 'calendarName':
@@ -184,18 +185,22 @@ class adminProxy extends HttpProxyController
$oCalendar = new CalendarDefinition(); $oCalendar = new CalendarDefinition();
$aCalendars = $oCalendar->getCalendarList(false,true); $aCalendars = $oCalendar->getCalendarList(false,true);
$aCalendarDefinitions = end($aCalendars); $aCalendarDefinitions = end($aCalendars);
foreach ($aCalendarDefinitions as $aDefinitions) { foreach ($aCalendarDefinitions as $aDefinitions) {
if (trim($_POST['name'])=='') { if (trim($_POST['name'])=='') {
$validated = false; $validated = false;
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME'); $message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
break; break;
} }
if (isset($aDefinitions['CALENDAR_NAME'])) { if (isset($aDefinitions['CALENDAR_NAME'])) {
if ($aDefinitions['CALENDAR_NAME'] == $_POST['name']) {
$validated = false; if ($aDefinitions['CALENDAR_UID'] != $uid) {
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME'); if ($aDefinitions['CALENDAR_NAME'] == $_POST['name']) {
break; $validated = false;
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
break;
}
} }
} }
} }

View File

@@ -1,6 +1,8 @@
<?php <?php
namespace ProcessMaker\BusinessModel; namespace ProcessMaker\BusinessModel;
use \G;
class Variable class Variable
{ {
/** /**
@@ -487,7 +489,7 @@ class Variable
$variableDbConnectionUid = $row["VAR_DBCONNECTION"]; $variableDbConnectionUid = $row["VAR_DBCONNECTION"];
$variableSql = $row["VAR_SQL"]; $variableSql = $row["VAR_SQL"];
} else { } else {
throw new \Exception(\G::LoadTranslation("ID_PROCESS_VARIABLE_DOES_NOT_EXIST", array(strtolower("VAR_NAME"), $variableName))); throw new \Exception(G::LoadTranslation("ID_PROCESS_VARIABLE_DOES_NOT_EXIST", array(strtolower("VAR_NAME"), $variableName)));
} }
//Verify data //Verify data
@@ -499,7 +501,9 @@ class Variable
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow"); $cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow");
$stmt = $cnn->createStatement(); $stmt = $cnn->createStatement();
$rs = $stmt->executeQuery(\G::replaceDataField($variableSql, $arrayVariable), \ResultSet::FETCHMODE_NUM); $replaceFields = G::replaceDataField($variableSql, $arrayVariable);
$rs = $stmt->executeQuery($replaceFields, \ResultSet::FETCHMODE_NUM);
while ($rs->next()) { while ($rs->next()) {
$row = $rs->getRow(); $row = $rs->getRow();
@@ -661,8 +665,9 @@ class Variable
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow"); $cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow");
$stmt = $cnn->createStatement(); $stmt = $cnn->createStatement();
$replaceFields = G::replaceDataField($sqlQuery, $arrayVariable);
$rs = $stmt->executeQuery(\G::replaceDataField($sqlQuery, $arrayVariable), \ResultSet::FETCHMODE_NUM); $rs = $stmt->executeQuery($replaceFields, \ResultSet::FETCHMODE_NUM);
while ($rs->next()) { while ($rs->next()) {
$row = $rs->getRow(); $row = $rs->getRow();

View File

@@ -757,13 +757,13 @@ Ext.onReady( function() {
Ext.getCmp('idInvalidCalendarName').hide(); Ext.getCmp('idInvalidCalendarName').hide();
var validateMessage = ''; var validateMessage = '';
var canlendarName = Ext.getCmp('dynaformCalendarName').getValue(); var canlendarName = Ext.getCmp('dynaformCalendarName').getValue();
Ext.Ajax.request( { Ext.Ajax.request( {
url: '../adminProxy/calendarValidate', url: '../adminProxy/calendarValidate',
params: { params: {
action : 'calendarName', action : 'calendarName',
oldName : fields.OLD_NAME, oldName : fields.OLD_NAME,
name : canlendarName name : canlendarName,
uid : fields.CALENDAR_UID
}, },
success: function(resp){ success: function(resp){
if (resp.responseText != '[]') if (resp.responseText != '[]')

View File

@@ -361,11 +361,9 @@ emailServer.application = {
{ {
if (flagPassChecked) { if (flagPassChecked) {
Ext.getCmp("txtPassword").setVisible(true); Ext.getCmp("txtPassword").setVisible(true);
Ext.getCmp("txtPassword").allowBlank = false; Ext.getCmp("txtPassword").allowBlank = false;
} else { } else {
Ext.getCmp("txtPassword").setVisible(false); Ext.getCmp("txtPassword").setVisible(false);
Ext.getCmp("txtPassword").allowBlank = true; Ext.getCmp("txtPassword").allowBlank = true;
} }
} }
@@ -374,11 +372,9 @@ emailServer.application = {
{ {
if (flagMailToChecked) { if (flagMailToChecked) {
Ext.getCmp("txtMailTo").setVisible(true); Ext.getCmp("txtMailTo").setVisible(true);
Ext.getCmp("txtMailTo").allowBlank = false; Ext.getCmp("txtMailTo").allowBlank = false;
} else { } else {
Ext.getCmp("txtMailTo").setVisible(false); Ext.getCmp("txtMailTo").setVisible(false);
Ext.getCmp("txtMailTo").allowBlank = true; Ext.getCmp("txtMailTo").allowBlank = true;
} }
} }
@@ -686,14 +682,14 @@ emailServer.application = {
hidden: true hidden: true
}); });
/*----------------------------------********---------------------------------*/
var chkEmailServerDefault = new Ext.form.Checkbox({ var chkEmailServerDefault = new Ext.form.Checkbox({
id: "chkEmailServerDefault", id: "chkEmailServerDefault",
name: "chkEmailServerDefault", name: "chkEmailServerDefault",
boxLabel: _("ID_EMAIL_SERVER_THIS_CONFIGURATION_IS_DEFAULT") boxLabel: _("ID_EMAIL_SERVER_THIS_CONFIGURATION_IS_DEFAULT")
}); });
/*----------------------------------********---------------------------------*/
var btnTest = new Ext.Action({ var btnTest = new Ext.Action({
id: "btnTest", id: "btnTest",
text: _("ID_TEST"), text: _("ID_TEST"),
@@ -786,8 +782,7 @@ emailServer.application = {
chkSendTestMail, chkSendTestMail,
txtMailTo txtMailTo
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
, , chkEmailServerDefault
chkEmailServerDefault
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
] ]
}) })