1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| buttons: [{
text: 'Valider',
id: 'ValidNewFolderBtn',
cls: 'x-btn-text-icon',
icon: 'client/img/icons/accept.png',
handler: function(){
Ext.Ajax.request({
url: '/Gestionnaire_de_courrier/server/json/AddFolder.php',
method: 'POST',
params: {
action : "AddFolder",
ID : Ext.getCmp("NewFolderNameFolder").getValue(),
ID_STYLE_MAIL : Ext.getCmp("NewFolderStyleMail").getValue(),
ID_THEME : Ext.getCmp("NewFolderThème").getValue(),
CONTACT : Ext.getCmp("NewFolderContact").getValue(),
ID_MEMBER : Ext.getCmp("stock_id_member").getValue(),
STRUCTURE : Ext.getCmp("NewFolderStructure").getValue(),
LIM_RESP_DATE : Ext.getCmp('NewFolderLimDate').getValue(),//Ext.util.Format.date((Ext.getCmp("NewFolderLimDate").getValue()), 'TimeStamp'),//.format(Date.patterns.TimeStamp),
ARRIVAL_DATE : myTimeStamp,//Ext.getCmp('NewFolderArrivalDate').getValue(),//(Ext.getCmp('NewFolderArrivalDate').getValue()).format(Date.patterns.TimeStamp),//Ext.getCmp("NewFolderArrivalDate").getValue(),
COMMENT: Ext.getCmp("NewFolderComment").getValue(),
ID_TAKE_CHARGE: Ext.getCmp("NewFolderAffect").getValue()
},
success: function() {
console.log('success');
Ext.getCmp('Form1').getForm().reset();
Ext.getCmp('Form2').getForm().reset();
Ext.getCmp('Form3').getForm().reset();
Ext.getCmp('Form4').getForm().reset();
Ext.Ajax.request({
url: '/Gestionnaire_de_courrier/server/json/RecoveryLastFolderId.php',
method: 'POST',
params: {
action : "RecoveryLastFolderId"
},
success: function(response) {
Folders = Ext.util.JSON.decode(response.responseText);
Ext.getCmp('NewFolderNameFolder').setValue(Folders.Folders.ID);
},
failure: function() {}
}); |