Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-939
This commit is contained in:
44
workflow/engine/methods/cases/cases_SaveData.php
Normal file → Executable file
44
workflow/engine/methods/cases/cases_SaveData.php
Normal file → Executable file
@@ -69,6 +69,10 @@ try {
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs" );
|
||||
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
|
||||
|
||||
if ($swpmdynaform) {
|
||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $pmdynaform );
|
||||
}
|
||||
|
||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
|
||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] );
|
||||
|
||||
@@ -123,27 +127,27 @@ try {
|
||||
$aAux = explode( '|', $oForm->fields[$oForm->fields[$sField]->pmconnection]->keys );
|
||||
$i = 0;
|
||||
$aValues = array ();
|
||||
if($aData == "" || count($aData['FIELDS']) < 1){
|
||||
$message = G::LoadTranslation( 'ID_PMTABLE_NOT_FOUNDED_SAVED_DATA' );
|
||||
G::SendMessageText( $message, "WARNING" );
|
||||
$aRow = false;
|
||||
if ($aData == "" || count($aData['FIELDS']) < 1) {
|
||||
$message = G::LoadTranslation( 'ID_PMTABLE_NOT_FOUNDED_SAVED_DATA' );
|
||||
G::SendMessageText( $message, "WARNING" );
|
||||
$aRow = false;
|
||||
} else {
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
if ($aField['FLD_KEY'] == '1') {
|
||||
$aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : '');
|
||||
$i ++;
|
||||
}
|
||||
if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) {
|
||||
$aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField];
|
||||
} else {
|
||||
$aValues[$aField['FLD_NAME']] = '';
|
||||
}
|
||||
}
|
||||
try {
|
||||
$aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys );
|
||||
} catch (Exception $oError) {
|
||||
$aRow = false;
|
||||
}
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
if ($aField['FLD_KEY'] == '1') {
|
||||
$aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : '');
|
||||
$i ++;
|
||||
}
|
||||
if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) {
|
||||
$aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField];
|
||||
} else {
|
||||
$aValues[$aField['FLD_NAME']] = '';
|
||||
}
|
||||
}
|
||||
try {
|
||||
$aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys );
|
||||
} catch (Exception $oError) {
|
||||
$aRow = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($aRow) {
|
||||
|
||||
@@ -38,9 +38,21 @@ emailServer.application = {
|
||||
//Data
|
||||
var p;
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (Ext.getCmp("chkEmailServerDefault").checked) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
var emailDefault = 1;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} else {
|
||||
var emailDefault = 0;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
switch (option) {
|
||||
|
||||
case "INS":
|
||||
var typeEmailEngine = Ext.getCmp("cboEmailEngine").getValue();
|
||||
|
||||
|
||||
if (typeEmailEngine == "PHPMAILER") {
|
||||
var rdoGrpOption = Ext.getCmp("rdoGrpSmtpSecure").getValue();
|
||||
@@ -60,7 +72,7 @@ emailServer.application = {
|
||||
smtpSecure: smtpSecure,
|
||||
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
|
||||
mailTo: Ext.getCmp("txtMailTo").getValue(),
|
||||
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0
|
||||
emailServerDefault: emailDefault
|
||||
};
|
||||
} else {
|
||||
//MAIL
|
||||
@@ -72,7 +84,7 @@ emailServer.application = {
|
||||
fromName: Ext.getCmp("txtFromName").getValue(),
|
||||
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
|
||||
mailTo: Ext.getCmp("txtMailTo").getValue(),
|
||||
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0
|
||||
emailServerDefault: emailDefault
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -98,7 +110,7 @@ emailServer.application = {
|
||||
smtpSecure: smtpSecure,
|
||||
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
|
||||
mailTo: Ext.getCmp("txtMailTo").getValue(),
|
||||
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0
|
||||
emailServerDefault: emailDefault
|
||||
};
|
||||
} else {
|
||||
//MAIL
|
||||
@@ -111,7 +123,7 @@ emailServer.application = {
|
||||
fromName: Ext.getCmp("txtFromName").getValue(),
|
||||
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
|
||||
mailTo: Ext.getCmp("txtMailTo").getValue(),
|
||||
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0
|
||||
emailServerDefault: emailDefault
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -144,7 +156,7 @@ emailServer.application = {
|
||||
smtpSecure: smtpSecure,
|
||||
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
|
||||
mailTo: Ext.getCmp("txtMailTo").getValue(),
|
||||
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0
|
||||
emailServerDefault: emailDefault
|
||||
};
|
||||
} else {
|
||||
//MAIL
|
||||
@@ -156,7 +168,7 @@ emailServer.application = {
|
||||
fromName: Ext.getCmp("txtFromName").getValue(),
|
||||
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
|
||||
mailTo: Ext.getCmp("txtMailTo").getValue(),
|
||||
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0
|
||||
emailServerDefault: emailDefault
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -251,7 +263,9 @@ emailServer.application = {
|
||||
|
||||
Ext.getCmp("txtMailTo").setValue("");
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
Ext.getCmp("chkEmailServerDefault").setValue(false);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
winData.setTitle(_("ID_EMAIL_SERVER_NEW"));
|
||||
winData.setDisabled(false);
|
||||
@@ -287,8 +301,17 @@ emailServer.application = {
|
||||
emailServerSetMailTo(Ext.getCmp("chkSendTestMail").checked);
|
||||
|
||||
Ext.getCmp("txtMailTo").setValue(record.get("MAIL_TO"));
|
||||
Ext.getCmp("chkEmailServerDefault").setValue((parseInt(record.get("MESS_DEFAULT")) == 1)? true : false);
|
||||
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (parseInt(record.get("MESS_DEFAULT")) == 1) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
Ext.getCmp("chkEmailServerDefault").setValue(true);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} else {
|
||||
Ext.getCmp("chkEmailServerDefault").setValue(false);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
winData.setTitle(_("ID_EMAIL_SERVER_EDIT"));
|
||||
winData.setDisabled(false);
|
||||
winData.show();
|
||||
@@ -591,6 +614,7 @@ emailServer.application = {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var txtAccountFrom = new Ext.form.TextField({
|
||||
id: "txtAccountFrom",
|
||||
name: "txtAccountFrom",
|
||||
@@ -599,7 +623,7 @@ emailServer.application = {
|
||||
|
||||
vtype: "emailUrlValidation"
|
||||
});
|
||||
|
||||
|
||||
var txtPassword = new Ext.form.TextField({
|
||||
id: "txtPassword",
|
||||
name: "txtPassword",
|
||||
@@ -662,14 +686,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"),
|
||||
@@ -760,8 +784,11 @@ emailServer.application = {
|
||||
txtFromName,
|
||||
rdoGrpSmtpSecure,
|
||||
chkSendTestMail,
|
||||
txtMailTo,
|
||||
txtMailTo
|
||||
/*----------------------------------********---------------------------------*/
|
||||
,
|
||||
chkEmailServerDefault
|
||||
/*----------------------------------********---------------------------------*/
|
||||
]
|
||||
})
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user