Procházet zdrojové kódy

changes for active / inactive user and toc

master
Daniel před 2 roky
rodič
revize
da0a1bce5b
13 změnil soubory, kde provedl 35 přidání a 24 odebrání
  1. +1
    -0
      .docker/docker-compose.yml
  2. +2
    -2
      src/client/app/js/app/core/Dict.js
  3. +3
    -3
      src/client/app/js/app/model/Group.js
  4. +1
    -1
      src/client/app/js/app/state/GroupDetailEdit.js
  5. +3
    -3
      src/client/app/tmpl/group-detail-edit.html
  6. +1
    -4
      src/client/app/tmpl/group-terms.html
  7. +1
    -1
      src/client/app/tmpl/home-modal-not-activated.html
  8. +2
    -0
      src/server/server/control/TB_Server_Control_Auth.php
  9. +13
    -4
      src/server/server/control/TB_Server_Control_Team.php
  10. +1
    -1
      src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php
  11. +1
    -1
      src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Team.php
  12. +1
    -1
      tools/patches/2addDbTermsConditionsToTeam.php
  13. +5
    -3
      tools/patches/4addDbNewUsersInactive.php

+ 1
- 0
.docker/docker-compose.yml Zobrazit soubor

@@ -1,4 +1,5 @@
version: '3.7'
name: probuddy

services:
database:


+ 2
- 2
src/client/app/js/app/core/Dict.js Zobrazit soubor

