File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Console \Commands ;
44
5+ use App \Models \Asset ;
56use App \Models \Department ;
67use App \Models \Group ;
78use 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 ) {
Original file line number Diff line number Diff 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 ());
Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments