2020-08-08 17:06:06 +02:00
|
|
|
/**
|
|
|
|
* This file is part of Zwii.
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*
|
|
|
|
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
2021-02-17 13:49:58 +01:00
|
|
|
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
2020-08-08 17:06:06 +02:00
|
|
|
* @license GNU General Public License, version 3
|
2020-09-01 20:48:40 +02:00
|
|
|
* @link http://zwiicms.fr/
|
2020-08-08 17:06:06 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
$( document).ready(function() {
|
|
|
|
$("#configBackupForm").submit( function(e){
|
2020-08-09 18:11:49 +02:00
|
|
|
$("#configBackupSubmit").addClass("disabled").prop("disabled", true);
|
2020-08-08 17:06:06 +02:00
|
|
|
e.preventDefault();
|
2020-09-01 21:35:25 +02:00
|
|
|
if ($("input[name=configBackupOption]").is(':checked')) {
|
2021-11-02 18:46:51 +01:00
|
|
|
$('body').css('cursor', 'wait');
|
2020-09-01 21:35:25 +02:00
|
|
|
}
|
2020-08-08 17:06:06 +02:00
|
|
|
var url = "<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup";
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: url,
|
|
|
|
data: $("form").serialize(),
|
2020-08-09 12:00:29 +02:00
|
|
|
success: function(data){
|
2021-11-02 18:46:51 +01:00
|
|
|
$('body').css('cursor', 'default');
|
2020-08-09 12:00:29 +02:00
|
|
|
core.alert("La sauvegarde a été générée avec succès.");
|
|
|
|
},
|
|
|
|
error: function(data){
|
2021-11-02 18:46:51 +01:00
|
|
|
|
|
|
|
$('body').css('cursor', 'default');
|
2020-08-09 12:00:29 +02:00
|
|
|
core.alert("Une erreur s'est produite, la sauvegarde n'a pas été générée !");
|
2020-08-09 18:11:49 +02:00
|
|
|
},
|
|
|
|
complete: function(){
|
|
|
|
$("#configBackupSubmit").removeClass("disabled").prop("disabled", false);
|
2020-08-08 17:14:52 +02:00
|
|
|
}
|
2020-08-08 17:06:06 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|