mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
removed commented out code, and unrelated crap
This commit is contained in:
parent
97b765b5cc
commit
c699baf519
|
@ -9,7 +9,6 @@ use App\Models\Setting;
|
||||||
use App\Notifications\ExpiringAssetsNotification;
|
use App\Notifications\ExpiringAssetsNotification;
|
||||||
use App\Notifications\ExpiringLicenseNotification;
|
use App\Notifications\ExpiringLicenseNotification;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Notification;
|
|
||||||
|
|
||||||
class SendExpirationAlerts extends Command
|
class SendExpirationAlerts extends Command
|
||||||
{
|
{
|
||||||
|
@ -46,7 +45,7 @@ class SendExpirationAlerts extends Command
|
||||||
$threshold = $settings->alert_interval;
|
$threshold = $settings->alert_interval;
|
||||||
|
|
||||||
if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) {
|
if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) {
|
||||||
$this->info('alerts');
|
|
||||||
// Send a rollup to the admin, if settings dictate
|
// Send a rollup to the admin, if settings dictate
|
||||||
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item, $key) {
|
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item, $key) {
|
||||||
return new AlertRecipient($item);
|
return new AlertRecipient($item);
|
||||||
|
@ -55,17 +54,15 @@ class SendExpirationAlerts extends Command
|
||||||
// Expiring Assets
|
// Expiring Assets
|
||||||
$assets = Asset::getExpiringWarrantee($threshold);
|
$assets = Asset::getExpiringWarrantee($threshold);
|
||||||
if ($assets->count() > 0) {
|
if ($assets->count() > 0) {
|
||||||
$this->info('expiring warrantees');
|
|
||||||
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $threshold]));
|
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $threshold]));
|
||||||
Notification::send($recipients, new ExpiringAssetsNotification($assets, $threshold));
|
\Notification::send($recipients, new ExpiringAssetsNotification($assets, $threshold));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expiring licenses
|
// Expiring licenses
|
||||||
$licenses = License::getExpiringLicenses($threshold);
|
$licenses = License::getExpiringLicenses($threshold);
|
||||||
if ($licenses->count() > 0) {
|
if ($licenses->count() > 0) {
|
||||||
$this->info('expiring licenses');
|
|
||||||
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $threshold]));
|
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $threshold]));
|
||||||
Notification::send($recipients, new ExpiringLicenseNotification($licenses, $threshold));
|
\Notification::send($recipients, new ExpiringLicenseNotification($licenses, $threshold));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($settings->alert_email == '') {
|
if ($settings->alert_email == '') {
|
||||||
|
@ -74,6 +71,5 @@ class SendExpirationAlerts extends Command
|
||||||
$this->info('Alerts are disabled in the settings. No mail will be sent');
|
$this->info('Alerts are disabled in the settings. No mail will be sent');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->info('nothing here.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1111,16 +1111,6 @@ class ReportsController extends Controller
|
||||||
$this->authorize('reports.view');
|
$this->authorize('reports.view');
|
||||||
$showDeleted = $deleted == 'deleted';
|
$showDeleted = $deleted == 'deleted';
|
||||||
|
|
||||||
// $acceptances = CheckoutAcceptance::pending()
|
|
||||||
// ->where('checkoutable_type', 'App\Models\Asset')
|
|
||||||
// ->withTrashed()
|
|
||||||
// ->with([
|
|
||||||
// 'assignedTo',
|
|
||||||
// 'checkoutable.assignedTo',
|
|
||||||
// 'checkoutable.model'
|
|
||||||
// ])->get();
|
|
||||||
$assetsForReport = collect();
|
|
||||||
|
|
||||||
$query = CheckoutAcceptance::pending()
|
$query = CheckoutAcceptance::pending()
|
||||||
->where('checkoutable_type', 'App\Models\Asset')
|
->where('checkoutable_type', 'App\Models\Asset')
|
||||||
->with([
|
->with([
|
||||||
|
|
Loading…
Reference in a new issue