From 147f36dc625497e830ec5eb46853bdba8b9102ad Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 14:10:47 +0200 Subject: [PATCH] last adjustments --- src/client/app/js/app/state/AppointmentEditAttendee.js | 2 +- src/server/server/control/TB_Server_Control_Auth.php | 2 +- src/server/server/control/TB_Server_Control_Team.php | 3 ++- .../ent/teamdata/TB_Shared_Ent_TeamData_Profile.php | 9 +++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/client/app/js/app/state/AppointmentEditAttendee.js b/src/client/app/js/app/state/AppointmentEditAttendee.js index b2eb3ab..35c485e 100644 --- a/src/client/app/js/app/state/AppointmentEditAttendee.js +++ b/src/client/app/js/app/state/AppointmentEditAttendee.js @@ -31,7 +31,7 @@ app.state.AppointmentEditAttendee = function() app.core.Rpc.call( 'Team', 'getMembers', - { teamId : appointment.getTeamId() }, + { teamId : appointment.getTeamId(), activeOnly: true }, function( res2 ) { let childs, m, notDecided = []; diff --git a/src/server/server/control/TB_Server_Control_Auth.php b/src/server/server/control/TB_Server_Control_Auth.php index 2d1dbca..5b285f6 100644 --- a/src/server/server/control/TB_Server_Control_Auth.php +++ b/src/server/server/control/TB_Server_Control_Auth.php @@ -691,7 +691,7 @@ class TB_Server_Control_Auth $team->category = _xss( $teamCategory ); $team->affiliate_id = is_string( $affiliateId ) ? _xss( $affiliateId ) : NULL; $team->terms_conditions_active = 0; - $team->new_users_inactive = 1; + $team->new_users_inactive = 0; $team->save(); // Set default course categories diff --git a/src/server/server/control/TB_Server_Control_Team.php b/src/server/server/control/TB_Server_Control_Team.php index b1767be..81d3093 100644 --- a/src/server/server/control/TB_Server_Control_Team.php +++ b/src/server/server/control/TB_Server_Control_Team.php @@ -161,6 +161,7 @@ class TB_Server_Control_Team { $resp = new TB_Server_Core_Response(); $teamId = $params->get( 'teamId' ); + $activeOnly = $params->get( 'activeOnly'); $sessionProfile = TB_Server_Core_Session::get()->getProfile(); if ( false === $sessionProfile->isInTeam( $teamId ) ) @@ -176,7 +177,7 @@ class TB_Server_Control_Team { return $resp; } - $resp->addData( 'members', TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id ) ); + $resp->addData( 'members', TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id, $activeOnly ) ); return $resp; } diff --git a/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php b/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php index 8cb36d4..e41702b 100644 --- a/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php +++ b/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php @@ -754,9 +754,14 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row { * @param $teamId * @return array */ - public static function getProfilesByTeamId( $teamId ) + public static function getProfilesByTeamId( $teamId, $activeOnly = null ) { - $whereJson = json_encode( array( 'team_id' => $teamId ) ); + $params = array('team_id' => $teamId); + if ($activeOnly === true ) { + $params['status'] = self::STATUS_ACTIVE; + } + + $whereJson = json_encode( $params ); $sql = 'SELECT * FROM ' . self::getTable() . ' WHERE '; $sql .= 'JSON_CONTAINS( `teams_js`, :where_json ) '; $sql .= 'ORDER BY last_name ASC';