Skip to content

Commit e38c213

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 9eed6cd + c012bf0 commit e38c213

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

app/Console/Commands/LdapSync.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Console\Commands;
44

5+
use App\Models\Asset;
56
use App\Models\Department;
67
use App\Models\Group;
78
use Illuminate\Console\Command;
@@ -418,6 +419,8 @@ public function handle()
418419
if ($item['createorupdate'] === 'created' && $ldap_default_group) {
419420
$user->groups()->attach($ldap_default_group);
420421
}
422+
//updates assets location based on user's location
423+
Asset::where('assigned_to', '=', $user->id)->update(['location_id' => $user->location_id]);
421424

422425
} else {
423426
foreach ($user->getErrors()->getMessages() as $key => $err) {

app/Listeners/CheckoutableListener.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ public function onCheckedIn($event)
175175
// Send Webhook notification
176176
try {
177177
if ($this->shouldSendWebhookNotification()) {
178-
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
179-
->notify($this->getCheckinNotification($event));
178+
if (Setting::getSettings()->webhook_selected === 'microsoft') {
179+
$message = $this->getCheckinNotification($event)->toMicrosoftTeams();
180+
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
181+
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
182+
} else {
183+
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
184+
->notify($this->getCheckinNotification($event));
185+
}
180186
}
181187
} catch (ClientException $e) {
182188
Log::warning("Exception caught during checkin notification: " . $e->getMessage());

app/Livewire/SlackSettingsForm.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ public function updatedWebhookSelected() {
113113
if($this->webhook_selected == 'microsoft' || $this->webhook_selected == 'google'){
114114
$this->webhook_channel = '#NA';
115115
}
116+
117+
}
118+
public function updatedwebhookEndpoint() {
119+
$this->teams_webhook_deprecated = !Str::contains($this->webhook_endpoint, 'workflows');
116120
}
117121

118122
private function isButtonDisabled() {

0 commit comments

Comments
 (0)