| @@ -245,7 +245,7 @@ app.core.Dict = { | |||||
| "GROUP_TERMS_ACTIVE_DESCRIPTION": "Wenn die Nutzungsbedingungen aktiv sind, müssen Gruppenmitglieder diese aktiv akzeptieren um weiter aktiv an Terminen teilnehmen zu können.", | "GROUP_TERMS_ACTIVE_DESCRIPTION": "Wenn die Nutzungsbedingungen aktiv sind, müssen Gruppenmitglieder diese aktiv akzeptieren um weiter aktiv an Terminen teilnehmen zu können.", | ||||
| "BTN_GROUP_TERMS_RESET": "Nutzungsbedingungen zurücksetzen", | "BTN_GROUP_TERMS_RESET": "Nutzungsbedingungen zurücksetzen", | ||||
| "GROUP_TERMS_RESET_DESCRIPTION": "Wenn sie die Nutzungsbedingung zurücksetzen, müssen alle Mitglieder die Nutzungsbedingungen erneut akzeptieren. Dies ist bei Änderungen der Nutzungsbedingungen sinnvoll.", | "GROUP_TERMS_RESET_DESCRIPTION": "Wenn sie die Nutzungsbedingung zurücksetzen, müssen alle Mitglieder die Nutzungsbedingungen erneut akzeptieren. Dies ist bei Änderungen der Nutzungsbedingungen sinnvoll.", | ||||
| "SUCCESS_RESET_TERMS_MEMBERS": "Die Akzeptierung der Nutzungsbedingungen aller Mitglieder wurde erfolgreich zurückgesetzt", | |||||
| "SUCCESS_RESET_TERMS_MEMBERS": "Die Akzeptierung der Nutzungsbedingungen aller Mitglieder wurden erfolgreich zurückgesetzt", | |||||
| "DO_YOU_REALLY_WANT_TO_RESET_GROUP_MEMBERS_ACCEPTED_TERMS": "Willst du wirklich Akzeptierung der Nutzungsbedingungen aller Mitglieder zurücksetzen? Mitglieder müssen danach die Nutzungsbedingungen neu bestätigen!", | "DO_YOU_REALLY_WANT_TO_RESET_GROUP_MEMBERS_ACCEPTED_TERMS": "Willst du wirklich Akzeptierung der Nutzungsbedingungen aller Mitglieder zurücksetzen? Mitglieder müssen danach die Nutzungsbedingungen neu bestätigen!", | ||||
| "BTN_CONFIRM_RESET_GROUP_MEMBERS_ACCEPTED_TERMS": "Ja, zurücksetzen", | "BTN_CONFIRM_RESET_GROUP_MEMBERS_ACCEPTED_TERMS": "Ja, zurücksetzen", | ||||
| "GROUP_INDUSTRY" : "Branche", | "GROUP_INDUSTRY" : "Branche", | ||||
| @@ -32,7 +32,6 @@ app.state.GroupDetailEdit = function() | |||||
| if (isValid) { | if (isValid) { | ||||
| app.gui.PageLoader.show(); | app.gui.PageLoader.show(); | ||||
| app.core.Rpc.call( | app.core.Rpc.call( | ||||
| 'Team', | 'Team', | ||||
| 'update', | 'update', | ||||
| @@ -40,6 +39,8 @@ app.state.GroupDetailEdit = function() | |||||
| groupId: groupId, | groupId: groupId, | ||||
| groupName: app.util.Helper.trim($form.find('[data-id="input-team-name"]').first().val()), | groupName: app.util.Helper.trim($form.find('[data-id="input-team-name"]').first().val()), | ||||
| description: app.util.Helper.trim($form.find('[data-id="textarea-team-description"]').first().val()), | description: app.util.Helper.trim($form.find('[data-id="textarea-team-description"]').first().val()), | ||||
| termsConditions: app.util.Helper.trim($form.find('[data-id="textarea-team-terms-conditions"]').first().val()), | |||||
| termsConditionsActive: $form.find('[data-id="checkbox-team-terms-conditions-active"]').first().is(":checked"), | |||||
| contactInformation: app.util.Helper.trim($form.find('[data-id="textarea-team-contactinformation"]').first().val()), | contactInformation: app.util.Helper.trim($form.find('[data-id="textarea-team-contactinformation"]').first().val()), | ||||
| industry: $form.find('[data-id="select-team-industry"]').first().val() | industry: $form.find('[data-id="select-team-industry"]').first().val() | ||||
| }, | }, | ||||
| @@ -640,6 +640,8 @@ class TB_Server_Control_Team { | |||||
| $team->display_name = _xss( $displayName ); | $team->display_name = _xss( $displayName ); | ||||
| $team->category = _xss( $category ); | $team->category = _xss( $category ); | ||||
| $team->description = _xss( $params->get( 'description' ) ); | $team->description = _xss( $params->get( 'description' ) ); | ||||
| $team->terms_conditions = _xss( $params->get( 'termsConditions' ) ); | |||||
| $team->terms_conditions_active = $params->get( 'termsConditionsActive' ) === true ? 1 : 0; | |||||
| $team->contact_information = _xss( $params->get( 'contactInformation' ) ); | $team->contact_information = _xss( $params->get( 'contactInformation' ) ); | ||||
| $team->save(); | $team->save(); | ||||
| @@ -1138,9 +1140,7 @@ class TB_Server_Control_Team { | |||||
| $memberProfiles = TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id ); | $memberProfiles = TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id ); | ||||
| foreach ($memberProfiles as $memberProfile) { | foreach ($memberProfiles as $memberProfile) { | ||||
| $tmpTeam = $memberProfile->team_js; | |||||
| $tmpTeam['terms_accepted'] = 0; | |||||
| $memberProfile->teams_js = $tmpTeam; | |||||
| $memberProfile->setTermsConditionAccepted($team->id, false); | |||||
| $memberProfile->save(); | $memberProfile->save(); | ||||
| } | } | ||||
| return $resp; | return $resp; | ||||
| @@ -434,6 +434,32 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row { | |||||
| $this->teams_js = $profileTeamData; | $this->teams_js = $profileTeamData; | ||||
| } | } | ||||
| public function setTermsConditionAccepted($teamId, $accepted) | |||||
| { | |||||
| if (!is_bool($accepted)) { | |||||
| throw new \Exception( "Accepted must be boolean" ); | |||||
| } | |||||
| $profileTeamData = array(); | |||||
| if ( is_array( $this->teams_js ) ) | |||||
| { | |||||
| // Make a copy | |||||
| $profileTeamData = unserialize( serialize( $this->teams_js ) ); | |||||
| } | |||||
| foreach( $profileTeamData as &$teamData ) | |||||
| { | |||||
| if ( $teamId === $teamData[ 'team_id' ] ) | |||||
| { | |||||
| $teamData[ 'terms_accepted' ] = $accepted === true ? 1 : 0; | |||||
| } | |||||
| } | |||||
| $this->teams_js = $profileTeamData; | |||||
| } | |||||
| /** | /** | ||||
| * @param $teamId | * @param $teamId | ||||
| * @param $contract | * @param $contract | ||||