Skip to content

A free open source IT asset/license management system

Remove notification sending from loggable trait

Till Deeke722f03289501
diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php
index 61b1d6deb7..f3914d9db5 100644
--- a/app/Models/Loggable.php
+++ b/app/Models/Loggable.php
@@ -6,14 +6,7 @@ use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\CheckoutRequest;
use App\Models\User;
-use App\Notifications\CheckinAssetNotification;
use App\Notifications\AuditNotification;
-use App\Notifications\CheckoutAssetNotification;
-use App\Notifications\CheckoutAccessoryNotification;
-use App\Notifications\CheckinAccessoryNotification;
-use App\Notifications\CheckoutConsumableNotification;
-use App\Notifications\CheckoutLicenseNotification;
-use App\Notifications\CheckinLicenseNotification;
use Illuminate\Support\Facades\Auth;
@@ -38,7 +31,6 @@ trait Loggable
*/
public function logCheckout($note, $target /* What are we checking out to? */)
{
- $settings = Setting::getSettings();
$log = new Actionlog;
$log = $this->determineLogItemType($log);
$log->user_id = Auth::user()->id;
@@ -63,29 +55,6 @@ trait Loggable
$log->note = $note;
$log->logaction('checkout');
- $params = [
- 'item' => $log->item,
- 'target_type' => $log->target_type,
- 'target' => $target,
- 'admin' => $log->user,
- 'note' => $note,
- 'log_id' => $log->id,
- 'settings' => $settings,
- ];
-
- $checkoutClass = null;
-
- if (method_exists($target, 'notify')) {
- $target->notify(new static::$checkoutClass($params));
- }
-
- // Send to the admin, if settings dictate
- $recipient = new \App\Models\Recipients\AdminRecipient();
-
- if (($settings->admin_cc_email!='') && (static::$checkoutClass!='')) {
- $recipient->notify(new static::$checkoutClass($params));
- }
-
return $log;
}
@@ -112,7 +81,6 @@ trait Loggable
*/
public function logCheckin($target, $note)
{
- $settings = Setting::getSettings();
$log = new Actionlog;
$log->target_type = get_class($target);
$log->target_id = $target->id;
@@ -140,29 +108,6 @@ trait Loggable
$log->user_id = Auth::user()->id;
$log->logaction('checkin from');
- $params = [
- 'target' => $target,
- 'item' => $log->item,
- 'admin' => $log->user,
- 'note' => $note,
- 'target_type' => $log->target_type,
- 'settings' => $settings,
- ];
-
-
- $checkinClass = null;
-
- if (method_exists($target, 'notify')) {
- $target->notify(new static::$checkinClass($params));
- }
-
- // Send to the admin, if settings dictate
- $recipient = new \App\Models\Recipients\AdminRecipient();
-
- if (($settings->admin_cc_email!='') && (static::$checkinClass!='')) {
- $recipient->notify(new static::$checkinClass($params));
- }
-
return $log;
}