@@ -240,8 +240,8 @@ app.core.Dict = {
"EDIT_GROUP" : "Gruppe bearbeiten",
"GROUP_NAME" : "Gruppenname",
"GROUP_DESCRIPTION" : "Beschreibung",
"GROUP_NEW_USERS_ACTIVE": "Erweiterte Sicherheit",
"GROUP_NEW_USERS_ACTIVE_CHECKBOX": "Hiermit deaktiviere ich die erweiterte Sicherheit im Anmeldeprozess und setze alle neuen Teilnehmer automatisch auf aktiv.",
"GROUP_NEW_USERS_INACTIVE": "Erweiterte Sicherheit aktiv",
"GROUP_NEW_USERS_INACTIVE_CHECKBOX": "Bei erweiterter Sicherheit sind neu registrierte Teilnehmer vorab vom Gruppeninhaber oder Admin in der Mitgliederverwaltung auf \"aktiv\" zu setzen. \"Inaktive\" Teilnehmer können nicht Zusagen und keine Termindetails einsehen. Ist die erweiterte Sicherheit ausgeschaltet, werden neue Teilnehmer automatisch auf aktiv gesetzt.",
"GROUP_TERMS": "Nutzungsbedingungen",
"GROUP_TERMS_ACCEPT": "akzeptieren",
"GROUP_TERMS_ACCEPTED": "Du hast die Nutzungsbedingungen akzeptiert",


+ 3
- 3
src/client/app/js/app/model/Group.js Zobrazit soubor

@@ -19,7 +19,7 @@ app.model.Group = function( data, memberData )
termsConditions = data.terms_conditions || null,
termsConditionsActive = data.terms_conditions_active == 1,
contactInformation = data.contact_information || null,
newUsersActive = data.new_users_active == 1,
newUsersInActive = data.new_users_inactive == 1,
emblemUrl = data.emblem_url || null,
emblem_cloud_id = data.emblem_cloud_id || null,
memberData = memberData || null,
@@ -119,9 +119,9 @@ app.model.Group = function( data, memberData )
return contactInformation;
};
this.getNewUsersActive = function()
this.getNewUsersInactive = function()
{
return newUsersActive;
return newUsersInActive;
};
/**


+ 1
- 1
src/client/app/js/app/state/GroupDetailEdit.js Zobrazit soubor

@@ -41,7 +41,7 @@ app.state.GroupDetailEdit = function()
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"),
newUsersActive: $form.find('[data-id="checkbox-new-users-active"]').first().is(":checked"),
newUsersInactive: $form.find('[data-id="checkbox-new-users-active"]').first().is(":checked"),
contactInformation: app.util.Helper.trim($form.find('[data-id="textarea-team-contactinformation"]').first().val()),
industry: $form.find('[data-id="select-team-industry"]').first().val()
},


+ 3
- 3
src/client/app/tmpl/group-detail-edit.html Zobrazit soubor

@@ -86,17 +86,17 @@
placeholder="<%= _lc( 'TEAM_DETAIL_TEAMDESCRIPTION_PLACEHOLDER' ) %>"><%= group.getDescription() ? group.getDescription() : '' %></textarea>
</div>
<div class="form-group">
<label><%= _lc( 'GROUP_NEW_USERS_ACTIVE' ) %></label>
<label><%= _lc( 'GROUP_NEW_USERS_INACTIVE' ) %></label>
<div class="custom-control custom-checkbox my-1 mr-sm-2">
<input type="checkbox"
name="checkbox-new-users-active"
data-id="checkbox-new-users-active"
id="checkbox-new-users-active"
class="custom-control-input"
<%= group.getNewUsersActive() ? 'checked' : '' %>
<%= group.getNewUsersInactive() ? 'checked' : '' %>
>
<label class="custom-control-label"
for="checkbox-new-users-active"><%= _lc( 'GROUP_NEW_USERS_ACTIVE_CHECKBOX' ) %></label>
for="checkbox-new-users-active"><%= _lc( 'GROUP_NEW_USERS_INACTIVE_CHECKBOX' ) %></label>
</div>
</div>
<div class="form-group">


+ 1
- 4
src/client/app/tmpl/group-terms.html Zobrazit soubor

@@ -19,10 +19,7 @@
<p>
<strong><%= _lc( 'GROUP_TERMS_DESCRIPTION' ) %></strong>
</p>
<textarea maxlength="4096"
rows="5"
class="form-control"
disabled><%= group.getTermsConditions() ? group.getTermsConditions() : '' %></textarea>
<p><%=raw group.getTermsConditions() ? app.util.Helper.nl2br( group.getTermsConditions() ) : '' %></p>
<% if ( group.getTermsConditionsActive() ) { %>
<div class="form-group">
<div class="custom-control custom-checkbox my-1 mr-sm-2">


+ 1
- 1
src/client/app/tmpl/home-modal-not-activated.html Zobrazit soubor

@@ -1,5 +1,5 @@
<strong><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> <%= groupName %>.</strong><br /><br />
<%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT2' ) %>
<div class="button-like-modal-footer">
<a href="#/configuration/account" class="btn btn-sm btn-secondary" data-id="not-activated"><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_BUTTON' ) %></a>
<a href="#/configuration/account/edit-address" class="btn btn-sm btn-secondary" data-id="not-activated"><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_BUTTON' ) %></a>
</div>

+ 2
- 0
src/server/server/control/TB_Server_Control_Auth.php Zobrazit soubor

@@ -690,6 +690,8 @@ class TB_Server_Control_Auth
$team->display_name = _xss( $teamName );
$team->category = _xss( $teamCategory );
$team->affiliate_id = is_string( $affiliateId ) ? _xss( $affiliateId ) : NULL;
$team->terms_conditions_active = 0;
$team->new_users_inactive = 1;
$team->save();
// Set default course categories


+ 13
- 4
src/server/server/control/TB_Server_Control_Team.php Zobrazit soubor

@@ -639,11 +639,20 @@ class TB_Server_Control_Team {
$category = $params->get( 'industry', $team->category );
$team->display_name = _xss( $displayName );
$team->category = _xss( $category );
$team->description = _xss( $params->get( 'description' ) );
$team->terms_conditions = _xss( $params->get( 'termsConditions' ) );
$description = _xss($params->get('description'));
$toc = _xss( $params->get('termsConditions'));
$contactInformation = _xss($params->get( 'contactInformation'));
$description = ($description === '') ? null : TB_Server_Utils_Helper::makeUrltoLink($description);
$toc = ($toc === '') ? null : TB_Server_Utils_Helper::makeUrltoLink($toc);
$contactInformation = ($contactInformation === '') ? null : TB_Server_Utils_Helper::makeUrltoLink($contactInformation);
$team->description = $description;
$team->terms_conditions = $toc;
$team->terms_conditions_active = $params->get( 'termsConditionsActive' ) === true ? 1 : 0;
$team->new_users_active = $params->get( 'newUsersActive' ) === true ? 1 : 0;
$team->contact_information = _xss( $params->get( 'contactInformation' ) );
$team->new_users_inactive = $params->get( 'newUsersInactive' ) === true ? 1 : 0;
$team->contact_information = $contactInformation;
$team->save();
return $resp;


+ 1
- 1
src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php Zobrazit soubor

@@ -510,7 +510,7 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row {
'role' => TB_Shared_Ent_TeamData_Profile::ROLE_PLAYER,
'is_anonymous' => 0,
'join_dt' => TB_Server_Utils_Helper::getUTCNowDateTime(),
'status' => $team->new_users_active ? self::STATUS_ACTIVE : self::STATUS_NOT_APPROVED,
'status' => $team->new_users_inactive ? self::STATUS_NOT_APPROVED : self::STATUS_ACTIVE,
'terms_accepted' => 0
);


+ 1
- 1
src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Team.php Zobrazit soubor

@@ -14,7 +14,7 @@
* @property string|NULL $contact_information
* @property string|NULL $terms_conditions
* @property bool $terms_conditions_active
* @property bool $new_users_active
* @property bool $new_users_inactive
* @property string $emblem_url
* @property string $emblem_cloud_id
* @property array|null $course_categories_js


+ 1
- 1
tools/patches/2addDbTermsConditionsToTeam.php Zobrazit soubor

@@ -16,4 +16,4 @@ function patch_addTermsConditionsToTeam()
echo "DONE...";
}

patch_addTermsConditionsToTeam();
patch();

tools/patches/4addDbNewUsersActive.php → tools/patches/4addDbNewUsersInactive.php Zobrazit soubor

@@ -3,16 +3,18 @@
require_once __DIR__ . '/../../src/server/server/config/boot_global.php';
require_once __DIR__ . '/../../src/server/server/config/boot_local.php';

function patch_addTermsConditionsToTeam()
function patch()
{

$db = TB_Shared_Db_TeamData::get();

$sql = "ALTER TABLE team
ADD COLUMN new_users_active TINYINT(1) NOT NULL DEFAULT 0 AFTER terms_conditions_active;";
ADD COLUMN new_users_inactive TINYINT(1) NOT NULL DEFAULT 1 AFTER terms_conditions_active;";
$stmt = $db->query( $sql );

$sql = "UPDATE team SET new_users_inactive = 0 WHERE 1";
$stmt = $db->query( $sql );
echo "DONE...";
}

patch_addTermsConditionsToTeam();
patch();

Načítá se…
Zrušit
Uložit