Added confirmation Pop-Up for: 1. history.archive 2. machine.delete 3. user.delete
This commit is contained in:
parent
db71c0400d
commit
a2d575e94f
|
@ -119,12 +119,31 @@ if( section.archive.element != null ){
|
|||
|
||||
e.preventDefault();
|
||||
|
||||
api.send({path: 'historyDefault/archive'}, function(result){
|
||||
if( result.error == 0 ){
|
||||
/* (2) Create popup */
|
||||
var PopupManager = new Popup();
|
||||
|
||||
document.location = result.link;
|
||||
var confirm_content = {
|
||||
title: "Archivage de l'historique",
|
||||
content: "L'historique sera définitivement supprimé de la plateforme après la création de l'archive. Cette opération ne peut être annulée.",
|
||||
type: "search",
|
||||
action: "Archiver"
|
||||
};
|
||||
|
||||
/* (3) Ask for confirmation */
|
||||
PopupManager.ask(confirm_content, function(is_confirmed){
|
||||
|
||||
// {3.1} If cancelled -> abort //
|
||||
if( !is_confirmed )
|
||||
return;
|
||||
|
||||
// {3.2} Manage request //
|
||||
api.send({path: 'historyDefault/archive'}, function(result){
|
||||
|
||||
if( result.error == 0 )
|
||||
document.location = result.link;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
|
|
@ -503,8 +503,26 @@ if( section.remove.element != null ){
|
|||
// On annule l'envoi de base (PHP)
|
||||
e.preventDefault();
|
||||
|
||||
// Si l'id est defini
|
||||
if( section.remove.input.search.id.value != '' ){
|
||||
// Si l'id n'est pas défini -> abort
|
||||
if( section.remove.input.search.id.value == '' )
|
||||
return;
|
||||
|
||||
/* (1) Create popup */
|
||||
var PopupManager = new Popup();
|
||||
|
||||
var confirm_content = {
|
||||
title: "Suppression de machine",
|
||||
content: "La machine <b>"+section.remove.input.name.value+"</b> sera définitivement supprimée de la plateforme. Cette opération ne peut être annulée.",
|
||||
type: "invalid",
|
||||
action: "Supprimer"
|
||||
};
|
||||
|
||||
/* (2) Ask for confirmation */
|
||||
PopupManager.ask(confirm_content, function(is_confirmed){
|
||||
|
||||
// {2.1} If cancelled -> abort //
|
||||
if( !is_confirmed )
|
||||
return;
|
||||
|
||||
/* (2) On supprime la machine */
|
||||
var request = {
|
||||
|
@ -548,7 +566,7 @@ if( section.remove.element != null ){
|
|||
console.error('ModuleError::'+answer.error);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ if( section.admins.element != null ){
|
|||
/* (3) Ask for confirmation */
|
||||
PopupManager.ask(confirm_content, function(is_confirmed){
|
||||
|
||||
/* (3.1) If not cancelled -> abort */
|
||||
/* (3.1) If cancelled -> abort */
|
||||
if( !is_confirmed )
|
||||
return;
|
||||
|
||||
|
|
|
@ -543,8 +543,26 @@ if( section.remove.element != null ){
|
|||
// On annule l'envoi de base (PHP)
|
||||
e.preventDefault();
|
||||
|
||||
// Si l'id est defini
|
||||
if( section.remove.input.search.id.value != '' ){
|
||||
// Si l'id n'est pas defini -> abort
|
||||
if( section.remove.input.search.id.value == '' )
|
||||
return;
|
||||
|
||||
/* (1) Create popup */
|
||||
var PopupManager = new Popup();
|
||||
|
||||
var confirm_content = {
|
||||
title: "Suppression d'utilisateur",
|
||||
content: "L'utilisateur <b>"+section.remove.input.username.value+"</b> sera définitivement supprimé de la plateforme. Cette opération ne peut être annulée.",
|
||||
type: "invalid",
|
||||
action: "Supprimer"
|
||||
};
|
||||
|
||||
/* (2) Ask for confirmation */
|
||||
PopupManager.ask(confirm_content, function(is_confirmed){
|
||||
|
||||
// {2.1} If cancelled -> abort //
|
||||
if( !is_confirmed )
|
||||
return;
|
||||
|
||||
/* (2) On supprime l'utilisateur */
|
||||
var request = {
|
||||
|
@ -589,7 +607,7 @@ if( section.remove.element != null ){
|
|||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}, false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue