worked on saving triggers part
This commit is contained in:
@@ -28,11 +28,11 @@ require_once('classes/model/Triggers.php');
|
|||||||
require_once('classes/model/Content.php');
|
require_once('classes/model/Content.php');
|
||||||
|
|
||||||
if( isset($_POST['function']) )
|
if( isset($_POST['function']) )
|
||||||
$sfunction = $_POST['function'];
|
$sfunction = $_POST['function']; //for old processmap
|
||||||
else if( isset($_POST['functions']) )
|
else if( isset($_POST['functions']) )
|
||||||
$sfunction = $_POST['functions'];
|
$sfunction = $_POST['functions']; //for extjs
|
||||||
|
|
||||||
if(isset($sfunction) && $sfunction=='lookforNameTrigger'){
|
if(isset($sfunction) && $sfunction=='lookforNameTrigger'){
|
||||||
$snameTrigger=urldecode($_POST['NAMETRIGGER']);
|
$snameTrigger=urldecode($_POST['NAMETRIGGER']);
|
||||||
$sPRO_UID=urldecode($_POST['proUid']);
|
$sPRO_UID=urldecode($_POST['proUid']);
|
||||||
|
|
||||||
@@ -56,14 +56,14 @@ if( isset($_POST['function']) )
|
|||||||
$oDataset1->next();
|
$oDataset1->next();
|
||||||
$aRow1 = $oDataset1->getRow();
|
$aRow1 = $oDataset1->getRow();
|
||||||
|
|
||||||
if($aRow1['TRIGGERS'])$flag=false;
|
if($aRow1['TRIGGERS']) $flag=false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
print $flag;
|
print $flag;
|
||||||
//print'krlos';return ;
|
//print'krlos';return ;
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
$oTrigger = new Triggers();
|
$oTrigger = new Triggers();
|
||||||
|
|
||||||
G::LoadClass('processMap');
|
G::LoadClass('processMap');
|
||||||
@@ -85,6 +85,15 @@ if( isset($_POST['function']) )
|
|||||||
//print_r($_POST['form']);die;
|
//print_r($_POST['form']);die;
|
||||||
$oTrigger->update($value);
|
$oTrigger->update($value);
|
||||||
|
|
||||||
|
if(!isset($_POST['mode']))
|
||||||
$oProcessMap->triggersList($value['PRO_UID']);
|
$oProcessMap->triggersList($value['PRO_UID']);
|
||||||
|
|
||||||
|
$result->success = true;
|
||||||
|
$result->msg = G::LoadTranslation('ID_TRIGGERS_SAVED');
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$result->success = false;
|
||||||
|
$result->msg = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
print G::json_encode($result);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
@@ -3209,8 +3209,6 @@ var triggersForm = new Ext.FormPanel({
|
|||||||
items : [{
|
items : [{
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
width : 200,
|
width : 200,
|
||||||
//id : 'DestPath',
|
|
||||||
//fieldLabel : _('ID_DESTINATION_PATH'),
|
|
||||||
name : 'TRI_WEBBOT',
|
name : 'TRI_WEBBOT',
|
||||||
anchor :'100%'
|
anchor :'100%'
|
||||||
}]
|
}]
|
||||||
@@ -3244,9 +3242,22 @@ var triggersForm = new Ext.FormPanel({
|
|||||||
var desc = getForm.TRI_DESCRIPTION;
|
var desc = getForm.TRI_DESCRIPTION;
|
||||||
|
|
||||||
if(title == '')
|
if(title == '')
|
||||||
PMExt.notify( _('ID_ERROR') , _('ID_DYNAFORM_TITLE_REQUIRED') );
|
PMExt.notify( _('ID_ERROR') , _('ID_TRIGGER_TITLE_REQUIRED') );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//First check whether trigger name already exist or not
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url : '../triggers/triggers_Save.php',
|
||||||
|
method: 'POST',
|
||||||
|
params: {
|
||||||
|
functions : 'lookforNameTrigger',
|
||||||
|
proUid : pro_uid,
|
||||||
|
NAMETRIGGER : title
|
||||||
|
},
|
||||||
|
success: function(response) {
|
||||||
|
var result = response.responseText;
|
||||||
|
if(result) {
|
||||||
|
//now save trigger
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url : '../triggers/triggers_Save.php',
|
url : '../triggers/triggers_Save.php',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -3258,13 +3269,25 @@ var triggersForm = new Ext.FormPanel({
|
|||||||
TRI_PARAM :'',
|
TRI_PARAM :'',
|
||||||
TRI_TYPE :'SCRIPT',
|
TRI_TYPE :'SCRIPT',
|
||||||
TRI_DESCRIPTION :desc,
|
TRI_DESCRIPTION :desc,
|
||||||
TRI_WEBBOT :condition
|
TRI_WEBBOT :condition,
|
||||||
|
mode :'ext'
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
// var result = Ext.util.JSON.decode(response.responseText);
|
var result = Ext.util.JSON.decode(response.responseText);
|
||||||
PMExt.notify( _('ID_STATUS') , _('ID_DYANFORM_CREATED') );
|
if( result.success ){
|
||||||
|
PMExt.notify( _('ID_STATUS') , result.msg);
|
||||||
|
|
||||||
|
//Reloading store after saving triggers
|
||||||
triggerStore.reload();
|
triggerStore.reload();
|
||||||
formWindow.hide();
|
formWindow.hide();
|
||||||
|
} else {
|
||||||
|
PMExt.error(_('ID_ERROR'), result.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
PMExt.error(_('ID_VALIDATION_ERROR'), 'There is a triggers with the same name in this process.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -3276,7 +3299,6 @@ var triggersForm = new Ext.FormPanel({
|
|||||||
formWindow.hide();
|
formWindow.hide();
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var formWindow = new Ext.Window({
|
var formWindow = new Ext.Window({
|
||||||
|
|||||||
Reference in New Issue
Block a user