add option to select non latest versions, fix #11

2.28
Jean-Christian Paul Denis 2023-05-24 22:59:19 +02:00
parent 9a329fdc76
commit 4fe8e1dcb5
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 31 additions and 68 deletions

View File

@ -1,191 +1,132 @@
# Language: Français
# Module: pacKman - 2023.03.14
# Date: 2023-03-18 16:15:39
# Author: , contact@jcdenis.fr
# Translated with translater 2023.03.17
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: pacKman 2023.03.14\n" "Project-Id-Version: pacKman 2023.05.13\n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2023-03-18T16:15:39+00:00\n" "PO-Revision-Date: 2023-05-24T20:51:11+00:00\n"
"Last-Translator: Jean-Christian Denis\n" "Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/Config.php:65
msgid "Configuration has been successfully updated." msgid "Configuration has been successfully updated."
msgstr "La configuration a été mise à jour avec succès." msgstr "La configuration a été mise à jour avec succès."
#: src/Config.php:95
msgid "Hide distributed modules from lists" msgid "Hide distributed modules from lists"
msgstr "Ne pas afficher dans les listes les modules de la distribution" msgstr "Ne pas afficher dans les listes les modules de la distribution"
#: src/Config.php:98
#: src/Utils.php:138
msgid "Root" msgid "Root"
msgstr "Racine" msgstr "Racine"
#: src/Config.php:101
msgid "Path to repository:" msgid "Path to repository:"
msgstr "Chemin vers le dépôt :" msgstr "Chemin vers le dépôt :"
#: src/Config.php:106
msgid "Preconization: %s" msgid "Preconization: %s"
msgstr "Préconisation : %s" msgstr "Préconisation : %s"
#: src/Config.php:108
msgid "Blog's public directory" msgid "Blog's public directory"
msgstr "Répertoire public du blog" msgstr "Répertoire public du blog"
#: src/Config.php:109
msgid "Leave it empty to use Dotclear VAR directory" msgid "Leave it empty to use Dotclear VAR directory"
msgstr "Laisser vide pour utiliser le répertoire VAR de Dotclear" msgstr "Laisser vide pour utiliser le répertoire VAR de Dotclear"
#: src/Config.php:112
msgid "Files" msgid "Files"
msgstr "Fichiers" msgstr "Fichiers"
#: src/Config.php:115
msgid "Name of exported package:" msgid "Name of exported package:"
msgstr "Nom du paquetage exporté :" msgstr "Nom du paquetage exporté :"
#: src/Config.php:121
msgid "Name of second exported package:" msgid "Name of second exported package:"
msgstr "Nom du second paquetage exporté :" msgstr "Nom du second paquetage exporté :"
#: src/Config.php:128
msgid "Overwrite existing package" msgid "Overwrite existing package"
msgstr "Écraser les paquetages existants" msgstr "Écraser les paquetages existants"
#: src/Config.php:134
msgid "Extra files to exclude from package:" msgid "Extra files to exclude from package:"
msgstr "Fichiers supplémentaires à exclure du paquetage :" msgstr "Fichiers supplémentaires à exclure du paquetage :"
#: src/Config.php:141
msgid "Remove comments from files" msgid "Remove comments from files"
msgstr "Retirer les commentaires des fichiers" msgstr "Retirer les commentaires des fichiers"
#: src/Config.php:146
msgid "Fix newline style from files content" msgid "Fix newline style from files content"
msgstr "Corriger les retour chariot du contenu des fichiers" msgstr "Corriger les retour chariot du contenu des fichiers"
#: src/Core.php:183
msgid "Directory is not writable"
msgstr "Le répertoire n'est pas accessible en écriture"
#: src/Core.php:195
msgid "Failed to get module info" msgid "Failed to get module info"
msgstr "Impossible de retrouver les informations du module" msgstr "Impossible de retrouver les informations du module"
#: src/Core.php:258 msgid "Directory is not writable"
msgid "Failed to get temporary directory" msgstr "Le répertoire n'est pas accessible en écriture"
msgstr "Impossible de retrouver le répertoire temporaire"
#: src/Manage.php:110
msgid "No modules selected." msgid "No modules selected."
msgstr "Aucun module sélectionné." msgstr "Aucun module sélectionné."
#: src/Manage.php:148
msgid "Package successfully created." msgid "Package successfully created."
msgstr "Paquetage créé avec succès." msgstr "Paquetage créé avec succès."
#: src/Manage.php:162
msgid "Undeletable file \"%s\"" msgid "Undeletable file \"%s\""
msgstr "Impossible de supprimer le fichier \"%s\"" msgstr "Impossible de supprimer le fichier \"%s\""
#: src/Manage.php:172
msgid "Package successfully deleted." msgid "Package successfully deleted."
msgstr "Paquetage effacé avec succès." msgstr "Paquetage effacé avec succès."
#: src/Manage.php:200
msgid "Package successfully installed." msgid "Package successfully installed."
msgstr "Paquetage installé avec succès." msgstr "Paquetage installé avec succès."
#: src/Manage.php:226
msgid "Package successfully copied." msgid "Package successfully copied."
msgstr "Paquetage copié avec succès." msgstr "Paquetage copié avec succès."
#: src/Manage.php:253
msgid "Package successfully moved." msgid "Package successfully moved."
msgstr "Paquetage déplacé avec succès." msgstr "Paquetage déplacé avec succès."
#: src/Manage.php:304
msgid "pacKman is not well configured."
msgstr "pacKman n'est pas correctement configuré."
#: src/Manage.php:305
msgid "Configuration"
msgstr "Configuration"
#: src/Manage.php:323
msgid "Plugins root" msgid "Plugins root"
msgstr "Racine des plugins" msgstr "Racine des plugins"
#: src/Manage.php:329
msgid "Themes root" msgid "Themes root"
msgstr "Racine des thèmes" msgstr "Racine des thèmes"
#: src/Manage.php:338
msgid "Packages repository" msgid "Packages repository"
msgstr "Dépôt de paquetages" msgstr "Dépôt de paquetages"
#: src/Utils.php:46
msgid "Cache directory is not writable."
msgstr "Le répertoire de cache n'est pas accessible en écriture."
#: src/Utils.php:51
msgid "Path to repository is not writable." msgid "Path to repository is not writable."
msgstr "Le chemin vers le dépôt n'est pas accessible en écriture." msgstr "Le chemin vers le dépôt n'est pas accessible en écriture."
#: src/Utils.php:57
msgid "You must specify the name of package to export." msgid "You must specify the name of package to export."
msgstr "Vous devez spécifier le nom du paquetage exporté." msgstr "Vous devez spécifier le nom du paquetage exporté."
#: src/Utils.php:63
msgid "Path to first export package is not writable." msgid "Path to first export package is not writable."
msgstr "Le chemin vers le premier paquetage exporté n'est pas accessible en écriture." msgstr "Le chemin vers le premier paquetage exporté n'est pas accessible en écriture."
#: src/Utils.php:69
msgid "Path to second export package is not writable." msgid "Path to second export package is not writable."
msgstr "Le chemin vers le second paquetage exporté n'est pas accessible en écriture." msgstr "Le chemin vers le second paquetage exporté n'est pas accessible en écriture."
#: src/Utils.php:175
msgid "Pack up selected modules" msgid "Pack up selected modules"
msgstr "Emballer les modules sélectionnés" msgstr "Emballer les modules sélectionnés"
#: src/Utils.php:201
msgid "install" msgid "install"
msgstr "installer" msgstr "installer"
#: src/Utils.php:204
msgid "copy to %s directory" msgid "copy to %s directory"
msgstr "copier dans le répertoire des %s" msgstr "copier dans le répertoire des %s"
#: src/Utils.php:204
msgid "plugins" msgid "plugins"
msgstr "extensions" msgstr "extensions"
#: src/Utils.php:205
msgid "move to %s directory" msgid "move to %s directory"
msgstr "déplacer dans le repertoire des %s" msgstr "déplacer dans le repertoire des %s"
#: src/Utils.php:208
msgid "themes" msgid "themes"
msgstr "thèmes" msgstr "thèmes"
#: src/Utils.php:212
msgid "repository" msgid "repository"
msgstr "dépôt" msgstr "dépôt"
#: src/Utils.php:222 msgid "Select non lastest versions"
msgstr "Sélectionner les versions anciennes"
msgid "File" msgid "File"
msgstr "Fichier" msgstr "Fichier"
#: src/Utils.php:265
msgid "Selected modules action:" msgid "Selected modules action:"
msgstr "Action sur les modules sélectionnés :" msgstr "Action sur les modules sélectionnés :"

