1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Miglioramento hook ed email

This commit is contained in:
Thomas Zilio
2019-08-26 18:02:05 +02:00
parent 27c97da691
commit ebea9ea807
42 changed files with 844 additions and 703 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Modules\Backups;
use Backup;
use Hooks\Manager;
class BackupHook extends Manager
{
public function manage()
{
$result = Backup::daily();
return $result;
}
public function response($update)
{
return [
'icon' => 'fa fa-file-o text-info',
'message' => tr('Backup completato!'),
'notify' => true,
];
}
public function prepare()
{
$result = setting('Backup automatico') && !Backup::isDailyComplete() && self::getHook()->processing == 0;
return [
'icon' => 'fa fa-file-o text-danger',
'message' => tr('Backup in corso...'),
'execute' => $result,
];
}
}