diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 9e811adca657..86f21e0152db 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -37,23 +37,33 @@ class SlackSettingsForm extends Component public function mount() { $this->webhook_text= [ - "slack" => array( + "slack" => array( "name" => trans('admin/settings/general.slack') , - "icon" => 'fab fa-slack', - "placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX", - "link" => 'https://api.slack.com/messaging/webhooks', + "icon" => 'fab fa-slack', + "placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX", + "link" => 'https://api.slack.com/messaging/webhooks', + "test" => "testWebhook" ), "general"=> array( "name" => trans('admin/settings/general.general_webhook'), "icon" => "fab fa-hashtag", "placeholder" => trans('general.url'), "link" => "", + "test" => "testWebhook" + ), + "google" => array( + "name" => trans('admin/settings/general.google_workspaces'), + "icon" => "fa-brands fa-google", + "placeholder" => "https://chat.googleapis.com/v1/spaces/xxxxxxxx/messages?key=xxxxxx", + "link" => "https://developers.google.com/chat/how-tos/webhooks#register_the_incoming_webhook", + "test" => "googleWebhookTest" ), "microsoft" => array( "name" => trans('admin/settings/general.ms_teams'), "icon" => "fa-brands fa-microsoft", "placeholder" => "https://abcd.webhook.office.com/webhookb2/XXXXXXX", "link" => "https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=dotnet#create-incoming-webhooks-1", + "test" => "msTeamTestWebhook" ), ]; @@ -64,10 +74,14 @@ public function mount() { $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_endpoint = $this->setting->webhook_endpoint; $this->webhook_channel = $this->setting->webhook_channel; $this->webhook_botname = $this->setting->webhook_botname; $this->webhook_options = $this->setting->webhook_selected; + if($this->webhook_selected == 'microsoft' || $this->webhook_selected == 'google'){ + $this->webhook_channel = '#NA'; + } if($this->setting->webhook_endpoint != null && $this->setting->webhook_channel != null){ @@ -87,10 +101,14 @@ public function updatedWebhookSelected() { $this->webhook_placeholder = $this->webhook_text[$this->webhook_selected]["placeholder"]; $this->webhook_endpoint = null; $this->webhook_link = $this->webhook_text[$this->webhook_selected]["link"]; + $this->webhook_test = $this->webhook_text[$this->webhook_selected]["test"]; if($this->webhook_selected != 'slack'){ $this->isDisabled= ''; $this->save_button = trans('general.save'); } + if($this->webhook_selected == 'microsoft' || $this->webhook_selected == 'google'){ + $this->webhook_channel = '#NA'; + } } @@ -151,6 +169,7 @@ public function testWebhook(){ } + public function clearSettings(){ if (Helper::isDemoMode()) { @@ -187,7 +206,35 @@ public function submit() } } - public function msTeamTestWebhook(){ + public function googleWebhookTest(){ + + $payload = [ + "text" => trans('general.webhook_test_msg', ['app' => $this->webhook_name]), + ]; + + try { + $response = Http::withHeaders([ + 'content-type' => 'applications/json', + ])->post($this->webhook_endpoint, + $payload)->throw(); + + + if (($response->getStatusCode() == 302) || ($response->getStatusCode() == 301)) { + return session()->flash('error', trans('admin/settings/message.webhook.error_redirect', ['endpoint' => $this->webhook_endpoint])); + } + + $this->isDisabled=''; + $this->save_button = trans('general.save'); + return session()->flash('success' , trans('admin/settings/message.webhook.success', ['webhook_name' => $this->webhook_name])); + + } catch (\Exception $e) { + + $this->isDisabled='disabled'; + $this->save_button = trans('admin/settings/general.webhook_presave'); + return session()->flash('error' , trans('admin/settings/message.webhook.error', ['error_message' => $e->getMessage(), 'app' => $this->webhook_name])); + } + } + public function msTeamTestWebhook(){ $payload = [ diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 162b07d27687..86a0957839b6 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -60,7 +60,7 @@ public function onCheckedOut($event) if ($this->shouldSendWebhookNotification()) { //slack doesn't include the url in its messaging format so this is needed to hit the endpoint - if(Setting::getSettings()->webhook_selected =='slack') { + if(Setting::getSettings()->webhook_selected =='slack' || Setting::getSettings()->webhook_selected =='general') { Notification::route('slack', Setting::getSettings()->webhook_endpoint) ->notify($this->getCheckoutNotification($event)); diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index f376c26a8469..c4c16f31eec1 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -9,6 +9,11 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -38,6 +43,10 @@ public function __construct(Accessory $accessory, $checkedOutTo, User $checkedIn public function via() { $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } if (Setting::getSettings()->webhook_selected == 'microsoft'){ @@ -132,6 +141,32 @@ public function toMicrosoftTeams() ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) ->fact(trans('mail.notes'), $note ?: ''); } + public function toGoogleChat() + { + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.Accessory_Checkin_Notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.checked_into').': '.$item->location->name ? $item->location->name : '', + trans('admin/consumables/general.remaining').': '.$item->numRemaining(), + trans('admin/hardware/form.notes').": ".$note ?: '', + ) + ->onClick(route('accessories.show', $item->id)) + ) + ) + ); + + } /** * Get the mail representation of the notification. diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php index 8e9467c54f5a..71632ca0e01a 100644 --- a/app/Notifications/CheckinAssetNotification.php +++ b/app/Notifications/CheckinAssetNotification.php @@ -10,6 +10,11 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -46,6 +51,10 @@ public function __construct(Asset $asset, $checkedOutTo, User $checkedInBy, $not public function via() { $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } if (Setting::getSettings()->webhook_selected == 'microsoft'){ @@ -108,6 +117,33 @@ public function toMicrosoftTeams() ->fact(trans('admin/hardware/form.status'), $item->assetstatus->name) ->fact(trans('mail.notes'), $note ?: ''); } + public function toGoogleChat() + { + $target = $this->target; + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.Asset_Checkin_Notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.checked_into') ?: '', + $item->location->name ? $item->location->name : '', + trans('admin/hardware/form.status').": ".$item->assetstatus->name, + ) + ->onClick(route('hardware.show', $item->id)) + ) + ) + ); + + } /** * Get the mail representation of the notification. diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php index 2222f937f3f6..ba0621d078ac 100644 --- a/app/Notifications/CheckinLicenseSeatNotification.php +++ b/app/Notifications/CheckinLicenseSeatNotification.php @@ -9,6 +9,11 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -43,6 +48,10 @@ public function via() { $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } if (Setting::getSettings()->webhook_selected == 'microsoft'){ $notifyBy[] = MicrosoftTeamsChannel::class; @@ -113,6 +122,34 @@ public function toMicrosoftTeams() ->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) ->fact(trans('mail.notes'), $note ?: ''); } + public function toGoogleChat() + { + $target = $this->target; + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.License_Checkin_Notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.checkedin_from') ?: '', + $target->present()->fullName() ?: '', + trans('admin/consumables/general.remaining').': '.$item->availCount()->count(), + ) + ->onClick(route('licenses.show', $item->id)) + ) + ) + ); + + } + /** * Get the mail representation of the notification. diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index 62fce8e176e7..868b1ced46a1 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -9,6 +9,11 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -37,6 +42,10 @@ public function __construct(Accessory $accessory, $checkedOutTo, User $checkedOu public function via() { $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } if (Setting::getSettings()->webhook_selected == 'microsoft'){ @@ -123,6 +132,34 @@ public function toMicrosoftTeams() ->fact(trans('mail.notes'), $note ?: ''); } + public function toGoogleChat() + { + $target = $this->target; + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.Accessory_Checkout_Notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.assigned_to') ?: '', + $target->present()->name ?: '', + trans('admin/consumables/general.remaining').": ". $item->numRemaining(), + ) + ->onClick(route('users.show', $target->id)) + ) + ) + ); + + } + /** * Get the mail representation of the notification. diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php index 7350a7736be4..a2fe275ae297 100644 --- a/app/Notifications/CheckoutAssetNotification.php +++ b/app/Notifications/CheckoutAssetNotification.php @@ -11,6 +11,13 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\Enums\Icon; +use NotificationChannels\GoogleChat\Enums\ImageStyle; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -54,13 +61,18 @@ public function __construct(Asset $asset, $checkedOutTo, User $checkedOutBy, $ac */ public function via() { + $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } + if (Setting::getSettings()->webhook_selected == 'microsoft'){ - return [MicrosoftTeamsChannel::class]; + $notifyBy[] = MicrosoftTeamsChannel::class; } - $notifyBy = []; - if ((Setting::getSettings()) && (Setting::getSettings()->webhook_selected == 'slack')) { + if ((Setting::getSettings()->webhook_selected == 'slack') || (Setting::getSettings()->webhook_selected == '')) { \Log::debug('use webhook'); $notifyBy[] = 'slack'; } @@ -143,6 +155,33 @@ public function toMicrosoftTeams() } +public function toGoogleChat() + { + $target = $this->target; + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.Asset_Checkout_Notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.assigned_to') ?: '', + $target->present()->name ?: '', + $note ?: '', + ) + ->onClick(route('users.show', $target->id)) + ) + ) + ); + + } /** * Get the mail representation of the notification. diff --git a/app/Notifications/CheckoutConsumableNotification.php b/app/Notifications/CheckoutConsumableNotification.php index 228c4c2e9592..d7999e9387bd 100644 --- a/app/Notifications/CheckoutConsumableNotification.php +++ b/app/Notifications/CheckoutConsumableNotification.php @@ -9,6 +9,11 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -44,6 +49,10 @@ public function __construct(Consumable $consumable, $checkedOutTo, User $checked public function via() { $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } if (Setting::getSettings()->webhook_selected == 'microsoft'){ @@ -128,6 +137,33 @@ public function toMicrosoftTeams() ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) ->fact(trans('mail.notes'), $note ?: ''); } + public function toGoogleChat() + { + $target = $this->target; + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.Consumable_checkout_notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.assigned_to') ?: '', + $target->present()->fullName() ?: '', + trans('admin/consumables/general.remaining').': '.$item->numRemaining(), + ) + ->onClick(route('users.show', $target->id)) + ) + ) + ); + + } /** * Get the mail representation of the notification. diff --git a/app/Notifications/CheckoutLicenseSeatNotification.php b/app/Notifications/CheckoutLicenseSeatNotification.php index d5c9871f3b86..fcaa4761cbb6 100644 --- a/app/Notifications/CheckoutLicenseSeatNotification.php +++ b/app/Notifications/CheckoutLicenseSeatNotification.php @@ -9,6 +9,11 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; +use NotificationChannels\GoogleChat\Card; +use NotificationChannels\GoogleChat\GoogleChatChannel; +use NotificationChannels\GoogleChat\GoogleChatMessage; +use NotificationChannels\GoogleChat\Section; +use NotificationChannels\GoogleChat\Widgets\KeyValue; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannel; use NotificationChannels\MicrosoftTeams\MicrosoftTeamsMessage; @@ -43,9 +48,12 @@ public function __construct(LicenseSeat $licenseSeat, $checkedOutTo, User $check */ public function via() { - $notifyBy = []; + if (Setting::getSettings()->webhook_selected == 'google'){ + + $notifyBy[] = GoogleChatChannel::class; + } if (Setting::getSettings()->webhook_selected == 'microsoft'){ $notifyBy[] = MicrosoftTeamsChannel::class; @@ -129,6 +137,33 @@ public function toMicrosoftTeams() ->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) ->fact(trans('mail.notes'), $note ?: ''); } + public function toGoogleChat() + { + $target = $this->target; + $item = $this->item; + $note = $this->note; + + return GoogleChatMessage::create() + ->to($this->settings->webhook_endpoint) + ->card( + Card::create() + ->header( + ''.trans('mail.License_Checkout_Notification').'' ?: '', + htmlspecialchars_decode($item->present()->name) ?: '', + ) + ->section( + Section::create( + KeyValue::create( + trans('mail.assigned_to') ?: '', + $target->present()->name ?: '', + trans('admin/consumables/general.remaining').': '.$item->availCount()->count(), + ) + ->onClick(route('users.show', $target->id)) + ) + ) + ); + + } /** * Get the mail representation of the notification. diff --git a/composer.json b/composer.json index a378f1590023..207d7d9f8c37 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,7 @@ "guzzlehttp/guzzle": "^7.0.1", "intervention/image": "^2.5", "javiereguiluz/easyslugger": "^1.0", + "laravel-notification-channels/google-chat": "^1.0", "laravel-notification-channels/microsoft-teams": "^1.1", "laravel/framework": "^8.46", "laravel/helpers": "^1.4", diff --git a/composer.lock b/composer.lock index f4baccc09255..961467e19c3e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "89580c52de91168aac8321460bd428e2", + "content-hash": "9cca85cd0074df9154765b1ab52f83fa", "packages": [ { "name": "alek13/slack", @@ -3188,6 +3188,63 @@ }, "time": "2015-04-12T19:57:10+00:00" }, + { + "name": "laravel-notification-channels/google-chat", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/laravel-notification-channels/google-chat.git", + "reference": "843078439403a925b484cef99a26b447e30a9c32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel-notification-channels/google-chat/zipball/843078439403a925b484cef99a26b447e30a9c32", + "reference": "843078439403a925b484cef99a26b447e30a9c32", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "illuminate/notifications": "~8.0", + "illuminate/support": "~8.0", + "php": ">=7.3" + }, + "require-dev": { + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NotificationChannels\\GoogleChat\\GoogleChatServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "NotificationChannels\\GoogleChat\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank Dixon", + "email": "frank@thetreehouse.family", + "homepage": "https://thetreehouse.family", + "role": "Developer" + } + ], + "description": "Google Chat Notification Channel for Laravel (fka. Hangouts Chat)", + "homepage": "https://github.com/laravel-notification-channels/google-chat", + "support": { + "issues": "https://github.com/laravel-notification-channels/google-chat/issues", + "source": "https://github.com/laravel-notification-channels/google-chat/tree/v1.0.1" + }, + "time": "2021-07-15T22:40:51+00:00" + }, { "name": "laravel-notification-channels/microsoft-teams", "version": "v1.1.4", diff --git a/resources/lang/en-US/admin/settings/general.php b/resources/lang/en-US/admin/settings/general.php index 21e575905373..0c572e067690 100644 --- a/resources/lang/en-US/admin/settings/general.php +++ b/resources/lang/en-US/admin/settings/general.php @@ -70,6 +70,7 @@ 'general_settings_keywords' => 'company support, signature, acceptance, email format, username format, images, per page, thumbnail, eula, tos, dashboard, privacy', 'general_settings_help' => 'Default EULA and more', 'generate_backup' => 'Generate Backup', + 'google_workspaces' => 'Google Workspaces', 'header_color' => 'Header Color', 'info' => 'These settings let you customize certain aspects of your installation.', 'label_logo' => 'Label Logo', diff --git a/resources/lang/en-US/mail.php b/resources/lang/en-US/mail.php index 418de5806fcd..759ff0f5e8b2 100644 --- a/resources/lang/en-US/mail.php +++ b/resources/lang/en-US/mail.php @@ -42,6 +42,7 @@ 'checkin_date' => 'Checkin Date:', 'checkout_date' => 'Checkout Date:', 'checkedout_from' => 'Checked out from', + 'checkedin_from' => 'Checked in from', 'checked_into' => 'Checked into', 'click_on_the_link_accessory' => 'Please click on the link at the bottom to confirm that you have received the accessory.', 'click_on_the_link_asset' => 'Please click on the link at the bottom to confirm that you have received the asset.', diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index ad3271bbc7f4..818264709836 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -61,9 +61,9 @@
@if (Helper::isDemoMode()) - {{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'), 'microsoft' => trans('admin/settings/general.ms_teams')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'style'=>'width:100%', 'disabled')) }} + {{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'),'google' => trans('admin/settings/general.google_workspaces'), 'microsoft' => trans('admin/settings/general.ms_teams')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'style'=>'width:100%', 'disabled')) }} @else - {{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'), 'microsoft' => trans('admin/settings/general.ms_teams')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'data-minimum-results-for-search' => '-1', 'style'=>'width:100%')) }} + {{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'),'google' => trans('admin/settings/general.google_workspaces'), 'microsoft' => trans('admin/settings/general.ms_teams')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'data-minimum-results-for-search' => '-1', 'style'=>'width:100%')) }} @endif
@@ -90,23 +90,25 @@ -
-
- {{ Form::label('webhook_channel', trans('admin/settings/general.webhook_channel',['app' => $webhook_name ])) }} -
-
- + @if($webhook_selected != 'microsoft' && $webhook_selected!= 'google') +
+
+ {{ Form::label('webhook_channel', trans('admin/settings/general.webhook_channel',['app' => $webhook_name ])) }} +
+
+ - {!! $errors->first('webhook_channel', '') !!} + {!! $errors->first('webhook_channel', '') !!} +
-
+ @endif @if (Helper::isDemoMode()) @include('partials.forms.demo-mode') @endif - @if($webhook_selected != 'microsoft') + @if($webhook_selected != 'microsoft' && $webhook_selected != 'google')
{{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_name ])) }} @@ -122,14 +124,11 @@ @endif + @if($webhook_endpoint != null && $webhook_channel != null)