View File

@ -24,6 +24,7 @@ use Dotclear\Helper\Html\Form\{
Form, Form,
Hidden, Hidden,
Label, Label,
Link,
Para, Para,
Select, Select,
Submit, Submit,
@ -203,13 +204,32 @@ class Utils
$combo_action[sprintf(__('move to %s directory'), __('repository'))] = 'move_to_repository'; $combo_action[sprintf(__('move to %s directory'), __('repository'))] = 'move_to_repository';
} }
$helpers_addon = [];
if ($type == 'repository') {
$helpers_addon[] = (new Link())
->class('button')
->href(dcCore::app()->adminurl?->get('admin.plugin.' . My::id(), ['purge' => 1]) . '#packman-repository-' . $type)
->text(__('Select non lastest versions'))
;
}
$versions = [];
if (!empty($_REQUEST['purge']) && $type = 'repository') {
foreach ($modules as $module) {
if (!isset($versions[$module->getId()]) || version_compare($module->get('version'), $versions[$module->getId()], '>')) {
$versions[$module->getId()] = $module->get('version');
}
}
}
$dup = $tbody = []; $dup = $tbody = [];
$i = 1; $i = 1;
self::sort($modules); self::sort($modules);
foreach ($modules as $module) { foreach ($modules as $module) {
if (isset($dup[$module->get('root')])) { if (isset($dup[$module->get('root')])) {
continue; //continue;
} }
$checked = isset($versions[$module->getId()]) && version_compare($versions[$module->getId()], $module->get('version'), '>');
$dup[$module->get('root')] = 1; $dup[$module->get('root')] = 1;
@ -219,7 +239,7 @@ class Utils
(new Para(null, 'td')) (new Para(null, 'td'))
->class('nowrap') ->class('nowrap')
->items([ ->items([
(new Checkbox(['modules[' . Html::escapeHTML($module->get('root')) . ']', 'r_modules_' . $type . $i], false)) (new Checkbox(['modules[' . Html::escapeHTML($module->get('root')) . ']', 'r_modules_' . $type . $i], $checked))
->value(Html::escapeHTML($module->getId())), ->value(Html::escapeHTML($module->getId())),
(new Label(Html::escapeHTML($module->getId()), Label::OUTSIDE_LABEL_AFTER)) (new Label(Html::escapeHTML($module->getId()), Label::OUTSIDE_LABEL_AFTER))
->class('classic') ->class('classic')
@ -281,6 +301,8 @@ class Utils
]), ]),
(new Para()) (new Para())
->class('checkboxes-helpers'), ->class('checkboxes-helpers'),
(new Para())
->items($helpers_addon),
(new Para())->class('col right') (new Para())->class('col right')
->items([ ->items([
(new Text(null, __('Selected modules action:') . ' ')), (new Text(null, __('Selected modules action:') . ' ')),