diff --git a/app/Models/Setting.php b/app/Models/Setting.php index fd02992f75..ecac183356 100755 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -83,9 +83,9 @@ class Setting extends Model 'email_domain', 'email_format', 'username_format', - 'slack_endpoint', - 'slack_channel', - 'slack_botname', + 'webhook_endpoint', + 'webhook_channel', + 'webhook_botname', ]; /** @@ -265,7 +265,7 @@ class Setting extends Model { // At this point the endpoint is the same for everything. // In the future this may want to be adapted for individual notifications. - return self::getSettings()->slack_endpoint; + return self::getSettings()->webhook_endpoint; } /** diff --git a/app/Models/User.php b/app/Models/User.php index 0e9d839a51..bf40982db3 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -272,7 +272,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo { // At this point the endpoint is the same for everything. // In the future this may want to be adapted for individual notifications. - $this->endpoint = \App\Models\Setting::getSettings()->slack_endpoint; + $this->endpoint = \App\Models\Setting::getSettings()->webhook_endpoint; return $this->endpoint; } diff --git a/app/Notifications/AuditNotification.php b/app/Notifications/AuditNotification.php index 84f1753767..9f5ae96687 100644 --- a/app/Notifications/AuditNotification.php +++ b/app/Notifications/AuditNotification.php @@ -34,7 +34,7 @@ class AuditNotification extends Notification public function via() { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint) { + if (Setting::getSettings()->webhook_endpoint) { $notifyBy[] = 'slack'; } diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index f9abba59f9..a375f37ad3 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -39,11 +39,7 @@ class CheckinAccessoryNotification extends Notification \Log::debug('via called'); $notifyBy = []; - if (Setting::getSettings()->slack_endpoint) { - $notifyBy[] = 'slack'; - } - - if (Setting::getSettings()->slack_endpoint != '') { + if (Setting::getSettings()->webhook_endpoint != '') { $notifyBy[] = 'slack'; } @@ -95,7 +91,7 @@ class CheckinAccessoryNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php index 9868ad1b4d..e8fdcf678b 100644 --- a/app/Notifications/CheckinAssetNotification.php +++ b/app/Notifications/CheckinAssetNotification.php @@ -43,9 +43,8 @@ class CheckinAssetNotification extends Notification public function via() { $notifyBy = []; - - if (Setting::getSettings()->slack_endpoint != '') { - \Log::debug('use slack'); + if (Setting::getSettings()->webhook_endpoint != '') { + \Log::debug('use webhook'); $notifyBy[] = 'slack'; } @@ -65,7 +64,7 @@ class CheckinAssetNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname != '') ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname != '') ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ trans('general.administrator') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php index faeafecb1b..a68930a683 100644 --- a/app/Notifications/CheckinLicenseSeatNotification.php +++ b/app/Notifications/CheckinLicenseSeatNotification.php @@ -41,7 +41,7 @@ class CheckinLicenseSeatNotification extends Notification { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint != '') { + if (Setting::getSettings()->webhook_endpoint != '') { $notifyBy[] = 'slack'; } @@ -62,7 +62,7 @@ class CheckinLicenseSeatNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; if ($admin) { $fields = [ diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index 5882fdf275..982fd863c5 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -37,7 +37,7 @@ class CheckoutAccessoryNotification extends Notification { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint != '') { + if (Setting::getSettings()->webhook_endpoint != '') { $notifyBy[] = 'slack'; } @@ -78,7 +78,7 @@ class CheckoutAccessoryNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php index c56c1a3711..303fc08f18 100644 --- a/app/Notifications/CheckoutAssetNotification.php +++ b/app/Notifications/CheckoutAssetNotification.php @@ -53,8 +53,8 @@ class CheckoutAssetNotification extends Notification { $notifyBy = []; - if ((Setting::getSettings()) && (Setting::getSettings()->slack_endpoint != '')) { - \Log::debug('use slack'); + if ((Setting::getSettings()) && (Setting::getSettings()->webhook_endpoint != '')) { + \Log::debug('use webhook'); $notifyBy[] = 'slack'; } @@ -95,7 +95,7 @@ class CheckoutAssetNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', diff --git a/app/Notifications/CheckoutConsumableNotification.php b/app/Notifications/CheckoutConsumableNotification.php index bfebe2c7d5..84e52fea77 100644 --- a/app/Notifications/CheckoutConsumableNotification.php +++ b/app/Notifications/CheckoutConsumableNotification.php @@ -43,7 +43,7 @@ class CheckoutConsumableNotification extends Notification { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint != '') { + if (Setting::getSettings()->webhook_endpoint != '') { $notifyBy[] = 'slack'; } @@ -84,7 +84,7 @@ class CheckoutConsumableNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', diff --git a/app/Notifications/CheckoutLicenseSeatNotification.php b/app/Notifications/CheckoutLicenseSeatNotification.php index 50d8313c09..d4741d9beb 100644 --- a/app/Notifications/CheckoutLicenseSeatNotification.php +++ b/app/Notifications/CheckoutLicenseSeatNotification.php @@ -43,7 +43,7 @@ class CheckoutLicenseSeatNotification extends Notification { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint != '') { + if (Setting::getSettings()->webhook_endpoint != '') { $notifyBy[] = 'slack'; } @@ -84,7 +84,7 @@ class CheckoutLicenseSeatNotification extends Notification $admin = $this->admin; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', diff --git a/app/Notifications/RequestAssetCancelation.php b/app/Notifications/RequestAssetCancelation.php index ea76056af3..905900de09 100644 --- a/app/Notifications/RequestAssetCancelation.php +++ b/app/Notifications/RequestAssetCancelation.php @@ -57,8 +57,8 @@ class RequestAssetCancelation extends Notification { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint != '') { - \Log::debug('use slack'); + if (Setting::getSettings()->webhook_endpoint != '') { + \Log::debug('use webhook'); $notifyBy[] = 'slack'; } @@ -73,7 +73,7 @@ class RequestAssetCancelation extends Notification $item = $this->item; $note = $this->note; $qty = $this->item_quantity; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'QTY' => $qty, diff --git a/app/Notifications/RequestAssetNotification.php b/app/Notifications/RequestAssetNotification.php index 22a8f3d464..028719f168 100644 --- a/app/Notifications/RequestAssetNotification.php +++ b/app/Notifications/RequestAssetNotification.php @@ -58,7 +58,7 @@ class RequestAssetNotification extends Notification { $notifyBy = []; - if (Setting::getSettings()->slack_endpoint != '') { + if (Setting::getSettings()->webhook_endpoint != '') { $notifyBy[] = 'slack'; } @@ -73,7 +73,7 @@ class RequestAssetNotification extends Notification $qty = $this->item_quantity; $item = $this->item; $note = $this->note; - $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot'; + $botname = ($this->settings->webhook_botname) ? $this->settings->webhook_botname : 'Snipe-Bot'; $fields = [ 'QTY' => $qty, diff --git a/public/img/demo/manufacturers/dellicon.png b/public/img/demo/manufacturers/dellicon.png new file mode 100644 index 0000000000..899de3ccab Binary files /dev/null and b/public/img/demo/manufacturers/dellicon.png differ diff --git a/public/img/demo/manufacturers/lenovoicon.png b/public/img/demo/manufacturers/lenovoicon.png new file mode 100644 index 0000000000..b8f7967bf8 Binary files /dev/null and b/public/img/demo/manufacturers/lenovoicon.png differ diff --git a/resources/lang/en/admin/hardware/general.php b/resources/lang/en/admin/hardware/general.php index 7aa0db7f34..3d1e43c2df 100644 --- a/resources/lang/en/admin/hardware/general.php +++ b/resources/lang/en/admin/hardware/general.php @@ -42,5 +42,6 @@ return [ 'error_messages' => 'Error messages:', 'success_messages' => 'Success messages:', 'alert_details' => 'Please see below for details.', - 'custom_export' => 'Custom Export' + 'custom_export' => 'Custom Export', + 'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup', ]; diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index ad96a2bb79..1ad9c376d8 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -253,7 +253,7 @@ return [ 'signature' => 'Signature', 'signed_off_by' => 'Signed Off By', 'skin' => 'Skin', - 'webhook_msg_note' => 'A :app message will be sent', + 'webhook_msg_note' => 'A notification will be sent via webhook', 'webhook_test_msg' => 'Oh hai! Looks like your :app integration with Snipe-IT is working!', 'some_features_disabled' => 'DEMO MODE: Some features are disabled for this installation.', 'site_name' => 'Site Name', diff --git a/resources/views/accessories/checkout.blade.php b/resources/views/accessories/checkout.blade.php index 000df2652a..3463d5eff3 100755 --- a/resources/views/accessories/checkout.blade.php +++ b/resources/views/accessories/checkout.blade.php @@ -54,7 +54,7 @@ @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.select_user'), 'fieldname' => 'assigned_to']) - @if ($accessory->requireAcceptance() || $accessory->getEula() || ($snipeSettings->slack_endpoint!='')) + @if ($accessory->requireAcceptance() || $accessory->getEula() || ($snipeSettings->webhook_endpoint!=''))