| @@ -31,7 +31,7 @@ app.state.AppointmentEditAttendee = function() | |||||
| app.core.Rpc.call( | app.core.Rpc.call( | ||||
| 'Team', | 'Team', | ||||
| 'getMembers', | 'getMembers', | ||||
| { teamId : appointment.getTeamId() }, | |||||
| { teamId : appointment.getTeamId(), activeOnly: true }, | |||||
| function( res2 ) | function( res2 ) | ||||
| { | { | ||||
| let childs, m, notDecided = []; | let childs, m, notDecided = []; | ||||
| @@ -691,7 +691,7 @@ class TB_Server_Control_Auth | |||||
| $team->category = _xss( $teamCategory ); | $team->category = _xss( $teamCategory ); | ||||
| $team->affiliate_id = is_string( $affiliateId ) ? _xss( $affiliateId ) : NULL; | $team->affiliate_id = is_string( $affiliateId ) ? _xss( $affiliateId ) : NULL; | ||||
| $team->terms_conditions_active = 0; | $team->terms_conditions_active = 0; | ||||
| $team->new_users_inactive = 1; | |||||
| $team->new_users_inactive = 0; | |||||
| $team->save(); | $team->save(); | ||||
| // Set default course categories | // Set default course categories | ||||
| @@ -161,6 +161,7 @@ class TB_Server_Control_Team { | |||||
| $resp = new TB_Server_Core_Response(); | $resp = new TB_Server_Core_Response(); | ||||
| $teamId = $params->get( 'teamId' ); | $teamId = $params->get( 'teamId' ); | ||||
| $activeOnly = $params->get( 'activeOnly'); | |||||
| $sessionProfile = TB_Server_Core_Session::get()->getProfile(); | $sessionProfile = TB_Server_Core_Session::get()->getProfile(); | ||||
| if ( false === $sessionProfile->isInTeam( $teamId ) ) | if ( false === $sessionProfile->isInTeam( $teamId ) ) | ||||
| @@ -176,7 +177,7 @@ class TB_Server_Control_Team { | |||||
| return $resp; | 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; | return $resp; | ||||
| } | } | ||||
| @@ -754,9 +754,14 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row { | |||||
| * @param $teamId | * @param $teamId | ||||
| * @return array | * @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 = 'SELECT * FROM ' . self::getTable() . ' WHERE '; | ||||
| $sql .= 'JSON_CONTAINS( `teams_js`, :where_json ) '; | $sql .= 'JSON_CONTAINS( `teams_js`, :where_json ) '; | ||||
| $sql .= 'ORDER BY last_name ASC'; | $sql .= 'ORDER BY last_name ASC'; | ||||