1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-07 23:28:50 +01:00

55 lines
1.6 KiB
PHP
Raw Normal View History

<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace Modules\StatoServizi;
use API\Services;
use Carbon\Carbon;
2021-09-24 12:26:34 +02:00
use Hooks\Manager;
2021-09-24 12:26:34 +02:00
class ServicesHook extends Manager
{
public function response()
{
// Elaborazione dei servizi in scadenza
2021-09-24 12:26:34 +02:00
$limite_scadenze = (new Carbon())->addDays(60);
$risorse_in_scadenza = Services::getRisorseInScadenza($limite_scadenze);
$message = tr('I seguenti servizi sono in scadenza: _LIST_', [
2021-09-29 11:07:51 +02:00
'_LIST_' => implode(', ', $risorse_in_scadenza->pluck('name')->all()),
]);
return [
'icon' => 'fa fa-refresh text-warning',
'message' => $message,
'show' => Services::isEnabled() && !$risorse_in_scadenza->isEmpty(),
];
}
2021-09-24 12:26:34 +02:00
public function execute()
{
2021-09-24 12:26:34 +02:00
return false;
}
2021-09-24 12:26:34 +02:00
public function needsExecution()
{
return false;
}
}