From 4b8e3ed8bf86b917920bfcd85658e248f8257662 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:09:00 +0700 Subject: [PATCH 01/41] Test config panel with getter setter --- config_panel.toml.example => config_panel.toml | 7 +++---- scripts/config | 12 ++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) rename config_panel.toml.example => config_panel.toml (81%) diff --git a/config_panel.toml.example b/config_panel.toml similarity index 81% rename from config_panel.toml.example rename to config_panel.toml index f6c6c06..5a64ef6 100644 --- a/config_panel.toml.example +++ b/config_panel.toml @@ -26,9 +26,8 @@ name = "Moncycle.app configuration" name = "export" [main.export.csv_sep] - #ask.en = "Separator for data export in csv format" - #ask.fr = "Séparateur pour l'export des données au format csv" - bind = ":__INSTALL_DIR__/config.php" + ask.en = "Separator for data export in csv format" + ask.fr = "Séparateur pour l'export des données au format csv" type = "string" - #default = ";" + default = ";" \ No newline at end of file diff --git a/scripts/config b/scripts/config index d03f829..9fdde39 100644 --- a/scripts/config +++ b/scripts/config @@ -24,10 +24,14 @@ ynh_abort_if_errors final_path=$(ynh_app_setting_get $app final_path) -## import needed settings -#creation_compte=$(ynh_app_setting_get --app="$app" --key=creation_compte) -#connexion_compte=$(ynh_app_setting_get --app="$app" --key=connexion_compte) -#csv_sep=$(ynh_app_setting_get --app="$app" --key=csv_sep) +get__csv_sep(){ + grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php" +} + +set__csv_sep(){ + sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" +} + #================================================= # GENERIC FINALIZATION From dbc061f0b8b774960bb2a83613a5dd685578f073 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:19:58 +0700 Subject: [PATCH 02/41] Update --- config_panel.toml | 50 +++++++++++++++++++++++------------------------ scripts/config | 16 +++++++++++++++ 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 5a64ef6..73bc1e9 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -2,32 +2,30 @@ version = "1.0" [main] name = "Moncycle.app configuration" - # [main.comptes] - # name = "comptes" + [main.comptes] + name = "comptes" - # [main.comptes.creation_compte] - # ask.en = "Enable account creation" - # ask.fr = "Permettre la création de nouveaux comptes" - # type = "select" - # choices = ["true", "false"] - # default = "true" - # help = "Don't disable account creation before creating one for yourself !" - # bind = "CREATION_COMPTE:__INSTALL_DIR__/config.php" - # - # [main.comptes.connexion_compte] - # ask.en = "Enable account connexion" - # ask.fr = "Permettre la connexion aux comptes" - # type = "select" - # choices = ["true", "false"] - # default = "true" - # bind = "CONNEXION_COMPTE:__INSTALL_DIR__/config.php" - - [main.export] - name = "export" + [main.comptes.creation_compte] + ask.en = "Enable account creation" + ask.fr = "Permettre la création de nouveaux comptes" + type = "select" + choices = ["true", "false"] + default = "true" + help = "Don't disable account creation before creating one for yourself !" - [main.export.csv_sep] - ask.en = "Separator for data export in csv format" - ask.fr = "Séparateur pour l'export des données au format csv" - type = "string" - default = ";" + [main.comptes.connexion_compte] + ask.en = "Enable account connexion" + ask.fr = "Permettre la connexion aux comptes" + type = "select" + choices = ["true", "false"] + default = "true" + + [main.export] + name = "export" + + [main.export.csv_sep] + ask.en = "Separator for data export in csv format" + ask.fr = "Séparateur pour l'export des données au format csv" + type = "string" + default = ";" \ No newline at end of file diff --git a/scripts/config b/scripts/config index 9fdde39..1bf8dd4 100644 --- a/scripts/config +++ b/scripts/config @@ -32,6 +32,22 @@ set__csv_sep(){ sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" } +get__creation_compte(){ + grep -oPi 'define\("CREATION_COMPTE",[\s"]*\K[^\")]+' "$install_dir/config.php" +} + +set__creation_compte(){ + sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CSV_SEP\", \"$creation_compte\");/" "$install_dir/config.php" +} + +get__connexion_compte(){ + grep -oPi 'define\("CONNEXION_COMPTE",[\s"]*\K[^\")]+' "$install_dir/config.php" +} + +set__connexion_compte(){ + sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CSV_SEP\", \"$connexion_compte\");/" "$install_dir/config.php" +} + #================================================= # GENERIC FINALIZATION From b9905f8bfe8cf6079a3b6904b8a2283c9e24669a Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:24:53 +0700 Subject: [PATCH 03/41] Update config --- scripts/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index 1bf8dd4..e271b78 100644 --- a/scripts/config +++ b/scripts/config @@ -37,7 +37,7 @@ get__creation_compte(){ } set__creation_compte(){ - sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CSV_SEP\", \"$creation_compte\");/" "$install_dir/config.php" + sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CREATION_COMPTE\", \"$creation_compte\");/" "$install_dir/config.php" } get__connexion_compte(){ @@ -45,7 +45,7 @@ get__connexion_compte(){ } set__connexion_compte(){ - sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CSV_SEP\", \"$connexion_compte\");/" "$install_dir/config.php" + sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CONNEXION_COMPTE\", \"$connexion_compte\");/" "$install_dir/config.php" } From ccdde9389b77019a5a6701146658c9a2f9edca03 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:25:51 +0700 Subject: [PATCH 04/41] Update config_panel.toml --- config_panel.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 73bc1e9..b662249 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,9 +1,9 @@ version = "1.0" [main] -name = "Moncycle.app configuration" +name = "Configuration" [main.comptes] - name = "comptes" + name = "Comptes" [main.comptes.creation_compte] ask.en = "Enable account creation" @@ -21,7 +21,7 @@ name = "Moncycle.app configuration" default = "true" [main.export] - name = "export" + name = "Export" [main.export.csv_sep] ask.en = "Separator for data export in csv format" From b40a564b7ca3e0dffbcf83c15528617ac1a44afb Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:33:30 +0700 Subject: [PATCH 05/41] Update config_panel.toml --- config_panel.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config_panel.toml b/config_panel.toml index b662249..e056647 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,6 +1,7 @@ version = "1.0" [main] name = "Configuration" +services = [ 'php$phpversion'] [main.comptes] name = "Comptes" From a5e3a54eb8e3e71d711b848b98c02f59f63b6859 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:36:14 +0700 Subject: [PATCH 06/41] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index e056647..a59aaa3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,7 +1,7 @@ version = "1.0" [main] name = "Configuration" -services = [ 'php$phpversion'] +services = [ 'php8.3-fpm'] [main.comptes] name = "Comptes" From 6fb37b2374f8b5018cfe7f76d111a1acaa8de788 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:51:39 +0700 Subject: [PATCH 07/41] Test --- config_panel.toml | 7 ++++--- scripts/config | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index a59aaa3..320b64c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -9,9 +9,10 @@ services = [ 'php8.3-fpm'] [main.comptes.creation_compte] ask.en = "Enable account creation" ask.fr = "Permettre la création de nouveaux comptes" - type = "select" - choices = ["true", "false"] - default = "true" + type = "boolean" + yes = true + no = false + default = true help = "Don't disable account creation before creating one for yourself !" [main.comptes.connexion_compte] diff --git a/scripts/config b/scripts/config index e271b78..6e23c85 100644 --- a/scripts/config +++ b/scripts/config @@ -30,6 +30,7 @@ get__csv_sep(){ set__csv_sep(){ sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" + } get__creation_compte(){ @@ -37,7 +38,7 @@ get__creation_compte(){ } set__creation_compte(){ - sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CREATION_COMPTE\", \"$creation_compte\");/" "$install_dir/config.php" + sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CREATION_COMPTE\", $creation_compte);/" "$install_dir/config.php" } get__connexion_compte(){ @@ -45,7 +46,7 @@ get__connexion_compte(){ } set__connexion_compte(){ - sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CONNEXION_COMPTE\", \"$connexion_compte\");/" "$install_dir/config.php" + sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CONNEXION_COMPTE\", $connexion_compte);/" "$install_dir/config.php" } From 46791750b487fd1a6862aaaa1188c8ee2f93ae13 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 21 Feb 2024 23:56:53 +0700 Subject: [PATCH 08/41] Update config_panel.toml --- config_panel.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 320b64c..148ef86 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -18,9 +18,10 @@ services = [ 'php8.3-fpm'] [main.comptes.connexion_compte] ask.en = "Enable account connexion" ask.fr = "Permettre la connexion aux comptes" - type = "select" - choices = ["true", "false"] - default = "true" + type = "boolean" + yes = true + no = false + default = true [main.export] name = "Export" From 09bb02b042c69f52506675c879cfde3355be6aa1 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:01:18 +0700 Subject: [PATCH 09/41] Update config_panel.toml --- config_panel.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 148ef86..3257c16 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -29,6 +29,7 @@ services = [ 'php8.3-fpm'] [main.export.csv_sep] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" - type = "string" + type = "select" + choices = [";", ",", ":", " ", " "] default = ";" \ No newline at end of file From 2a5c64d917df43668ceaa7793015a1b580c773de Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:09:35 +0700 Subject: [PATCH 10/41] Test Test --- config_panel.toml | 5 ++--- scripts/config | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 3257c16..fd4c5c3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -30,6 +30,5 @@ services = [ 'php8.3-fpm'] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" type = "select" - choices = [";", ",", ":", " ", " "] - default = ";" - \ No newline at end of file + choices = [";", "-"] + default = ";" \ No newline at end of file diff --git a/scripts/config b/scripts/config index 6e23c85..6995014 100644 --- a/scripts/config +++ b/scripts/config @@ -30,7 +30,6 @@ get__csv_sep(){ set__csv_sep(){ sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" - } get__creation_compte(){ From 78f073a7fc9c08c69c8ac4c75b234bd9c8bc1ffc Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:22:09 +0700 Subject: [PATCH 11/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 6995014..3a7cca0 100644 --- a/scripts/config +++ b/scripts/config @@ -25,7 +25,7 @@ ynh_abort_if_errors final_path=$(ynh_app_setting_get $app final_path) get__csv_sep(){ - grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php" + echo "$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")" } set__csv_sep(){ From ea8e518860fb7955d3c053195dc0943807ed51c9 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:32:30 +0700 Subject: [PATCH 12/41] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index fd4c5c3..9739186 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -30,5 +30,5 @@ services = [ 'php8.3-fpm'] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" type = "select" - choices = [";", "-"] + choices = [";", ",", " "] default = ";" \ No newline at end of file From f418ce598a261d3a41a5bff492accdc684cc77df Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:39:46 +0700 Subject: [PATCH 13/41] Update --- conf/version.json | 2 +- config_panel.toml | 3 +-- doc/POST_INSTALL.md | 2 +- manifest.toml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conf/version.json b/conf/version.json index 83ce69b..c7a0777 100644 --- a/conf/version.json +++ b/conf/version.json @@ -1,6 +1,6 @@ { "app": "moncycle.app", - "version": "10.0~ynh1", + "version": "10.0~ynh2", "build": "2024-02-21", "commit": "6e19865" } diff --git a/config_panel.toml b/config_panel.toml index 9739186..7acd999 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -29,6 +29,5 @@ services = [ 'php8.3-fpm'] [main.export.csv_sep] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" - type = "select" - choices = [";", ",", " "] + type = "string" default = ";" \ No newline at end of file diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 9f0e131..6c47990 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,4 +1,4 @@ * After installing, you can create your own user using the form -* Once done, you can (if you want) set the account creation to false in `/var/www/moncycle/config.php` +* Once done, you can (if you want) disable the account creation in the config panel * If you want to use the app in PWA mode, be sure to be connected to your account first * After upgrading from 7.0 to 9.0, you may experience issues if you don't clean your browser cache diff --git a/manifest.toml b/manifest.toml index bf02ad5..9124843 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Moncycle" description.en = "Menstrual cycle follow-up for natural family planning" description.fr = "Suivi de cycle pour les méthodes naturelles de régulation de naissance" -version = "10.0~ynh1" +version = "10.0~ynh2" maintainers = ["Raoul de Limezy"] From 5dfe18d500c1911ebcd2db68071f6ca3c988d173 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:46:46 +0700 Subject: [PATCH 14/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 3a7cca0..465c2eb 100644 --- a/scripts/config +++ b/scripts/config @@ -25,7 +25,7 @@ ynh_abort_if_errors final_path=$(ynh_app_setting_get $app final_path) get__csv_sep(){ - echo "$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")" + echo ""$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")"" } set__csv_sep(){ From 2f5d01f5362174809107aaf25701c82a310b83bb Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 00:57:48 +0700 Subject: [PATCH 15/41] Update config_panel.toml --- config_panel.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 7acd999..0969d0d 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -29,5 +29,6 @@ services = [ 'php8.3-fpm'] [main.export.csv_sep] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" - type = "string" + type = "tags" + choices = [";",","] default = ";" \ No newline at end of file From 2000f1d468f2e2a207d4e2ceee5fae668c71dbb2 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 01:01:18 +0700 Subject: [PATCH 16/41] Update config_panel.toml --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 0969d0d..2246640 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -30,5 +30,5 @@ services = [ 'php8.3-fpm'] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" type = "tags" - choices = [";",","] - default = ";" \ No newline at end of file + choices = [';',','] + default = ';' \ No newline at end of file From 880e0fe4591e2e20db05c97779d26e6d80d86889 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 01:09:42 +0700 Subject: [PATCH 17/41] Statistics --- config_panel.toml | 11 ++++++++++- scripts/config | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 2246640..657fcb9 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -31,4 +31,13 @@ services = [ 'php8.3-fpm'] ask.fr = "Séparateur pour l'export des données au format csv" type = "tags" choices = [';',','] - default = ';' \ No newline at end of file + default = ';' + + [main.statistics] + name = "Statistiques" + + [main.statistics.statistics] + ask.en = "Statistics for the server" + ask.fr = "Statistiques du serveur" + type = "display_text" + readonly = true \ No newline at end of file diff --git a/scripts/config b/scripts/config index 465c2eb..a9c4ff1 100644 --- a/scripts/config +++ b/scripts/config @@ -48,6 +48,9 @@ set__connexion_compte(){ sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CONNEXION_COMPTE\", $connexion_compte);/" "$install_dir/config.php" } +get__statistics(){ + echo "$(/usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" +} #================================================= # GENERIC FINALIZATION From e0e089cf155e463e054db0c9b097b80d91a65717 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 01:12:08 +0700 Subject: [PATCH 18/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index a9c4ff1..b08f0bf 100644 --- a/scripts/config +++ b/scripts/config @@ -49,7 +49,7 @@ set__connexion_compte(){ } get__statistics(){ - echo "$(/usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" + echo "$(/usr/bin/php8.3 --define apc.enable_cli=1 "$install_dir/script/stat.php")" } #================================================= From 98b775c8e32fcdf71c87516183551b152c67d873 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 01:15:57 +0700 Subject: [PATCH 19/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index b08f0bf..e13b8cc 100644 --- a/scripts/config +++ b/scripts/config @@ -49,7 +49,7 @@ set__connexion_compte(){ } get__statistics(){ - echo "$(/usr/bin/php8.3 --define apc.enable_cli=1 "$install_dir/script/stat.php")" + echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 "stat.php")" } #================================================= From ccdf1f8ba9f5d5edb3e428f5b49b1c022b566c48 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 01:18:37 +0700 Subject: [PATCH 20/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index e13b8cc..9d1d9d9 100644 --- a/scripts/config +++ b/scripts/config @@ -49,7 +49,7 @@ set__connexion_compte(){ } get__statistics(){ - echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 "stat.php")" + echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" } #================================================= From ca7bfb3227b63f64dc42236ae6bb228f57bdf91d Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 01:20:51 +0700 Subject: [PATCH 21/41] Update config_panel.toml --- config_panel.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 657fcb9..fb7304c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -39,5 +39,4 @@ services = [ 'php8.3-fpm'] [main.statistics.statistics] ask.en = "Statistics for the server" ask.fr = "Statistiques du serveur" - type = "display_text" - readonly = true \ No newline at end of file + type = "display_text" \ No newline at end of file From 6d3024abb685bf4b59bbc8ce09a0e9da9d0b07c2 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 11:34:10 +0700 Subject: [PATCH 22/41] Tests --- conf/config.php | 6 +++--- scripts/config | 6 +++++- scripts/install | 9 +++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/conf/config.php b/conf/config.php index f4ced39..fb6da8b 100644 --- a/conf/config.php +++ b/conf/config.php @@ -20,10 +20,10 @@ define("SMTP_PORT", 25); define("SMTP_MAIL", "__APP__@__DOMAIN__"); define("SMTP_PASSWORD", ""); -define("CREATION_COMPTE", true); -define("CONNEXION_COMPTE", true); +define("CREATION_COMPTE", __CREATION_COMPTE__); +define("CONNEXION_COMPTE", __CONNEXION_COMPTE__); -define("CSV_SEP", ";"); +define("CSV_SEP", "__CSV_SEP__"); define("PHP_SECURE_COOKIES", true); diff --git a/scripts/config b/scripts/config index 9d1d9d9..c32a1fa 100644 --- a/scripts/config +++ b/scripts/config @@ -30,6 +30,7 @@ get__csv_sep(){ set__csv_sep(){ sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" + ynh_app_setting_set --app=$app --key=csv_sep --value="$csv_sep" } get__creation_compte(){ @@ -38,6 +39,7 @@ get__creation_compte(){ set__creation_compte(){ sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CREATION_COMPTE\", $creation_compte);/" "$install_dir/config.php" + ynh_app_setting_set --app=$app --key=creation_compte --value="$creation_compte" } get__connexion_compte(){ @@ -46,10 +48,12 @@ get__connexion_compte(){ set__connexion_compte(){ sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CONNEXION_COMPTE\", $connexion_compte);/" "$install_dir/config.php" + ynh_app_setting_set --app=$app --key=connexion_compte --value="$connexion_compte" } get__statistics(){ - echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" + #echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" + echo "salut la compagnie" } #================================================= diff --git a/scripts/install b/scripts/install index 7b55452..57fc55f 100755 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,15 @@ source _common.sh source /usr/share/yunohost/helpers +creation_compte=true +ynh_app_setting_set --app=$app --key=csv_sep --value="$csv_sep" +connexion_compte=true +ynh_app_setting_set --app=$app --key=creation_compte --value="$creation_compte" +csv_sep=";" +ynh_app_setting_set --app=$app --key=connexion_compte --value="$connexion_compte" + + + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From f4d0b8a6b6a3ffdd237aab2d8dc29d3bbde73970 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 11:34:38 +0700 Subject: [PATCH 23/41] Update config_panel.toml --- config_panel.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index fb7304c..cfd220a 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -29,8 +29,7 @@ services = [ 'php8.3-fpm'] [main.export.csv_sep] ask.en = "Separator for data export in csv format" ask.fr = "Séparateur pour l'export des données au format csv" - type = "tags" - choices = [';',','] + type = "string" default = ';' [main.statistics] From 6c6fc2b2f9a9bdfb54d3ac8359985cfaa407b5c4 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 11:41:46 +0700 Subject: [PATCH 24/41] Update install --- scripts/install | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 57fc55f..0713394 100755 --- a/scripts/install +++ b/scripts/install @@ -9,15 +9,14 @@ source _common.sh source /usr/share/yunohost/helpers -creation_compte=true -ynh_app_setting_set --app=$app --key=csv_sep --value="$csv_sep" -connexion_compte=true -ynh_app_setting_set --app=$app --key=creation_compte --value="$creation_compte" csv_sep=";" +creation_compte=true +connexion_compte=true +ynh_app_setting_set --app=$app --key=csv_sep --value="$csv_sep" +ynh_app_setting_set --app=$app --key=creation_compte --value="$creation_compte" ynh_app_setting_set --app=$app --key=connexion_compte --value="$connexion_compte" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 6c61d31d3ddd153b5ce575f53d08e0f5570d15e9 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 13:32:04 +0700 Subject: [PATCH 25/41] Update config_panel.toml --- config_panel.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index cfd220a..0096dd3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -38,4 +38,5 @@ services = [ 'php8.3-fpm'] [main.statistics.statistics] ask.en = "Statistics for the server" ask.fr = "Statistiques du serveur" - type = "display_text" \ No newline at end of file + type = "string" + default ="coucou" \ No newline at end of file From b734347e9e379ed69ef1292d3636f2162e078538 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 13:46:08 +0700 Subject: [PATCH 26/41] Test --- config_panel.toml | 2 +- scripts/config | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 0096dd3..e0b288f 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -39,4 +39,4 @@ services = [ 'php8.3-fpm'] ask.en = "Statistics for the server" ask.fr = "Statistiques du serveur" type = "string" - default ="coucou" \ No newline at end of file + readonly = true \ No newline at end of file diff --git a/scripts/config b/scripts/config index c32a1fa..8ed3a83 100644 --- a/scripts/config +++ b/scripts/config @@ -52,8 +52,7 @@ set__connexion_compte(){ } get__statistics(){ - #echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" - echo "salut la compagnie" + echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" } #================================================= From 157fc2eca7c8d37a98ab2140a58aabf83efbcaf5 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 22 Feb 2024 18:55:56 +0700 Subject: [PATCH 27/41] Test --- config_panel.toml | 58 +++++++++++++++++++++++++++++++++++++++++++---- scripts/config | 44 +++++++++++++++++++++++++++++++++-- 2 files changed, 95 insertions(+), 7 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index e0b288f..46e7470 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -35,8 +35,56 @@ services = [ 'php8.3-fpm'] [main.statistics] name = "Statistiques" - [main.statistics.statistics] - ask.en = "Statistics for the server" - ask.fr = "Statistiques du serveur" - type = "string" - readonly = true \ No newline at end of file + [main.statistics.moncycle_app_nb_compte] + ask.fr = "Nombre de comptes" + type = "number" + readonly = true + + [main.statistics.moncycle_app_nb_session] + ask.fr = "Nombre de sessions" + type = "number" + readonly = true + + [main.statistics.moncycle_app_visite_mensuel] + ask.fr = "Nombre de visites mensuelles" + type = "number" + readonly = true + + [main.statistics.moncycle_app_visite_hebdo] + ask.fr = "Nombre de visites hebdomadaires" + type = "number" + readonly = true + + [main.statistics.moncycle_app_visite_jour] + ask.fr = "Nombre de visites quotidiennes" + type = "number" + readonly = true + + [main.statistics.moncycle_app_nb_compte_actif] + ask.fr = "Nombre de comptes actifs" + type = "number" + readonly = true + + [main.statistics.moncycle_app_pc_compte_actif] + ask.fr = "Pourcentage de comptes actifs" + type = "number" + readonly = true + + [main.statistics.moncycle_app_nb_compte_avec_totp] + ask.fr = "Nombre de comptes avec totp" + type = "number" + readonly = true + + [main.statistics.moncycle_app_nb_compte_actif_billings] + ask.fr = "Nombre de comptes Billings actifs" + type = "number" + readonly = true + + [main.statistics.moncycle_app_pc_compte_actif_billings] + ask.fr = "Pourcentage de comptes actifs Billings" + type = "number" + readonly = true + + + + diff --git a/scripts/config b/scripts/config index 8ed3a83..848bde2 100644 --- a/scripts/config +++ b/scripts/config @@ -24,6 +24,10 @@ ynh_abort_if_errors final_path=$(ynh_app_setting_get $app final_path) +pushd "$install_dir/script" + statistiques=$(/usr/bin/php8.3 --define apc.enable_cli=1 stat.php) +popd + get__csv_sep(){ echo ""$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")"" } @@ -51,8 +55,44 @@ set__connexion_compte(){ ynh_app_setting_set --app=$app --key=connexion_compte --value="$connexion_compte" } -get__statistics(){ - echo "$(pushd "$install_dir/script" && /usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" +get__moncycle_app_nb_compte(){ + grep 'moncycle_app_nb_compte' $statistiques +} + +get__moncycle_app_nb_session(){ + grep 'moncycle_app_nb_session' $statistiques +} + +get__moncycle_app_visite_mensuel(){ + grep 'moncycle_app_visite_mensuel' $statistiques +} + +get__moncycle_app_visite_hebdo(){ + grep 'moncycle_app_visite_hebdo' $statistiques +} + +get__moncycle_app_visite_jour(){ + grep 'moncycle_app_visite_jour' $statistiques +} + +get__moncycle_app_nb_compte_actif(){ + grep 'moncycle_app_nb_compte_actif' $statistiques +} + +get__moncycle_app_pc_compte_actif(){ + grep 'moncycle_app_pc_compte_actif' $statistiques +} + +get__moncycle_app_nb_compte_avec_totp(){ + grep 'moncycle_app_nb_compte_avec_totp' $statistiques +} + +get__moncycle_app_nb_compte_actif_billings(){ + grep 'moncycle_app_nb_compte_actif_billings' $statistiques +} + +get__moncycle_app_pc_compte_actif_billings(){ + grep 'moncycle_app_pc_compte_actif_billings' $statistiques } #================================================= From 6cd0d63fdc948476ae2710354a2afe9fcb6de548 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 01:00:33 +0700 Subject: [PATCH 28/41] Update config --- scripts/config | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/config b/scripts/config index 848bde2..facdddf 100644 --- a/scripts/config +++ b/scripts/config @@ -25,7 +25,7 @@ ynh_abort_if_errors final_path=$(ynh_app_setting_get $app final_path) pushd "$install_dir/script" - statistiques=$(/usr/bin/php8.3 --define apc.enable_cli=1 stat.php) + statistiques="$(/usr/bin/php8.3 --define apc.enable_cli=1 stat.php)" popd get__csv_sep(){ @@ -56,43 +56,43 @@ set__connexion_compte(){ } get__moncycle_app_nb_compte(){ - grep 'moncycle_app_nb_compte' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte \K.*' } get__moncycle_app_nb_session(){ - grep 'moncycle_app_nb_session' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_nb_session \K.*' } get__moncycle_app_visite_mensuel(){ - grep 'moncycle_app_visite_mensuel' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_visite_mensuel \K.*' } get__moncycle_app_visite_hebdo(){ - grep 'moncycle_app_visite_hebdo' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_visite_hebdo \K.*' } get__moncycle_app_visite_jour(){ - grep 'moncycle_app_visite_jour' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_visite_jour \K.*' } get__moncycle_app_nb_compte_actif(){ - grep 'moncycle_app_nb_compte_actif' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_actif \K.*' } get__moncycle_app_pc_compte_actif(){ - grep 'moncycle_app_pc_compte_actif' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_pc_compte_actif \K.*' } get__moncycle_app_nb_compte_avec_totp(){ - grep 'moncycle_app_nb_compte_avec_totp' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_avec_totp \K.*' } get__moncycle_app_nb_compte_actif_billings(){ - grep 'moncycle_app_nb_compte_actif_billings' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_actif_billings \K.*' } get__moncycle_app_pc_compte_actif_billings(){ - grep 'moncycle_app_pc_compte_actif_billings' $statistiques + echo "$statistiques" | grep -Poi 'moncycle_app_pc_compte_actif_billings \K.*' } #================================================= From 5e78edb372939e1a8a1becfcf30aac5d36e47da9 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 01:06:49 +0700 Subject: [PATCH 29/41] Update config_panel.toml --- config_panel.toml | 87 ++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 46e7470..5c62da3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -32,58 +32,61 @@ services = [ 'php8.3-fpm'] type = "string" default = ';' - [main.statistics] - name = "Statistiques" +[statistics] +name = "Statistiques" - [main.statistics.moncycle_app_nb_compte] - ask.fr = "Nombre de comptes" - type = "number" - readonly = true +[statistics.comptes] +name = "Satistiques des comptes" - [main.statistics.moncycle_app_nb_session] - ask.fr = "Nombre de sessions" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_nb_compte] +ask.fr = "Nombre de comptes" +type = "number" +readonly = true - [main.statistics.moncycle_app_visite_mensuel] - ask.fr = "Nombre de visites mensuelles" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_nb_session] +ask.fr = "Nombre de sessions" +type = "number" +readonly = true - [main.statistics.moncycle_app_visite_hebdo] - ask.fr = "Nombre de visites hebdomadaires" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_visite_mensuel] +ask.fr = "Nombre de visites mensuelles" +type = "number" +readonly = true - [main.statistics.moncycle_app_visite_jour] - ask.fr = "Nombre de visites quotidiennes" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_visite_hebdo] +ask.fr = "Nombre de visites hebdomadaires" +type = "number" +readonly = true - [main.statistics.moncycle_app_nb_compte_actif] - ask.fr = "Nombre de comptes actifs" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_visite_jour] +ask.fr = "Nombre de visites quotidiennes" +type = "number" +readonly = true - [main.statistics.moncycle_app_pc_compte_actif] - ask.fr = "Pourcentage de comptes actifs" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_nb_compte_actif] +ask.fr = "Nombre de comptes actifs" +type = "number" +readonly = true - [main.statistics.moncycle_app_nb_compte_avec_totp] - ask.fr = "Nombre de comptes avec totp" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_pc_compte_actif] +ask.fr = "Pourcentage de comptes actifs" +type = "number" +readonly = true - [main.statistics.moncycle_app_nb_compte_actif_billings] - ask.fr = "Nombre de comptes Billings actifs" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_nb_compte_avec_totp] +ask.fr = "Nombre de comptes avec totp" +type = "number" +readonly = true - [main.statistics.moncycle_app_pc_compte_actif_billings] - ask.fr = "Pourcentage de comptes actifs Billings" - type = "number" - readonly = true +[statistics.comptes.moncycle_app_nb_compte_actif_billings] +ask.fr = "Nombre de comptes Billings actifs" +type = "number" +readonly = true + +[statistics.comptes.moncycle_app_pc_compte_actif_billings] +ask.fr = "Pourcentage de comptes actifs Billings" +type = "number" +readonly = true From 1e570e9b5a022e1062e4ae373b5a9dd7d1a083d2 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 01:19:55 +0700 Subject: [PATCH 30/41] Test --- config_panel.toml | 4 ++-- scripts/config | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 5c62da3..3ed890e 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -70,7 +70,7 @@ readonly = true [statistics.comptes.moncycle_app_pc_compte_actif] ask.fr = "Pourcentage de comptes actifs" -type = "number" +type = "string" readonly = true [statistics.comptes.moncycle_app_nb_compte_avec_totp] @@ -85,7 +85,7 @@ readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_billings] ask.fr = "Pourcentage de comptes actifs Billings" -type = "number" +type = "string" readonly = true diff --git a/scripts/config b/scripts/config index facdddf..3d8ab43 100644 --- a/scripts/config +++ b/scripts/config @@ -80,7 +80,7 @@ get__moncycle_app_nb_compte_actif(){ } get__moncycle_app_pc_compte_actif(){ - echo "$statistiques" | grep -Poi 'moncycle_app_pc_compte_actif \K.*' + echo $(echo "$statistiques" | grep -Poi 'moncycle_app_pc_compte_actif \K.*')"%" } get__moncycle_app_nb_compte_avec_totp(){ @@ -92,7 +92,7 @@ get__moncycle_app_nb_compte_actif_billings(){ } get__moncycle_app_pc_compte_actif_billings(){ - echo "$statistiques" | grep -Poi 'moncycle_app_pc_compte_actif_billings \K.*' + echo $(echo "$statistiques" | grep -Poi 'app_pc_compte_actif_billings \K.*')"%" } #================================================= From e09897d25b9abf705b4ea2fbe66308f9a7026fe0 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 09:13:20 +0700 Subject: [PATCH 31/41] Trying to solve sep issue --- config_panel.toml | 9 +++++---- scripts/config | 10 ++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 3ed890e..912996f 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -27,10 +27,11 @@ services = [ 'php8.3-fpm'] name = "Export" [main.export.csv_sep] - ask.en = "Separator for data export in csv format" - ask.fr = "Séparateur pour l'export des données au format csv" - type = "string" - default = ';' + ask.en = "For data in csv format" + ask.fr = "Pour les des données au format csv" + type = "select" + choices = ["Utiliser le séparateur ;", "Utiliser le séparateur ,", "Utiliser un espace"] + default = "Utiliser le séparateur ;" [statistics] name = "Statistiques" diff --git a/scripts/config b/scripts/config index 3d8ab43..9ad4b3a 100644 --- a/scripts/config +++ b/scripts/config @@ -29,11 +29,17 @@ pushd "$install_dir/script" popd get__csv_sep(){ - echo ""$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")"" + echo "Utiliser le séparateur" "$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")" } set__csv_sep(){ - sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" + if [ $csv_sep == "Utiliser le séparateur ," ]; then + sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \",\");/" "$install_dir/config.php" + elif [ $csv_sep == "Utiliser un espace" ]; then + sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \" \");/" "$install_dir/config.php" + else + sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \";\");/" "$install_dir/config.php" + fi ynh_app_setting_set --app=$app --key=csv_sep --value="$csv_sep" } From 35a49573d222fa24cdfec31663bd3d9ede8b4a9a Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 09:22:29 +0700 Subject: [PATCH 32/41] Update config --- scripts/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index 9ad4b3a..be72ded 100644 --- a/scripts/config +++ b/scripts/config @@ -33,9 +33,9 @@ get__csv_sep(){ } set__csv_sep(){ - if [ $csv_sep == "Utiliser le séparateur ," ]; then + if [ $csv_sep = "Utiliser le séparateur ," ]; then sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \",\");/" "$install_dir/config.php" - elif [ $csv_sep == "Utiliser un espace" ]; then + elif [ $csv_sep = "Utiliser un espace" ]; then sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \" \");/" "$install_dir/config.php" else sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \";\");/" "$install_dir/config.php" From b9aea8224e296fa8d631656a7c3dc160bb515515 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 09:25:56 +0700 Subject: [PATCH 33/41] Update config --- scripts/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index be72ded..3850cf8 100644 --- a/scripts/config +++ b/scripts/config @@ -33,9 +33,9 @@ get__csv_sep(){ } set__csv_sep(){ - if [ $csv_sep = "Utiliser le séparateur ," ]; then + if [ "$csv_sep" == "Utiliser le séparateur ," ]; then sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \",\");/" "$install_dir/config.php" - elif [ $csv_sep = "Utiliser un espace" ]; then + elif [ "$csv_sep" == "Utiliser un espace" ]; then sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \" \");/" "$install_dir/config.php" else sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \";\");/" "$install_dir/config.php" From 0047638eef37eccc04ada101df5c27d805d99565 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 09:30:37 +0700 Subject: [PATCH 34/41] Update config --- scripts/config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 3850cf8..ba0eddf 100644 --- a/scripts/config +++ b/scripts/config @@ -29,7 +29,12 @@ pushd "$install_dir/script" popd get__csv_sep(){ - echo "Utiliser le séparateur" "$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")" + separateur="$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")" + if [ $separateur = " "]; then + echo "Utiliser un espace" + else + echo "Utiliser le séparateur ""separateur" + fi } set__csv_sep(){ From 9034340957cd3c2eec0bd8bd0089eb7cdf2a7320 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 09:34:13 +0700 Subject: [PATCH 35/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index ba0eddf..0d2b84a 100644 --- a/scripts/config +++ b/scripts/config @@ -30,7 +30,7 @@ popd get__csv_sep(){ separateur="$(grep -oPi 'define\("CSV_SEP",[\s"]*\K[^\")]+' "$install_dir/config.php")" - if [ $separateur = " "]; then + if [ "$separateur" == " " ]; then echo "Utiliser un espace" else echo "Utiliser le séparateur ""separateur" From c9f168d58d3e96768c196ce588e550c63312c88d Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 09:39:00 +0700 Subject: [PATCH 36/41] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 0d2b84a..19b6f05 100644 --- a/scripts/config +++ b/scripts/config @@ -33,7 +33,7 @@ get__csv_sep(){ if [ "$separateur" == " " ]; then echo "Utiliser un espace" else - echo "Utiliser le séparateur ""separateur" + echo "Utiliser le séparateur ""$separateur" fi } From f0dc6134b4f2483d44953988f6b978a23d25e88d Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 10:08:10 +0700 Subject: [PATCH 37/41] Config panel --- config_panel.toml | 172 ++++++++++++++++++++++++++++++++++------------ scripts/config | 68 ++++++++++++++++++ 2 files changed, 197 insertions(+), 43 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 912996f..c2e4afa 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -13,11 +13,12 @@ services = [ 'php8.3-fpm'] yes = true no = false default = true - help = "Don't disable account creation before creating one for yourself !" + help = "Créez votre propre compte avant de fermer cette option !" [main.comptes.connexion_compte] ask.en = "Enable account connexion" ask.fr = "Permettre la connexion aux comptes" + help = "La connexion sera désactivée pour l'ensemble des utilisateurs de l'instance" type = "boolean" yes = true no = false @@ -36,59 +37,144 @@ services = [ 'php8.3-fpm'] [statistics] name = "Statistiques" -[statistics.comptes] -name = "Satistiques des comptes" + [statistics.usage] + name = "Satistiques d'usage" -[statistics.comptes.moncycle_app_nb_compte] -ask.fr = "Nombre de comptes" -type = "number" -readonly = true + [statistics.usage.moncycle_app_nb_session] + ask.fr = "Nombre de sessions" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_nb_session] -ask.fr = "Nombre de sessions" -type = "number" -readonly = true + [statistics.usage.moncycle_app_visite_mensuel] + ask.fr = "Nombre de visites mensuelles" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_visite_mensuel] -ask.fr = "Nombre de visites mensuelles" -type = "number" -readonly = true + [statistics.usage.moncycle_app_visite_hebdo] + ask.fr = "Nombre de visites hebdomadaires" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_visite_hebdo] -ask.fr = "Nombre de visites hebdomadaires" -type = "number" -readonly = true + [statistics.usage.moncycle_app_visite_jour] + ask.fr = "Nombre de visites quotidiennes" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_visite_jour] -ask.fr = "Nombre de visites quotidiennes" -type = "number" -readonly = true + [statistics.usage.moncycle_app_nb_cycle] + ask.fr = "Nombre de cycles" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_nb_compte_actif] -ask.fr = "Nombre de comptes actifs" -type = "number" -readonly = true + [statistics.usage.moncycle_app_nb_cycle_recent] + ask.fr = "Nombre de cycles récents" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_pc_compte_actif] -ask.fr = "Pourcentage de comptes actifs" -type = "string" -readonly = true + [statistics.usage.moncycle_app_age_moyen] + ask.fr = "Âge moyen" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_nb_compte_avec_totp] -ask.fr = "Nombre de comptes avec totp" -type = "number" -readonly = true + [statistics.usage.moncycle_app_age_moyen_recent] + ask.fr = "Âge moyen récent" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_nb_compte_actif_billings] -ask.fr = "Nombre de comptes Billings actifs" -type = "number" -readonly = true + [statistics.usage.moncycle_app_nb_total_observation] + ask.fr = "Nombre total d'observations" + type = "number" + readonly = true -[statistics.comptes.moncycle_app_pc_compte_actif_billings] -ask.fr = "Pourcentage de comptes actifs Billings" -type = "string" -readonly = true + [statistics.usage.moncycle_app_nb_observation_aujourdhui] + ask.fr = "Nombre d'observations aujourd'hui" + type = "number" + readonly = true + [statistics.usage.moncycle_app_nb_observation_1j] + ask.fr = "Nombre d'observations depuis 1 jour" + type = "number" + readonly = true + [statistics.usage.moncycle_app_nb_observation_5j] + ask.fr = "Nombre d'observations depuis 5 jours" + type = "number" + readonly = true + [statistics.usage.moncycle_app_nb_observation_15j] + ask.fr = "Nombre d'observations depuis 15 jours" + type = "number" + readonly = true + + [statistics.usage.moncycle_app_nb_observation_30j] + ask.fr = "Nombre d'observations depuis 30 jours" + type = "number" + readonly = true + + [statistics.comptes] + name = "Satistiques des comptes" + + [statistics.comptes.moncycle_app_nb_compte] + ask.fr = "Nombre de comptes" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_actif] + ask.fr = "Nombre de comptes actifs" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_pc_compte_actif] + ask.fr = "Pourcentage de comptes actifs" + type = "string" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_avec_totp] + ask.fr = "Nombre de comptes avec totp" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_actif_billings] + ask.fr = "Nombre de comptes Billings actifs" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_pc_compte_actif_billings] + ask.fr = "Pourcentage de comptes actifs Billings" + type = "string" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_actif_billings_temp] + ask.fr = "Nombre de comptes Billings actifs" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_pc_compte_actif_billings_temp] + ask.fr = "Pourcentage de comptes actifs Billings" + type = "string" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_actif_fertilitycare] + ask.fr = "Nombre de comptes Fertility Care actifs" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_pc_compte_actif_fertilitycare] + ask.fr = "Pourcentage de comptes actifs Fertility Care" + type = "string" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_actif_fertilitycare_temp] + ask.fr = "Nombre de comptes Fertility Care actifs" + type = "number" + readonly = true + + [statistics.comptes.moncycle_app_pc_compte_actif_fertilitycare_temp] + ask.fr = "Pourcentage de comptes actifs Fertility Care" + type = "string" + readonly = true + + [statistics.comptes.moncycle_app_nb_compte_recent] + ask.fr = "Nombre de comptes récents" + type = "string" + readonly = true diff --git a/scripts/config b/scripts/config index 19b6f05..220144d 100644 --- a/scripts/config +++ b/scripts/config @@ -106,6 +106,74 @@ get__moncycle_app_pc_compte_actif_billings(){ echo $(echo "$statistiques" | grep -Poi 'app_pc_compte_actif_billings \K.*')"%" } +get__moncycle_app_nb_compte_actif_billings_temp(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_actif_billings_temp \K.*' +} + +get__moncycle_app_pc_compte_actif_billings_temp(){ + echo $(echo "$statistiques" | grep -Poi 'app_pc_compte_actif_billings_temp \K.*')"%" +} + +get__moncycle_app_nb_compte_actif_fertilitycare(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_actif_fertilitycare \K.*' +} + +get__moncycle_app_pc_compte_actif_fertilitycare(){ + echo $(echo "$statistiques" | grep -Poi 'app_pc_compte_actif_fertilitycare \K.*')"%" +} + +get__moncycle_app_nb_compte_actif_fertilitycare_temp(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_actif_fertilitycare_temp \K.*' +} + +get__moncycle_app_pc_compte_actif_fertilitycare_temp(){ + echo $(echo "$statistiques" | grep -Poi 'app_pc_compte_actif_fertilitycare_temp \K.*')"%" +} + +get__moncycle_app_nb_compte_recent(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_compte_recent \K.*' +} + +get__moncycle_app_nb_cycle(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_cycle \K.*' +} + +get__moncycle_app_nb_cycle_recent(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_cycle_recent \K.*' +} + +get__moncycle_app_age_moyen(){ + echo "$statistiques" | grep -Poi 'moncycle_app_age_moyen \K.*' +} + +get__moncycle_app_age_moyen_recent(){ + echo "$statistiques" | grep -Poi 'moncycle_app_age_moyen_recent \K.*' +} + +get__moncycle_app_nb_total_observation(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_total_observation \K.*' +} + +get__moncycle_app_nb_observation_aujourdhui(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_observation_aujourdhui \K.*' +} + +get__moncycle_app_nb_observation_1j(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_observation_1j \K.*' +} + +get__moncycle_app_nb_observation_5j(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_observation_5j \K.*' +} + +get__moncycle_app_nb_observation_15j(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_observation_15j \K.*' +} + +get__moncycle_app_nb_observation_30j(){ + echo "$statistiques" | grep -Poi 'moncycle_app_nb_observation_30j \K.*' +} + #================================================= # GENERIC FINALIZATION #================================================= From a5476abab2a28ba0008ab871808b6cda5082fc96 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 10:14:57 +0700 Subject: [PATCH 38/41] Update config_panel.toml --- config_panel.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index c2e4afa..19e37ee 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -13,12 +13,12 @@ services = [ 'php8.3-fpm'] yes = true no = false default = true - help = "Créez votre propre compte avant de fermer cette option !" + help = "N'oubliez pas de créer votre propre compte avant de fermer cette option !" [main.comptes.connexion_compte] ask.en = "Enable account connexion" ask.fr = "Permettre la connexion aux comptes" - help = "La connexion sera désactivée pour l'ensemble des utilisateurs de l'instance" + help = "La connexion sera activée ou désactivée pour l'ensemble des utilisateurs de l'instance" type = "boolean" yes = true no = false @@ -124,7 +124,7 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif] - ask.fr = "Pourcentage de comptes actifs" + ask.fr = "Part de comptes actifs" type = "string" readonly = true @@ -139,7 +139,7 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_billings] - ask.fr = "Pourcentage de comptes actifs Billings" + ask.fr = "Part de comptes actifs Billings" type = "string" readonly = true @@ -149,7 +149,7 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_billings_temp] - ask.fr = "Pourcentage de comptes actifs Billings" + ask.fr = "Part de comptes actifs Billings" type = "string" readonly = true @@ -159,7 +159,7 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_fertilitycare] - ask.fr = "Pourcentage de comptes actifs Fertility Care" + ask.fr = "Part de comptes actifs Fertility Care" type = "string" readonly = true @@ -169,7 +169,7 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_fertilitycare_temp] - ask.fr = "Pourcentage de comptes actifs Fertility Care" + ask.fr = "Part de comptes actifs Fertility Care" type = "string" readonly = true From 70b462209af6b1ff59779cb60e3a700f39df3600 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 10:17:04 +0700 Subject: [PATCH 39/41] Update config.php if change URL --- scripts/change_url | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 30276c1..050ace5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -19,6 +19,14 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config +#================================================= +# MODIFY CONFIG.PHP +#================================================= + +ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php" +chmod 400 "$install_dir/config.php" +chown $app:$app "$install_dir/config.php" + #================================================= # END OF SCRIPT #================================================= From 9ebb9a2d1aa65da37ebf0b1d971ae3fac991d050 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 23 Feb 2024 10:19:48 +0700 Subject: [PATCH 40/41] Update config_panel.toml --- config_panel.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 19e37ee..e2880fc 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -144,12 +144,12 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_nb_compte_actif_billings_temp] - ask.fr = "Nombre de comptes Billings actifs" + ask.fr = "Nombre de comptes Billings avec température actifs" type = "number" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_billings_temp] - ask.fr = "Part de comptes actifs Billings" + ask.fr = "Part de comptes actifs Billings avec température" type = "string" readonly = true @@ -164,12 +164,12 @@ name = "Statistiques" readonly = true [statistics.comptes.moncycle_app_nb_compte_actif_fertilitycare_temp] - ask.fr = "Nombre de comptes Fertility Care actifs" + ask.fr = "Nombre de comptes Fertility Care avec température actifs" type = "number" readonly = true [statistics.comptes.moncycle_app_pc_compte_actif_fertilitycare_temp] - ask.fr = "Part de comptes actifs Fertility Care" + ask.fr = "Part de comptes actifs FC avec température" type = "string" readonly = true From e8316a91913457d5e9e3f12b46f3e1ec8fa00133 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 23 Feb 2024 16:32:14 +0000 Subject: [PATCH 41/41] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ea8cbd..25ebe52 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Make it easy to monitor menstrual cycles and apply natural methods. Billings. Sy - automatic sending of cycles by email - no data sales/no advertising -**Shipped version:** 10.0~ynh1 +**Shipped version:** 10.0~ynh2 **Demo:** https://tableau.moncycle.app/connexion.php?email1=demo@moncycle.app&mdp=demo diff --git a/README_fr.md b/README_fr.md index 3c8515c..7ea2d2c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -36,7 +36,7 @@ Rendre facile le suivi des cycles menstruels et l’application des méthodes na - pas de vente de données/pas de publicité -**Version incluse :** 10.0~ynh1 +**Version incluse :** 10.0~ynh2 **Démo :** https://tableau.moncycle.app/connexion.php?email1=demo@moncycle.app&mdp=demo