| @@ -14,6 +14,8 @@ | |||||
| - 1337hamburg@gmail.com | - 1337hamburg@gmail.com | ||||
| - d.knudsen@spawntree.de | - d.knudsen@spawntree.de | ||||
| - UPDATE `account` SET `pass`='aa47377bfef0917b6ff2e73ece5a6952d7763664' WHERE 1 | - UPDATE `account` SET `pass`='aa47377bfef0917b6ff2e73ece5a6952d7763664' WHERE 1 | ||||
| - in den Container wcchseln: docker exec -it pb-php /bin/bash | |||||
| - Validation-link: http://localhost:8097/client/app//#/auth/validate-email/dGm4XsJy0dp7gPnkgnKNzlgrUKh5M9pE | |||||
| Neuinstallation: | Neuinstallation: | ||||
| - cd .docker | - cd .docker | ||||
| @@ -252,6 +252,10 @@ app.core.Controller = (function(){ | |||||
| { | { | ||||
| app.core.StateManager.switchTo( new app.state.GroupLeave(), r.params ); | app.core.StateManager.switchTo( new app.state.GroupLeave(), r.params ); | ||||
| }); | }); | ||||
| rlite.add( 'group/:groupId/terms', function( r ) | |||||
| { | |||||
| app.core.StateManager.switchTo( new app.state.GroupTermsConditions(), r.params ); | |||||
| }); | |||||
| // stop: group(s) | // stop: group(s) | ||||
| // start: profile | // start: profile | ||||
| @@ -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,18 @@ 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": "Nutzungsbedingungen", | |||||
| "GROUP_TERMS_ACCEPT": "akzeptieren", | |||||
| "GROUP_TERMS_ACCEPTED": "Du hast die Nutzungsbedingungen akzeptiert", | |||||
| "GROUP_TERMS_NOT_ACCEPTED": "Du hast die Nutzungsbedingungen nicht akzeptiert", | |||||
| "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 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!", | |||||
| "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", | ||||
| @@ -406,7 +419,14 @@ app.core.Dict = { | |||||
| "CONTINUE_TO_PROBUDDY" : "Weiter", | "CONTINUE_TO_PROBUDDY" : "Weiter", | ||||
| "REGISTRATION_INCOMPLETE" : "Validierung fehlgeschlagen.", | "REGISTRATION_INCOMPLETE" : "Validierung fehlgeschlagen.", | ||||
| "REGISTRATION_INCOMPLETE_INFO" : "Bitte melde dich beim ProBuddy Support Team.", | "REGISTRATION_INCOMPLETE_INFO" : "Bitte melde dich beim ProBuddy Support Team.", | ||||
| "ACCOUNT_NOT_VALIDATED" : "Email nocht nicht validiert!", | |||||
| "REGISTRATION_EMAIL_PROVIDED" : "Du hast dich mit folgender Emailadresse registriert:", | |||||
| "REGISTRATION_SUCCESS_EMAIL_CHECK_NOTE" : "Bitte prüfe, ob du die Emailadresse korrekt eingetragen hast bzw. ob es auch die richtige Emailadresse ist! Sollte die Emailadresse nicht korrekt sein, logge dich erneut mit der nicht korrekten Emailadresse ein. Nach dem Login hast die die Möglichkeit die Emailadresse zu ändern.", | |||||
| "REGISTRATION_EMAIL_CHECK_NOTE" : "Bitte prüfe, ob du die Emailadresse korrekt eingetragen hast bzw. ob es auch die richtige Emailadresse ist!", | |||||
| "REGISTRATION_EMAIL_CHANGE_NOTE" : "Du hast hier die Möglichkeit deine, noch nicht validierte, Emailadresse zu ändern. Wenn du deine Emailadresse geändert hast, versuche dich mit deiner neuen Emailadresse einzuloggen. Danach wirst du eine neue Verifizierungs-Email erhalten.", | |||||
| "REGISTRATION_EMAIL_CHANGE_BTN" : "Email ändern", | |||||
| "REGISTRATION_EMAIL_CHANGED_SUCCESS" : "Deine Emailadresse wurde erfolgreich geändert.", | |||||
| "REGISTRATION_EMAIL_CHANGED_SUCCESS_INFO" : "Deine Emailadresse wurde erfolgreich geändert. Gehe nun zurück zum Login und versuche nun dich mit deiner neuen Emailadresse einzuloggen, um eine neue Verifizierungsmail zu erhalten.", | |||||
| "ACCOUNT_NOT_VALIDATED" : "Email noch nicht validiert!", | |||||
| "ACCOUNT_NOT_VALIDATED_DESCRIPTION" : "Bitte validiere zunächst deine Email Adresse. Wir haben dir gerade erneut einen Validierungslink per Mail zugeschickt. Bitte schau in deinem Postfach nach (ggf. auch im Spam-Ordner) und klicke auf den Button.", | "ACCOUNT_NOT_VALIDATED_DESCRIPTION" : "Bitte validiere zunächst deine Email Adresse. Wir haben dir gerade erneut einen Validierungslink per Mail zugeschickt. Bitte schau in deinem Postfach nach (ggf. auch im Spam-Ordner) und klicke auf den Button.", | ||||
| "LOGIN_FIRSTNAME" : "Vorname", | "LOGIN_FIRSTNAME" : "Vorname", | ||||
| "LOGIN_LASTNAME" : "Nachname", | "LOGIN_LASTNAME" : "Nachname", | ||||
| @@ -544,18 +564,24 @@ 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", | ||||
| "HOME_MODAL_TERMS_NOT_ACCEPTED_TITLE" : "Nutzungsbedingungen akzeptieren", | |||||
| "HOME_MODAL_TERMS_NOT_ACCEPTED_TEXT" : "Folgende Gruppen haben Nutzungsbedingungen, die Du noch akzeptieren musst, um auf Deine Termine zugreifen zu können.", | |||||
| }, | }, | ||||
| "en" : { | "en" : { | ||||
| } | } | ||||
| @@ -194,6 +194,7 @@ app.core.View = (function(){ | |||||
| cbOnConfirm = params.onConfirm || null, | cbOnConfirm = params.onConfirm || null, | ||||
| cbOnShow = params.onShow || null, | cbOnShow = params.onShow || null, | ||||
| cbOnHide = params.onHide || null, | cbOnHide = params.onHide || null, | ||||
| prohibitCloseModal = params.hasOwnProperty( 'prohibitCloseModal' ) ? params.prohibitCloseModal : false, | |||||
| options = { show : true }, | options = { show : true }, | ||||
| isAlert = ( params.hasOwnProperty( 'cancelButtonText' ) && params.cancelButtonText === null ); | isAlert = ( params.hasOwnProperty( 'cancelButtonText' ) && params.cancelButtonText === null ); | ||||
| @@ -259,6 +260,10 @@ app.core.View = (function(){ | |||||
| }); | }); | ||||
| $modal.modal( options ); | $modal.modal( options ); | ||||
| if ( true === prohibitCloseModal ) { | |||||
| $modal.off(); | |||||
| } | |||||
| } | } | ||||
| , | , | ||||
| closeModal : function( fnOnHidden ) | closeModal : function( fnOnHidden ) | ||||
| @@ -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; | ||||
| @@ -14,6 +14,7 @@ app.state.AuthLogin = function() | |||||
| var $authContent = app.core.View.getAuthContent(), | var $authContent = app.core.View.getAuthContent(), | ||||
| redirect = app.core.Controller.getGetParam( "redirect" ), | redirect = app.core.Controller.getGetParam( "redirect" ), | ||||
| theme = p.hasOwnProperty( 'theme' ) ? p.theme : null, | theme = p.hasOwnProperty( 'theme' ) ? p.theme : null, | ||||
| validatationEmail = ""; | |||||
| bgImg = null; | bgImg = null; | ||||
| switch( theme ) | switch( theme ) | ||||
| @@ -43,6 +44,9 @@ app.state.AuthLogin = function() | |||||
| $authContent.find( '[data-id="btn-back-to-login"]' ).first().click( function() | $authContent.find( '[data-id="btn-back-to-login"]' ).first().click( function() | ||||
| { | { | ||||
| $authContent.find( '[data-id="section-not-validated"]' ).first().hide(); | $authContent.find( '[data-id="section-not-validated"]' ).first().hide(); | ||||
| $authContent.find( '[data-id="section-not-validated-change-email"]' ).first().hide(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email-info"]' ).first().hide(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email-info-changed"]' ).first().hide(); | |||||
| $authContent.find( '[data-id="section-login"]' ).first().show(); | $authContent.find( '[data-id="section-login"]' ).first().show(); | ||||
| }); | }); | ||||
| @@ -69,7 +73,14 @@ app.state.AuthLogin = function() | |||||
| res.error === 'not_validated' ) | res.error === 'not_validated' ) | ||||
| { | { | ||||
| $authContent.find( '[data-id="section-login"]' ).first().hide(); | $authContent.find( '[data-id="section-login"]' ).first().hide(); | ||||
| $authContent.find( '[data-id="form-not-validated-email-change"]' ).first().show(); | |||||
| $authContent.find( '[data-id="section-not-validated"]' ).first().show(); | $authContent.find( '[data-id="section-not-validated"]' ).first().show(); | ||||
| $authContent.find( '[data-id="section-not-validated-change-email"]' ).first().show(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email-info"]' ).first().show(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email-info-changed"]' ).first().hide(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email"]' ).html(res.email); | |||||
| $authContent.find( '[data-id="input-change-email"]' ).html(""); | |||||
| validatationEmail = res.email; | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -115,6 +126,38 @@ app.state.AuthLogin = function() | |||||
| return false; | return false; | ||||
| }); | }); | ||||
| $authContent.find( '[data-id="btn-not-validated-email-change"]' ).first().click( function() { | |||||
| let $form = $authContent.find('[data-id="form-not-validated-email-change"]').first(), | |||||
| isValid = app.util.Form.bootstrapValidate($form), | |||||
| newEmail = $form.find( '[data-id="input-change-email"]' ).first().val(); | |||||
| if (isValid) { | |||||
| app.core.Rpc.call( | |||||
| 'Auth', | |||||
| 'changeNotValidatedEmail', | |||||
| { | |||||
| currentEmail: validatationEmail, | |||||
| newEmail : newEmail, | |||||
| }, | |||||
| function( res ) | |||||
| { | |||||
| validatationEmail = newEmail; | |||||
| $authContent.find( '[data-id="auth-change-registered-email-info"]' ).first().hide(); | |||||
| $authContent.find( '[data-id="form-not-validated-email-change"]' ).first().hide(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email-info-changed"]' ).first().show(); | |||||
| $authContent.find( '[data-id="auth-change-registered-email"]' ).html(newEmail); | |||||
| app.core.View.toastSuccess( _lc( 'REGISTRATION_EMAIL_CHANGED_SUCCESS' ) ); | |||||
| }, | |||||
| function( err, code ) | |||||
| { | |||||
| app.core.View.toastError( _lc( 'GENERAL_SERVER_ERROR' ) ); | |||||
| } | |||||
| ); | |||||
| } | |||||
| }); | |||||
| app.gui.PageLoader.hide(); | app.gui.PageLoader.hide(); | ||||
| }; | }; | ||||
| @@ -66,6 +66,7 @@ app.state.AuthStartJoin = function() | |||||
| app.gui.PageLoader.hide(); | app.gui.PageLoader.hide(); | ||||
| $authContent.find( '[data-id="section-form-join"]' ).first().hide(); | $authContent.find( '[data-id="section-form-join"]' ).first().hide(); | ||||
| $authContent.find( '[data-id="section-validation-info"]' ).first().show(); | $authContent.find( '[data-id="section-validation-info"]' ).first().show(); | ||||
| $authContent.find( '[data-id="validation-registered-email"]' ).html(res.email); | |||||
| } | } | ||||
| } | } | ||||
| ); | ); | ||||
| @@ -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,34 @@ 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()), | |||||
| 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()), | |||||
| 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 +54,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; | ||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,68 @@ | |||||
| /** | |||||
| * (c) by aheadware.com | |||||
| */ | |||||
| var app = app || {}; | |||||
| app.state = app.state || {}; | |||||
| app.state.GroupTermsConditions = function() | |||||
| { | |||||
| var state = app.core.StateManager.createState( 'group-terms-conditions' ); | |||||
| state.onEnter = function( p ) | |||||
| { | |||||
| var $content = app.core.View.getContent(), | |||||
| groupId = p.groupId; | |||||
| app.gui.PageLoader.show(); | |||||
| app.core.Rpc.call( | |||||
| 'Team', | |||||
| 'getDetails', | |||||
| { teamId : groupId }, | |||||
| function( res ) | |||||
| { | |||||
| var mGroup = new app.model.Group(res.team), | |||||
| currentProfile = null; | |||||
| app.core.View.setContent( | |||||
| app.core.View.getTemplate( | |||||
| 'group-terms', | |||||
| { | |||||
| group: mGroup, | |||||
| currentProfile: app.model.SessionUser.getUserProfile() | |||||
| }) | |||||
| ); | |||||
| $content.find( '[data-id="btn-copy-ical-group-link"]' ).first().click( function() | |||||
| { | |||||
| app.util.Helper.copyInputToClipboard( $content.find( '[data-id="input-group-ical"]' ).first() ); | |||||
| app.core.View.toastSuccess( _lc( 'CALENDER_LINK_COPIED' ) ); | |||||
| }); | |||||
| $content.find( '[data-id="checkbox-terms-conditions-accept"]' ).first().change( function() | |||||
| { | |||||
| let accepted = $content.find( '[data-id="checkbox-terms-conditions-accept"]' ).first().is(":checked"); | |||||
| app.core.Rpc.call( | |||||
| 'Profile', | |||||
| 'acceptTerms', | |||||
| { groupId: groupId, termsAccepted: accepted }, | |||||
| function( res ) | |||||
| { | |||||
| let msg = _lc( accepted ? 'GROUP_TERMS_ACCEPTED' : 'GROUP_TERMS_NOT_ACCEPTED'); | |||||
| $content.find( '[data-id="terms-accepted-note"]' ).first().text("(" + msg + ")"); | |||||
| app.core.View.toastSuccess( msg ); | |||||
| }, | |||||
| function ( res ){ | |||||
| app.core.View.toastError( _lc( 'GENERAL_SERVER_ERROR' ) ); | |||||
| }); | |||||
| }); | |||||
| app.gui.PageLoader.hide(); | |||||
| } | |||||
| ); | |||||
| }; | |||||
| return state; | |||||
| }; | |||||
| @@ -228,6 +228,7 @@ app.state.Home = function() | |||||
| filter = this.getStateSetting( 'filter' ), | filter = this.getStateSetting( 'filter' ), | ||||
| isBackButton = app.core.StateManager.isPreviousState(), | isBackButton = app.core.StateManager.isPreviousState(), | ||||
| scrollY = +this.getStateSetting( 'scrollY' ); | scrollY = +this.getStateSetting( 'scrollY' ); | ||||
| groupsTermsNotAccepted = []; | |||||
| // For paging | // For paging | ||||
| self.currentPage = 1; | self.currentPage = 1; | ||||
| @@ -251,6 +252,12 @@ app.state.Home = function() | |||||
| for ( var ui = 0; ui < userGroups.length; ui++ ) | for ( var ui = 0; ui < userGroups.length; ui++ ) | ||||
| { | { | ||||
| let group = userGroups[ ui ]; | |||||
| let groupData = app.model.SessionUser.getUserProfile().getGroupData(group.getId()); | |||||
| if (group.getTermsConditionsActive() && groupData.terms_accepted !== 1) { | |||||
| groupsTermsNotAccepted.push(group); | |||||
| } | |||||
| gcgIds = userGroups[ ui ].getCourseCategories(); | gcgIds = userGroups[ ui ].getCourseCategories(); | ||||
| for ( var gci = 0; gci < gcgIds.length; gci++ ) | for ( var gci = 0; gci < gcgIds.length; gci++ ) | ||||
| { | { | ||||
| @@ -258,7 +265,6 @@ app.state.Home = function() | |||||
| } | } | ||||
| } | } | ||||
| if ( !filter || !filter.hasOwnProperty( 'version' ) ) | if ( !filter || !filter.hasOwnProperty( 'version' ) ) | ||||
| { | { | ||||
| filter = { | filter = { | ||||
| @@ -665,7 +671,6 @@ app.state.Home = function() | |||||
| $modalRoot.on( 'click', '[data-type="rsvp-button-accept"]', function() | $modalRoot.on( 'click', '[data-type="rsvp-button-accept"]', function() | ||||
| { | { | ||||
| callSetAttendanceStatus( appId, "accepted", $(this).attr( 'data-child-profile-id' ) ); | callSetAttendanceStatus( appId, "accepted", $(this).attr( 'data-child-profile-id' ) ); | ||||
| console.log('accept'); | |||||
| //app.core.View.closeModal(); | //app.core.View.closeModal(); | ||||
| //renderAppointmentItem( appointment ); | //renderAppointmentItem( appointment ); | ||||
| }); | }); | ||||
| @@ -673,7 +678,6 @@ app.state.Home = function() | |||||
| $modalRoot.on( 'click', '[data-type="rsvp-button-recall"]', function() | $modalRoot.on( 'click', '[data-type="rsvp-button-recall"]', function() | ||||
| { | { | ||||
| callSetAttendanceStatus( appId, "declined", $(this).attr( 'data-child-profile-id' ) ); | callSetAttendanceStatus( appId, "declined", $(this).attr( 'data-child-profile-id' ) ); | ||||
| console.log('decline'); | |||||
| //app.core.View.closeModal(); | //app.core.View.closeModal(); | ||||
| //renderAppointmentItem( appointment ); | //renderAppointmentItem( appointment ); | ||||
| }); | }); | ||||
| @@ -682,13 +686,11 @@ app.state.Home = function() | |||||
| { | { | ||||
| const $modalRoot = app.core.View.getModalContent(); | const $modalRoot = app.core.View.getModalContent(); | ||||
| $modalRoot.off( 'click', '[data-type="rsvp-button-accept"]' ); | $modalRoot.off( 'click', '[data-type="rsvp-button-accept"]' ); | ||||
| console.log('onHide - 685'); | |||||
| renderAppointmentItem( getAppointment(appId) ); | renderAppointmentItem( getAppointment(appId) ); | ||||
| }, | }, | ||||
| 'onConfirm' : function() | 'onConfirm' : function() | ||||
| { | { | ||||
| app.core.View.closeModal(); | app.core.View.closeModal(); | ||||
| console.log('onConfirm - 690'); | |||||
| } | } | ||||
| } | } | ||||
| ); | ); | ||||
| @@ -1066,7 +1068,24 @@ app.state.Home = function() | |||||
| sessionStorage.removeItem("g_ids_popup_shown"); | sessionStorage.removeItem("g_ids_popup_shown"); | ||||
| } | } | ||||
| if (showPopup) { | |||||
| if (groupsTermsNotAccepted.length > 0) { | |||||
| // Show terms not accepted popup | |||||
| app.core.View.showModal({ | |||||
| title: _lc('HOME_MODAL_TERMS_NOT_ACCEPTED_TITLE'), | |||||
| body: app.core.View.getTemplate('home-modal-terms-not-accepted', { groups: groupsTermsNotAccepted }), | |||||
| hideButtons: true, | |||||
| hideCloseBtn: true, | |||||
| prohibitCloseModal: true, | |||||
| }); | |||||
| $("body").on( 'click', '[data-type="group-accept-link"]', function() | |||||
| { | |||||
| var groupId = $(this).data('group-id'); | |||||
| window.location.hash = "#/group/" + groupId + "/terms"; | |||||
| app.core.View.closeModal(); | |||||
| }); | |||||
| } else if (showPopup) { | |||||
| app.core.View.showModal({ | app.core.View.showModal({ | ||||
| title: _lc('HOME_MODAL_NOT_ACTIVATED_TITLE'), | title: _lc('HOME_MODAL_NOT_ACTIVATED_TITLE'), | ||||
| body: app.core.View.getTemplate('home-modal-not-activated', { groupName: groupName }), | body: app.core.View.getTemplate('home-modal-not-activated', { groupName: groupName }), | ||||
| @@ -1082,7 +1101,6 @@ app.state.Home = function() | |||||
| window.location.href = $(this).attr("href"); | window.location.href = $(this).attr("href"); | ||||
| }); | }); | ||||
| } | } | ||||
| } | } | ||||
| ); | ); | ||||
| }; | }; | ||||
| @@ -52,9 +52,9 @@ | |||||
| </form> | </form> | ||||
| </section> | </section> | ||||
| <section data-id="section-not-validated" | <section data-id="section-not-validated" | ||||
| style="display: none"> | |||||
| style="display: none" class="bg-white rounded pb_form_v1 form-auth-login"> | |||||
| <form data-id="form-login-not-validated" | <form data-id="form-login-not-validated" | ||||
| class="bg-white rounded pb_form_v1 form-auth-login needs-validation" | |||||
| class="needs-validation" | |||||
| novalidate> | novalidate> | ||||
| <h2 class="mb-4 mt-0 text-center"> | <h2 class="mb-4 mt-0 text-center"> | ||||
| <%= _lc( 'ACCOUNT_NOT_VALIDATED' ) %> | <%= _lc( 'ACCOUNT_NOT_VALIDATED' ) %> | ||||
| @@ -70,4 +70,46 @@ | |||||
| </button> | </button> | ||||
| </div> | </div> | ||||
| </form> | </form> | ||||
| <div data-id="section-not-validated-change-email" | |||||
| style="display: none;padding-top: 20px;"> | |||||
| <div data-id="auth-change-email"> | |||||
| <div class="auth-change-email"> | |||||
| <p class="text-center"><%=raw _lc( 'REGISTRATION_EMAIL_PROVIDED' ) %><br /><br /> | |||||
| <strong data-id="auth-change-registered-email" style="font-size: 20px;"></strong> | |||||
| </p> | |||||
| <p class="text-center" data-id="auth-change-registered-email-info"> | |||||
| <%=raw _lc( 'REGISTRATION_EMAIL_CHECK_NOTE' ) %><br /> | |||||
| <%=raw _lc( 'REGISTRATION_EMAIL_CHANGE_NOTE' ) %> | |||||
| </p> | |||||
| <p class="text-center pb_color-danger" data-id="auth-change-registered-email-info-changed"> | |||||
| <%=raw _lc( 'REGISTRATION_EMAIL_CHANGED_SUCCESS_INFO' ) %> | |||||
| </p> | |||||
| <form data-id="form-not-validated-email-change" | |||||
| class="needs-validation" | |||||
| novalidate> | |||||
| <div class="form-group"> | |||||
| <label for="input-change-email" | |||||
| data-id="" | |||||
| class="sr-only"> | |||||
| <%= _lc( 'LOGIN_EMAIL' ) %> | |||||
| </label> | |||||
| <input type="email" | |||||
| id="input-change-email" | |||||
| data-id="input-change-email" | |||||
| class="form-control reverse pb_height-50" | |||||
| placeholder="<%= _lc( 'LOGIN_EMAIL' ) %>" | |||||
| required autofocus /> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <button class="btn btn-lg btn-primary btn-block" | |||||
| data-id="btn-not-validated-email-change" | |||||
| type="button"> | |||||
| <%= _lc( 'REGISTRATION_EMAIL_CHANGE_BTN' ) %> | |||||
| </button> | |||||
| </div> | |||||
| </form> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </section> | </section> | ||||
| @@ -101,6 +101,19 @@ | |||||
| </h2> | </h2> | ||||
| <p class="text-center"> | <p class="text-center"> | ||||
| <%=raw _lc( 'REGISTER_SUCCESS_HEADER_DESCRIPTION' ) %> | <%=raw _lc( 'REGISTER_SUCCESS_HEADER_DESCRIPTION' ) %> | ||||
| </p> | |||||
| <p class="text-center"> | |||||
| <%=raw _lc( 'REGISTRATION_EMAIL_PROVIDED' ) %> | |||||
| </p> | |||||
| <p class="text-center"> | |||||
| <strong data-id="validation-registered-email" style="font-size: 20px;"></strong> | |||||
| </p> | |||||
| <p class="text-center"> | |||||
| <%=raw _lc( 'REGISTRATION_SUCCESS_EMAIL_CHECK_NOTE' ) %> | |||||
| </p> | |||||
| <p class="text-center"> | |||||
| </p> | </p> | ||||
| <p class="text-center"> | <p class="text-center"> | ||||
| <a href="#/auth/login"><%= _lc( 'BACK_TO_LOGIN' ) %></a> | <a href="#/auth/login"><%= _lc( 'BACK_TO_LOGIN' ) %></a> | ||||
| @@ -85,6 +85,44 @@ | |||||
| 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" | |||||
| <%= group.getTermsConditionsActive() ? 'checked' : '' %> | |||||
| > | |||||
| <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><span class="fa fa-exclamation-triangle"></span> <%= _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"> | ||||
| @@ -3,7 +3,7 @@ | |||||
| <div class="col-sm-12"> | <div class="col-sm-12"> | ||||
| <div class="card"> | <div class="card"> | ||||
| <div class="card-header"> | <div class="card-header"> | ||||
| <div class="row"> | |||||
| <div class="row" style="padding-bottom: 10px;"> | |||||
| <div class="col"> | <div class="col"> | ||||
| <label><%= _lc( 'GROUP' ) %></label> | <label><%= _lc( 'GROUP' ) %></label> | ||||
| <select class="form-control form-control-sm" | <select class="form-control form-control-sm" | ||||
| @@ -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 --> | ||||
| @@ -28,4 +28,10 @@ | |||||
| </a> | </a> | ||||
| </li> | </li> | ||||
| <% } %> | <% } %> | ||||
| <li class="nav-item"> | |||||
| <a class="nav-link <%= ( activeTab == 'terms' ) ? 'active' : '' %>" | |||||
| href="#/group/<%= group.getId() %>/terms"> | |||||
| <%= _lc( 'GROUP_TERMS' ) %> | |||||
| </a> | |||||
| </li> | |||||
| </ul> | </ul> | ||||
| @@ -0,0 +1,60 @@ | |||||
| <%=raw app.core.View.getTemplate( 'group-nav', { activeTab : 'terms', group : group, currentProfile : currentProfile } ) %> | |||||
| <% var termsAccepted = currentProfile.getGroupData(group.getId()).terms_accepted == 1; %> | |||||
| <div class="row"> | |||||
| <div class="col-sm-12"> | |||||
| <div class="card"> | |||||
| <div class="team-header"> | |||||
| <div class="pb_cover_v3 overflow-hidden cover-bg-indigo cover-bg-opacity-8 text-left pb_gradient_v1 pb_slant-white-small" | |||||
| style="overflow: hidden; background: url(./img-system/<%= group.getBackgroundImgUrl() %>); background-position: center;background-repeat: no-repeat;background-size: cover;height: 135px;"> | |||||
| </div> | |||||
| <div class="team-logo" | |||||
| style="position: relative"> | |||||
| <img src="<%= group.getEmblemUrl() %>" | |||||
| style="width: 128px; height: 128px; top: -64px; margin: auto; border: 4px solid white;z-index: 11; padding: 0; " | |||||
| class="card-img-overlay"/> | |||||
| </div> | |||||
| </div> | |||||
| <div class="card-body"> | |||||
| <div class="form-group"> | |||||
| <p> | |||||
| <strong><%= _lc( 'GROUP_TERMS_DESCRIPTION' ) %></strong> | |||||
| </p> | |||||
| <textarea maxlength="4096" | |||||
| rows="5" | |||||
| class="form-control" | |||||
| disabled | |||||
| placeholder="<%= _lc( 'TEAM_DETAIL_TEAM_TERMS_PLACEHOLDER' ) %>"><%= group.getTermsConditions() ? group.getTermsConditions() : '' %></textarea> | |||||
| <% if ( group.getTermsConditionsActive() ) { %> | |||||
| <div class="form-group"> | |||||
| <div class="custom-control custom-checkbox my-1 mr-sm-2"> | |||||
| <input type="checkbox" | |||||
| name="checkbox-terms-conditions-accept" | |||||
| data-id="checkbox-terms-conditions-accept" | |||||
| id="checkbox-terms-conditions-accept" | |||||
| class="custom-control-input" | |||||
| <%= termsAccepted ? 'checked' : '' %> | |||||
| > | |||||
| <label class="custom-control-label" | |||||
| for="checkbox-terms-conditions-accept"><%= _lc( 'GROUP_TERMS_ACCEPT' ) %> | |||||
| <span data-id="terms-accepted-note"> | |||||
| <% if (termsAccepted) { %> | |||||
| (<%= _lc( 'GROUP_TERMS_ACCEPTED' ) %>) | |||||
| <% } else { %> | |||||
| (<%= _lc( 'GROUP_TERMS_NOT_ACCEPTED' ) %>) | |||||
| <% } %> | |||||
| </span> | |||||
| %> | |||||
| </label> | |||||
| <p> | |||||
| <small><%= _lc( 'GROUP_TERMS_ACTIVE_DESCRIPTION' ) %></small> | |||||
| </div> | |||||
| </div> | |||||
| <% } %> | |||||
| </div> | |||||
| </div> | |||||
| <div class="card-footer"> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| @@ -35,7 +35,7 @@ | |||||
| <%= _lc( 'NOTIFICATION_EMPTY' ) %> | <%= _lc( 'NOTIFICATION_EMPTY' ) %> | ||||
| </p> | </p> | ||||
| <% } %> | <% } %> | ||||
| <div> | |||||
| <div style="padding: 0 0.7rem;"> | |||||
| <button data-id="btn-mark-all-notifications-as-read" | <button data-id="btn-mark-all-notifications-as-read" | ||||
| class="btn btn-link btn-sm btn-primary dropdown-item text-center"> | class="btn btn-link btn-sm btn-primary dropdown-item text-center"> | ||||
| <%= _lc( 'MARK_ALL_NOTIFICATION_AS_READ' ) %> | <%= _lc( 'MARK_ALL_NOTIFICATION_AS_READ' ) %> | ||||
| @@ -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> | ||||
| @@ -0,0 +1,20 @@ | |||||
| <p><%= _lc( 'HOME_MODAL_TERMS_NOT_ACCEPTED_TEXT' ) %></p> | |||||
| <table class="table table-groups"> | |||||
| <tbody> | |||||
| <% for ( var g = 0; g < groups.length; g++ ) { %> | |||||
| <tr class="clickable" data-type="group-accept-link" data-group-id="<%= groups[g].getId() %>"> | |||||
| <td> | |||||
| <img class="img-fluid group-image-table" src="<%= groups[g].getEmblemUrl() %>"> | |||||
| </td> | |||||
| <td class="align-middle"> | |||||
| <%= groups[g].getName() %> | |||||
| </td> | |||||
| <td class="align-middle"> | |||||
| <i class="fas fa-chevron-right"></i> | |||||
| </td> | |||||
| </tr> | |||||
| <% } %> | |||||
| </tbody> | |||||
| </table> | |||||
| @@ -4,7 +4,7 @@ | |||||
| ********************************************************************************/ | ********************************************************************************/ | ||||
| // General | // General | ||||
| Francis_Utils_Config::set( 'url.client', 'src/client/app/' ); | |||||
| Francis_Utils_Config::set( 'url.client', 'src/client/app' ); | |||||
| // DB settings | // DB settings | ||||
| Francis_Utils_Config::set( 'db.tbcore.host', 'database' ); | Francis_Utils_Config::set( 'db.tbcore.host', 'database' ); | ||||
| @@ -50,6 +50,7 @@ class TB_Server_Control_Auth | |||||
| 'url' => TB_Server_Utils_Config::get( 'url.client' ) . '/#/auth/validate-email/' . $ad->token | 'url' => TB_Server_Utils_Config::get( 'url.client' ) . '/#/auth/validate-email/' . $ad->token | ||||
| )); | )); | ||||
| $resp->addData( 'error', 'not_validated' ); | $resp->addData( 'error', 'not_validated' ); | ||||
| $resp->addData( 'email', $account->email ); | |||||
| return $resp; | return $resp; | ||||
| } | } | ||||
| @@ -111,6 +112,43 @@ class TB_Server_Control_Auth | |||||
| return $resp; | return $resp; | ||||
| } | } | ||||
| public static function changeNotValidatedEmail( TB_Server_Core_RequestData $params ) { | |||||
| // Return value | |||||
| $resp = new TB_Server_Core_Response(); | |||||
| // Validate params | |||||
| $newEmail = $params->get( 'newEmail' ); | |||||
| $currentEmail = $params->get( 'currentEmail' ); | |||||
| $newEmail = TB_Shared_Utils_Validator::isValidEmail( $newEmail ) ? $newEmail : NULL; | |||||
| $currentEmail = TB_Shared_Utils_Validator::isValidEmail( $currentEmail ) ? $currentEmail : NULL; | |||||
| if ( is_null( $newEmail ) || is_null($currentEmail) ) | |||||
| { | |||||
| throw new Exception( 'Invalid email' ); | |||||
| } | |||||
| $account = TB_Shared_Ent_Core_Account::getByEmail( $currentEmail ); | |||||
| if ( is_null( $account ) ) | |||||
| { | |||||
| throw new Exception( 'account not found' ); | |||||
| } | |||||
| $existingAccount = TB_Shared_Ent_Core_Account::getByEmail( $newEmail ); | |||||
| if ( !is_null( $existingAccount ) ) | |||||
| { | |||||
| throw new Exception( 'account with this new email exists already' ); | |||||
| } | |||||
| if ($account->is_validated) { | |||||
| throw new Exception( 'account already validated' ); | |||||
| } | |||||
| $account->email = $newEmail; | |||||
| $account->save(); | |||||
| return $resp; | |||||
| } | |||||
| /** | /** | ||||
| * @param TB_Server_Core_RequestData $params | * @param TB_Server_Core_RequestData $params | ||||
| * @return TB_Server_Core_Response | * @return TB_Server_Core_Response | ||||
| @@ -151,6 +189,8 @@ class TB_Server_Control_Auth | |||||
| $email = $params->get( 'email' ); | $email = $params->get( 'email' ); | ||||
| $email = TB_Shared_Utils_Validator::isValidEmail( $email ) ? $email : NULL; | $email = TB_Shared_Utils_Validator::isValidEmail( $email ) ? $email : NULL; | ||||
| $resp->addData( 'email', $email ); | |||||
| if ( is_null( $email ) ) | if ( is_null( $email ) ) | ||||
| { | { | ||||
| throw new Exception( 'Invalid email' ); | throw new Exception( 'Invalid email' ); | ||||
| @@ -628,4 +628,23 @@ class TB_Server_Control_Profile { | |||||
| { | { | ||||
| return self::delete( $params ); | return self::delete( $params ); | ||||
| } | } | ||||
| public static function acceptTerms ( TB_Server_Core_RequestData $params ) | |||||
| { | |||||
| $resp = new TB_Server_Core_Response(); | |||||
| $groupId = $params->get( 'groupId' ); | |||||
| $termsAccepted = $params->get( 'termsAccepted' ); | |||||
| /** @var TB_Shared_Ent_TeamData_Profile $profile */ | |||||
| $profile = TB_Server_Core_Session::get()->getProfile(); | |||||
| if (!$profile->isInTeam($groupId)) { | |||||
| throw new \Exception( 'Profile not in team.' ); | |||||
| } | |||||
| $profile->setTermsConditionAccepted($groupId, $termsAccepted); | |||||
| $profile->save(); | |||||
| return $resp; | |||||
| } | |||||
| } | } | ||||
| @@ -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(); | ||||
| @@ -1117,6 +1119,33 @@ 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) { | |||||
| $memberProfile->setTermsConditionAccepted($team->id, false); | |||||
| $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,8 @@ 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( '#/profile/' . $profile->id ); | |||||
| $additionalData = self::createAdditionalData( '#/group/' . $team->id . '/membermanagement/' . $profile->id); | |||||
| //$additionalData = self::createAdditionalData( '#/profile/' . $profile->id ); | |||||
| self::sendToProfiles( | self::sendToProfiles( | ||||
| $headline, | $headline, | ||||
| $message, | $message, | ||||
| @@ -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 ); | ||||
| @@ -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 | ||||
| @@ -485,6 +511,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(); | |||||