Skip to content

Commit

Permalink
Released version 3.4.18.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Apr 29, 2024
1 parent 9e9f33a commit cd0f06c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ protected function preInstall(): void
}

$this->installDir();

$config = $services->get('Config');
$basePath = $config['file_store']['local']['base_path'] ?: (OMEKA_PATH . '/files');
$settings = $services->get('Omeka\Settings');
$settings->set('easyadmin_local_path', $settings->get('bulkimport_local_path') ?: $basePath . '/preload');
$settings->set('easyadmin_allow_empty_files', (bool) $settings->get('bulkimport_allow_empty_files'));
}

protected function installDir(): void
Expand Down
2 changes: 1 addition & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
'resource_public_view',
// 'resource_previous_next',
],
'easyadmin_local_path' => OMEKA_PATH . '/files/import',
'easyadmin_local_path' => OMEKA_PATH . '/files/preload',
'easyadmin_allow_empty_files' => false,
'easyadmin_addon_notify_version_inactive' => true,
'easyadmin_addon_notify_version_dev' => false,
Expand Down
4 changes: 2 additions & 2 deletions config/module.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

[info]
name = "Easy Admin"
description = "Manage tasks from the admin interface: install modules and themes, check database and files, block concurrent edition, run cron tasks."
description = "Manage tasks from the admin interface: install modules and themes, check database and files, bulk upload without limits, block concurrent edition, run cron tasks."
tags = "administration, miscellaneous, cron task, check, curation"
license = "CeCILL v2.1"
author = "Daniel Berthereau"
author_link = "https://gitlab.com/Daniel-KM"
module_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-EasyAdmin"
support_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-EasyAdmin/-/issues"
configurable = false
version = "3.4.17"
version = "3.4.18"
omeka_version_constraint = "^4.0.0"
dependencies = "Common"
46 changes: 41 additions & 5 deletions data/scripts/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$api = $plugins->get('api');
$settings = $services->get('Omeka\Settings');
$translate = $plugins->get('translate');
$translator = $services->get('MvcTranslator');
$connection = $services->get('Omeka\Connection');
$messenger = $plugins->get('messenger');
$entityManager = $services->get('Omeka\EntityManager');
Expand Down Expand Up @@ -72,7 +73,6 @@
if (version_compare($oldVersion, '3.3.6', '<')) {
$sqlFile = $this->modulePath() . '/data/install/schema.sql';
if (!$this->checkNewTablesFromFile($sqlFile)) {
$translator = $services->get('MvcTranslator');
$message = new PsrMessage(
$translator->translate('This module cannot install its tables, because they exist already. Try to remove them first.') // @translate
);
Expand Down Expand Up @@ -144,7 +144,7 @@
}

$maintenanceStatus = $settings->get('maintenance_status', false) ? 'no' : 'public';
$maintenanceText = $settings->get('maintenance_text') ?: $services->get('MvcTranslator')->translate('This site is down for maintenance. Please contact the site administrator for more information.'); // @translate
$maintenanceText = $settings->get('maintenance_text') ?: $translate('This site is down for maintenance. Please contact the site administrator for more information.'); // @translate
$settings->set('easyadmin_maintenance_status', $maintenanceStatus);
$settings->set('easyadmin_maintenance_text', $maintenanceText); // @translate

Expand Down Expand Up @@ -248,16 +248,52 @@
'The directory "{dir}" is not writeable.', // @translate
['dir' => $basePath]
);
throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message);
throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message->setTranslator($translator));
}

$message = new PsrMessage(
'A new task allow to backup Omeka installation files (without directory /files).' // @translate
'A new task allows to backup Omeka installation files (without directory /files).' // @translate
);
$messenger->addSuccess($message);

$message = new PsrMessage(
'A new task allow to clear php caches (code and data), in particular after an update or direct modification of code.' // @translate
'A new task allows to clear php caches (code and data), in particular after an update or direct modification of code.' // @translate
);
$messenger->addSuccess($message);
}

if (version_compare($oldVersion, '3.4.18', '<')) {
$settings->set('easyadmin_local_path', $settings->get('bulkimport_local_path') ?: $basePath . '/preload');
$settings->set('easyadmin_allow_empty_files', (bool) $settings->get('bulkimport_allow_empty_files'));
$settings->set('easyadmin_addon_notify_version_inactive', true);
$settings->set('easyadmin_addon_notify_version_dev', false);

if (!$this->checkDestinationDir($settings->get('easyadmin_local_path'))) {
$message = new PsrMessage(
'The directory "{dir}" is not writeable.', // @translate
['dir' => $basePath]
);
throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message->setTranslator($translator));
}

$message = new PsrMessage(
'A new task allows to loop resources, for example to manage a new setting in template or in parameters via triggers.' // @translate
);
$messenger->addSuccess($message);

$message = new PsrMessage(
'It is now possible to bulk upload files without any server limit (file size, post size, number of files) in item form and in a separate form (feature moved from module {link_module}Bulk Import{link_end}, fix {link_github}omeka/omeka-s #1785{link_end}).', // @translate
[
'link_module' => '<a href="https://gitlab.com/Daniel-KM/Omeka-S-module-BulkImport" target="_blank" rel="noopener">',
'link_end' => '</a>',
'link_github' => '<a href="https://github.com/omeka/omeka-s/issues/1785" target="_blank" rel="noopener">',
]
);
$message->setEscapeHtml(false);
$messenger->addSuccess($message);

$message = new PsrMessage(
'A new option allows to notify new version of inactive modules.' // @translate
);
$messenger->addSuccess($message);
}

0 comments on commit cd0f06c

Please sign in to comment.