Skip to content

Commit e7c4343

Browse files
committed
readd checkin accessory format
1 parent c0620c2 commit e7c4343

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

app/Helpers/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ public static function deprecationCheck(){
721721
// The check and message that the user is still using the deprecated version
722722
$deprecations = [
723723
'ms_teams_deprecated' => array(
724-
'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'),
724+
'check' => Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'),
725725
'message' => 'The Microsoft Teams webhook URL being used will be deprecated Jan 31st, 2025. <a class="btn btn-primary" href="' . route('settings.slack.index') . '">Change your webhook URL</a>'),
726726
];
727727

app/Livewire/SlackSettingsForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function mount() {
8989
if($this->setting->webhook_endpoint != null && $this->setting->webhook_channel != null){
9090
$this->isDisabled= '';
9191
}
92-
if($this->webhook_selected === 'microsoft' && $this->teams_webhook_deprecated) {
92+
if($this->webhook_selected === 'microsoft' && !$this->teams_webhook_deprecated) {
9393
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 <a href="https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498" target="_blank"> here.</a>');
9494
}
9595
}

app/Notifications/CheckinAccessoryNotification.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,19 @@ public function toMicrosoftTeams()
104104
$admin = $this->admin;
105105
$item = $this->item;
106106
$note = $this->note;
107-
if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) {}
107+
if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) {
108+
return MicrosoftTeamsMessage::create()
109+
->to($this->settings->webhook_endpoint)
110+
->type('success')
111+
->addStartGroupToSection('activityTitle')
112+
->title(trans('Accessory_Checkin_Notification'))
113+
->addStartGroupToSection('activityText')
114+
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
115+
->fact(trans('mail.checked_into'), $item->location->name ? $item->location->name : '')
116+
->fact(trans('mail.Accessory_Checkin_Notification')." by ", $admin->present()->fullName())
117+
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
118+
->fact(trans('mail.notes'), $note ?: '');
119+
}
108120

109121
$message = trans('mail.Accessory_Checkin_Notification');
110122
$details = [

0 commit comments

Comments
 (0)