| @@ -403,8 +403,9 @@ | ||
| 403 | 403 | */ |
| 404 | 404 | function timetics_update_default_settings() { |
| 405 | 405 | $settings = [ |
| 406 | 406 | 'google_auth_redirect_uri' => timetics_get_auth_redirect_uri( 'google-auth' ), |
| 407 | + 'outlook_auth_redirect_uri'=> timetics_get_auth_redirect_uri( 'outlook-auth' ), | |
| 407 | 408 | 'default_booking_status' => 'pending', |
| 408 | 409 | 'currency' => 'USD', |
| 409 | 410 | 'primary_color' => '#3161F1', |
| 410 | 411 | 'secondary_color' => '#6188ff', |
| @@ -719,11 +720,34 @@ | ||
| 719 | 720 | $user_data = [ |
| 720 | 721 | 'id' => $user->ID, |
| 721 | 722 | 'username' => $user->user_login, |
| 722 | 723 | 'email' => $user->user_email, |
| 723 | - 'roles' => array_values( $user->roles ), | |
| 724 | + 'roles' => $user-> roles, | |
| 724 | 725 | ]; |
| 725 | - | |
| 726 | 726 | return $user_data; |
| 727 | 727 | } |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | +if ( ! function_exists( 'timetics_connected_platforms' ) ) { | |
| 731 | + | |
| 732 | + /** | |
| 733 | + * Get connected platforms | |
| 734 | + * | |
| 735 | + * @param integer $id | |
| 736 | + * | |
| 737 | + * @return array Connected platform lists | |
| 738 | + */ | |
| 739 | + function timetics_connected_platforms( $id ) { | |
| 740 | + $integrations = timetics_get_staff_integrations( $id ); | |
| 741 | + $integration_names = []; | |
| 742 | + | |
| 743 | + if ( $integrations ) { | |
| 744 | + foreach ( $integrations as $integration ) { | |
| 745 | + if ( $integration['connected'] ) { | |
| 746 | + $integration_names[] = $integration['id']; | |
| 747 | + } | |
| 748 | + } | |
| 749 | + } | |
| 750 | + | |
| 751 | + return $integration_names; | |
| 752 | + } | |
| 753 | +} | |