diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index dc54b296c4..995b7a7e4e 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -722,8 +722,8 @@ class Helper // The check and message that the user is still using the deprecated version $deprecations = [ 'ms_teams_deprecated' => array( - 'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'), - 'message' => 'The Microsoft Teams webhook URL being used will be deprecated Jan 31st, 2025. Change webhook endpoint'), + 'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows') && (Setting::getSettings()->webhook_selected === 'microsoft'), + 'message' => 'The Microsoft Teams webhook URL being used will be deprecated Dec 31st, 2025. Change webhook endpoint'), ]; // if item of concern is being used and its being used with the deprecated values return the notification array. diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php index 7487f30961..8bc775a27a 100644 --- a/app/Livewire/SlackSettingsForm.php +++ b/app/Livewire/SlackSettingsForm.php @@ -71,12 +71,12 @@ class SlackSettingsForm extends Component $this->setting = Setting::getSettings(); $this->save_button = trans('general.save'); - $this->webhook_selected = $this->setting->webhook_selected; - $this->webhook_name = $this->webhook_text[$this->setting->webhook_selected]["name"]; - $this->webhook_icon = $this->webhook_text[$this->setting->webhook_selected]["icon"]; - $this->webhook_placeholder = $this->webhook_text[$this->setting->webhook_selected]["placeholder"]; - $this->webhook_link = $this->webhook_text[$this->setting->webhook_selected]["link"]; - $this->webhook_test = $this->webhook_text[$this->setting->webhook_selected]["test"]; + $this->webhook_selected = $this->setting->webhook_selected ?? 'slack'; + $this->webhook_name = $this->webhook_text[$this->setting->webhook_selected]["name"] ?? $this->webhook_text['slack']["name"]; + $this->webhook_icon = $this->webhook_text[$this->setting->webhook_selected]["icon"] ?? $this->webhook_text['slack']["icon"]; + $this->webhook_placeholder = $this->webhook_text[$this->setting->webhook_selected]["placeholder"] ?? $this->webhook_text['slack']["placeholder"]; + $this->webhook_link = $this->webhook_text[$this->setting->webhook_selected]["link"] ?? $this->webhook_text['slack']["link"]; + $this->webhook_test = $this->webhook_text[$this->setting->webhook_selected]["test"] ?? $this->webhook_text['slack']["test"]; $this->webhook_endpoint = $this->setting->webhook_endpoint; $this->webhook_channel = $this->setting->webhook_channel; $this->webhook_botname = $this->setting->webhook_botname; @@ -90,7 +90,7 @@ class SlackSettingsForm extends Component $this->isDisabled= ''; } if($this->webhook_selected === 'microsoft' && $this->teams_webhook_deprecated) { - session()->flash('warning', 'The selected Microsoft Teams webhook URL will be deprecated Jan 31st, 2025. Please use a workflow URL. Microsofts Documentation on creating a workflow can be found here.'); + session()->flash('warning', trans('admin/settings/message.webhook.ms_teams_deprecation')); } } public function updated($field) { @@ -191,6 +191,7 @@ class SlackSettingsForm extends Component $this->setting->webhook_endpoint = ''; $this->setting->webhook_channel = ''; $this->setting->webhook_botname = ''; + $this->setting->webhook_selected = ''; $this->setting->save(); diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index 2a4d09d131..f4310b3a1a 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -298,6 +298,7 @@ class AssetPresenter extends Presenter 'sortable' => true, 'visible' => false, 'title' => trans('general.byod'), + 'class' => 'byod', 'formatter' => 'trueFalseFormatter', ], diff --git a/resources/lang/en-US/admin/settings/message.php b/resources/lang/en-US/admin/settings/message.php index 8d9b40e956..58abf14c5c 100644 --- a/resources/lang/en-US/admin/settings/message.php +++ b/resources/lang/en-US/admin/settings/message.php @@ -49,12 +49,11 @@ return [ 'error_redirect' => 'ERROR: 301/302 :endpoint returns a redirect. For security reasons, we don’t follow redirects. Please use the actual endpoint.', 'error_misc' => 'Something went wrong. :( ', 'webhook_fail' => ' webhook notification failed: Check to make sure the URL is still valid.', - 'webhook_channel_not_found' => ' webhook channel not found.' + 'webhook_channel_not_found' => ' webhook channel not found.', + 'ms_teams_deprecation' => 'The selected Microsoft Teams webhook URL will be deprecated Dec 31st, 2025. Please use a workflow URL. Microsoft\'s documentation on creating a workflow can be found here.', ], - 'location_scoping' => [ 'not_saved' => 'Your settings were not saved.', 'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping.|There are :count items in the database that need your attention before you can enable location scoping.', ], - ]; diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.php index b77443ae2c..28b9a8438a 100755 --- a/resources/views/hardware/edit.blade.php +++ b/resources/views/hardware/edit.blade.php @@ -137,7 +137,7 @@ -
+
-
+
{{ trans('general.byod') }}
diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index b3ac770dc6..d83a7f0e33 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -266,19 +266,21 @@ dir="{{ Helper::determineLanguageDirection() }}"> @endcan @can('admin') - @if ($snipeSettings->show_alerts_in_menu=='1') - - + + show_alerts_in_menu=='1') ? Helper::checkLowInventory() : []; + $deprecations = Helper::deprecationCheck() + ?> - + @endcan @@ -475,48 +478,48 @@ dir="{{ Helper::determineLanguageDirection() }}"> @endif - +
  • {{ trans('general.deployed') }} {{ (isset($total_deployed_sidebar)) ? $total_deployed_sidebar : '' }}
  • - +
  • {{ trans('general.ready_to_deploy') }} {{ (isset($total_rtd_sidebar)) ? $total_rtd_sidebar : '' }}
  • - +
  • {{ trans('general.pending') }} {{ (isset($total_pending_sidebar)) ? $total_pending_sidebar : '' }}
  • - {{ trans('general.undeployable') }} {{ (isset($total_undeployable_sidebar)) ? $total_undeployable_sidebar : '' }} - {{ trans('general.byod') }} {{ (isset($total_byod_sidebar)) ? $total_byod_sidebar : '' }} - {{ trans('admin/hardware/general.archived') }} {{ (isset($total_archived_sidebar)) ? $total_archived_sidebar : '' }} - {{ trans('admin/hardware/general.requestable') }} @@ -524,7 +527,7 @@ dir="{{ Helper::determineLanguageDirection() }}"> @can('audit', \App\Models\Asset::class) - +
  • {{ trans('general.audit_due') }} @@ -534,7 +537,7 @@ dir="{{ Helper::determineLanguageDirection() }}"> @endcan @can('checkin', \App\Models\Asset::class) - +
  • {{ trans('general.checkin_due') }} @@ -577,14 +580,14 @@ dir="{{ Helper::determineLanguageDirection() }}">
  • @endcan @can('admin') -
  • +
  • {{ trans('general.import-history') }}
  • @endcan @can('audit', \App\Models\Asset::class) -
  • +
  • {{ trans('general.bulkaudit') }} @@ -602,7 +605,7 @@ dir="{{ Helper::determineLanguageDirection() }}">
  • @endcan @can('index', \App\Models\Accessory::class) - +
  • {{ trans('general.accessories') }} @@ -610,7 +613,7 @@ dir="{{ Helper::determineLanguageDirection() }}">
  • @endcan @can('view', \App\Models\Consumable::class) - +
  • {{ trans('general.consumables') }} @@ -618,7 +621,7 @@ dir="{{ Helper::determineLanguageDirection() }}">
  • @endcan @can('view', \App\Models\Component::class) - +
  • {{ trans('general.components') }} @@ -626,7 +629,7 @@ dir="{{ Helper::determineLanguageDirection() }}">
  • @endcan @can('view', \App\Models\PredefinedKit::class) - +
  • {{ trans('general.kits') }} @@ -635,7 +638,7 @@ dir="{{ Helper::determineLanguageDirection() }}"> @endcan @can('view', \App\Models\User::class) - +
  • shortcuts_enabled == 1 ? "accesskey=6" : ''}}> {{ trans('general.people') }} @@ -643,7 +646,7 @@ dir="{{ Helper::determineLanguageDirection() }}">
  • @endcan @can('import') - +
  • {{ trans('general.import') }} @@ -652,7 +655,7 @@ dir="{{ Helper::determineLanguageDirection() }}"> @endcan @can('backend.interact') -
  • +
  • {{ trans('general.settings') }}