mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #14315 from snipe/fixes/rb-3565
Only send notification if the item is assigned to a person
This commit is contained in:
commit
eb61f5aa9e
|
@ -1156,16 +1156,20 @@ class ReportsController extends Controller
|
||||||
$logItem = $logItem_res[0];
|
$logItem = $logItem_res[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$assetItem->assignedTo->locale){
|
// Only send notification if assigned
|
||||||
Notification::locale(Setting::getSettings()->locale)->send(
|
if ($assetItem->assignedTo) {
|
||||||
$assetItem->assignedTo,
|
|
||||||
new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note)
|
if (!$assetItem->assignedTo->locale) {
|
||||||
);
|
Notification::locale(Setting::getSettings()->locale)->send(
|
||||||
} else {
|
$assetItem->assignedTo,
|
||||||
Notification::send(
|
new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note)
|
||||||
$assetItem->assignedTo,
|
);
|
||||||
new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note)
|
} else {
|
||||||
);
|
Notification::send(
|
||||||
|
$assetItem->assignedTo,
|
||||||
|
new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('reports/unaccepted_assets')->with('success', trans('admin/reports/general.reminder_sent'));
|
return redirect()->route('reports/unaccepted_assets')->with('success', trans('admin/reports/general.reminder_sent'));
|
||||||
|
|
Loading…
Reference in a new issue