| @@ -62,6 +62,7 @@ app.core.Dict = { | |||||
| "STATS" : "Statistik", | "STATS" : "Statistik", | ||||
| "TEAM_DETAIL_TEAMNAME_PLACEHOLDER" : "Bitte gib deinem Firmen-/Gruppennamen ein", | "TEAM_DETAIL_TEAMNAME_PLACEHOLDER" : "Bitte gib deinem Firmen-/Gruppennamen ein", | ||||
| "TEAM_DETAIL_TEAMDESCRIPTION_PLACEHOLDER" : "Schreibe ein paar Worte über deine Gruppe...", | "TEAM_DETAIL_TEAMDESCRIPTION_PLACEHOLDER" : "Schreibe ein paar Worte über deine Gruppe...", | ||||
| "TEAM_DETAIL_TEAM_TERMS_PLACEHOLDER" : "Schreibe eine Begrüßung, deine Nutzungsbedingungen und entscheide ob diese aktiv und somit verpflichtend sein sollen", | |||||
| "BTN_SAVE_CHANGES" : "Änderungen speichern", | "BTN_SAVE_CHANGES" : "Änderungen speichern", | ||||
| "UNKNOWN_NAME" : "Name unbekannt", | "UNKNOWN_NAME" : "Name unbekannt", | ||||
| "SHARE_INVITATION_LINK_HEADER" : "So geht's", | "SHARE_INVITATION_LINK_HEADER" : "So geht's", | ||||
| @@ -239,6 +240,14 @@ app.core.Dict = { | |||||
| "EDIT_GROUP" : "Gruppe bearbeiten", | "EDIT_GROUP" : "Gruppe bearbeiten", | ||||
| "GROUP_NAME" : "Gruppenname", | "GROUP_NAME" : "Gruppenname", | ||||
| "GROUP_DESCRIPTION" : "Beschreibung", | "GROUP_DESCRIPTION" : "Beschreibung", | ||||
| "GROUP_TERMS_DESCRIPTION": "Begrüßung und Nutzungsbedingungen", | |||||
| "GROUP_TERMS_ACTIVE": "Nutzungsbedingungen aktiv", | |||||
| "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", | |||||
| "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", | |||||
| "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", | |||||
| "GROUP_INDUSTRY" : "Branche", | "GROUP_INDUSTRY" : "Branche", | ||||
| "GROUP_INDUSTRY_FITNESS" : "Sport und Fitness", | "GROUP_INDUSTRY_FITNESS" : "Sport und Fitness", | ||||
| "GROUP_INDUSTRY_YOGA" : "Yoga", | "GROUP_INDUSTRY_YOGA" : "Yoga", | ||||
| @@ -551,17 +560,21 @@ app.core.Dict = { | |||||
| "STATS_REPORTING" : 'Reporting', | "STATS_REPORTING" : 'Reporting', | ||||
| 'STATS_PLANNING' : 'Planung', | 'STATS_PLANNING' : 'Planung', | ||||
| "DO_YOU_REALLY_WANT_TO_DELETE_THIS_CONTRACT" : "Möchtest Du diesen Vertrag wirklich löschen?", | "DO_YOU_REALLY_WANT_TO_DELETE_THIS_CONTRACT" : "Möchtest Du diesen Vertrag wirklich löschen?", | ||||
| "GROUP_MANAGEMENT_MEMBERS_FILTER" : "Suchfilter Name", | |||||
| "GROUP_MANAGEMENT_MEMBERS_EMAIL_VALIDATED" : "Emailadresse validiert", | |||||
| "GROUP_MANAGEMENT_MEMBERS_EMAIL_NOT_VALIDATED" : "Emailadresse noch nicht validiert", | |||||
| "GROUP_MANAGEMENT_MEMBERS_ACTIVE" : "Aktiv", | "GROUP_MANAGEMENT_MEMBERS_ACTIVE" : "Aktiv", | ||||
| "GROUP_MANAGEMENT_MEMBERS_INACTIVE" : "Inaktiv", | "GROUP_MANAGEMENT_MEMBERS_INACTIVE" : "Inaktiv", | ||||
| "GROUP_MANAGEMENT_MEMBERS_NOT_APPROVED" : "Unbestätigt", | "GROUP_MANAGEMENT_MEMBERS_NOT_APPROVED" : "Unbestätigt", | ||||
| "GROUP_MANAGEMENT_MEMBERS_CHANGE_STATUS" : "Gruppenstatus ändern", | "GROUP_MANAGEMENT_MEMBERS_CHANGE_STATUS" : "Gruppenstatus ändern", | ||||
| "GROUP_MANAGEMENT_MEMBERS_CHANGE_STATUS_INFO" : "Du kannst deinen eigenen Gruppenstatus nicht verändern.", | |||||
| "BTN_GROUP_MANAGEMENT_MEMBERS_SAVE_STATUS" : "Status speichern", | "BTN_GROUP_MANAGEMENT_MEMBERS_SAVE_STATUS" : "Status speichern", | ||||
| "MEMBER_STATUS_CHANGED" : "Status erfolgreich geändert.", | "MEMBER_STATUS_CHANGED" : "Status erfolgreich geändert.", | ||||
| "GROUP_DETAIL_NOTE_INACTIVE_OR_NOT_APPROVED" : "Du bist bereits Mitglied dieser Gruppe, deine volle Mitgliedschaft muss von einem Admin aktiviert werden. Aktuell kannst du noch keine Gruppentermine sehen oder an ihnen teilnehmen.", | "GROUP_DETAIL_NOTE_INACTIVE_OR_NOT_APPROVED" : "Du bist bereits Mitglied dieser Gruppe, deine volle Mitgliedschaft muss von einem Admin aktiviert werden. Aktuell kannst du noch keine Gruppentermine sehen oder an ihnen teilnehmen.", | ||||
| "GROUP_DETAIL_STATUS" : "Dein Gruppenstatus", | "GROUP_DETAIL_STATUS" : "Dein Gruppenstatus", | ||||
| "HOME_MODAL_NOT_ACTIVATED_TITLE" : "Herzlich Willkommen", | "HOME_MODAL_NOT_ACTIVATED_TITLE" : "Herzlich Willkommen", | ||||
| "HOME_MODAL_NOT_ACTIVATED_TEXT1" : "Herzlich Willkommen bei", | "HOME_MODAL_NOT_ACTIVATED_TEXT1" : "Herzlich Willkommen bei", | ||||
| "HOME_MODAL_NOT_ACTIVATED_TEXT2" : "Ihre Registrierung war erfolgreich, bitte vervollständigen Sie schon Ihr Profil, damit der Gruppeninhaber Ihre Anmeldung bestätigen kann. Sie werden benachrichtigt, sobald die Freigabe erfolgt ist.", | |||||
| "HOME_MODAL_NOT_ACTIVATED_TEXT2" : "Ihre Registrierung war erfolgreich. Der Gruppeninhaber wurde benachrichtigt und wird Sie in Kürze für die Gruppe freigeben. Bitte ergänzen Sie Ihre Adressdaten und Ihre Telefonnummer im Profil, sollten Rückfragen aufkommen. Vielen Dank.", | |||||
| "HOME_MODAL_NOT_ACTIVATED_BUTTON" : "Profil vervollständigen", | "HOME_MODAL_NOT_ACTIVATED_BUTTON" : "Profil vervollständigen", | ||||
| }, | }, | ||||
| "en" : { | "en" : { | ||||
| @@ -16,6 +16,8 @@ app.model.Group = function( data, memberData ) | |||||
| name = data.display_name, | name = data.display_name, | ||||
| category = data.category, | category = data.category, | ||||
| description = data.description || null, | description = data.description || null, | ||||
| termsConditions = data.terms_conditions || null, | |||||
| termsConditionsActive = data.terms_conditions_active === 1, | |||||
| contactInformation = data.contact_information || null, | contactInformation = data.contact_information || null, | ||||
| emblemUrl = data.emblem_url || null, | emblemUrl = data.emblem_url || null, | ||||
| emblem_cloud_id = data.emblem_cloud_id || null, | emblem_cloud_id = data.emblem_cloud_id || null, | ||||
| @@ -101,6 +103,16 @@ app.model.Group = function( data, memberData ) | |||||
| return description; | return description; | ||||
| }; | }; | ||||
| this.getTermsConditions = function() | |||||
| { | |||||
| return termsConditions; | |||||
| }; | |||||
| this.getTermsConditionsActive = function() | |||||
| { | |||||
| return termsConditionsActive; | |||||
| }; | |||||
| this.getContactInformation = function() | this.getContactInformation = function() | ||||
| { | { | ||||
| return contactInformation; | return contactInformation; | ||||
| @@ -34,7 +34,8 @@ app.model.Profile = function( data, groupsData ) | |||||
| childProfiles = data.child_profile_js || [], | childProfiles = data.child_profile_js || [], | ||||
| createdDt = data.created_dt, | createdDt = data.created_dt, | ||||
| // Note: Emails are optional | // Note: Emails are optional | ||||
| email = null; | |||||
| email = null, | |||||
| emailValidated = null; | |||||
| if ( "object" === typeof( teamCategoryIds ) ) | if ( "object" === typeof( teamCategoryIds ) ) | ||||
| { | { | ||||
| @@ -59,6 +60,16 @@ app.model.Profile = function( data, groupsData ) | |||||
| return email; | return email; | ||||
| }; | }; | ||||
| this.setEmailValidated = function( ev ) | |||||
| { | |||||
| emailValidated = ev; | |||||
| }; | |||||
| this.getEmailValidated = function() | |||||
| { | |||||
| return emailValidated; | |||||
| }; | |||||
| this.isAdminOfGroup = function( groupId ) | this.isAdminOfGroup = function( groupId ) | ||||
| { | { | ||||
| let isAdmin = false; | let isAdmin = false; | ||||
| @@ -9,8 +9,7 @@ app.state.GroupDetailEdit = function() | |||||
| { | { | ||||
| var state = app.core.StateManager.createState( 'group-detail-edit' ); | var state = app.core.StateManager.createState( 'group-detail-edit' ); | ||||
| state.onEnter = function( p ) | |||||
| { | |||||
| state.onEnter = function( p ) { | |||||
| let $content = app.core.View.getContent(), | let $content = app.core.View.getContent(), | ||||
| groupId = p.groupId; | groupId = p.groupId; | ||||
| @@ -19,37 +18,33 @@ app.state.GroupDetailEdit = function() | |||||
| app.core.Rpc.call( | app.core.Rpc.call( | ||||
| 'Team', | 'Team', | ||||
| 'getDetails', | 'getDetails', | ||||
| { teamId : groupId }, | |||||
| function( res ) | |||||
| { | |||||
| var group = new app.model.Group( res.team ); | |||||
| {teamId: groupId}, | |||||
| function (res) { | |||||
| var group = new app.model.Group(res.team); | |||||
| app.core.View.setContent( | app.core.View.setContent( | ||||
| app.core.View.getTemplate( 'group-detail-edit', { group : group } ) | |||||
| app.core.View.getTemplate('group-detail-edit', {group: group}) | |||||
| ); | ); | ||||
| $content.find( '[data-id="btn-save-changes"]' ).first().click( function() | |||||
| { | |||||
| let $form = $content.find( '[data-id="form-team-details"]' ).first(), | |||||
| isValid = app.util.Form.bootstrapValidate( $form ); | |||||
| $content.find('[data-id="btn-save-changes"]').first().click(function () { | |||||
| let $form = $content.find('[data-id="form-team-details"]').first(), | |||||
| isValid = app.util.Form.bootstrapValidate($form); | |||||
| if ( isValid ) | |||||
| { | |||||
| if (isValid) { | |||||
| app.gui.PageLoader.show(); | app.gui.PageLoader.show(); | ||||
| app.core.Rpc.call( | app.core.Rpc.call( | ||||
| 'Team', | 'Team', | ||||
| 'update', | 'update', | ||||
| { | { | ||||
| groupId : groupId, | |||||
| 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() ), | |||||
| contactInformation : app.util.Helper.trim( $form.find( '[data-id="textarea-team-contactinformation"]' ).first().val() ), | |||||
| industry : $form.find( '[data-id="select-team-industry"]' ).first().val() | |||||
| groupId: groupId, | |||||
| 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()), | |||||
| contactInformation: app.util.Helper.trim($form.find('[data-id="textarea-team-contactinformation"]').first().val()), | |||||
| industry: $form.find('[data-id="select-team-industry"]').first().val() | |||||
| }, | }, | ||||
| function( res ) | |||||
| { | |||||
| app.core.Controller.redirect( '#/group/' + groupId ); | |||||
| function (res) { | |||||
| app.core.Controller.redirect('#/group/' + groupId); | |||||
| } | } | ||||
| ); | ); | ||||
| @@ -58,10 +53,32 @@ app.state.GroupDetailEdit = function() | |||||
| return false; | return false; | ||||
| }); | }); | ||||
| app.gui.PageLoader.hide(); | |||||
| $content.find('[data-id="btn-reset-terms-members"]').first().click(function () { | |||||
| app.core.View.confirm( | |||||
| _lc('DO_YOU_REALLY_WANT_TO_RESET_GROUP_MEMBERS_ACCEPTED_TERMS'), | |||||
| function () { | |||||
| app.gui.PageLoader.show(); | |||||
| app.core.View.closeModal(); | |||||
| app.core.Rpc.call( | |||||
| 'Team', | |||||
| 'resetAcceptedMemberTerms', | |||||
| { | |||||
| groupId: groupId, | |||||
| }, | |||||
| function (res) { | |||||
| app.core.View.toastSuccess(_lc('SUCCESS_RESET_TERMS_MEMBERS')); | |||||
| }, | |||||
| function (res) { | |||||
| app.core.View.toastError(_lc('GENERAL_SERVER_ERROR')); | |||||
| } | |||||
| ); | |||||
| }, | |||||
| _lc('BTN_CONFIRM_RESET_GROUP_MEMBERS_ACCEPTED_TERMS') | |||||
| ); | |||||
| }); | |||||
| } | } | ||||
| ); | ); | ||||
| }; | |||||
| app.gui.PageLoader.hide(); | |||||
| } | |||||
| return state; | return state; | ||||
| }; | |||||
| } | |||||
| @@ -45,6 +45,7 @@ app.state.GroupMemberManagement = function() | |||||
| if ( member.getAccountId() == emails[ ei ].id ) | if ( member.getAccountId() == emails[ ei ].id ) | ||||
| { | { | ||||
| member.setEmail( emails[ ei ].email ); | member.setEmail( emails[ ei ].email ); | ||||
| member.setEmailValidated(emails[ ei ].is_validated == 1) | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -99,8 +100,11 @@ app.state.GroupMemberManagement = function() | |||||
| }); | }); | ||||
| $content.on( 'click', '[data-id="member-header"] .nav-tabs .nav-link', function() | $content.on( 'click', '[data-id="member-header"] .nav-tabs .nav-link', function() | ||||
| { | { | ||||
| var content = $(this).data("content"); | |||||
| let searchInput = $content.find('[data-id="member-search-filter"]') | |||||
| searchInput.val(''); | |||||
| searchInput.trigger('input'); | |||||
| $('[data-id="member-header"] .nav-tabs .nav-link').removeClass("active"); | $('[data-id="member-header"] .nav-tabs .nav-link').removeClass("active"); | ||||
| var content = $(this).data("content"); | |||||
| $(".group-members-content").removeClass("active"); | $(".group-members-content").removeClass("active"); | ||||
| $(this).addClass("active"); | $(this).addClass("active"); | ||||
| $("#" + content).addClass("active"); | $("#" + content).addClass("active"); | ||||
| @@ -113,6 +117,23 @@ app.state.GroupMemberManagement = function() | |||||
| fnUpdateMemberToEdit( memberId ) | fnUpdateMemberToEdit( memberId ) | ||||
| } | } | ||||
| $content.on('input', '[data-id="member-search-filter"]', function(e) | |||||
| { | |||||
| var searchTerm = $(this).val().toLowerCase(); | |||||
| // Filter elements | |||||
| $('table.table-profiles tbody tr').each(function() { | |||||
| var $tr = $(this); | |||||
| var userName = $tr.find('.align-middle > div').text().toLowerCase(); | |||||
| if (userName.includes(searchTerm) || searchTerm === '') { | |||||
| $tr.show(); | |||||
| } else { | |||||
| $tr.hide(); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| app.gui.PageLoader.hide(); | app.gui.PageLoader.hide(); | ||||
| } | } | ||||
| ); | ); | ||||
| @@ -11,6 +11,7 @@ app.state.GroupMemberManagementMember = function() | |||||
| state.onEnter = function( p ) | state.onEnter = function( p ) | ||||
| { | { | ||||
| console.log(p); | |||||
| let $content = app.core.View.getContent(), | let $content = app.core.View.getContent(), | ||||
| fnRenderMemberForm = null, | fnRenderMemberForm = null, | ||||
| fnGetMemberById = null, | fnGetMemberById = null, | ||||
| @@ -165,6 +166,7 @@ app.state.GroupMemberManagementMember = function() | |||||
| if ( member.getAccountId() == emails[ ei ].id ) | if ( member.getAccountId() == emails[ ei ].id ) | ||||
| { | { | ||||
| member.setEmail( emails[ ei ].email ); | member.setEmail( emails[ ei ].email ); | ||||
| member.setEmailValidated(emails[ ei ].is_validated == 1) | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -85,6 +85,43 @@ | |||||
| class="form-control" | class="form-control" | ||||
| placeholder="<%= _lc( 'TEAM_DETAIL_TEAMDESCRIPTION_PLACEHOLDER' ) %>"><%= group.getDescription() ? group.getDescription() : '' %></textarea> | placeholder="<%= _lc( 'TEAM_DETAIL_TEAMDESCRIPTION_PLACEHOLDER' ) %>"><%= group.getDescription() ? group.getDescription() : '' %></textarea> | ||||
| </div> | </div> | ||||
| <div class="form-group"> | |||||
| <label for="textarea-team-terms-conditions"> | |||||
| <%= _lc( 'GROUP_TERMS_DESCRIPTION' ) %> | |||||
| </label> | |||||
| <textarea maxlength="4096" | |||||
| rows="5" | |||||
| data-id="textarea-team-terms-conditions" | |||||
| id="textarea-team-terms-conditions" | |||||
| class="form-control" | |||||
| placeholder="<%= _lc( 'TEAM_DETAIL_TEAM_TERMS_PLACEHOLDER' ) %>"><%= group.getTermsConditions() ? group.getTermsConditions() : '' %></textarea> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <div class="custom-control custom-checkbox my-1 mr-sm-2"> | |||||
| <input type="checkbox" | |||||
| name="checkbox-team-terms-conditions-active" | |||||
| data-id="checkbox-team-terms-conditions-active" | |||||
| id="checkbox-team-terms-conditions-active" | |||||
| class="custom-control-input" | |||||
| > | |||||
| <label class="custom-control-label" | |||||
| for="checkbox-team-terms-conditions-active"><%= _lc( 'GROUP_TERMS_ACTIVE' ) %></label> | |||||
| <p> | |||||
| <small><%= _lc( 'GROUP_TERMS_ACTIVE_DESCRIPTION' ) %></small> | |||||
| </p> | |||||
| </div> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <button type="button" | |||||
| name="btn-reset-terms-members" | |||||
| data-id="btn-reset-terms-members" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <%= _lc( 'BTN_GROUP_TERMS_RESET' ) %> | |||||
| </button> | |||||
| <p> | |||||
| <small><%= _lc( 'GROUP_TERMS_RESET_DESCRIPTION' ) %></small> | |||||
| </p> | |||||
| </div> | |||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label for="textarea-team-contactinformation"> | <label for="textarea-team-contactinformation"> | ||||
| <%= _lc( 'GROUP_CONTACT_INFORMATION' ) %> | <%= _lc( 'GROUP_CONTACT_INFORMATION' ) %> | ||||
| @@ -1,5 +1,5 @@ | |||||
| <% if ( p ) { %> | <% if ( p ) { %> | ||||
| <% var currentUser = app.model.SessionUser.getUserProfile(); %> | |||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col text-center"> | <div class="col text-center"> | ||||
| <img class="img-fluid rounded-circle profile-image-big img-thumbnail" | <img class="img-fluid rounded-circle profile-image-big img-thumbnail" | ||||
| @@ -56,6 +56,11 @@ | |||||
| <div class="profile-content"> | <div class="profile-content"> | ||||
| <% if ( p.getEmail() ) { %> | <% if ( p.getEmail() ) { %> | ||||
| <a href="mailto:<%= p.getEmail() %>"><%= p.getEmail() %></a> | <a href="mailto:<%= p.getEmail() %>"><%= p.getEmail() %></a> | ||||
| <% if ( p.getEmailValidated() === true ) { %> | |||||
| <div> ( <i class="far fa-check-circle text-success"></i> <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_EMAIL_VALIDATED' ) %> )</div> | |||||
| <% } else { %> | |||||
| <div> ( <i class="far fa-window-close text-danger"></i> <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_EMAIL_NOT_VALIDATED' ) %> )</div> | |||||
| <% } %> | |||||
| <% } else { %> | <% } else { %> | ||||
| --- | --- | ||||
| <% } %> | <% } %> | ||||
| @@ -119,14 +124,16 @@ | |||||
| </div> | </div> | ||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col-6"> | <div class="col-6"> | ||||
| <select class="form-control form-control-sm" data-id="select-member-status"> | |||||
| <option value="active" <%= ( 'active' === p.getGroupData( g.getId() ).status ) ? 'selected="selected"' : '' %> > | |||||
| <select class="form-control form-control-sm" data-id="select-member-status" | |||||
| <%= ( p.getId() === currentUser.getId() ) ? 'disabled="disabled"' : '' %> | |||||
| > | |||||
| <option value="active" <%= ( 'active' === p.getGroupData( g.getId() ).status ) ? 'selected="selected"' : '' %> > | |||||
| <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_ACTIVE' ) %> | <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_ACTIVE' ) %> | ||||
| </option> | </option> | ||||
| <option value="inactive" <%= ( 'inactive' === p.getGroupData( g.getId() ).status ) ? 'selected="selected"' : '' %> > | |||||
| <option value="inactive" <%= ( 'inactive' === p.getGroupData( g.getId() ).status ) ? 'selected="selected"' : '' %> > | |||||
| <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_INACTIVE' ) %> | <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_INACTIVE' ) %> | ||||
| </option> | </option> | ||||
| <option value="not_approved" <%= ( 'not_approved' === p.getGroupData( g.getId() ).status ) ? 'selected="selected"' : '' %> > | |||||
| <option value="not_approved" <%= ( 'not_approved' === p.getGroupData( g.getId() ).status ) ? 'selected="selected"' : '' %> > | |||||
| <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_NOT_APPROVED' ) %> | <%= _lc( 'GROUP_MANAGEMENT_MEMBERS_NOT_APPROVED' ) %> | ||||
| </option> | </option> | ||||
| </select> | </select> | ||||
| @@ -136,9 +143,9 @@ | |||||
| <%= _lc( 'BTN_GROUP_MANAGEMENT_MEMBERS_SAVE_STATUS' ) %> | <%= _lc( 'BTN_GROUP_MANAGEMENT_MEMBERS_SAVE_STATUS' ) %> | ||||
| </button> | </button> | ||||
| </div> | </div> | ||||
| <% if ( 'trainer' === p.getRoleInGroup( g.getId() ) ) { %> | |||||
| <% if ( p.getId() === currentUser.getId() ) { %> | |||||
| <div class="col-sm-12"> | <div class="col-sm-12"> | ||||
| <small><i><%= _lc( 'CANNOT_CHANGE_GROUP_OWNER_ROLE_INFO' ) %></i></small> | |||||
| <small><i><%= _lc( 'GROUP_MANAGEMENT_MEMBERS_CHANGE_STATUS_INFO' ) %></i></small> | |||||
| </div> | </div> | ||||
| <% } %> | <% } %> | ||||
| </div> | </div> | ||||
| @@ -2,7 +2,7 @@ | |||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col-sm-12"> | <div class="col-sm-12"> | ||||
| <div class="card"> | <div class="card"> | ||||
| <div class="card-header"></div> | |||||
| <div class="card-header"><%= group.getName() %></div> | |||||
| <div class="card-body" | <div class="card-body" | ||||
| data-id="member-container"> | data-id="member-container"> | ||||
| @@ -18,6 +18,12 @@ | |||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="row"> | |||||
| <div class="col"> | |||||
| <label><%= _lc( 'GROUP_MANAGEMENT_MEMBERS_FILTER' ) %></label> | |||||
| <input data-id="member-search-filter" type="text" class="form-control form-control-sm"> | |||||
| </div> | |||||
| </div> | |||||
| </div> | </div> | ||||
| <div class="card-header" data-id="member-header"> | <div class="card-header" data-id="member-header"> | ||||
| <!-- tab bar --> | <!-- tab bar --> | ||||
| @@ -1,5 +1,5 @@ | |||||
| <strong><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> <%= groupName %>.</strong><br /><br /> | <strong><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> <%= groupName %>.</strong><br /><br /> | ||||
| <%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT2' ) %> | <%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT2' ) %> | ||||
| <div class="button-like-modal-footer"> | <div class="button-like-modal-footer"> | ||||
| <a href="#/configuration/profile" class="btn btn-sm btn-secondary" data-id="not-activated"><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_BUTTON' ) %></a> | |||||
| <a href="#/configuration/account" class="btn btn-sm btn-secondary" data-id="not-activated"><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_BUTTON' ) %></a> | |||||
| </div> | </div> | ||||
| @@ -1117,6 +1117,35 @@ class TB_Server_Control_Team { | |||||
| return $resp; | return $resp; | ||||
| } | } | ||||
| public static function resetAcceptedMemberTerms( TB_Server_Core_RequestData $params ) | |||||
| { | |||||
| $resp = new TB_Server_Core_Response(); | |||||
| $teamId = $params->get( 'groupId' ); | |||||
| $team = TB_Shared_Ent_TeamData_Team::get( $teamId ); | |||||
| if ( is_null( $team ) ) | |||||
| { | |||||
| throw new \Exception( 'Team not found to reset member terms.' ); | |||||
| } | |||||
| // Rights | |||||
| $sessionProfile = TB_Server_Core_Session::get()->getProfile(); | |||||
| if ( false === $sessionProfile->isAdminOfTeam( $teamId ) ) | |||||
| { | |||||
| throw new \Exception( 'Not allowed to reset member terms.' ); | |||||
| } | |||||
| $memberProfiles = TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id ); | |||||
| foreach ($memberProfiles as $memberProfile) { | |||||
| $tmpTeam = $memberProfile->team_js; | |||||
| $tmpTeam['terms_accepted'] = 0; | |||||
| $memberProfile->teams_js = $tmpTeam; | |||||
| $memberProfile->save(); | |||||
| } | |||||
| return $resp; | |||||
| } | |||||
| // NOT USED AT THE MOMENT | // NOT USED AT THE MOMENT | ||||
| public static function delete( TB_Server_Core_RequestData $params ) | public static function delete( TB_Server_Core_RequestData $params ) | ||||
| { | { | ||||
| @@ -141,7 +141,7 @@ class TB_Server_Core_Notification | |||||
| // Notify | // Notify | ||||
| $headline = "Neues Mitglied"; | $headline = "Neues Mitglied"; | ||||
| $message = "Ein neues Mitglied ist deiner Gruppe beigetreten."; | $message = "Ein neues Mitglied ist deiner Gruppe beigetreten."; | ||||
| $additionalData = self::createAdditionalData( '#/group/' . $team->id . '/membermanagement' ); | |||||
| $additionalData = self::createAdditionalData( '#/group/' . $team->id . '/membermanagement/' . $profile->id); | |||||
| //$additionalData = self::createAdditionalData( '#/profile/' . $profile->id ); | //$additionalData = self::createAdditionalData( '#/profile/' . $profile->id ); | ||||
| self::sendToProfiles( | self::sendToProfiles( | ||||
| $headline, | $headline, | ||||
| @@ -50,7 +50,7 @@ class TB_Shared_Ent_Core_Account extends Francis_Db_Row { | |||||
| $dbh = self::getDbh(); | $dbh = self::getDbh(); | ||||
| $in = str_repeat('?,', count( $accountIds ) - 1) . '?'; | $in = str_repeat('?,', count( $accountIds ) - 1) . '?'; | ||||
| $sql = "SELECT id, email FROM " . self::getTable() . " WHERE id IN ($in)"; | |||||
| $sql = "SELECT id, email, is_validated FROM " . self::getTable() . " WHERE id IN ($in)"; | |||||
| $stmt = $dbh->prepare( $sql ); | $stmt = $dbh->prepare( $sql ); | ||||
| $stmt->execute( $accountIds ); | $stmt->execute( $accountIds ); | ||||
| $emails = $stmt->fetchAll( PDO::FETCH_ASSOC ); | $emails = $stmt->fetchAll( PDO::FETCH_ASSOC ); | ||||
| @@ -485,6 +485,7 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row { | |||||
| 'is_anonymous' => 0, | 'is_anonymous' => 0, | ||||
| 'join_dt' => TB_Server_Utils_Helper::getUTCNowDateTime(), | 'join_dt' => TB_Server_Utils_Helper::getUTCNowDateTime(), | ||||
| 'status' => self::STATUS_NOT_APPROVED, | 'status' => self::STATUS_NOT_APPROVED, | ||||
| 'terms_accepted' => 0 | |||||
| ); | ); | ||||
| $this->teams_js = $teamsJson; | $this->teams_js = $teamsJson; | ||||
| @@ -12,6 +12,8 @@ | |||||
| * @property string $category | * @property string $category | ||||
| * @property string|NULL $description | * @property string|NULL $description | ||||
| * @property string|NULL $contact_information | * @property string|NULL $contact_information | ||||
| * @property string|NULL $terms_conditions | |||||
| * @property bool $terms_conditions_active | |||||
| * @property string $emblem_url | * @property string $emblem_url | ||||
| * @property string $emblem_cloud_id | * @property string $emblem_cloud_id | ||||
| * @property array|null $course_categories_js | * @property array|null $course_categories_js | ||||
| @@ -0,0 +1,20 @@ | |||||
| <?php | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_global.php'; | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_local.php'; | |||||
| function patch_addTermsAcceptedToProfile() | |||||
| { | |||||
| if (Francis_Utils_Config::get('environment') === 'DEV') { | |||||
| $db = TB_Shared_Db_Core::get(); | |||||
| $sql = 'UPDATE `account` SET `pass`="aa47377bfef0917b6ff2e73ece5a6952d7763664" WHERE 1'; | |||||
| $stmt = $db->query( $sql ); | |||||
| } else { | |||||
| throw new Exception('only for dev environment'); | |||||
| } | |||||
| echo "DONE..."; | |||||
| } | |||||
| patch_addTermsAcceptedToProfile(); | |||||
| @@ -3,7 +3,7 @@ | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_global.php'; | require_once __DIR__ . '/../../src/server/server/config/boot_global.php'; | ||||
| require_once __DIR__ . '/../../src/server/server/config/boot_local.php'; | require_once __DIR__ . '/../../src/server/server/config/boot_local.php'; | ||||
| function patch_addStatusToProfileArrays() | |||||
| function patch_addActiveStateToProfile() | |||||
| { | { | ||||
| $db = TB_Shared_Db_TeamData::get(); | $db = TB_Shared_Db_TeamData::get(); | ||||
| @@ -35,4 +35,4 @@ function patch_addStatusToProfileArrays() | |||||
| echo "DONE..."; | echo "DONE..."; | ||||
| } | } | ||||
| patch_addStatusToProfileArrays(); | |||||
| patch_addActiveStateToProfile(); | |||||
| @@ -0,0 +1,38 @@ | |||||
| <?php | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_global.php'; | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_local.php'; | |||||
| function patch_addTermsAcceptedToProfile() | |||||
| { | |||||
| $db = TB_Shared_Db_TeamData::get(); | |||||
| $sql = 'SELECT * FROM profile'; | |||||
| $stmt = $db->query( $sql ); | |||||
| $res = $stmt->fetchAll(); | |||||
| $db->beginTransaction(); | |||||
| foreach( $res as $row ) | |||||
| { | |||||
| if ( is_array( $row ) && isset( $row[ 'id' ] ) ) | |||||
| { | |||||
| $entProfile = TB_Shared_Ent_TeamData_Profile::get( $row[ 'id' ] ); | |||||
| $resTeam = []; | |||||
| foreach ($entProfile->teams_js as $team) { | |||||
| $tmpTeam = $team; | |||||
| $tmpTeam['terms_accepted'] = 0; | |||||
| $resTeam[] = $tmpTeam; | |||||
| } | |||||
| $entProfile->teams_js = $resTeam; | |||||
| $entProfile->save(); | |||||
| unset($team); | |||||
| unset( $entProfile ); | |||||
| } | |||||
| } | |||||
| $db->commit(); | |||||
| echo "DONE..."; | |||||
| } | |||||
| patch_addTermsAcceptedToProfile(); | |||||
| @@ -0,0 +1,19 @@ | |||||
| <?php | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_global.php'; | |||||
| require_once __DIR__ . '/../../src/server/server/config/boot_local.php'; | |||||
| function patch_addTermsConditionsToTeam() | |||||
| { | |||||
| $db = TB_Shared_Db_TeamData::get(); | |||||
| $sql = "ALTER TABLE team | |||||
| ADD COLUMN terms_conditions VARCHAR(1024) NULL AFTER contact_information, | |||||
| ADD COLUMN terms_conditions_active TINYINT(1) NOT NULL DEFAULT 0 AFTER terms_conditions;"; | |||||
| $stmt = $db->query( $sql ); | |||||
| echo "DONE..."; | |||||
| } | |||||
| patch_addTermsConditionsToTeam(); | |||||