diff --git a/.composer-require-checker.config.json b/.composer-require-checker.config.json index 26bde63..f49e224 100644 --- a/.composer-require-checker.config.json +++ b/.composer-require-checker.config.json @@ -23,6 +23,7 @@ "// Galette constants (not detected as they are dynamically declared)", "GALETTE_ATTACHMENTS_PATH", + "GALETTE_ADAPTATIVE_CARDS", "GALETTE_BASE_PATH", "GALETTE_CACHE_DIR", "GALETTE_CARD_COLS", diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 2ad1cf0..8393926 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -205,15 +205,17 @@ jobs: POSTGRES_HOST: localhost POSTGRES_PORT: 5432 run: | - PGPASSWORD=g@l3tte psql -d galette_tests -a -f galette-core/galette/install/scripts/pgsql.sql -U galette_tests -h localhost - PGPASSWORD=g@l3tte psql -d galette_tests -a -f galette-core/galette/plugins/plugin-auto/scripts/pgsql.sql -U galette_tests -h localhost + cd galette-core + bin/console galette:install -v --dbtype=pgsql --dbhost=localhost --dbname=galette_tests --dbuser=galette_tests --dbpass=g@l3tte --admin=admin --password=admin --no-interaction -w + bin/console galette:plugins:install-db --all if: env.skip != 'true' && startsWith(matrix.db-image, 'postgres') - name: Init for MariaDB run: | + cd galette-core mysql -e 'create database IF NOT EXISTS galette_tests;' -u galette_tests --password=g@l3tte -h 127.0.0.1 -P 3306 - mysql -e 'use galette_tests; source galette-core/galette/install/scripts/mysql.sql;' -u galette_tests --password=g@l3tte -h 127.0.0.1 -P 3306 - mysql -e 'use galette_tests; source galette-core/galette/plugins/plugin-auto/scripts/mysql.sql;' -u galette_tests --password=g@l3tte -h 127.0.0.1 -P 3306 + bin/console galette:install -v --dbtype=mysql --dbhost=127.0.0.1 --dbname=galette_tests --dbuser=galette_tests --dbpass=g@l3tte --admin=admin --password=admin --no-interaction -w + bin/console galette:plugins:install-db --all if: env.skip != 'true' && (startsWith(matrix.db-image, 'mysql') || startsWith(matrix.db-image, 'mariadb')) - name: Unit tests diff --git a/_define.php b/_define.php index afd147a..f2d86ed 100644 --- a/_define.php +++ b/_define.php @@ -25,10 +25,10 @@ 'Galette Auto', //Name 'Plugin to manage Automobile clubs', //Short description 'Johan Cwiklinski', //Author - '2.1.1', //Version - '1.1.0', //Galette compatible version + '2.1.2', //Version + '1.1.4', //Galette compatible version 'auto', //routing name - '2024-07-06', //Release date + '2024-10-20', //Release date [ //routes permissions 'vehiclesList' => 'groupmanager', 'memberVehiclesList' => 'groupmanager', diff --git a/lang/auto_es.utf8.po b/lang/auto_es.utf8.po index cd7ce3c..e980a3f 100644 --- a/lang/auto_es.utf8.po +++ b/lang/auto_es.utf8.po @@ -10,22 +10,23 @@ # Cow , 2022. # Carlos Cruzyc , 2022. # Javier , 2022. -# gallegonovato , 2022. +# gallegonovato , 2022, 2024. +# Kamborio , 2024. msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" +"Report-Msgid-Bugs-To: translations@galette.eu\n" "POT-Creation-Date: 2024-02-23 08:39+0100\n" -"PO-Revision-Date: 2023-09-20 00:29+0000\n" -"Last-Translator: Johan Cwiklinski \n" -"Language-Team: Spanish \n" +"PO-Revision-Date: 2024-10-18 12:15+0000\n" +"Last-Translator: gallegonovato \n" +"Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.8-rc\n" #: ../_routes.php:125 msgid "No vehicle was selected, please check at least one name." @@ -89,12 +90,11 @@ msgstr "Quitar modelo «%1$s»" #: ../lib/GaletteAuto/Controllers/Crud/ModelsController.php:389 msgid "This model is used by one or more vehicles, it cannot be deleted." msgstr "" +"Este modelo es utilizado por uno o más vehículos, no puede ser eliminado." #: ../lib/GaletteAuto/Controllers/Crud/ModelsController.php:394 -#, fuzzy -#| msgid "An error occurred while trying to delete car's photo" msgid "An error occurred while deleting model." -msgstr "Ha ocurrido un error al intentar eliminar la foto del auto" +msgstr "Se ha producido un error al borrar el modelo." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:189 #: ../lib/GaletteAuto/PluginGaletteAuto.php:61 @@ -158,7 +158,7 @@ msgstr "Añadir marca" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:332 msgid "New" -msgstr "Crear" +msgstr "Nuevo" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:338 #, php-format @@ -193,113 +193,99 @@ msgid "Remove %1$s %2$s" msgstr "Retirar %1$s %2$s" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:607 -#, fuzzy, php-format -#| msgid "%count %property have been successfully deleted." +#, php-format msgid "%1$s color has been successfully deleted." msgid_plural "%1$s colors have been successfully deleted." -msgstr[0] "%count propiedad %property ha sido correctamente eliminada." -msgstr[1] "%count propiedad %property ha sido correctamente eliminada." +msgstr[0] "El color %1$s ha sido eliminado correctamente." +msgstr[1] "Los colores %1$s han sido eliminados correctamente." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:611 -#, fuzzy, php-format -#| msgid "%count vehicles have been successfully deleted." +#, php-format msgid "%1$s state has been successfully deleted." msgid_plural "%1$s states have been successfully deleted." -msgstr[0] "Se han eliminado %count vehículos correctamente." -msgstr[1] "Se han eliminado %count vehículos correctamente." +msgstr[0] "La situación %1$s ha sido eliminada correctamente." +msgstr[1] "Las situaciones %1$s han sido eliminadas correctamente." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:615 -#, fuzzy, php-format -#| msgid "%count vehicles have been successfully deleted." +#, php-format msgid "%1$s finition has been successfully deleted." msgid_plural "%1$s finitions have been successfully deleted." -msgstr[0] "Se han eliminado %count vehículos correctamente." -msgstr[1] "Se han eliminado %count vehículos correctamente." +msgstr[0] "El acabado %1$s ha sido borrado correctamente." +msgstr[1] "Los acabados %1$s han sido borrados correctamente." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:619 -#, fuzzy, php-format -#| msgid "%count %property have been successfully deleted." +#, php-format msgid "%1$s body has been successfully deleted." msgid_plural "%1$s bodies have been successfully deleted." -msgstr[0] "%count propiedad %property ha sido correctamente eliminada." -msgstr[1] "%count propiedad %property ha sido correctamente eliminada." +msgstr[0] "El chasis %1$s ha sido eliminado correctamente." +msgstr[1] "Los chasis %1$s han sido eliminados correctamente." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:623 -#, fuzzy, php-format -#| msgid "%count vehicles have been successfully deleted." +#, php-format msgid "%1$s transmission has been successfully deleted." msgid_plural "%1$s transmissions have been successfully deleted." -msgstr[0] "Se han eliminado %count vehículos correctamente." -msgstr[1] "Se han eliminado %count vehículos correctamente." +msgstr[0] "La transmisión %1$s ha sido eliminada correctamente." +msgstr[1] "Las transmisiones %1$s han sido eliminadas correctamente." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:627 -#, fuzzy, php-format -#| msgid "%count %property have been successfully deleted." +#, php-format msgid "%1$s brand has been successfully deleted." msgid_plural "%1$s brands have been successfully deleted." -msgstr[0] "%count propiedad %property ha sido correctamente eliminada." -msgstr[1] "%count propiedad %property ha sido correctamente eliminada." +msgstr[0] "La marca %1$s ha sido eliminada correctamente." +msgstr[1] "Las marcas %1$s han sido eliminadas correctamente." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:644 msgid "This color is used by one or more vehicles, it cannot be deleted." msgstr "" +"Este color es utilizado por uno o más vehículos, no puede ser eliminado." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:648 msgid "This state is used by one or more vehicles, it cannot be deleted." msgstr "" +"Este estado es utilizado por uno o más vehículos, no puede ser eliminado." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:652 msgid "This finition is used by one or more vehicles, it cannot be deleted." msgstr "" +"Este acabado es utilizado por uno o más vehículos, no se puede eliminar." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:656 msgid "This body is used by one or more vehicles, it cannot be deleted." -msgstr "" +msgstr "Este chasis es utilizada por uno o más vehículos, no se puede eliminar." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:660 msgid "" "This transmission is used by one or more vehicles, it cannot be deleted." msgstr "" +"Esta transmisión es utilizada por uno o más vehículos, no se puede eliminar." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:664 msgid "This brand is used by one or more vehicles, it cannot be deleted." -msgstr "" +msgstr "Esta marca es utilizada por uno o más vehículos, no se puede eliminar." #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:678 -#, fuzzy -#| msgid "An error occurred trying to remove vehicles :/" msgid "An error occurred trying to remove color :/" -msgstr "Ha ocurrido un error intentando retirar vehículos :/" +msgstr "Se ha producido un error al intentar eliminar el color :/" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:682 -#, fuzzy -#| msgid "An error occurred trying to remove vehicles :/" msgid "An error occurred trying to remove state :/" -msgstr "Ha ocurrido un error intentando retirar vehículos :/" +msgstr "Se ha producido un error al intentar eliminar la situación :/" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:686 -#, fuzzy -#| msgid "An error occurred trying to remove vehicles :/" msgid "An error occurred trying to remove finition :/" -msgstr "Ha ocurrido un error intentando retirar vehículos :/" +msgstr "Se ha producido un error al intentar eliminar el acabado :/" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:690 -#, fuzzy -#| msgid "An error occurred trying to remove %property :/" msgid "An error occurred trying to remove body :/" -msgstr "Ha ocurrido un error al intentar retirar la propiedad %property :/" +msgstr "Se ha producido un error al intentar eliminar el chasis :/" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:694 -#, fuzzy -#| msgid "An error occurred trying to remove vehicles :/" msgid "An error occurred trying to remove transmission :/" -msgstr "Ha ocurrido un error intentando retirar vehículos :/" +msgstr "Se ha producido un error al intentar eliminar la transmisión :/" #: ../lib/GaletteAuto/Controllers/Crud/PropertiesController.php:698 -#, fuzzy -#| msgid "An error occurred trying to remove %property :/" msgid "An error occurred trying to remove brand :/" -msgstr "Ha ocurrido un error al intentar retirar la propiedad %property :/" +msgstr "Se ha producido un error al intentar eliminar la marca :/" #: ../lib/GaletteAuto/Controllers/Controller.php:90 msgid "You do not have enough privileges." @@ -460,11 +446,11 @@ msgstr "Modelo" #: ../lib/GaletteAuto/Auto.php:173 ../tempcache/vehicles.html.twig:404 #: ../tempcache/history.html.twig:70 ../tempcache/history.html.twig:142 msgid "Registration" -msgstr "Registro" +msgstr "Inscripción" #: ../lib/GaletteAuto/Auto.php:174 ../tempcache/vehicles.html.twig:142 msgid "First registration date" -msgstr "Fecha del primer registro" +msgstr "Primera fecha de inscripción" #: ../lib/GaletteAuto/Auto.php:175 ../tempcache/vehicles.html.twig:148 msgid "First circulation date" @@ -533,7 +519,7 @@ msgstr "Auto actualizado" #: ../lib/GaletteAuto/Auto.php:698 msgid "- Maximum size for %field is %maxsize (current %cursize)!" -msgstr "" +msgstr "- ¡El tamaño máximo de %field es %maxsize (%cursize actual)!" #: ../lib/GaletteAuto/Auto.php:741 #, php-format diff --git a/lang/auto_fr_FR.utf8.po b/lang/auto_fr_FR.utf8.po index b58137e..20caeb9 100644 --- a/lang/auto_fr_FR.utf8.po +++ b/lang/auto_fr_FR.utf8.po @@ -16,7 +16,7 @@ msgstr "" "Project-Id-Version: fr_FR@euro\n" "Report-Msgid-Bugs-To: translations@galette.eu\n" "POT-Creation-Date: 2024-02-23 08:39+0100\n" -"PO-Revision-Date: 2024-07-02 19:43+0000\n" +"PO-Revision-Date: 2024-09-15 07:51+0000\n" "Last-Translator: Johan Cwiklinski \n" "Language-Team: French \n" @@ -25,7 +25,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.7-dev\n" +"X-Generator: Weblate 5.8-dev\n" #: ../_routes.php:125 msgid "No vehicle was selected, please check at least one name." @@ -383,7 +383,7 @@ msgstr "- Vous devez sélectionner une marque !" #: ../tempcache/vehicles.html.twig:370 ../tempcache/history.html.twig:76 #: ../tempcache/history.html.twig:148 msgid "Color" -msgstr "Coleur" +msgstr "Couleur" #: ../lib/GaletteAuto/Color.php:100 #, php-format diff --git a/lang/es.utf8/LC_MESSAGES/auto.mo b/lang/es.utf8/LC_MESSAGES/auto.mo index cf3a919..6ce3f19 100644 Binary files a/lang/es.utf8/LC_MESSAGES/auto.mo and b/lang/es.utf8/LC_MESSAGES/auto.mo differ diff --git a/lang/fr_FR.utf8/LC_MESSAGES/auto.mo b/lang/fr_FR.utf8/LC_MESSAGES/auto.mo index 0fd3df0..708f643 100644 Binary files a/lang/fr_FR.utf8/LC_MESSAGES/auto.mo and b/lang/fr_FR.utf8/LC_MESSAGES/auto.mo differ diff --git a/lib/GaletteAuto/PluginGaletteAuto.php b/lib/GaletteAuto/PluginGaletteAuto.php index 3fa9ecf..3aec7b9 100644 --- a/lib/GaletteAuto/PluginGaletteAuto.php +++ b/lib/GaletteAuto/PluginGaletteAuto.php @@ -140,19 +140,12 @@ public static function getPublicMenusItemsList(): array } /** - * Get dashboards contents + * Get current logged-in user dashboards contents * * @return array|array[] */ - public static function getDashboardsContents(): array + public static function getMyDashboardsContents(): array { - /** @var Login $login */ - global $login; - - if ($login->isSuperAdmin()) { - return []; - } - return [ [ 'label' => _T("My cars", "auto"), @@ -164,6 +157,16 @@ public static function getDashboardsContents(): array ]; } + /** + * Get dashboards contents + * + * @return array|array[] + */ + public static function getDashboardsContents(): array + { + return []; + } + /** * Get actions contents * diff --git a/templates/default/vehicles.html.twig b/templates/default/vehicles.html.twig index 1e86a9b..7c6cd90 100644 --- a/templates/default/vehicles.html.twig +++ b/templates/default/vehicles.html.twig @@ -314,7 +314,7 @@ {% block javascripts %}