From 147f36dc625497e830ec5eb46853bdba8b9102ad Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 14:10:47 +0200 Subject: [PATCH 01/22] last adjustments --- src/client/app/js/app/state/AppointmentEditAttendee.js | 2 +- src/server/server/control/TB_Server_Control_Auth.php | 2 +- src/server/server/control/TB_Server_Control_Team.php | 3 ++- .../ent/teamdata/TB_Shared_Ent_TeamData_Profile.php | 9 +++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/client/app/js/app/state/AppointmentEditAttendee.js b/src/client/app/js/app/state/AppointmentEditAttendee.js index b2eb3ab..35c485e 100644 --- a/src/client/app/js/app/state/AppointmentEditAttendee.js +++ b/src/client/app/js/app/state/AppointmentEditAttendee.js @@ -31,7 +31,7 @@ app.state.AppointmentEditAttendee = function() app.core.Rpc.call( 'Team', 'getMembers', - { teamId : appointment.getTeamId() }, + { teamId : appointment.getTeamId(), activeOnly: true }, function( res2 ) { let childs, m, notDecided = []; diff --git a/src/server/server/control/TB_Server_Control_Auth.php b/src/server/server/control/TB_Server_Control_Auth.php index 2d1dbca..5b285f6 100644 --- a/src/server/server/control/TB_Server_Control_Auth.php +++ b/src/server/server/control/TB_Server_Control_Auth.php @@ -691,7 +691,7 @@ class TB_Server_Control_Auth $team->category = _xss( $teamCategory ); $team->affiliate_id = is_string( $affiliateId ) ? _xss( $affiliateId ) : NULL; $team->terms_conditions_active = 0; - $team->new_users_inactive = 1; + $team->new_users_inactive = 0; $team->save(); // Set default course categories diff --git a/src/server/server/control/TB_Server_Control_Team.php b/src/server/server/control/TB_Server_Control_Team.php index b1767be..81d3093 100644 --- a/src/server/server/control/TB_Server_Control_Team.php +++ b/src/server/server/control/TB_Server_Control_Team.php @@ -161,6 +161,7 @@ class TB_Server_Control_Team { $resp = new TB_Server_Core_Response(); $teamId = $params->get( 'teamId' ); + $activeOnly = $params->get( 'activeOnly'); $sessionProfile = TB_Server_Core_Session::get()->getProfile(); if ( false === $sessionProfile->isInTeam( $teamId ) ) @@ -176,7 +177,7 @@ class TB_Server_Control_Team { return $resp; } - $resp->addData( 'members', TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id ) ); + $resp->addData( 'members', TB_Shared_Ent_TeamData_Profile::getProfilesByTeamId( $team->id, $activeOnly ) ); return $resp; } diff --git a/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php b/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php index 8cb36d4..e41702b 100644 --- a/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php +++ b/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php @@ -754,9 +754,14 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row { * @param $teamId * @return array */ - public static function getProfilesByTeamId( $teamId ) + public static function getProfilesByTeamId( $teamId, $activeOnly = null ) { - $whereJson = json_encode( array( 'team_id' => $teamId ) ); + $params = array('team_id' => $teamId); + if ($activeOnly === true ) { + $params['status'] = self::STATUS_ACTIVE; + } + + $whereJson = json_encode( $params ); $sql = 'SELECT * FROM ' . self::getTable() . ' WHERE '; $sql .= 'JSON_CONTAINS( `teams_js`, :where_json ) '; $sql .= 'ORDER BY last_name ASC'; From 99a8252793f4c6e6153a04638b46a83ee27f6984 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 15:05:20 +0200 Subject: [PATCH 02/22] filter active members --- src/client/app/js/app/state/CourseCategories.js | 4 +++- src/server/server/control/TB_Server_Control_Team.php | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/client/app/js/app/state/CourseCategories.js b/src/client/app/js/app/state/CourseCategories.js index 3f2de62..ad457e5 100644 --- a/src/client/app/js/app/state/CourseCategories.js +++ b/src/client/app/js/app/state/CourseCategories.js @@ -30,7 +30,9 @@ app.state.CourseCategories = function() 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true, + activeOnly: true }, function( res ) { diff --git a/src/server/server/control/TB_Server_Control_Team.php b/src/server/server/control/TB_Server_Control_Team.php index 81d3093..de6130f 100644 --- a/src/server/server/control/TB_Server_Control_Team.php +++ b/src/server/server/control/TB_Server_Control_Team.php @@ -83,6 +83,7 @@ class TB_Server_Control_Team { $includeEmail = $params->get( 'includeEmails' ); $adminsOnly = $params->get( 'adminsOnly' ); $includeMembers = $params->get( 'includeMembers' ); + $activeOnly = $params->get( 'activeOnly'); $members = array(); $sessionProfile = TB_Server_Core_Session::get()->getProfile(); @@ -113,7 +114,14 @@ class TB_Server_Control_Team { $filteredMembers[] = $member; } } else { - $filteredMembers[] = $member; + if ($activeOnly === true) { + $teamData = $member->getTeamsData($teamId); + if ($teamData['status'] === TB_Shared_Ent_TeamData_Profile::STATUS_ACTIVE) { + $filteredMembers[] = $member; + } + } else { + $filteredMembers[] = $member; + } } } } From 6379f83b26ee74eadf28dda463fd36f5206de043 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 15:06:10 +0200 Subject: [PATCH 03/22] default --- tools/patches/4addDbNewUsersInactive.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patches/4addDbNewUsersInactive.php b/tools/patches/4addDbNewUsersInactive.php index 5fd8d21..eef502c 100644 --- a/tools/patches/4addDbNewUsersInactive.php +++ b/tools/patches/4addDbNewUsersInactive.php @@ -9,7 +9,7 @@ function patch() $db = TB_Shared_Db_TeamData::get(); $sql = "ALTER TABLE team - ADD COLUMN new_users_inactive TINYINT(1) NOT NULL DEFAULT 1 AFTER terms_conditions_active;"; + ADD COLUMN new_users_inactive TINYINT(1) NOT NULL DEFAULT 0 AFTER terms_conditions_active;"; $stmt = $db->query( $sql ); $sql = "UPDATE team SET new_users_inactive = 0 WHERE 1"; From 29e3d6665751f758f1a84fd92e5c4e42644f3cfc Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 15:26:58 +0200 Subject: [PATCH 04/22] moved patches --- .../patches/1addActiveStateToProfile.php | 38 ++++++++++++++ .../patches/2addDbTermsConditionsToTeam.php | 19 +++++++ .../patches/3addTermsAcceptedToProfile.php | 38 ++++++++++++++ src/server/patches/4addDbNewUsersInactive.php | 20 ++++++++ .../old/addCategoryIdsJsToAppointments.php | 44 ++++++++++++++++ ...ddDateTimeRejectToExistingAppointments.php | 39 ++++++++++++++ .../old/addGeneralCourseCategoryToTeam.php | 41 +++++++++++++++ .../patches/old/addPublicIdToProfile.php | 51 +++++++++++++++++++ .../old/addTeamCategoriesToAdminProfiles.php | 50 ++++++++++++++++++ ...placeCategoryByCategoryIdInAppointment.php | 51 +++++++++++++++++++ 10 files changed, 391 insertions(+) create mode 100644 src/server/patches/1addActiveStateToProfile.php create mode 100644 src/server/patches/2addDbTermsConditionsToTeam.php create mode 100644 src/server/patches/3addTermsAcceptedToProfile.php create mode 100644 src/server/patches/4addDbNewUsersInactive.php create mode 100644 src/server/patches/old/addCategoryIdsJsToAppointments.php create mode 100644 src/server/patches/old/addDateTimeRejectToExistingAppointments.php create mode 100644 src/server/patches/old/addGeneralCourseCategoryToTeam.php create mode 100644 src/server/patches/old/addPublicIdToProfile.php create mode 100644 src/server/patches/old/addTeamCategoriesToAdminProfiles.php create mode 100644 src/server/patches/old/replaceCategoryByCategoryIdInAppointment.php diff --git a/src/server/patches/1addActiveStateToProfile.php b/src/server/patches/1addActiveStateToProfile.php new file mode 100644 index 0000000..68af861 --- /dev/null +++ b/src/server/patches/1addActiveStateToProfile.php @@ -0,0 +1,38 @@ +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['status'] = 'active'; + $resTeam[] = $tmpTeam; + } + $entProfile->teams_js = $resTeam; + $entProfile->save(); + unset($team); + unset( $entProfile ); + } + } + $db->commit(); + + echo "DONE..."; +} + +patch_addActiveStateToProfile(); \ No newline at end of file diff --git a/src/server/patches/2addDbTermsConditionsToTeam.php b/src/server/patches/2addDbTermsConditionsToTeam.php new file mode 100644 index 0000000..29fa2a2 --- /dev/null +++ b/src/server/patches/2addDbTermsConditionsToTeam.php @@ -0,0 +1,19 @@ +query( $sql ); + + echo "DONE..."; +} + +patch(); \ No newline at end of file diff --git a/src/server/patches/3addTermsAcceptedToProfile.php b/src/server/patches/3addTermsAcceptedToProfile.php new file mode 100644 index 0000000..f777470 --- /dev/null +++ b/src/server/patches/3addTermsAcceptedToProfile.php @@ -0,0 +1,38 @@ +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(); \ No newline at end of file diff --git a/src/server/patches/4addDbNewUsersInactive.php b/src/server/patches/4addDbNewUsersInactive.php new file mode 100644 index 0000000..b607718 --- /dev/null +++ b/src/server/patches/4addDbNewUsersInactive.php @@ -0,0 +1,20 @@ +query( $sql ); + + $sql = "UPDATE team SET new_users_inactive = 0 WHERE 1"; + $stmt = $db->query( $sql ); + echo "DONE..."; +} + +patch(); \ No newline at end of file diff --git a/src/server/patches/old/addCategoryIdsJsToAppointments.php b/src/server/patches/old/addCategoryIdsJsToAppointments.php new file mode 100644 index 0000000..f77271a --- /dev/null +++ b/src/server/patches/old/addCategoryIdsJsToAppointments.php @@ -0,0 +1,44 @@ +query( $sql ); + $res = $stmt->fetchAll(); + + foreach( $res as $row ) + { + if ( is_array( $row ) && isset( $row[ 'id' ] ) ) + { + $db->beginTransaction(); + $entApp = TB_Shared_Ent_TeamData_Appointment::get( $row[ 'id' ] ); + if ( $entApp instanceof TB_Shared_Ent_TeamData_Appointment ) + { + if ( !is_null( $entApp->category_id ) ) + { + $entApp->category_ids_js = array( $entApp->category_id ); + $entApp->save(); + } + } + $db->commit(); + } + } + + echo "DONE..."; +} + +patch_addCategoryIdsJsToAppointments(); diff --git a/src/server/patches/old/addDateTimeRejectToExistingAppointments.php b/src/server/patches/old/addDateTimeRejectToExistingAppointments.php new file mode 100644 index 0000000..847546a --- /dev/null +++ b/src/server/patches/old/addDateTimeRejectToExistingAppointments.php @@ -0,0 +1,39 @@ +query( $sql ); + $res = $stmt->fetchAll(); + + foreach( $res as $row ) + { + if ( is_array( $row ) && isset( $row[ 'id' ] ) ) + { + $db->beginTransaction(); + $entAppointment = TB_Shared_Ent_TeamData_Appointment::get( $row[ 'id' ] ); + $entAppointment->deadline_reject_dt = $entAppointment->start_dt; + $entAppointment->save(); + $db->commit(); + unset( $entAppointment ); + } + } + + echo "DONE..."; +} + +patch_addDateTimeRejectToExistingAppointments(); diff --git a/src/server/patches/old/addGeneralCourseCategoryToTeam.php b/src/server/patches/old/addGeneralCourseCategoryToTeam.php new file mode 100644 index 0000000..0b0c167 --- /dev/null +++ b/src/server/patches/old/addGeneralCourseCategoryToTeam.php @@ -0,0 +1,41 @@ +id . '-0'; + $generalCategory = $team->getCourseCategoryDataById( $generalCategoryId ); + if ( is_null( $generalCategory ) ) + { + $team->addCourseCategory( [ 'id' => $generalCategoryId, 'name' => 'Allgemein' ] ); + $team->save(); + } + + unset( $team ); + } + + echo "DONE..."; +} + +patch_addGeneralCourseCategoryToTeam(); diff --git a/src/server/patches/old/addPublicIdToProfile.php b/src/server/patches/old/addPublicIdToProfile.php new file mode 100644 index 0000000..47b6f03 --- /dev/null +++ b/src/server/patches/old/addPublicIdToProfile.php @@ -0,0 +1,51 @@ +query( $sql ); + $res = $stmt->fetchAll(); + + foreach( $res as $row ) + { + if ( is_array( $row ) && isset( $row[ 'id' ] ) ) + { + $db->beginTransaction(); + $entProfile = TB_Shared_Ent_TeamData_Profile::get( $row[ 'id' ] ); + if ( $entProfile instanceof TB_Shared_Ent_TeamData_Profile ) + { + $entProfile->public_id = TB_Server_Utils_Helper::getToken(64); + $entProfile->save(); + } + $db->commit(); + } + } + + echo "DONE..."; +} + +patch_AddPublicIdToProfiles(); diff --git a/src/server/patches/old/addTeamCategoriesToAdminProfiles.php b/src/server/patches/old/addTeamCategoriesToAdminProfiles.php new file mode 100644 index 0000000..c14ddbe --- /dev/null +++ b/src/server/patches/old/addTeamCategoriesToAdminProfiles.php @@ -0,0 +1,50 @@ +getTeamIds(); + foreach( $tIds as $tId ) + { + if ( $ap->isAdminOfTeam( $tId ) ) + { + /** @var TB_Shared_Ent_TeamData_Team $team */ + $team = TB_Shared_Ent_TeamData_Team::get( $tId ); + if ( is_array( $team->course_categories_js ) ) + { + $teamCategoryIds = $ap->getTeamIds(); + foreach( $team->course_categories_js as $courseCategory ) + { + $ap->addToCategoryId( $courseCategory[ 'id' ] ); + } + + $ap->save(); + } + } + } + } + + + echo "DONE..."; +} + +patch_AddTeamCategoriesToAdminProfiles(); diff --git a/src/server/patches/old/replaceCategoryByCategoryIdInAppointment.php b/src/server/patches/old/replaceCategoryByCategoryIdInAppointment.php new file mode 100644 index 0000000..589256f --- /dev/null +++ b/src/server/patches/old/replaceCategoryByCategoryIdInAppointment.php @@ -0,0 +1,51 @@ +team_id ); + if ( $team ) + { + $categoryId = $team->id . '-0'; + foreach( $team->course_categories_js as $category ) + { + if ( $category[ 'name' ] === $a->category ) + { + $categoryId = $category[ 'id' ]; + break; + } + } + if ( $categoryId ) + { + //$a->category = NULL; + $a->category_id = $categoryId; + $a->save(); + } + unset( $team ); + } + } + + echo "DONE..."; +} + +patch_replaceCategoryByCategoryIdInAppointment(); From d0171c90b64ac25287c513d6dd1e33087a32f4d4 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 15:36:04 +0200 Subject: [PATCH 05/22] moced patches --- 1-deployBetaProBuddy.sh | 3 + 1-deployLiveProBuddy.sh | 55 +++++++++++++++++++ .../patches/1addActiveStateToProfile.php | 4 +- tools/patches/1addActiveStateToProfile.php | 38 ------------- tools/patches/2addDbTermsConditionsToTeam.php | 19 ------- tools/patches/3addTermsAcceptedToProfile.php | 38 ------------- tools/patches/4addDbNewUsersInactive.php | 20 ------- .../old/addCategoryIdsJsToAppointments.php | 44 --------------- ...ddDateTimeRejectToExistingAppointments.php | 39 ------------- .../old/addGeneralCourseCategoryToTeam.php | 41 -------------- tools/patches/old/addPublicIdToProfile.php | 51 ----------------- .../old/addTeamCategoriesToAdminProfiles.php | 50 ----------------- ...placeCategoryByCategoryIdInAppointment.php | 51 ----------------- 13 files changed, 60 insertions(+), 393 deletions(-) create mode 100644 1-deployLiveProBuddy.sh delete mode 100644 tools/patches/1addActiveStateToProfile.php delete mode 100644 tools/patches/2addDbTermsConditionsToTeam.php delete mode 100644 tools/patches/3addTermsAcceptedToProfile.php delete mode 100644 tools/patches/4addDbNewUsersInactive.php delete mode 100644 tools/patches/old/addCategoryIdsJsToAppointments.php delete mode 100644 tools/patches/old/addDateTimeRejectToExistingAppointments.php delete mode 100644 tools/patches/old/addGeneralCourseCategoryToTeam.php delete mode 100644 tools/patches/old/addPublicIdToProfile.php delete mode 100644 tools/patches/old/addTeamCategoriesToAdminProfiles.php delete mode 100644 tools/patches/old/replaceCategoryByCategoryIdInAppointment.php diff --git a/1-deployBetaProBuddy.sh b/1-deployBetaProBuddy.sh index 8621bc5..89cf04f 100644 --- a/1-deployBetaProBuddy.sh +++ b/1-deployBetaProBuddy.sh @@ -28,6 +28,9 @@ cp -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/git_repositories/beta- rm -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/httpdocs/src/server/dependencies cp -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/git_repositories/beta-probuddy/src/server/dependencies /var/www/vhosts/spawntree.de/probuddy.spawntree.de/httpdocs/src/server +rm -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/httpdocs/src/server/patches +cp -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/git_repositories/beta-probuddy/src/server/patches /var/www/vhosts/spawntree.de/probuddy.spawntree.de/httpdocs/src/server + rm -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/httpdocs/src/server/server/cli cp -rf /var/www/vhosts/spawntree.de/probuddy.spawntree.de/git_repositories/beta-probuddy/src/server/server/cli /var/www/vhosts/spawntree.de/probuddy.spawntree.de/httpdocs/src/server/server diff --git a/1-deployLiveProBuddy.sh b/1-deployLiveProBuddy.sh new file mode 100644 index 0000000..dc4cdf5 --- /dev/null +++ b/1-deployLiveProBuddy.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +cd /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master +git pull + +echo "$(tput setab 2)pro-buddy has been PULLED$(tput sgr 0)" + +rm -rf /www/htdocs/v034011/projects/probuddy/client +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/client /www/htdocs/v034011/projects/probuddy + +rm -rf /www/htdocs/v034011/projects/probuddy/server/admin/AHDMN +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/admin/AHDMN /www/htdocs/v034011/projects/probuddy/server/admin + +rm -rf /www/htdocs/v034011/projects/probuddy/server/admin/libs +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/admin/libs /www/htdocs/v034011/projects/probuddy/server/admin + +rm -rf /www/htdocs/v034011/projects/probuddy/server/admin/services +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/admin/services /www/htdocs/v034011/projects/probuddy/server/admin + +rm -rf /www/htdocs/v034011/projects/probuddy/server/admin/boot.php +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/admin/boot.php /www/htdocs/v034011/projects/probuddy/server/admin + +rm -rf /www/htdocs/v034011/projects/probuddy/server/dependencies +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/dependencies /www/htdocs/v034011/projects/probuddy/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/patches +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/patches /www/htdocs/v034011/projects/probuddy/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/server/cli +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/server/cli /www/htdocs/v034011/projects/probuddy/server/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/server/control +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/server/control /www/htdocs/v034011/projects/probuddy/server/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/server/core +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/server/core /www/htdocs/v034011/projects/probuddy/server/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/server/job +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/server/job /www/htdocs/v034011/projects/probuddy/server/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/server/template +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/server/template /www/htdocs/v034011/projects/probuddy/server/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/server/utils +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/server/utils /www/htdocs/v034011/projects/probuddy/server/server + +rm -rf /www/htdocs/v034011/projects/probuddy/server/shared +cp -rf /www/htdocs/v034011/projects/probuddy/git_repository/probuddy-master/src/server/shared /www/htdocs/v034011/projects/probuddy/server + +echo "$(tput setab 2)Files have been copied$(tput sgr 0)" + + +echo "$(tput setab 7)$(tput setaf 1)THINK ABOUT POSSIBLE PATCHES!" + +echo "You have updated probuddy live!$(tput sgr 0)" diff --git a/src/server/patches/1addActiveStateToProfile.php b/src/server/patches/1addActiveStateToProfile.php index 68af861..eba11b2 100644 --- a/src/server/patches/1addActiveStateToProfile.php +++ b/src/server/patches/1addActiveStateToProfile.php @@ -1,7 +1,7 @@ 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['status'] = 'active'; - $resTeam[] = $tmpTeam; - } - $entProfile->teams_js = $resTeam; - $entProfile->save(); - unset($team); - unset( $entProfile ); - } - } - $db->commit(); - - echo "DONE..."; -} - -patch_addActiveStateToProfile(); \ No newline at end of file diff --git a/tools/patches/2addDbTermsConditionsToTeam.php b/tools/patches/2addDbTermsConditionsToTeam.php deleted file mode 100644 index 58a4447..0000000 --- a/tools/patches/2addDbTermsConditionsToTeam.php +++ /dev/null @@ -1,19 +0,0 @@ -query( $sql ); - - echo "DONE..."; -} - -patch(); \ No newline at end of file diff --git a/tools/patches/3addTermsAcceptedToProfile.php b/tools/patches/3addTermsAcceptedToProfile.php deleted file mode 100644 index 5735c78..0000000 --- a/tools/patches/3addTermsAcceptedToProfile.php +++ /dev/null @@ -1,38 +0,0 @@ -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(); \ No newline at end of file diff --git a/tools/patches/4addDbNewUsersInactive.php b/tools/patches/4addDbNewUsersInactive.php deleted file mode 100644 index eef502c..0000000 --- a/tools/patches/4addDbNewUsersInactive.php +++ /dev/null @@ -1,20 +0,0 @@ -query( $sql ); - - $sql = "UPDATE team SET new_users_inactive = 0 WHERE 1"; - $stmt = $db->query( $sql ); - echo "DONE..."; -} - -patch(); \ No newline at end of file diff --git a/tools/patches/old/addCategoryIdsJsToAppointments.php b/tools/patches/old/addCategoryIdsJsToAppointments.php deleted file mode 100644 index f77271a..0000000 --- a/tools/patches/old/addCategoryIdsJsToAppointments.php +++ /dev/null @@ -1,44 +0,0 @@ -query( $sql ); - $res = $stmt->fetchAll(); - - foreach( $res as $row ) - { - if ( is_array( $row ) && isset( $row[ 'id' ] ) ) - { - $db->beginTransaction(); - $entApp = TB_Shared_Ent_TeamData_Appointment::get( $row[ 'id' ] ); - if ( $entApp instanceof TB_Shared_Ent_TeamData_Appointment ) - { - if ( !is_null( $entApp->category_id ) ) - { - $entApp->category_ids_js = array( $entApp->category_id ); - $entApp->save(); - } - } - $db->commit(); - } - } - - echo "DONE..."; -} - -patch_addCategoryIdsJsToAppointments(); diff --git a/tools/patches/old/addDateTimeRejectToExistingAppointments.php b/tools/patches/old/addDateTimeRejectToExistingAppointments.php deleted file mode 100644 index 847546a..0000000 --- a/tools/patches/old/addDateTimeRejectToExistingAppointments.php +++ /dev/null @@ -1,39 +0,0 @@ -query( $sql ); - $res = $stmt->fetchAll(); - - foreach( $res as $row ) - { - if ( is_array( $row ) && isset( $row[ 'id' ] ) ) - { - $db->beginTransaction(); - $entAppointment = TB_Shared_Ent_TeamData_Appointment::get( $row[ 'id' ] ); - $entAppointment->deadline_reject_dt = $entAppointment->start_dt; - $entAppointment->save(); - $db->commit(); - unset( $entAppointment ); - } - } - - echo "DONE..."; -} - -patch_addDateTimeRejectToExistingAppointments(); diff --git a/tools/patches/old/addGeneralCourseCategoryToTeam.php b/tools/patches/old/addGeneralCourseCategoryToTeam.php deleted file mode 100644 index 0b0c167..0000000 --- a/tools/patches/old/addGeneralCourseCategoryToTeam.php +++ /dev/null @@ -1,41 +0,0 @@ -id . '-0'; - $generalCategory = $team->getCourseCategoryDataById( $generalCategoryId ); - if ( is_null( $generalCategory ) ) - { - $team->addCourseCategory( [ 'id' => $generalCategoryId, 'name' => 'Allgemein' ] ); - $team->save(); - } - - unset( $team ); - } - - echo "DONE..."; -} - -patch_addGeneralCourseCategoryToTeam(); diff --git a/tools/patches/old/addPublicIdToProfile.php b/tools/patches/old/addPublicIdToProfile.php deleted file mode 100644 index 47b6f03..0000000 --- a/tools/patches/old/addPublicIdToProfile.php +++ /dev/null @@ -1,51 +0,0 @@ -query( $sql ); - $res = $stmt->fetchAll(); - - foreach( $res as $row ) - { - if ( is_array( $row ) && isset( $row[ 'id' ] ) ) - { - $db->beginTransaction(); - $entProfile = TB_Shared_Ent_TeamData_Profile::get( $row[ 'id' ] ); - if ( $entProfile instanceof TB_Shared_Ent_TeamData_Profile ) - { - $entProfile->public_id = TB_Server_Utils_Helper::getToken(64); - $entProfile->save(); - } - $db->commit(); - } - } - - echo "DONE..."; -} - -patch_AddPublicIdToProfiles(); diff --git a/tools/patches/old/addTeamCategoriesToAdminProfiles.php b/tools/patches/old/addTeamCategoriesToAdminProfiles.php deleted file mode 100644 index c14ddbe..0000000 --- a/tools/patches/old/addTeamCategoriesToAdminProfiles.php +++ /dev/null @@ -1,50 +0,0 @@ -getTeamIds(); - foreach( $tIds as $tId ) - { - if ( $ap->isAdminOfTeam( $tId ) ) - { - /** @var TB_Shared_Ent_TeamData_Team $team */ - $team = TB_Shared_Ent_TeamData_Team::get( $tId ); - if ( is_array( $team->course_categories_js ) ) - { - $teamCategoryIds = $ap->getTeamIds(); - foreach( $team->course_categories_js as $courseCategory ) - { - $ap->addToCategoryId( $courseCategory[ 'id' ] ); - } - - $ap->save(); - } - } - } - } - - - echo "DONE..."; -} - -patch_AddTeamCategoriesToAdminProfiles(); diff --git a/tools/patches/old/replaceCategoryByCategoryIdInAppointment.php b/tools/patches/old/replaceCategoryByCategoryIdInAppointment.php deleted file mode 100644 index 589256f..0000000 --- a/tools/patches/old/replaceCategoryByCategoryIdInAppointment.php +++ /dev/null @@ -1,51 +0,0 @@ -team_id ); - if ( $team ) - { - $categoryId = $team->id . '-0'; - foreach( $team->course_categories_js as $category ) - { - if ( $category[ 'name' ] === $a->category ) - { - $categoryId = $category[ 'id' ]; - break; - } - } - if ( $categoryId ) - { - //$a->category = NULL; - $a->category_id = $categoryId; - $a->save(); - } - unset( $team ); - } - } - - echo "DONE..."; -} - -patch_replaceCategoryByCategoryIdInAppointment(); From e73d59ecbfdf429f92fa4b59eccac27cd97bcbe1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 15:43:53 +0200 Subject: [PATCH 06/22] add patch --- 1addActiveStateToProfile.php | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 1addActiveStateToProfile.php diff --git a/1addActiveStateToProfile.php b/1addActiveStateToProfile.php new file mode 100644 index 0000000..68af861 --- /dev/null +++ b/1addActiveStateToProfile.php @@ -0,0 +1,38 @@ +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['status'] = 'active'; + $resTeam[] = $tmpTeam; + } + $entProfile->teams_js = $resTeam; + $entProfile->save(); + unset($team); + unset( $entProfile ); + } + } + $db->commit(); + + echo "DONE..."; +} + +patch_addActiveStateToProfile(); \ No newline at end of file From 4f24984d333c5f646f0b349c5bc5db1c6e5dd55f Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 3 Oct 2023 15:46:09 +0200 Subject: [PATCH 07/22] client version --- src/client/app/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/index.php b/src/client/app/index.php index d57d9c6..b9a62de 100644 --- a/src/client/app/index.php +++ b/src/client/app/index.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../../server/server/config/boot_global.php'; require_once __DIR__ . '/../../server/server/config/boot_local.php'; - $version = 'v=2.0.1';//time();//Francis_Utils_Config::get( 'version' ); + $version = 'v=2.1.0';//time();//Francis_Utils_Config::get( 'version' ); ?> From cdc5763d35e25f8d507aa1ae804d39bc6b26abb5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Oct 2023 13:14:25 +0200 Subject: [PATCH 08/22] team get member fix --- src/client/app/js/app/state/StatsExport.js | 3 ++- .../manager/js/app/views/appointments/AppointmentCalendar.js | 3 ++- .../manager/js/app/views/appointments/AppointmentList.js | 3 ++- src/client/manager/js/app/views/contract/ContractCharging.js | 3 ++- src/client/manager/js/app/views/contract/ContractCreate.js | 3 ++- src/client/manager/js/app/views/corona/CoronaSpecial.js | 3 ++- src/client/manager/js/app/views/kkspecial/EmployeeList.js | 3 ++- src/client/manager/js/app/views/members/MemberList.js | 4 +++- src/client/manager/js/app/views/settings/SettingsAccess.js | 3 ++- src/server/server/config/boot_local.php | 2 +- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/client/app/js/app/state/StatsExport.js b/src/client/app/js/app/state/StatsExport.js index 28a2e57..fd2e881 100644 --- a/src/client/app/js/app/state/StatsExport.js +++ b/src/client/app/js/app/state/StatsExport.js @@ -104,7 +104,8 @@ app.state.StatsExport = function() 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true }, function( res2 ) { diff --git a/src/client/manager/js/app/views/appointments/AppointmentCalendar.js b/src/client/manager/js/app/views/appointments/AppointmentCalendar.js index 69bf9cf..a28eba3 100644 --- a/src/client/manager/js/app/views/appointments/AppointmentCalendar.js +++ b/src/client/manager/js/app/views/appointments/AppointmentCalendar.js @@ -23,7 +23,8 @@ const AppointmentCalendar = { 'Team', 'getDetails', { - teamId : p.groupId + teamId : p.groupId, + includeMembers: true }, function( res ) { diff --git a/src/client/manager/js/app/views/appointments/AppointmentList.js b/src/client/manager/js/app/views/appointments/AppointmentList.js index ff5a78d..3d1b49d 100644 --- a/src/client/manager/js/app/views/appointments/AppointmentList.js +++ b/src/client/manager/js/app/views/appointments/AppointmentList.js @@ -25,7 +25,8 @@ const AppointmentList = { 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true }, function( res ) { diff --git a/src/client/manager/js/app/views/contract/ContractCharging.js b/src/client/manager/js/app/views/contract/ContractCharging.js index 8ec54e1..0b2e137 100644 --- a/src/client/manager/js/app/views/contract/ContractCharging.js +++ b/src/client/manager/js/app/views/contract/ContractCharging.js @@ -40,7 +40,8 @@ const ContractCharging = { 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true }, function( res ) { diff --git a/src/client/manager/js/app/views/contract/ContractCreate.js b/src/client/manager/js/app/views/contract/ContractCreate.js index 2829a0f..ca03116 100644 --- a/src/client/manager/js/app/views/contract/ContractCreate.js +++ b/src/client/manager/js/app/views/contract/ContractCreate.js @@ -25,7 +25,8 @@ const ContractCreate = { 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true }, function( res ) { diff --git a/src/client/manager/js/app/views/corona/CoronaSpecial.js b/src/client/manager/js/app/views/corona/CoronaSpecial.js index 97ddfe2..1439810 100644 --- a/src/client/manager/js/app/views/corona/CoronaSpecial.js +++ b/src/client/manager/js/app/views/corona/CoronaSpecial.js @@ -27,7 +27,8 @@ const CoronaSpecial = { 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true }, function( res ) { diff --git a/src/client/manager/js/app/views/kkspecial/EmployeeList.js b/src/client/manager/js/app/views/kkspecial/EmployeeList.js index de6728b..32b8d8e 100644 --- a/src/client/manager/js/app/views/kkspecial/EmployeeList.js +++ b/src/client/manager/js/app/views/kkspecial/EmployeeList.js @@ -44,7 +44,8 @@ const EmployeeList = { 'Team', 'getDetails', { - teamId : p.get( 'groupId' ) + teamId : p.get( 'groupId' ), + includeMembers: true }, function( res ) { diff --git a/src/client/manager/js/app/views/members/MemberList.js b/src/client/manager/js/app/views/members/MemberList.js index 65d0fb6..a01de61 100644 --- a/src/client/manager/js/app/views/members/MemberList.js +++ b/src/client/manager/js/app/views/members/MemberList.js @@ -22,7 +22,9 @@ const MemberList = { 'Team', 'getDetails', { - teamId : p.get( 'groupId' ) + teamId : p.get( 'groupId' ), + includeMembers: true + }, function( res ) { diff --git a/src/client/manager/js/app/views/settings/SettingsAccess.js b/src/client/manager/js/app/views/settings/SettingsAccess.js index 42828ad..99b9eaa 100644 --- a/src/client/manager/js/app/views/settings/SettingsAccess.js +++ b/src/client/manager/js/app/views/settings/SettingsAccess.js @@ -26,7 +26,8 @@ const SettingsAccess = { 'Team', 'getDetails', { - teamId : groupId + teamId : groupId, + includeMembers: true }, function( res ) { diff --git a/src/server/server/config/boot_local.php b/src/server/server/config/boot_local.php index 7ca7242..25e0d44 100644 --- a/src/server/server/config/boot_local.php +++ b/src/server/server/config/boot_local.php @@ -39,4 +39,4 @@ Francis_Utils_Config::set( 'slack.logWebhook', "https://hooks.slack.com/services Francis_Utils_Config::set( 'analytics.trackingId', 'UA-139730172-1' ); // Manager console -Francis_Utils_Config::set( 'url.manager', 'https://manager.probuddy.de/' ); +Francis_Utils_Config::set( 'url.manager', 'http://localhost:8097/client/manager' ); From df487b18314a3c446b5db6237131cd0cdc7130cb Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Oct 2023 13:16:45 +0200 Subject: [PATCH 09/22] increase client version --- src/client/app/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/index.php b/src/client/app/index.php index b9a62de..b472244 100644 --- a/src/client/app/index.php +++ b/src/client/app/index.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../../server/server/config/boot_global.php'; require_once __DIR__ . '/../../server/server/config/boot_local.php'; - $version = 'v=2.1.0';//time();//Francis_Utils_Config::get( 'version' ); + $version = 'v=2.1.1';//time();//Francis_Utils_Config::get( 'version' ); ?> From 5b7bab6d857187191ed8c2e88fb331d471ae8400 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Oct 2023 13:55:36 +0200 Subject: [PATCH 10/22] fix attend circle icon after attending --- src/server/server/control/TB_Server_Control_Appointment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/server/control/TB_Server_Control_Appointment.php b/src/server/server/control/TB_Server_Control_Appointment.php index 9624229..7e075db 100644 --- a/src/server/server/control/TB_Server_Control_Appointment.php +++ b/src/server/server/control/TB_Server_Control_Appointment.php @@ -862,10 +862,12 @@ class TB_Server_Control_Appointment { throw new \Exception( 'Not visible for current session profile.' ); } - if ( false === $appointment->isAttendableByProfile( $sessionProfile ) ) + $isAttendableByProfile = $appointment->isAttendableByProfile( $sessionProfile ); + if ( false === $isAttendableByProfile ) { throw new \Exception( 'Not possible to attend by current profile.' ); } + $appointment->v_profile_can_attend = $isAttendableByProfile; //$attendeeData = TB_Shared_Ent_TeamData_Attendee::getWithProfileDataByAppointmentId( $appointment->id ); $attendeeData = TB_Shared_Ent_TeamData_Attendee::getByAppointmentId( $appointment->id ); From fea8735ad4a67b4da69e6beeb1837df340f682c6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 1 Nov 2023 15:22:36 +0100 Subject: [PATCH 11/22] search appointment, fix modal, number participant not below 0 --- src/client/app/css/app.css | 38 +++++++++++++++++++ src/client/app/js/app/state/Home.js | 23 +++++++++++ .../app/tmpl/home-appointment-item.html | 3 +- .../tmpl/home-modal-appointment-filter.html | 2 +- src/client/app/tmpl/home.html | 16 +++++--- 5 files changed, 75 insertions(+), 7 deletions(-) diff --git a/src/client/app/css/app.css b/src/client/app/css/app.css index c925fe5..1f5054f 100644 --- a/src/client/app/css/app.css +++ b/src/client/app/css/app.css @@ -1125,6 +1125,44 @@ h6.in-card { font-size: 0.75rem; } +.search-box { + display: flex; + position: relative; + margin-right: 20px; +} + +.search-box .fa { + font-size: 16px; + color: #ccc; + position: absolute; + right: 8px; + top: 50%; + transform: translate(0,-50%); + +} + +.search-box input { + width: 200px; + padding-right: 25px; +} + +.right-content { + display: flex; + justify-content: right; + align-items: center; +} + +@media only screen and (max-width: 500px) { + .float-right.search-content { + float: none !important; + margin-right: 0 !important; + } + .right-content { + justify-content: left; + padding-top: 5px; + } +} + h6.calendar-week { margin-top: 0; margin-bottom: 0; diff --git a/src/client/app/js/app/state/Home.js b/src/client/app/js/app/state/Home.js index 898931b..136486d 100644 --- a/src/client/app/js/app/state/Home.js +++ b/src/client/app/js/app/state/Home.js @@ -521,6 +521,29 @@ app.state.Home = function() updatePaging( +$( this ).val() ); }); + $content.on('input', '[data-id="appointment-search-filter"]', function(e) + { + var searchTerm = $(this).val().toLowerCase(); + + // Filter elements + $('[data-type="appointment-item-container"]').each(function() { + + var $div = $(this); + let appCat = $div.find('.appointment-category').text().toLowerCase(); + let appSub = $div.find('.appointment-subject').text().toLowerCase(); + let appDate = $div.find('.appointment-datetime').text().toLowerCase(); + + if (appCat.includes(searchTerm) || + appSub.includes(searchTerm) || + appDate.includes(searchTerm) || + searchTerm === '') { + $div.show(); + } else { + $div.hide(); + } + }); + }); + $content.on( 'click', '[data-type="appointment-short-info"]', function( e ) { var $eTarget = $( e.target ); diff --git a/src/client/app/tmpl/home-appointment-item.html b/src/client/app/tmpl/home-appointment-item.html index b21d534..5169d96 100644 --- a/src/client/app/tmpl/home-appointment-item.html +++ b/src/client/app/tmpl/home-appointment-item.html @@ -58,7 +58,8 @@ <% displayedDateStart = mStart.format( 'ddd' ) + ' ' + mStart.format( 'D.M.' ) + ' ' + mStart.format( 'HH:mm' ) %> <% displayedDateEnd = mEnd.format( 'ddd' ) + ' ' + mEnd.format( 'D.M.' ) + ' ' + mEnd.format( 'HH:mm' ) %> <% } %> - <%= displayedDateStart %> - <%= displayedDateEnd %> | <%= a.getNumAttendeesAccepted() %> <% if ( 0 < a.getMaxAttendees() ) { %> | <%= a.getMaxAttendees() - a.getNumAttendeesAccepted() %> verfügbar <% } %> | <%= group ? group.getName() : '' %> + <% var available = a.getMaxAttendees() - a.getNumAttendeesAccepted() >= 0 ? a.getMaxAttendees() - a.getNumAttendeesAccepted() : 0 %> + <%= displayedDateStart %> - <%= displayedDateEnd %> | <%= a.getNumAttendeesAccepted() %> <% if ( 0 < a.getMaxAttendees() ) { %> | <%= available %> verfügbar <% } %> | <%= group ? group.getName() : '' %> <% if ( a.getVProfileCanAttend() ) { %> diff --git a/src/client/app/tmpl/home-modal-appointment-filter.html b/src/client/app/tmpl/home-modal-appointment-filter.html index b23b81e..1450be5 100644 --- a/src/client/app/tmpl/home-modal-appointment-filter.html +++ b/src/client/app/tmpl/home-modal-appointment-filter.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/client/app/tmpl/home.html b/src/client/app/tmpl/home.html index ada30ed..fb65e0b 100644 --- a/src/client/app/tmpl/home.html +++ b/src/client/app/tmpl/home.html @@ -79,11 +79,17 @@

<%= currentMonth %> <% if ( monthHeader === null ) { %> - -
- + +
+ +
+ +
<% } %> From 6fe3a469fa796e82d3bf75cea3bcf6d8e07f7ee5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 1 Nov 2023 15:24:57 +0100 Subject: [PATCH 12/22] version increased --- src/client/app/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/index.php b/src/client/app/index.php index b472244..9dd05b5 100644 --- a/src/client/app/index.php +++ b/src/client/app/index.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../../server/server/config/boot_global.php'; require_once __DIR__ . '/../../server/server/config/boot_local.php'; - $version = 'v=2.1.1';//time();//Francis_Utils_Config::get( 'version' ); + $version = 'v=2.1.2';//time();//Francis_Utils_Config::get( 'version' ); ?> From 7bcc3ed79a11fae680db9b92bc0102eefc2547c4 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 1 Nov 2023 15:26:42 +0100 Subject: [PATCH 13/22] readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a2c30ea..5903e18 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,5 @@ Neuinstallation: - php pw_gen.php - Erzeugt Passwort "test" - In phpmyadmin pb_core - account: SQL Statement: UPDATE `account` SET `pass`='aa47377bfef0917b6ff2e73ece5a6952d7763664' WHERE 1 +Update client: +- um Client Caching zu umgehen bei Frontend Changes -> versions nummer erhöhen in src/client/app/index.php \ No newline at end of file From df5e9d54505afc0a5bd436f78e1a1394e137e2c7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 30 Aug 2024 11:47:16 +0200 Subject: [PATCH 14/22] ddev, fix empty participations, fix paging appointments --- .ddev/addon-metadata/phpmyadmin/manifest.yaml | 10 + .ddev/commands/host/phpmyadmin | 14 + .ddev/config.yaml | 277 ++++++++++++++++++ .ddev/docker-compose.phpmyadmin.yaml | 30 ++ .ddev/docker-compose.phpmyadmin_norouter.yaml | 4 + .ddev/php/xdebug.ini | 8 + src/client/app/index.php | 1 - .../app/state/ConfigurationAttendanceLog.js | 2 +- src/client/app/js/app/state/Home.js | 48 +-- src/client/app/tmpl/home.html | 4 +- src/server/server/config/boot_local.php | 17 +- 11 files changed, 373 insertions(+), 42 deletions(-) create mode 100644 .ddev/addon-metadata/phpmyadmin/manifest.yaml create mode 100755 .ddev/commands/host/phpmyadmin create mode 100644 .ddev/config.yaml create mode 100644 .ddev/docker-compose.phpmyadmin.yaml create mode 100644 .ddev/docker-compose.phpmyadmin_norouter.yaml create mode 100644 .ddev/php/xdebug.ini diff --git a/.ddev/addon-metadata/phpmyadmin/manifest.yaml b/.ddev/addon-metadata/phpmyadmin/manifest.yaml new file mode 100644 index 0000000..e86794d --- /dev/null +++ b/.ddev/addon-metadata/phpmyadmin/manifest.yaml @@ -0,0 +1,10 @@ +name: phpmyadmin +repository: ddev/ddev-phpmyadmin +version: v0.3.8 +install_date: "2024-08-29T14:51:22+02:00" +project_files: + - docker-compose.phpmyadmin.yaml + - docker-compose.phpmyadmin_norouter.yaml + - commands/host/phpmyadmin +global_files: [] +removal_actions: [] diff --git a/.ddev/commands/host/phpmyadmin b/.ddev/commands/host/phpmyadmin new file mode 100755 index 0000000..a1cdb80 --- /dev/null +++ b/.ddev/commands/host/phpmyadmin @@ -0,0 +1,14 @@ +#!/bin/bash + +## #ddev-generated: If you want to edit and own this file, remove this line. +## Description: Launch a browser with PhpMyAdmin +## Usage: phpmyadmin +## Example: "ddev phpmyadmin" + +DDEV_PHPMYADMIN_PORT=8036 +DDEV_PHPMYADMIN_HTTPS_PORT=8037 +if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then + ddev launch :$DDEV_PHPMYADMIN_PORT +else + ddev launch :$DDEV_PHPMYADMIN_HTTPS_PORT +fi diff --git a/.ddev/config.yaml b/.ddev/config.yaml new file mode 100644 index 0000000..be6539e --- /dev/null +++ b/.ddev/config.yaml @@ -0,0 +1,277 @@ +name: probuddy-master +type: php +docroot: /src/client/app +php_version: "8.1" +webserver_type: nginx-fpm +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: mariadb + version: "10.4" +use_dns_when_possible: true +composer_version: "2" +web_environment: [] +router_http_port: 8091 +router_https_port: 8463 + +# Key features of DDEV's config.yaml: + +# name: # Name of the project, automatically provides +# http://projectname.ddev.site and https://projectname.ddev.site + +# type: # backdrop, craftcms, django4, drupal6/7/8/9/10, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress +# See https://ddev.readthedocs.io/en/latest/users/quickstart/ for more +# information on the different project types + +# docroot: # Relative path to the directory containing index.php. + +# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" + +# You can explicitly specify the webimage but this +# is not recommended, as the images are often closely tied to DDEV's' behavior, +# so this can break upgrades. + +# webimage: # nginx/php docker image. + +# database: +# type: # mysql, mariadb, postgres +# version: # database version, like "10.4" or "8.0" +# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0 +# PostgreSQL versions can be 9-16. + +# router_http_port: # Port to be used for http (defaults to global configuration, usually 80) +# router_https_port: # Port for https (defaults to global configuration, usually 443) + +# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better, +# as leaving Xdebug enabled all the time is a big performance hit. + +# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better, +# as leaving Xhprof enabled all the time is a big performance hit. + +# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn + +# timezone: Europe/Berlin +# This is the timezone used in the containers and by PHP; +# it can be set to any valid timezone, +# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# For example Europe/Dublin or MST7MDT + +# composer_root: +# Relative path to the Composer root directory from the project root. This is +# the directory which contains the composer.json and where all Composer related +# commands are executed. + +# composer_version: "2" +# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1 +# to use the latest major version available at the time your container is built. +# It is also possible to use each other Composer version channel. This includes: +# - 2.2 (latest Composer LTS version) +# - stable +# - preview +# - snapshot +# Alternatively, an explicit Composer version may be specified, for example "2.2.18". +# To reinstall Composer after the image was built, run "ddev debug refresh". + +# nodejs_version: "18" +# change from the default system Node.js version to any other version. +# Numeric version numbers can be complete (i.e. 18.15.0) or +# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with +# other named releases. +# see https://www.npmjs.com/package/n#specifying-nodejs-versions +# Note that you can continue using 'ddev nvm' or nvm inside the web container +# to change the project's installed node version if you need to. + +# additional_hostnames: +# - somename +# - someothername +# would provide http and https URLs for "somename.ddev.site" +# and "someothername.ddev.site". + +# additional_fqdns: +# - example.com +# - sub1.example.com +# would provide http and https URLs for "example.com" and "sub1.example.com" +# Please take care with this because it can cause great confusion. + +# upload_dirs: "custom/upload/dir" +# +# upload_dirs: +# - custom/upload/dir +# - ../private +# +# would set the destination paths for ddev import-files to /custom/upload/dir +# When Mutagen is enabled this path is bind-mounted so that all the files +# in the upload_dirs don't have to be synced into Mutagen. + +# disable_upload_dirs_warning: false +# If true, turns off the normal warning that says +# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set" + +# ddev_version_constraint: "" +# Example: +# ddev_version_constraint: ">= 1.22.4" +# This will enforce that the running ddev version is within this constraint. +# See https://github.com/Masterminds/semver#checking-version-constraints for +# supported constraint formats + +# working_dir: +# web: /var/www/html +# db: /home +# would set the default working directory for the web and db services. +# These values specify the destination directory for ddev ssh and the +# directory in which commands passed into ddev exec are run. + +# omit_containers: [db, ddev-ssh-agent] +# Currently only these containers are supported. Some containers can also be +# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit +# the "db" container, several standard features of DDEV that access the +# database container will be unusable. In the global configuration it is also +# possible to omit ddev-router, but not here. + +# performance_mode: "global" +# DDEV offers performance optimization strategies to improve the filesystem +# performance depending on your host system. Should be configured globally. +# +# If set, will override the global config. Possible values are: +# - "global": uses the value from the global config. +# - "none": disables performance optimization for this project. +# - "mutagen": enables Mutagen for this project. +# - "nfs": enables NFS for this project. +# +# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs +# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen + +# fail_on_hook_fail: False +# Decide whether 'ddev start' should be interrupted by a failing hook + +# host_https_port: "59002" +# The host port binding for https can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_webserver_port: "59001" +# The host port binding for the ddev-webserver can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_db_port: "59002" +# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic +# unless explicitly specified. + +# mailpit_http_port: "8025" +# mailpit_https_port: "8026" +# The Mailpit ports can be changed from the default 8025 and 8026 + +# host_mailpit_port: "8025" +# The mailpit port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be bound directly to localhost if specified here. + +# webimage_extra_packages: [php7.4-tidy, php-bcmath] +# Extra Debian packages that are needed in the webimage can be added here + +# dbimage_extra_packages: [telnet,netcat] +# Extra Debian packages that are needed in the dbimage can be added here + +# use_dns_when_possible: true +# If the host has internet access and the domain configured can +# successfully be looked up, DNS will be used for hostname resolution +# instead of editing /etc/hosts +# Defaults to true + +# project_tld: ddev.site +# The top-level domain used for project URLs +# The default "ddev.site" allows DNS lookup via a wildcard +# If you prefer you can change this to "ddev.local" to preserve +# pre-v1.9 behavior. + +# ngrok_args: --basic-auth username:pass1234 +# Provide extra flags to the "ngrok http" command, see +# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h" + +# disable_settings_management: false +# If true, DDEV will not create CMS-specific settings files like +# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php +# In this case the user must provide all such settings. + +# You can inject environment variables into the web container with: +# web_environment: +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue + +# no_project_mount: false +# (Experimental) If true, DDEV will not mount the project into the web container; +# the user is responsible for mounting it manually or via a script. +# This is to enable experimentation with alternate file mounting strategies. +# For advanced users only! + +# bind_all_interfaces: false +# If true, host ports will be bound on all network interfaces, +# not the localhost interface only. This means that ports +# will be available on the local network if the host firewall +# allows it. + +# default_container_timeout: 120 +# The default time that DDEV waits for all containers to become ready can be increased from +# the default 120. This helps in importing huge databases, for example. + +#web_extra_exposed_ports: +#- name: nodejs +# container_port: 3000 +# http_port: 2999 +# https_port: 3000 +#- name: something +# container_port: 4000 +# https_port: 4000 +# http_port: 3999 +# Allows a set of extra ports to be exposed via ddev-router +# Fill in all three fields even if you don’t intend to use the https_port! +# If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start. +# +# The port behavior on the ddev-webserver must be arranged separately, for example +# using web_extra_daemons. +# For example, with a web app on port 3000 inside the container, this config would +# expose that web app on https://.ddev.site:9999 and http://.ddev.site:9998 +# web_extra_exposed_ports: +# - name: myapp +# container_port: 3000 +# http_port: 9998 +# https_port: 9999 + +#web_extra_daemons: +#- name: "http-1" +# command: "/var/www/html/node_modules/.bin/http-server -p 3000" +# directory: /var/www/html +#- name: "http-2" +# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000" +# directory: /var/www/html + +# override_config: false +# By default, config.*.yaml files are *merged* into the configuration +# But this means that some things can't be overridden +# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge +# and you can't erase existing hooks or all environment variables. +# However, with "override_config: true" in a particular config.*.yaml file, +# 'use_dns_when_possible: false' can override the existing values, and +# hooks: +# post-start: [] +# or +# web_environment: [] +# or +# additional_hostnames: [] +# can have their intended affect. 'override_config' affects only behavior of the +# config.*.yaml file it exists in. + +# Many DDEV commands can be extended to run tasks before or after the +# DDEV command is executed, for example "post-start", "post-import-db", +# "pre-composer", "post-composer" +# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more +# information on the commands that can be extended and the tasks you can define +# for them. Example: +#hooks: diff --git a/.ddev/docker-compose.phpmyadmin.yaml b/.ddev/docker-compose.phpmyadmin.yaml new file mode 100644 index 0000000..8d5dd2a --- /dev/null +++ b/.ddev/docker-compose.phpmyadmin.yaml @@ -0,0 +1,30 @@ +#ddev-generated +services: + phpmyadmin: + container_name: ddev-${DDEV_SITENAME}-phpmyadmin + image: phpmyadmin:5.2.0 + working_dir: "/root" + restart: "no" + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: $DDEV_APPROOT + volumes: + - ".:/mnt/ddev_config" + - "ddev-global-cache:/mnt/ddev-global-cache" + expose: + - "80" + environment: + - PMA_USER=root + - PMA_PASSWORD=root + - PMA_HOST=db + - PMA_PORT=3306 + - VIRTUAL_HOST=$DDEV_HOSTNAME + - UPLOAD_LIMIT=4000M + - HTTP_EXPOSE=8036:80 + - HTTPS_EXPOSE=8037:80 + healthcheck: + interval: 120s + timeout: 2s + retries: 1 + depends_on: + - db diff --git a/.ddev/docker-compose.phpmyadmin_norouter.yaml b/.ddev/docker-compose.phpmyadmin_norouter.yaml new file mode 100644 index 0000000..f369b69 --- /dev/null +++ b/.ddev/docker-compose.phpmyadmin_norouter.yaml @@ -0,0 +1,4 @@ +#ddev-generated +# If omit_containers[ddev-router] then this file will be replaced +# with another with a `ports` statement to directly expose port 80 to 8036 +services: {} diff --git a/.ddev/php/xdebug.ini b/.ddev/php/xdebug.ini new file mode 100644 index 0000000..768107f --- /dev/null +++ b/.ddev/php/xdebug.ini @@ -0,0 +1,8 @@ +;xdebug.log = /home/danielknudsen/xdebug.log +;xdebug.client_port = 9003 +;xdebug.client_host=host.docker.internal +xdebug.client_host=docker.for.mac.localhost +xdebug.mode = debug +xdebug.start_with_request = yes +xdebug.log = /tmp/xdebug.log +xdebug.log_level = 7 \ No newline at end of file diff --git a/src/client/app/index.php b/src/client/app/index.php index 9dd05b5..5f0c1da 100644 --- a/src/client/app/index.php +++ b/src/client/app/index.php @@ -1,7 +1,6 @@ diff --git a/src/client/app/js/app/state/ConfigurationAttendanceLog.js b/src/client/app/js/app/state/ConfigurationAttendanceLog.js index c336ed1..068ddb6 100644 --- a/src/client/app/js/app/state/ConfigurationAttendanceLog.js +++ b/src/client/app/js/app/state/ConfigurationAttendanceLog.js @@ -40,7 +40,7 @@ app.state.ConfigurationAttendanceLog = function() { $content.find( '[data-id="container-appointment-log"]' ).first().html( app.core.View.getTemplate( - 'group-member-management-body-appointment-log', + 'group-member-management-member-body-appointment-log', { logs : res.appointmentLog } diff --git a/src/client/app/js/app/state/Home.js b/src/client/app/js/app/state/Home.js index 136486d..a1c58fd 100644 --- a/src/client/app/js/app/state/Home.js +++ b/src/client/app/js/app/state/Home.js @@ -452,34 +452,6 @@ app.state.Home = function() } } - /** - * Render appointments according to pager setting - * @param pageNo - */ - function updatePaging( pageNo ) - { - var pager = self.createPager( - appointments, - +pageNo - ), - $content = app.core.View.getContent(); - - $content.html( - app.core.View.getTemplate( - 'home', - { - appointments : pager.pageElements, - pager : pager, - filter : filter, - groupsNotActiveString: groupsNotActiveString, - } - ) - ); - - // Animate scroll to top - $("html, body").animate({ scrollTop: 0 }); - } - // Note // This needs to be called once at the beginning to trigger correct handlers and body classes app.core.View.setContent( 'Loading...' ); @@ -511,15 +483,23 @@ app.state.Home = function() ) ); } - self.appointments = appointments; - updatePaging(); + $content = app.core.View.getContent(); - $content.on( 'change', '[data-id="pager"]', function( e ) - { - updatePaging( +$( this ).val() ); - }); + $content.html( + app.core.View.getTemplate( + 'home', + { + appointments: appointments, + filter : filter, + groupsNotActiveString: groupsNotActiveString, + } + ) + ); + + // Animate scroll to top + $("html, body").animate({ scrollTop: 0 }); $content.on('input', '[data-id="appointment-search-filter"]', function(e) { diff --git a/src/client/app/tmpl/home.html b/src/client/app/tmpl/home.html index fb65e0b..0313f70 100644 --- a/src/client/app/tmpl/home.html +++ b/src/client/app/tmpl/home.html @@ -61,7 +61,7 @@ <% } %> <% var monthHeader = null, weekHeader = null, currentMonth, currentWeek, currentWeekMoment, a, mStart, mEnd, mDeadline; %> - +<%= appointments.length %> <% for ( var ai = 0; ai < appointments.length; ai++ ) { %> <% a = appointments[ ai ]; %> @@ -116,6 +116,4 @@
<% } %> - <%=raw app.core.View.getTemplate( 'home-pager', { pager : pager } ) %> - <% } %> \ No newline at end of file diff --git a/src/server/server/config/boot_local.php b/src/server/server/config/boot_local.php index 25e0d44..3cddc23 100644 --- a/src/server/server/config/boot_local.php +++ b/src/server/server/config/boot_local.php @@ -6,13 +6,24 @@ // General Francis_Utils_Config::set( 'url.client', 'src/client/app' ); -// DB settings -Francis_Utils_Config::set( 'db.tbcore.host', 'database' ); +// DB settings (docker) +//Francis_Utils_Config::set( 'db.tbcore.host', 'database' ); +//Francis_Utils_Config::set( 'db.tbcore.name', 'pb_core' ); // probudy core +//Francis_Utils_Config::set( 'db.tbcore.user', 'root' ); +//Francis_Utils_Config::set( 'db.tbcore.pass', 'root' ); +// +//Francis_Utils_Config::set( 'db.tbteamdata.host', 'database' ); +//Francis_Utils_Config::set( 'db.tbteamdata.name', 'pb_teamdata' ); +//Francis_Utils_Config::set( 'db.tbteamdata.user', 'root' ); +//Francis_Utils_Config::set( 'db.tbteamdata.pass', 'root' ); + +// DB settings (ddev) +Francis_Utils_Config::set( 'db.tbcore.host', 'db' ); Francis_Utils_Config::set( 'db.tbcore.name', 'pb_core' ); // probudy core Francis_Utils_Config::set( 'db.tbcore.user', 'root' ); Francis_Utils_Config::set( 'db.tbcore.pass', 'root' ); -Francis_Utils_Config::set( 'db.tbteamdata.host', 'database' ); +Francis_Utils_Config::set( 'db.tbteamdata.host', 'db' ); Francis_Utils_Config::set( 'db.tbteamdata.name', 'pb_teamdata' ); Francis_Utils_Config::set( 'db.tbteamdata.user', 'root' ); Francis_Utils_Config::set( 'db.tbteamdata.pass', 'root' ); From c2667e2a2ccb4c668c61c580f5bb47fdfbc353be Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Sep 2024 16:54:29 +0200 Subject: [PATCH 15/22] removed debug output --- src/client/app/tmpl/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/tmpl/home.html b/src/client/app/tmpl/home.html index 0313f70..4a0eb24 100644 --- a/src/client/app/tmpl/home.html +++ b/src/client/app/tmpl/home.html @@ -61,7 +61,7 @@ <% } %> <% var monthHeader = null, weekHeader = null, currentMonth, currentWeek, currentWeekMoment, a, mStart, mEnd, mDeadline; %> -<%= appointments.length %> + <% for ( var ai = 0; ai < appointments.length; ai++ ) { %> <% a = appointments[ ai ]; %> From 18f096923c0f85a14bf0b22d1d9a23ea1867a237 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Sep 2024 18:52:45 +0200 Subject: [PATCH 16/22] appointments --- .ddev/config.yaml | 4 +++- README.md | 5 +++++ .../components/appointments/appointment-select-table.html | 3 ++- src/server/server/config/boot_local.php | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.ddev/config.yaml b/.ddev/config.yaml index be6539e..bfb6364 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -1,6 +1,8 @@ name: probuddy-master type: php -docroot: /src/client/app +docroot: /src/client +#docroot: /src/client/manager #manager console +#docroot: /src/client/app #app php_version: "8.1" webserver_type: nginx-fpm xdebug_enabled: false diff --git a/README.md b/README.md index 5903e18..bb7301c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +DDEV +- Um zwischen app und manager zu wechseln in die .ddev/config.yaml gucken, dort dann entsprechend einstellen :) + + +DOCKER - Client: http://localhost:8097/client/app/#/auth/start - Database: http://localhost:8096 - Template-Engine: https://github.com/cho45/micro-template.js diff --git a/src/client/manager/js/app/components/appointments/appointment-select-table.html b/src/client/manager/js/app/components/appointments/appointment-select-table.html index 6a84f64..b4b253f 100644 --- a/src/client/manager/js/app/components/appointments/appointment-select-table.html +++ b/src/client/manager/js/app/components/appointments/appointment-select-table.html @@ -85,8 +85,9 @@

-/* todo: refactoring into css file */ +