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

View File

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

View File

@@ -1,6 +1,8 @@
<?php
namespace ProcessMaker\BusinessModel;
use \G;
class Variable
{
/**
@@ -487,7 +489,7 @@ class Variable
$variableDbConnectionUid = $row["VAR_DBCONNECTION"];
$variableSql = $row["VAR_SQL"];
} 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
@@ -499,7 +501,9 @@ class Variable
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow");
$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()) {
$row = $rs->getRow();
@@ -661,8 +665,9 @@ class Variable
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow");
$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()) {
$row = $rs->getRow();

View File

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

View File

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