From ae4ed875ad4590a76a4bc3e2c7081a7ccf9b0f30 Mon Sep 17 00:00:00 2001 From: Jennifer Piva Date: Tue, 22 Feb 2022 14:04:43 +0000 Subject: [PATCH 01/22] Translated using Weblate (German) Currently translated at 99.7% (2811 of 2818 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/de/ --- resources/locales/messages.de.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index 52fec74ab8..868442ed3d 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -12153,7 +12153,7 @@ print:: add and remember password to protect the pdf - Ein Passwort für das Öffnen der PDF festlegen + Ein Passwort für das Öffnen der PDF festlegen (optional) prod/actions/printer_default.html.twig @@ -12265,7 +12265,7 @@ print:: some options - Weitere Optionen + Weitere Einstellungen prod/actions/printer_default.html.twig From 4e4485e63169282480d32c8a3dce27d25d2df988 Mon Sep 17 00:00:00 2001 From: Jennifer Piva Date: Tue, 22 Feb 2022 14:04:19 +0000 Subject: [PATCH 02/22] Translated using Weblate (English) Currently translated at 99.7% (2810 of 2818 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/en/ --- resources/locales/messages.en.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index 8a1b4d29f2..551c3cc264 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -12156,7 +12156,7 @@ print:: add and remember password to protect the pdf - Define a password to protect the PDF + Define a password to protect the PDF (optional) prod/actions/printer_default.html.twig @@ -12268,7 +12268,7 @@ print:: some options - More Options + Additional settings prod/actions/printer_default.html.twig From af437f0aeb54c2591f4742695b9aaf2e85d303ab Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Tue, 22 Feb 2022 14:03:13 +0000 Subject: [PATCH 03/22] Translated using Weblate (French) Currently translated at 99.7% (2812 of 2818 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/fr/ --- resources/locales/messages.fr.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index 29459baa37..e548a236ea 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -12156,7 +12156,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le print:: add and remember password to protect the pdf - Définir un mot de passe pour l'ouverture du PDF + Définir un mot de passe pour l'ouverture du PDF (optionnel) prod/actions/printer_default.html.twig @@ -12268,7 +12268,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le print:: some options - Options supplémentaires + Réglages supplémentaires prod/actions/printer_default.html.twig From e88202101999361e03c5f3bd564373d8a17ec226 Mon Sep 17 00:00:00 2001 From: aynsix Date: Thu, 24 Feb 2022 16:07:54 +0300 Subject: [PATCH 04/22] PHRAS-3642 api return subdefs --- .../Controller/Api/V3/V3Controller.php | 76 +++++++++++++++++++ .../Phrasea/ControllerProvider/Api/V3.php | 14 ++++ 2 files changed, 90 insertions(+) create mode 100644 lib/Alchemy/Phrasea/Controller/Api/V3/V3Controller.php diff --git a/lib/Alchemy/Phrasea/Controller/Api/V3/V3Controller.php b/lib/Alchemy/Phrasea/Controller/Api/V3/V3Controller.php new file mode 100644 index 0000000000..fe865f41c2 --- /dev/null +++ b/lib/Alchemy/Phrasea/Controller/Api/V3/V3Controller.php @@ -0,0 +1,76 @@ +attributes->get('databox_id'))) { + $ret = [ + 'databoxes' => $this->listSubdefsStructure([$this->findDataboxById($request->attributes->get('databox_id'))]) + ]; + } else { + $acl = $this->getAclForUser($this->getAuthenticatedUser()); + + // ensure can see databox structure + $ret = [ + 'databoxes' => $this->listSubdefsStructure($acl->get_granted_sbas([\ACL::BAS_MODIFY_STRUCT])) + ]; + } + + return Result::create($request, $ret)->createResponse(); + } + + /** + * List the subdef structure of databoxes + * @param array $databoxes + * @return array + * @throws \Exception + */ + private function listSubdefsStructure(array $databoxes) + { + $ret = []; + + /** @var \databox $databox */ + foreach ($databoxes as $databox) { + $databoxId = $databox->get_sbas_id(); + $subdefStructure = $databox->get_subdef_structure(); + $subdefs = []; + foreach ($subdefStructure as $subGroup) { + /** @var \databox_subdef $sub */ + foreach ($subGroup->getIterator() as $sub) { + $opt = []; + $data = [ + 'name' => $sub->get_name(), + 'databox_id' => $databoxId, + 'class' => $sub->get_class(), + 'preset' => $sub->get_preset(), + 'downloadable' => $sub->isDownloadable(), + 'devices' => $sub->getDevices(), + 'labels' => [ + 'fr' => $sub->get_label('fr'), + 'en' => $sub->get_label('en'), + 'de' => $sub->get_label('de'), + 'nl' => $sub->get_label('nl'), + ], + ]; + $options = $sub->getOptions(); + foreach ($options as $option) { + $opt[$option->getName()] = $option->getValue(); + } + $data['options'] = $opt; + $subdefs[$subGroup->getName()][$sub->get_name()] = $data; + } + } + $ret[$databoxId]['databox_id'] = $databoxId; + $ret[$databoxId]['subdefs'] = $subdefs; + } + + return $ret; + } +} diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Api/V3.php b/lib/Alchemy/Phrasea/ControllerProvider/Api/V3.php index 011000495d..e7797eaf92 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Api/V3.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Api/V3.php @@ -4,6 +4,7 @@ namespace Alchemy\Phrasea\ControllerProvider\Api; use Alchemy\Phrasea\Application as PhraseaApplication; use Alchemy\Phrasea\Controller\Api\V1Controller; +use Alchemy\Phrasea\Controller\Api\V3\V3Controller; use Alchemy\Phrasea\Controller\Api\V3\V3RecordController; use Alchemy\Phrasea\Controller\Api\V3\V3ResultHelpers; use Alchemy\Phrasea\Controller\Api\V3\V3SearchController; @@ -53,6 +54,9 @@ class V3 extends Api implements ControllerProviderInterface, ServiceProviderInte $app['controller.api.v3.stories'] = $app->share(function (PhraseaApplication $app) { return (new V3StoriesController($app)); }); + $app['controller.api.v3'] = $app->share(function (PhraseaApplication $app) { + return (new V3Controller($app)); + }); } public function boot(Application $app) @@ -150,6 +154,16 @@ class V3 extends Api implements ControllerProviderInterface, ServiceProviderInte $controllers->post('/subdefs_service/', 'controller.api.v3.subdefs_service:indexAction_POST'); } + /** + * @uses V3Controller::getDataboxSubdefsAction() + */ + $controllers->get('/databoxes/{databox_id}/subdefs/', 'controller.api.v3:getDataboxSubdefsAction') + ->before('controller.api.v1:ensureAccessToDatabox') + ->before('controller.api.v1:ensureCanSeeDataboxStructure') + ->assert('databox_id', '\d+'); + + $controllers->get('/databoxes/subdefs/', 'controller.api.v3:getDataboxSubdefsAction'); + return $controllers; } From 406a0ce9532205e6c6def06ef395020ac9fcd270 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Fri, 25 Feb 2022 10:11:49 +0100 Subject: [PATCH 05/22] PHRAS-3602 : add ThumbnailOrientation facet ; add strings --- .../Phrasea/Controller/Api/V1Controller.php | 2 +- .../Controller/Prod/QueryController.php | 5 +- .../Provider/SearchEngineServiceProvider.php | 3 +- .../Elastic/ElasticSearchEngine.php | 16 +++- .../Elastic/ElasticsearchOptions.php | 56 ++++++++---- .../Elastic/ElasticsearchSettingsFormType.php | 2 +- .../Record/Hydrator/SubDefinitionHydrator.php | 86 +++++++++++++------ .../MetadataTagToFieldMappingConverter.php | 19 ++++ .../Elastic/Search/FacetsResponse.php | 16 +++- lib/classes/media/subdef.php | 2 + 10 files changed, 156 insertions(+), 51 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php index 9f1cae2919..1632fe1571 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php @@ -2813,7 +2813,7 @@ class V1Controller extends Controller { $ret = [ "meta_fields" => $this->listUserAuthorizedMetadataFields($this->getAuthenticatedUser()), - "aggregable_fields" => $this->buildUserFieldList(ElasticsearchOptions::getAggregableTechnicalFields(), ['choices']), + "aggregable_fields" => $this->buildUserFieldList(ElasticsearchOptions::getAggregableTechnicalFields($this->app['translator']), ['choices']), "technical_fields" => $this->buildUserFieldList(media_subdef::getTechnicalFieldsList()), ]; diff --git a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php index 4ca7c3bf0f..d055206d18 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php @@ -76,7 +76,8 @@ class QueryController extends Controller $this->app['elasticsearch.client'], $query_context_factory, $this->app['elasticsearch.facets_response.factory'], - $this->app['elasticsearch.options'] + $this->app['elasticsearch.options'], + $this->app['translator'] ); $autocomplete = $engine->autocomplete($word, $options); @@ -351,7 +352,7 @@ class QueryController extends Controller // add technical fields $fieldsInfosByName = []; - foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { + foreach(ElasticsearchOptions::getAggregableTechnicalFields($this->app['translator']) as $k => $f) { $fieldsInfosByName[$k] = $f; $fieldsInfosByName[$k]['trans_label'] = $this->app->trans( /** @ignore */ $f['label']); $fieldsInfosByName[$k]['labels'] = []; diff --git a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php index bab1a62f28..71159f028e 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php @@ -96,7 +96,8 @@ class SearchEngineServiceProvider implements ServiceProviderInterface $app['elasticsearch.client'], $app['query_context.factory'], $app['elasticsearch.facets_response.factory'], - $app['elasticsearch.options'] + $app['elasticsearch.options'], + $app['translator'] ); }); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php index 43dc650c27..5eab435c70 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php @@ -33,6 +33,7 @@ use Closure; use databox_field; use Doctrine\Common\Collections\ArrayCollection; use Elasticsearch\Client; +use Symfony\Component\Translation\TranslatorInterface; class ElasticSearchEngine implements SearchEngineInterface { @@ -59,6 +60,8 @@ class ElasticSearchEngine implements SearchEngineInterface */ private $context_factory; + private $translator; + /** * @param Application $app * @param GlobalStructure $structure @@ -66,8 +69,9 @@ class ElasticSearchEngine implements SearchEngineInterface * @param QueryContextFactory $context_factory * @param Closure $facetsResponseFactory * @param ElasticsearchOptions $options + * @param TranslatorInterface $translator */ - public function __construct(Application $app, GlobalStructure $structure, Client $client, QueryContextFactory $context_factory, Closure $facetsResponseFactory, ElasticsearchOptions $options) + public function __construct(Application $app, GlobalStructure $structure, Client $client, QueryContextFactory $context_factory, Closure $facetsResponseFactory, ElasticsearchOptions $options, TranslatorInterface $translator) { $this->app = $app; $this->structure = $structure; @@ -75,6 +79,7 @@ class ElasticSearchEngine implements SearchEngineInterface $this->context_factory = $context_factory; $this->facetsResponseFactory = $facetsResponseFactory; $this->options = $options; + $this->translator = $translator; $this->indexName = $options->getIndexName(); } @@ -780,7 +785,7 @@ class ElasticSearchEngine implements SearchEngineInterface { $aggs = []; // technical aggregates (enable + optional limit) - foreach (ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { + foreach (ElasticsearchOptions::getAggregableTechnicalFields($this->translator) as $k => $f) { $size = $this->options->getAggregableFieldLimit($k); if ($size !== databox_field::FACET_DISABLED) { if ($size === databox_field::FACET_NO_LIMIT) { @@ -793,6 +798,13 @@ class ElasticSearchEngine implements SearchEngineInterface ] ]; $aggs[$k] = $agg; + if($options->getIncludeUnsetFieldFacet() === true) { + $aggs[$k . '#empty'] = [ + 'missing' => [ + 'field' => $f['esfield'], + ] + ]; + } } } // fields aggregates diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php index 4f7de4c7af..581bd42982 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic; use databox_field; use igorw; +use Symfony\Component\Translation\TranslatorInterface; class ElasticsearchOptions @@ -312,7 +313,7 @@ class ElasticsearchOptions $this->_customValues = igorw\assoc_in($this->_customValues, $keys, $value); } - public static function getAggregableTechnicalFields() + public static function getAggregableTechnicalFields(TranslatorInterface $translator) { return [ '_base' => [ @@ -338,21 +339,21 @@ class ElasticsearchOptions ], '_camera_model' => [ 'type' => 'string', - 'label' => 'Camera Model', + 'label' => 'prod::facet:CameraModel_label', 'field' => "meta.CameraModel", 'esfield' => 'metadata_tags.CameraModel', - 'query' => 'meta.CameraModel:%s', + 'query' => 'meta.CameraModel=%s', ], '_iso' => [ 'type' => 'number', - 'label' => 'ISO', + 'label' => 'prod::facet:ISO_label', 'field' => "meta.ISO", 'esfield' => 'metadata_tags.ISO', 'query' => 'meta.ISO=%s', ], '_aperture' => [ 'type' => 'number', - 'label' => 'Aperture', + 'label' => 'prod::facet:Aperture_label', 'field' => "meta.Aperture", 'esfield' => 'metadata_tags.Aperture', 'query' => 'meta.Aperture=%s', @@ -362,7 +363,7 @@ class ElasticsearchOptions ], '_shutterspeed' => [ 'type' => 'number', - 'label' => 'Shutter speed', + 'label' => 'prod::facet:ShutterSpeed_label', 'field' => "meta.ShutterSpeed", 'esfield' => 'metadata_tags.ShutterSpeed', 'query' => 'meta.ShutterSpeed=%s', @@ -375,63 +376,86 @@ class ElasticsearchOptions ], '_flashfired' => [ 'type' => 'boolean', - 'label' => 'FlashFired', + 'label' => 'prod::facet:FlashFired_label', 'field' => "meta.FlashFired", 'esfield' => 'metadata_tags.FlashFired', 'query' => 'meta.FlashFired=%s', 'choices' => [ "aggregated (2 values: fired = 0 or 1)" => -1, ], - 'output_formatter' => function($value) { - static $map = ["false"=>"No flash", "true"=>"Flash", '0'=>"No flash", '1'=>"Flash"]; + 'output_formatter' => function($value) use($translator) { + $map = [ + "false" => $translator->trans("facet.flashfired:no"), + "true" => $translator->trans("facet.flashfired:yes"), + '0' => $translator->trans("facet.flashfired:no"), + '1' => $translator->trans("facet.flashfired:yes") + ]; return array_key_exists($value, $map) ? $map[$value] : $value; }, ], '_framerate' => [ 'type' => 'number', - 'label' => 'FrameRate', + 'label' => 'prod::facet:FrameRate_label', 'field' => "meta.FrameRate", 'esfield' => 'metadata_tags.FrameRate', 'query' => 'meta.FrameRate=%s', ], '_audiosamplerate' => [ 'type' => 'number', - 'label' => 'Audio Samplerate', + 'label' => 'prod::facet:AudioSamplerate_label', 'field' => "meta.AudioSamplerate", 'esfield' => 'metadata_tags.AudioSamplerate', 'query' => 'meta.AudioSamplerate=%s', ], '_videocodec' => [ 'type' => 'string', - 'label' => 'Video codec', + 'label' => 'prod::facet:VideoCodec_label', 'field' => "meta.VideoCodec", 'esfield' => 'metadata_tags.VideoCodec', 'query' => 'meta.VideoCodec:%s', ], '_audiocodec' => [ 'type' => 'string', - 'label' => 'Audio codec', + 'label' => 'prod::facet:AudioCodec_label', 'field' => "meta.AudioCodec", 'esfield' => 'metadata_tags.AudioCodec', 'query' => 'meta.AudioCodec:%s', ], '_orientation' => [ 'type' => 'string', - 'label' => 'Orientation', + 'label' => 'prod::facet.Orientation_label', 'field' => "meta.Orientation", 'esfield' => 'metadata_tags.Orientation', 'query' => 'meta.Orientation=%s', ], + '_thumbnail_orientation' => [ + 'type' => 'string', + 'label' => 'prod::facet.ThumbnailOrientation_label', + 'field' => "meta.ThumbnailOrientation", + 'esfield' => 'metadata_tags.ThumbnailOrientation', + 'query' => 'meta.ThumbnailOrientation=%s', + 'choices' => [ + "aggregated (4 values: '', 'S', 'L', 'P')" => -1, + ], + 'output_formatter' => function($value) use($translator) { + $map = [ + "L" => $translator->trans("facet.ThumbnailOrientation:Landscape"), + "P" => $translator->trans("facet.ThumbnailOrientation:Portrait"), + 'S' => $translator->trans("facet.ThumbnailOrientation:Square") + ]; + return array_key_exists($value, $map) ? $map[$value] : $value; + }, + ], '_colorspace' => [ 'type' => 'string', - 'label' => 'Colorspace', + 'label' => 'prod::facet:Colorspace_label', 'field' => "meta.ColorSpace", 'esfield' => 'metadata_tags.ColorSpace', 'query' => 'meta.ColorSpace:%s', ], '_mimetype' => [ 'type' => 'string', - 'label' => 'MimeType', + 'label' => 'prod::facet:MimeType_label', 'field' => "meta.MimeType", 'esfield' => 'metadata_tags.MimeType', 'query' => 'meta.MimeType:%s', diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php index 0b7a3ce9e6..3115055a34 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php @@ -137,7 +137,7 @@ class ElasticsearchSettingsFormType extends AbstractType } // add or replace hardcoded tech fields - foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { + foreach(ElasticsearchOptions::getAggregableTechnicalFields($this->translator) as $k => $f) { $choices = array_key_exists('choices', $f) ? $f['choices'] : null; // a tech-field can publish it's own choices $help = null; $label = '#' . $k; diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php index a7da16e834..32a06e3781 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php @@ -18,7 +18,18 @@ use media_Permalink_Adapter; class SubDefinitionHydrator implements HydratorInterface { - /** @var Application */ + const ORIENTATION_SQUARE = 'S'; + const ORIENTATION_LANDSCAPE = 'L'; + const ORIENTATION_PORTRAIT = 'P'; + const ORIENTATION_UNKNOW = ''; + +// const ORIENTATION_SQUARE = 1; +// const ORIENTATION_LANDSCAPE = 2; +// const ORIENTATION_PORTRAIT = 3; +// const ORIENTATION_UNKNOW = 0; + + + /** @var Application */ private $app; /** @var databox */ @@ -38,45 +49,50 @@ class SubDefinitionHydrator implements HydratorInterface { if ($this->populatePermalinks) { $this->hydrateRecordsWithPermalinks($records); - } else { + } + else { $this->hydrateRecordsWithoutPermalinks($records); } } private function hydrateRecordsWithPermalinks(&$records) { - foreach(array_keys($records) as $rid) { + foreach (array_keys($records) as $rid) { + + $record = &$records[$rid]; + try { $subdefs = $this->databox->getRecordRepository()->find($rid)->get_subdefs(); $pls = array_map( /** media_Permalink_Adapter|null $plink */ - function($plink) { - return $plink ? ((string) $plink->get_url()) : null; + function ($plink) { + return $plink ? ((string)$plink->get_url()) : null; }, media_Permalink_Adapter::getMany($this->app, $subdefs, false) // false: don't create missing plinks ); - foreach($subdefs as $subdef) { + foreach ($subdefs as $subdef) { $name = $subdef->get_name(); - if(substr(($path = $subdef->get_path()), -1) !== '/') { + if (substr(($path = $subdef->get_path()), -1) !== '/') { $path .= '/'; } - $records[$rid]['subdefs'][$name] = array( - 'path' => $path . $subdef->get_file(), - 'width' => $subdef->get_width(), - 'height' => $subdef->get_height(), - 'size' => $subdef->get_size(), - 'mime' => $subdef->get_mime(), + $record['subdefs'][$name] = [ + 'path' => $path . $subdef->get_file(), + 'width' => $subdef->get_width(), + 'height' => $subdef->get_height(), + 'size' => $subdef->get_size(), + 'mime' => $subdef->get_mime(), 'permalink' => array_key_exists($name, $pls) ? $pls[$name] : null - ); - + ]; + if ($name == "thumbnail") { + $this->setOrientation($record, $subdef->get_width(), $subdef->get_height()); + } } } catch (\Exception $e) { // cant get record ? ignore } - } } @@ -96,22 +112,42 @@ class SubDefinitionHydrator implements HydratorInterface ORDER BY s.record_id SQL; $statement = $this->databox->get_connection()->executeQuery($sql, - array(array_keys($records)), - array(Connection::PARAM_INT_ARRAY) + [array_keys($records)], + [Connection::PARAM_INT_ARRAY] ); $current_rid = null; $record = null; while ($subdef = $statement->fetch()) { + $rid = $subdef['record_id']; + $record = &$records[$rid]; $name = $subdef['name']; - $records[$subdef['record_id']]['subdefs'][$name] = array( - 'path' => $subdef['path'], - 'width' => $subdef['width'], - 'height' => $subdef['height'], - 'size' => $subdef['size'], - 'mime' => $subdef['mime'], + $record['subdefs'][$name] = [ + 'path' => $subdef['path'], + 'width' => $subdef['width'], + 'height' => $subdef['height'], + 'size' => $subdef['size'], + 'mime' => $subdef['mime'], 'permalink' => null - ); + ]; + if ($name == "thumbnail") { + $this->setOrientation($record, $subdef['width'], $subdef['height']); + } } } + + private function setOrientation(&$record, $w, $h) + { + $o = self::ORIENTATION_UNKNOW; + if ($w !== '' && $h !== '' && !is_null($w) && !is_null($h)) { + $w = (int)$w; + $h = (int)$h; + $o = $w == $h ? self::ORIENTATION_SQUARE : ($w > $h ? self::ORIENTATION_LANDSCAPE : self::ORIENTATION_PORTRAIT); + } + if(!array_key_exists('metadata_tags', $record)) { + $record['metadata_tags'] = []; + } + $record['metadata_tags']['ThumbnailOrientation'] = $o; + } } + diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php index 07d186b4e3..ceb7a0a6d9 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php @@ -18,6 +18,25 @@ class MetadataTagToFieldMappingConverter { public function convertTag(Tag $tag) + { + if ($tag->getType() === FieldMapping::TYPE_STRING) { + + $fieldMapping = new StringFieldMapping($tag->getName()); + $fieldMapping->addChild((new StringFieldMapping('raw'))->enableRawIndexing()); + if ($tag->isAnalyzable()) { + $fieldMapping->enableAnalysis(); + } + else { + $fieldMapping->disableAnalysis(); + } + + return $fieldMapping; + } + + return new FieldMapping($tag->getName(), $tag->getType()); + } + + public function dead_convertTag(Tag $tag) { if ($tag->getType() === FieldMapping::TYPE_STRING) { $fieldMapping = new StringFieldMapping($tag->getName()); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php index 4849ff4693..6f7d0b4655 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php @@ -24,7 +24,7 @@ class FacetsResponse return; } - $atf = ElasticsearchOptions::getAggregableTechnicalFields(); + $atf = ElasticsearchOptions::getAggregableTechnicalFields($this->translator); // sort facets respecting the order defined in options foreach($options->getAggregableFields() as $name=>$foptions) { @@ -35,9 +35,11 @@ class FacetsResponse $tf = null; $valueFormatter = function($v){ return $v; }; // default equality formatter + $label = $name; if(array_key_exists($name, $atf)) { $tf = $atf[$name]; + $label = $tf['label']; if(array_key_exists('output_formatter', $tf)) { $valueFormatter = $tf['output_formatter']; } @@ -56,7 +58,8 @@ class FacetsResponse if($response['aggregations'][$name . '#empty']['doc_count'] > 0) { // don't add a facet for 0 results $aggregation['buckets'][] = [ 'key' => '_unset_', - 'value' => $this->translator->trans('prod:workzone:facetstab:unset_field_facet_label_(%fieldname%)', ['%fieldname%' =>$name]), // special homemade prop to display a human value instead of the key + 'value' => $this->translator->trans('prod:workzone:facetstab:unset_field_facet_label_(%fieldname%)', ['%fieldname%' =>$label]), // special homemade prop to display a human value instead of the key + // 'value' => 'unset '.$name, // special homemade prop to display a human value instead of the key 'doc_count' => $response['aggregations'][$name . '#empty']['doc_count'] ]; } @@ -70,8 +73,15 @@ class FacetsResponse $key = array_key_exists('key_as_string', $bucket) ? $bucket['key_as_string'] : $bucket['key']; if($tf) { // the field is one of the hardcoded tech fields + if($key == '_unset_' && array_key_exists('value', $bucket)) { + // don't use the valueformatter since 'value' if already translated + $v = $bucket['value']; + } + else { + $v = $valueFormatter($key); + } $value = [ - 'value' => $valueFormatter($key), + 'value' => $v, 'raw_value' => $key, 'count' => $bucket['doc_count'], 'query' => sprintf($tf['query'], $this->escaper->escapeWord($key)) diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php index 8893523fe0..544f838504 100644 --- a/lib/classes/media/subdef.php +++ b/lib/classes/media/subdef.php @@ -109,6 +109,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface const TC_DATA_COLORSPACE = 'ColorSpace'; const TC_DATA_CHANNELS = 'Channels'; const TC_DATA_ORIENTATION = 'Orientation'; + const TC_DATA_THUMBNAILORIENTATION = 'ThumbnailOrientation'; const TC_DATA_COLORDEPTH = 'ColorDepth'; const TC_DATA_DURATION = 'Duration'; const TC_DATA_AUDIOCODEC = 'AudioCodec'; @@ -864,6 +865,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface self::TC_DATA_VIDEOCODEC => ['method' => 'getVideoCodec', 'type' => 'string', 'analyzable' => false], self::TC_DATA_AUDIOCODEC => ['method' => 'getAudioCodec', 'type' => 'string', 'analyzable' => false], self::TC_DATA_ORIENTATION => ['method' => 'getOrientation', 'type' => 'integer', 'analyzable' => false], + self::TC_DATA_THUMBNAILORIENTATION => ['type' => 'string', 'analyzable' => false], self::TC_DATA_LONGITUDE => ['method' => 'getLongitude', 'type' => 'float', 'analyzable' => false], self::TC_DATA_LONGITUDE_REF => ['method' => 'getLongitudeRef'], self::TC_DATA_LATITUDE => ['method' => 'getLatitude', 'type' => 'float', 'analyzable' => false], From c7ad4ae37fed4aa19378d0c1e0ce593bafd05d79 Mon Sep 17 00:00:00 2001 From: aynsix Date: Fri, 25 Feb 2022 13:02:39 +0300 Subject: [PATCH 06/22] add publish option --- lib/Alchemy/Phrasea/Command/BuildSubdefs.php | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php index 32c43d01eb..292495b22f 100644 --- a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php +++ b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php @@ -13,9 +13,9 @@ namespace Alchemy\Phrasea\Command; use Alchemy\Phrasea\Core\PhraseaTokens; use Alchemy\Phrasea\Databox\SubdefGroup; use Alchemy\Phrasea\Media\SubdefGenerator; +use Alchemy\Phrasea\WorkerManager\Queue\MessagePublisher; use databox_subdef; use Doctrine\DBAL\Connection; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -77,6 +77,8 @@ class BuildSubdefs extends Command /** @var bool */ private $dry; /** @var bool */ + private $publish; + /** @var bool */ private $show_sql; /** @var array */ @@ -130,6 +132,7 @@ class BuildSubdefs extends Command $this->addOption('maxduration', null, InputOption::VALUE_REQUIRED, 'Maximum duration (seconds) of job. (job will do at least one record)'); $this->addOption('ttl', null, InputOption::VALUE_REQUIRED, 'Wait time (seconds) before quit if no records were changed'); $this->addOption('dry', null, InputOption::VALUE_NONE, 'dry run, list but don\'t act'); + $this->addOption('publish', null, InputOption::VALUE_NONE, 'publish message in Q for build subdef'); $this->addOption('show_sql', null, InputOption::VALUE_NONE, 'show sql pre-selecting records'); $this->setHelp("" @@ -258,6 +261,7 @@ class BuildSubdefs extends Command $this->show_sql = $input->getOption('show_sql') ? true : false; $this->dry = $input->getOption('dry') ? true : false; + $this->publish = $input->getOption('publish') ? true : false; $this->min_record_id = $input->getOption('min_record_id'); $this->max_record_id = $input->getOption('max_record_id'); $this->substituted_only = $input->getOption('substituted_only') ? true : false; @@ -443,11 +447,28 @@ class BuildSubdefs extends Command $subdefNamesToDo = array_keys($subdefNamesToDo); if(!empty($subdefNamesToDo)) { - if(!$this->dry) { + if (!$this->dry && !$this->publish) { /** @var SubdefGenerator $subdefGenerator */ $subdefGenerator = $this->container['subdef.generator']; $subdefGenerator->generateSubdefs($record, $subdefNamesToDo); } + + if (!$this->dry && $this->publish) { + foreach ($subdefNamesToDo as $subdefName) { + $payload = [ + 'message_type' => MessagePublisher::SUBDEF_CREATION_TYPE, + 'payload' => [ + 'recordId' => $record->getRecordId(), + 'databoxId' => $this->databox->get_sbas_id(), + 'subdefName' => $subdefName, + 'status' => '' + ] + ]; + + $this->getPublisher()->publishMessage($payload, MessagePublisher::SUBDEF_CREATION_TYPE); + } + } + $recordChanged = true; $msg[] = sprintf(" [\"%s\"] built", implode('","', $subdefNamesToDo)); } @@ -577,4 +598,13 @@ class BuildSubdefs extends Command return $sql; } + + /** + * @return MessagePublisher + */ + private function getPublisher() + { + return $this->container['alchemy_worker.message.publisher']; + } + } From 635ae58bd546f6f4f9d62f7b8c00a1b2e2aa8999 Mon Sep 17 00:00:00 2001 From: aynsix Date: Fri, 25 Feb 2022 17:52:58 +0300 Subject: [PATCH 07/22] bump version to 4.1.6-rc1 --- .env | 2 +- lib/Alchemy/Phrasea/Core/Version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index f3dbbc7a1a..fd804fbc09 100644 --- a/.env +++ b/.env @@ -120,7 +120,7 @@ PHRASEANET_DOCKER_REGISTRY=local # Docker images tag. # @run -PHRASEANET_DOCKER_TAG=4.1.5 +PHRASEANET_DOCKER_TAG=4.1.6-rc1 # Application port. # @run diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index abfcc87945..62554030cb 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -16,7 +16,7 @@ class Version /** * @var string */ - private $number = '4.1.5'; + private $number = '4.1.6-rc1'; /** * @var string From ccd460be27d50b647e3d97d32149168959f11108 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Fri, 25 Feb 2022 23:10:23 +0100 Subject: [PATCH 08/22] Revert "PHRAS-3215 : add ThumbnailOrientation facet ; add strings" --- .../Phrasea/Controller/Api/V1Controller.php | 2 +- .../Controller/Prod/QueryController.php | 5 +- .../Provider/SearchEngineServiceProvider.php | 3 +- .../Elastic/ElasticSearchEngine.php | 16 +--- .../Elastic/ElasticsearchOptions.php | 56 ++++-------- .../Elastic/ElasticsearchSettingsFormType.php | 2 +- .../Record/Hydrator/SubDefinitionHydrator.php | 86 ++++++------------- .../MetadataTagToFieldMappingConverter.php | 19 ---- .../Elastic/Search/FacetsResponse.php | 16 +--- lib/classes/media/subdef.php | 2 - 10 files changed, 51 insertions(+), 156 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php index 1632fe1571..9f1cae2919 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php @@ -2813,7 +2813,7 @@ class V1Controller extends Controller { $ret = [ "meta_fields" => $this->listUserAuthorizedMetadataFields($this->getAuthenticatedUser()), - "aggregable_fields" => $this->buildUserFieldList(ElasticsearchOptions::getAggregableTechnicalFields($this->app['translator']), ['choices']), + "aggregable_fields" => $this->buildUserFieldList(ElasticsearchOptions::getAggregableTechnicalFields(), ['choices']), "technical_fields" => $this->buildUserFieldList(media_subdef::getTechnicalFieldsList()), ]; diff --git a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php index d055206d18..4ca7c3bf0f 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php @@ -76,8 +76,7 @@ class QueryController extends Controller $this->app['elasticsearch.client'], $query_context_factory, $this->app['elasticsearch.facets_response.factory'], - $this->app['elasticsearch.options'], - $this->app['translator'] + $this->app['elasticsearch.options'] ); $autocomplete = $engine->autocomplete($word, $options); @@ -352,7 +351,7 @@ class QueryController extends Controller // add technical fields $fieldsInfosByName = []; - foreach(ElasticsearchOptions::getAggregableTechnicalFields($this->app['translator']) as $k => $f) { + foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { $fieldsInfosByName[$k] = $f; $fieldsInfosByName[$k]['trans_label'] = $this->app->trans( /** @ignore */ $f['label']); $fieldsInfosByName[$k]['labels'] = []; diff --git a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php index 71159f028e..bab1a62f28 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php @@ -96,8 +96,7 @@ class SearchEngineServiceProvider implements ServiceProviderInterface $app['elasticsearch.client'], $app['query_context.factory'], $app['elasticsearch.facets_response.factory'], - $app['elasticsearch.options'], - $app['translator'] + $app['elasticsearch.options'] ); }); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php index 5eab435c70..43dc650c27 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php @@ -33,7 +33,6 @@ use Closure; use databox_field; use Doctrine\Common\Collections\ArrayCollection; use Elasticsearch\Client; -use Symfony\Component\Translation\TranslatorInterface; class ElasticSearchEngine implements SearchEngineInterface { @@ -60,8 +59,6 @@ class ElasticSearchEngine implements SearchEngineInterface */ private $context_factory; - private $translator; - /** * @param Application $app * @param GlobalStructure $structure @@ -69,9 +66,8 @@ class ElasticSearchEngine implements SearchEngineInterface * @param QueryContextFactory $context_factory * @param Closure $facetsResponseFactory * @param ElasticsearchOptions $options - * @param TranslatorInterface $translator */ - public function __construct(Application $app, GlobalStructure $structure, Client $client, QueryContextFactory $context_factory, Closure $facetsResponseFactory, ElasticsearchOptions $options, TranslatorInterface $translator) + public function __construct(Application $app, GlobalStructure $structure, Client $client, QueryContextFactory $context_factory, Closure $facetsResponseFactory, ElasticsearchOptions $options) { $this->app = $app; $this->structure = $structure; @@ -79,7 +75,6 @@ class ElasticSearchEngine implements SearchEngineInterface $this->context_factory = $context_factory; $this->facetsResponseFactory = $facetsResponseFactory; $this->options = $options; - $this->translator = $translator; $this->indexName = $options->getIndexName(); } @@ -785,7 +780,7 @@ class ElasticSearchEngine implements SearchEngineInterface { $aggs = []; // technical aggregates (enable + optional limit) - foreach (ElasticsearchOptions::getAggregableTechnicalFields($this->translator) as $k => $f) { + foreach (ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { $size = $this->options->getAggregableFieldLimit($k); if ($size !== databox_field::FACET_DISABLED) { if ($size === databox_field::FACET_NO_LIMIT) { @@ -798,13 +793,6 @@ class ElasticSearchEngine implements SearchEngineInterface ] ]; $aggs[$k] = $agg; - if($options->getIncludeUnsetFieldFacet() === true) { - $aggs[$k . '#empty'] = [ - 'missing' => [ - 'field' => $f['esfield'], - ] - ]; - } } } // fields aggregates diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php index 581bd42982..4f7de4c7af 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php @@ -11,7 +11,6 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic; use databox_field; use igorw; -use Symfony\Component\Translation\TranslatorInterface; class ElasticsearchOptions @@ -313,7 +312,7 @@ class ElasticsearchOptions $this->_customValues = igorw\assoc_in($this->_customValues, $keys, $value); } - public static function getAggregableTechnicalFields(TranslatorInterface $translator) + public static function getAggregableTechnicalFields() { return [ '_base' => [ @@ -339,21 +338,21 @@ class ElasticsearchOptions ], '_camera_model' => [ 'type' => 'string', - 'label' => 'prod::facet:CameraModel_label', + 'label' => 'Camera Model', 'field' => "meta.CameraModel", 'esfield' => 'metadata_tags.CameraModel', - 'query' => 'meta.CameraModel=%s', + 'query' => 'meta.CameraModel:%s', ], '_iso' => [ 'type' => 'number', - 'label' => 'prod::facet:ISO_label', + 'label' => 'ISO', 'field' => "meta.ISO", 'esfield' => 'metadata_tags.ISO', 'query' => 'meta.ISO=%s', ], '_aperture' => [ 'type' => 'number', - 'label' => 'prod::facet:Aperture_label', + 'label' => 'Aperture', 'field' => "meta.Aperture", 'esfield' => 'metadata_tags.Aperture', 'query' => 'meta.Aperture=%s', @@ -363,7 +362,7 @@ class ElasticsearchOptions ], '_shutterspeed' => [ 'type' => 'number', - 'label' => 'prod::facet:ShutterSpeed_label', + 'label' => 'Shutter speed', 'field' => "meta.ShutterSpeed", 'esfield' => 'metadata_tags.ShutterSpeed', 'query' => 'meta.ShutterSpeed=%s', @@ -376,86 +375,63 @@ class ElasticsearchOptions ], '_flashfired' => [ 'type' => 'boolean', - 'label' => 'prod::facet:FlashFired_label', + 'label' => 'FlashFired', 'field' => "meta.FlashFired", 'esfield' => 'metadata_tags.FlashFired', 'query' => 'meta.FlashFired=%s', 'choices' => [ "aggregated (2 values: fired = 0 or 1)" => -1, ], - 'output_formatter' => function($value) use($translator) { - $map = [ - "false" => $translator->trans("facet.flashfired:no"), - "true" => $translator->trans("facet.flashfired:yes"), - '0' => $translator->trans("facet.flashfired:no"), - '1' => $translator->trans("facet.flashfired:yes") - ]; + 'output_formatter' => function($value) { + static $map = ["false"=>"No flash", "true"=>"Flash", '0'=>"No flash", '1'=>"Flash"]; return array_key_exists($value, $map) ? $map[$value] : $value; }, ], '_framerate' => [ 'type' => 'number', - 'label' => 'prod::facet:FrameRate_label', + 'label' => 'FrameRate', 'field' => "meta.FrameRate", 'esfield' => 'metadata_tags.FrameRate', 'query' => 'meta.FrameRate=%s', ], '_audiosamplerate' => [ 'type' => 'number', - 'label' => 'prod::facet:AudioSamplerate_label', + 'label' => 'Audio Samplerate', 'field' => "meta.AudioSamplerate", 'esfield' => 'metadata_tags.AudioSamplerate', 'query' => 'meta.AudioSamplerate=%s', ], '_videocodec' => [ 'type' => 'string', - 'label' => 'prod::facet:VideoCodec_label', + 'label' => 'Video codec', 'field' => "meta.VideoCodec", 'esfield' => 'metadata_tags.VideoCodec', 'query' => 'meta.VideoCodec:%s', ], '_audiocodec' => [ 'type' => 'string', - 'label' => 'prod::facet:AudioCodec_label', + 'label' => 'Audio codec', 'field' => "meta.AudioCodec", 'esfield' => 'metadata_tags.AudioCodec', 'query' => 'meta.AudioCodec:%s', ], '_orientation' => [ 'type' => 'string', - 'label' => 'prod::facet.Orientation_label', + 'label' => 'Orientation', 'field' => "meta.Orientation", 'esfield' => 'metadata_tags.Orientation', 'query' => 'meta.Orientation=%s', ], - '_thumbnail_orientation' => [ - 'type' => 'string', - 'label' => 'prod::facet.ThumbnailOrientation_label', - 'field' => "meta.ThumbnailOrientation", - 'esfield' => 'metadata_tags.ThumbnailOrientation', - 'query' => 'meta.ThumbnailOrientation=%s', - 'choices' => [ - "aggregated (4 values: '', 'S', 'L', 'P')" => -1, - ], - 'output_formatter' => function($value) use($translator) { - $map = [ - "L" => $translator->trans("facet.ThumbnailOrientation:Landscape"), - "P" => $translator->trans("facet.ThumbnailOrientation:Portrait"), - 'S' => $translator->trans("facet.ThumbnailOrientation:Square") - ]; - return array_key_exists($value, $map) ? $map[$value] : $value; - }, - ], '_colorspace' => [ 'type' => 'string', - 'label' => 'prod::facet:Colorspace_label', + 'label' => 'Colorspace', 'field' => "meta.ColorSpace", 'esfield' => 'metadata_tags.ColorSpace', 'query' => 'meta.ColorSpace:%s', ], '_mimetype' => [ 'type' => 'string', - 'label' => 'prod::facet:MimeType_label', + 'label' => 'MimeType', 'field' => "meta.MimeType", 'esfield' => 'metadata_tags.MimeType', 'query' => 'meta.MimeType:%s', diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php index 3115055a34..0b7a3ce9e6 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php @@ -137,7 +137,7 @@ class ElasticsearchSettingsFormType extends AbstractType } // add or replace hardcoded tech fields - foreach(ElasticsearchOptions::getAggregableTechnicalFields($this->translator) as $k => $f) { + foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { $choices = array_key_exists('choices', $f) ? $f['choices'] : null; // a tech-field can publish it's own choices $help = null; $label = '#' . $k; diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php index 32a06e3781..a7da16e834 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php @@ -18,18 +18,7 @@ use media_Permalink_Adapter; class SubDefinitionHydrator implements HydratorInterface { - const ORIENTATION_SQUARE = 'S'; - const ORIENTATION_LANDSCAPE = 'L'; - const ORIENTATION_PORTRAIT = 'P'; - const ORIENTATION_UNKNOW = ''; - -// const ORIENTATION_SQUARE = 1; -// const ORIENTATION_LANDSCAPE = 2; -// const ORIENTATION_PORTRAIT = 3; -// const ORIENTATION_UNKNOW = 0; - - - /** @var Application */ + /** @var Application */ private $app; /** @var databox */ @@ -49,50 +38,45 @@ class SubDefinitionHydrator implements HydratorInterface { if ($this->populatePermalinks) { $this->hydrateRecordsWithPermalinks($records); - } - else { + } else { $this->hydrateRecordsWithoutPermalinks($records); } } private function hydrateRecordsWithPermalinks(&$records) { - foreach (array_keys($records) as $rid) { - - $record = &$records[$rid]; - + foreach(array_keys($records) as $rid) { try { $subdefs = $this->databox->getRecordRepository()->find($rid)->get_subdefs(); $pls = array_map( /** media_Permalink_Adapter|null $plink */ - function ($plink) { - return $plink ? ((string)$plink->get_url()) : null; + function($plink) { + return $plink ? ((string) $plink->get_url()) : null; }, media_Permalink_Adapter::getMany($this->app, $subdefs, false) // false: don't create missing plinks ); - foreach ($subdefs as $subdef) { + foreach($subdefs as $subdef) { $name = $subdef->get_name(); - if (substr(($path = $subdef->get_path()), -1) !== '/') { + if(substr(($path = $subdef->get_path()), -1) !== '/') { $path .= '/'; } - $record['subdefs'][$name] = [ - 'path' => $path . $subdef->get_file(), - 'width' => $subdef->get_width(), - 'height' => $subdef->get_height(), - 'size' => $subdef->get_size(), - 'mime' => $subdef->get_mime(), + $records[$rid]['subdefs'][$name] = array( + 'path' => $path . $subdef->get_file(), + 'width' => $subdef->get_width(), + 'height' => $subdef->get_height(), + 'size' => $subdef->get_size(), + 'mime' => $subdef->get_mime(), 'permalink' => array_key_exists($name, $pls) ? $pls[$name] : null - ]; - if ($name == "thumbnail") { - $this->setOrientation($record, $subdef->get_width(), $subdef->get_height()); - } + ); + } } catch (\Exception $e) { // cant get record ? ignore } + } } @@ -112,42 +96,22 @@ class SubDefinitionHydrator implements HydratorInterface ORDER BY s.record_id SQL; $statement = $this->databox->get_connection()->executeQuery($sql, - [array_keys($records)], - [Connection::PARAM_INT_ARRAY] + array(array_keys($records)), + array(Connection::PARAM_INT_ARRAY) ); $current_rid = null; $record = null; while ($subdef = $statement->fetch()) { - $rid = $subdef['record_id']; - $record = &$records[$rid]; $name = $subdef['name']; - $record['subdefs'][$name] = [ - 'path' => $subdef['path'], - 'width' => $subdef['width'], - 'height' => $subdef['height'], - 'size' => $subdef['size'], - 'mime' => $subdef['mime'], + $records[$subdef['record_id']]['subdefs'][$name] = array( + 'path' => $subdef['path'], + 'width' => $subdef['width'], + 'height' => $subdef['height'], + 'size' => $subdef['size'], + 'mime' => $subdef['mime'], 'permalink' => null - ]; - if ($name == "thumbnail") { - $this->setOrientation($record, $subdef['width'], $subdef['height']); - } + ); } } - - private function setOrientation(&$record, $w, $h) - { - $o = self::ORIENTATION_UNKNOW; - if ($w !== '' && $h !== '' && !is_null($w) && !is_null($h)) { - $w = (int)$w; - $h = (int)$h; - $o = $w == $h ? self::ORIENTATION_SQUARE : ($w > $h ? self::ORIENTATION_LANDSCAPE : self::ORIENTATION_PORTRAIT); - } - if(!array_key_exists('metadata_tags', $record)) { - $record['metadata_tags'] = []; - } - $record['metadata_tags']['ThumbnailOrientation'] = $o; - } } - diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php index ceb7a0a6d9..07d186b4e3 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php @@ -18,25 +18,6 @@ class MetadataTagToFieldMappingConverter { public function convertTag(Tag $tag) - { - if ($tag->getType() === FieldMapping::TYPE_STRING) { - - $fieldMapping = new StringFieldMapping($tag->getName()); - $fieldMapping->addChild((new StringFieldMapping('raw'))->enableRawIndexing()); - if ($tag->isAnalyzable()) { - $fieldMapping->enableAnalysis(); - } - else { - $fieldMapping->disableAnalysis(); - } - - return $fieldMapping; - } - - return new FieldMapping($tag->getName(), $tag->getType()); - } - - public function dead_convertTag(Tag $tag) { if ($tag->getType() === FieldMapping::TYPE_STRING) { $fieldMapping = new StringFieldMapping($tag->getName()); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php index 6f7d0b4655..4849ff4693 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php @@ -24,7 +24,7 @@ class FacetsResponse return; } - $atf = ElasticsearchOptions::getAggregableTechnicalFields($this->translator); + $atf = ElasticsearchOptions::getAggregableTechnicalFields(); // sort facets respecting the order defined in options foreach($options->getAggregableFields() as $name=>$foptions) { @@ -35,11 +35,9 @@ class FacetsResponse $tf = null; $valueFormatter = function($v){ return $v; }; // default equality formatter - $label = $name; if(array_key_exists($name, $atf)) { $tf = $atf[$name]; - $label = $tf['label']; if(array_key_exists('output_formatter', $tf)) { $valueFormatter = $tf['output_formatter']; } @@ -58,8 +56,7 @@ class FacetsResponse if($response['aggregations'][$name . '#empty']['doc_count'] > 0) { // don't add a facet for 0 results $aggregation['buckets'][] = [ 'key' => '_unset_', - 'value' => $this->translator->trans('prod:workzone:facetstab:unset_field_facet_label_(%fieldname%)', ['%fieldname%' =>$label]), // special homemade prop to display a human value instead of the key - // 'value' => 'unset '.$name, // special homemade prop to display a human value instead of the key + 'value' => $this->translator->trans('prod:workzone:facetstab:unset_field_facet_label_(%fieldname%)', ['%fieldname%' =>$name]), // special homemade prop to display a human value instead of the key 'doc_count' => $response['aggregations'][$name . '#empty']['doc_count'] ]; } @@ -73,15 +70,8 @@ class FacetsResponse $key = array_key_exists('key_as_string', $bucket) ? $bucket['key_as_string'] : $bucket['key']; if($tf) { // the field is one of the hardcoded tech fields - if($key == '_unset_' && array_key_exists('value', $bucket)) { - // don't use the valueformatter since 'value' if already translated - $v = $bucket['value']; - } - else { - $v = $valueFormatter($key); - } $value = [ - 'value' => $v, + 'value' => $valueFormatter($key), 'raw_value' => $key, 'count' => $bucket['doc_count'], 'query' => sprintf($tf['query'], $this->escaper->escapeWord($key)) diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php index 544f838504..8893523fe0 100644 --- a/lib/classes/media/subdef.php +++ b/lib/classes/media/subdef.php @@ -109,7 +109,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface const TC_DATA_COLORSPACE = 'ColorSpace'; const TC_DATA_CHANNELS = 'Channels'; const TC_DATA_ORIENTATION = 'Orientation'; - const TC_DATA_THUMBNAILORIENTATION = 'ThumbnailOrientation'; const TC_DATA_COLORDEPTH = 'ColorDepth'; const TC_DATA_DURATION = 'Duration'; const TC_DATA_AUDIOCODEC = 'AudioCodec'; @@ -865,7 +864,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface self::TC_DATA_VIDEOCODEC => ['method' => 'getVideoCodec', 'type' => 'string', 'analyzable' => false], self::TC_DATA_AUDIOCODEC => ['method' => 'getAudioCodec', 'type' => 'string', 'analyzable' => false], self::TC_DATA_ORIENTATION => ['method' => 'getOrientation', 'type' => 'integer', 'analyzable' => false], - self::TC_DATA_THUMBNAILORIENTATION => ['type' => 'string', 'analyzable' => false], self::TC_DATA_LONGITUDE => ['method' => 'getLongitude', 'type' => 'float', 'analyzable' => false], self::TC_DATA_LONGITUDE_REF => ['method' => 'getLongitudeRef'], self::TC_DATA_LATITUDE => ['method' => 'getLatitude', 'type' => 'float', 'analyzable' => false], From d0851a084af2019f0e15fe011e31226c3af0a1ab Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Sat, 26 Feb 2022 00:09:41 +0100 Subject: [PATCH 09/22] Update readme --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f96324fe..bd057baf0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # CHANGELOG +## 4.1.6-rc1 + +### Update instructions + + - Migration patch: no patch to play, just run upgrade for bump version + - Elasticsearch action : none + +### Version summary : + + - Big improvement of generated PDF, + - Password protection + - Download link + - Prod - Publications editing, user experience improvements + +### New Features + +``` +PHRAS-3642 API - Return databox subdefs on new endpoint /api/v3/databoxes/\{databox\_id\}/subdefs/ and /api/v3/databoxes/subdefs/ +PHRAS-3636 docker - docker-compose - Add container for execute primary datastore \(mysql\) backup +``` + +### Improvement + +``` +PHRAS-3633 Prod - Printed PDF Improvement - add a Title , Password, download link to the PDF +PHRAS-3595 Prod - New publication - features and UX improvement +PHRAS-3631 Prod : Notifications : Add a fonction to mark all notification as read +PHRAS-3229 Thesaurus GUI improvement - import - refresh candidat terms +``` + + +### Bug fix + +``` +PHRAS-3637 API - Upload Url | Prod GUI - Let's Encrypt ssl certificate verification fail. use the correct guzzle version +PHRAS-3635 user list : general toggles change selection +PHRAS-3626 Prod - detailed view - Print, Export windows appear behind the detailed view \(z-index\) +PHRAS-3620 Admin - subviews : a bad path can lead to creating file at the roots of the Phraseanet sources. +PHRAS-3619 After record removal, we have an HTTP status 200 on the /records route of the API on the deleted record +PHRAS-3285 Thesaurus - candidat panel - The Stock is not available +PHRAS-3628 API - create record - 500 error if No file + ``` + ## 4.1.5 ### Version summary : From bdcbd7c0e049eef0231a7f8b9644d5a6b7d906f1 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Tue, 8 Mar 2022 11:49:36 +0100 Subject: [PATCH 10/22] Revert " "PHRAS-3215 : Revert add ThumbnailOrientation facet ; add strings"" --- .../Phrasea/Controller/Api/V1Controller.php | 2 +- .../Controller/Prod/QueryController.php | 5 +- .../Provider/SearchEngineServiceProvider.php | 3 +- .../Elastic/ElasticSearchEngine.php | 16 +++- .../Elastic/ElasticsearchOptions.php | 56 ++++++++---- .../Elastic/ElasticsearchSettingsFormType.php | 2 +- .../Record/Hydrator/SubDefinitionHydrator.php | 86 +++++++++++++------ .../MetadataTagToFieldMappingConverter.php | 19 ++++ .../Elastic/Search/FacetsResponse.php | 16 +++- lib/classes/media/subdef.php | 2 + 10 files changed, 156 insertions(+), 51 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php index 9f1cae2919..1632fe1571 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php @@ -2813,7 +2813,7 @@ class V1Controller extends Controller { $ret = [ "meta_fields" => $this->listUserAuthorizedMetadataFields($this->getAuthenticatedUser()), - "aggregable_fields" => $this->buildUserFieldList(ElasticsearchOptions::getAggregableTechnicalFields(), ['choices']), + "aggregable_fields" => $this->buildUserFieldList(ElasticsearchOptions::getAggregableTechnicalFields($this->app['translator']), ['choices']), "technical_fields" => $this->buildUserFieldList(media_subdef::getTechnicalFieldsList()), ]; diff --git a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php index 4ca7c3bf0f..d055206d18 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php @@ -76,7 +76,8 @@ class QueryController extends Controller $this->app['elasticsearch.client'], $query_context_factory, $this->app['elasticsearch.facets_response.factory'], - $this->app['elasticsearch.options'] + $this->app['elasticsearch.options'], + $this->app['translator'] ); $autocomplete = $engine->autocomplete($word, $options); @@ -351,7 +352,7 @@ class QueryController extends Controller // add technical fields $fieldsInfosByName = []; - foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { + foreach(ElasticsearchOptions::getAggregableTechnicalFields($this->app['translator']) as $k => $f) { $fieldsInfosByName[$k] = $f; $fieldsInfosByName[$k]['trans_label'] = $this->app->trans( /** @ignore */ $f['label']); $fieldsInfosByName[$k]['labels'] = []; diff --git a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php index bab1a62f28..71159f028e 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php @@ -96,7 +96,8 @@ class SearchEngineServiceProvider implements ServiceProviderInterface $app['elasticsearch.client'], $app['query_context.factory'], $app['elasticsearch.facets_response.factory'], - $app['elasticsearch.options'] + $app['elasticsearch.options'], + $app['translator'] ); }); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php index 43dc650c27..5eab435c70 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php @@ -33,6 +33,7 @@ use Closure; use databox_field; use Doctrine\Common\Collections\ArrayCollection; use Elasticsearch\Client; +use Symfony\Component\Translation\TranslatorInterface; class ElasticSearchEngine implements SearchEngineInterface { @@ -59,6 +60,8 @@ class ElasticSearchEngine implements SearchEngineInterface */ private $context_factory; + private $translator; + /** * @param Application $app * @param GlobalStructure $structure @@ -66,8 +69,9 @@ class ElasticSearchEngine implements SearchEngineInterface * @param QueryContextFactory $context_factory * @param Closure $facetsResponseFactory * @param ElasticsearchOptions $options + * @param TranslatorInterface $translator */ - public function __construct(Application $app, GlobalStructure $structure, Client $client, QueryContextFactory $context_factory, Closure $facetsResponseFactory, ElasticsearchOptions $options) + public function __construct(Application $app, GlobalStructure $structure, Client $client, QueryContextFactory $context_factory, Closure $facetsResponseFactory, ElasticsearchOptions $options, TranslatorInterface $translator) { $this->app = $app; $this->structure = $structure; @@ -75,6 +79,7 @@ class ElasticSearchEngine implements SearchEngineInterface $this->context_factory = $context_factory; $this->facetsResponseFactory = $facetsResponseFactory; $this->options = $options; + $this->translator = $translator; $this->indexName = $options->getIndexName(); } @@ -780,7 +785,7 @@ class ElasticSearchEngine implements SearchEngineInterface { $aggs = []; // technical aggregates (enable + optional limit) - foreach (ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { + foreach (ElasticsearchOptions::getAggregableTechnicalFields($this->translator) as $k => $f) { $size = $this->options->getAggregableFieldLimit($k); if ($size !== databox_field::FACET_DISABLED) { if ($size === databox_field::FACET_NO_LIMIT) { @@ -793,6 +798,13 @@ class ElasticSearchEngine implements SearchEngineInterface ] ]; $aggs[$k] = $agg; + if($options->getIncludeUnsetFieldFacet() === true) { + $aggs[$k . '#empty'] = [ + 'missing' => [ + 'field' => $f['esfield'], + ] + ]; + } } } // fields aggregates diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php index 4f7de4c7af..581bd42982 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic; use databox_field; use igorw; +use Symfony\Component\Translation\TranslatorInterface; class ElasticsearchOptions @@ -312,7 +313,7 @@ class ElasticsearchOptions $this->_customValues = igorw\assoc_in($this->_customValues, $keys, $value); } - public static function getAggregableTechnicalFields() + public static function getAggregableTechnicalFields(TranslatorInterface $translator) { return [ '_base' => [ @@ -338,21 +339,21 @@ class ElasticsearchOptions ], '_camera_model' => [ 'type' => 'string', - 'label' => 'Camera Model', + 'label' => 'prod::facet:CameraModel_label', 'field' => "meta.CameraModel", 'esfield' => 'metadata_tags.CameraModel', - 'query' => 'meta.CameraModel:%s', + 'query' => 'meta.CameraModel=%s', ], '_iso' => [ 'type' => 'number', - 'label' => 'ISO', + 'label' => 'prod::facet:ISO_label', 'field' => "meta.ISO", 'esfield' => 'metadata_tags.ISO', 'query' => 'meta.ISO=%s', ], '_aperture' => [ 'type' => 'number', - 'label' => 'Aperture', + 'label' => 'prod::facet:Aperture_label', 'field' => "meta.Aperture", 'esfield' => 'metadata_tags.Aperture', 'query' => 'meta.Aperture=%s', @@ -362,7 +363,7 @@ class ElasticsearchOptions ], '_shutterspeed' => [ 'type' => 'number', - 'label' => 'Shutter speed', + 'label' => 'prod::facet:ShutterSpeed_label', 'field' => "meta.ShutterSpeed", 'esfield' => 'metadata_tags.ShutterSpeed', 'query' => 'meta.ShutterSpeed=%s', @@ -375,63 +376,86 @@ class ElasticsearchOptions ], '_flashfired' => [ 'type' => 'boolean', - 'label' => 'FlashFired', + 'label' => 'prod::facet:FlashFired_label', 'field' => "meta.FlashFired", 'esfield' => 'metadata_tags.FlashFired', 'query' => 'meta.FlashFired=%s', 'choices' => [ "aggregated (2 values: fired = 0 or 1)" => -1, ], - 'output_formatter' => function($value) { - static $map = ["false"=>"No flash", "true"=>"Flash", '0'=>"No flash", '1'=>"Flash"]; + 'output_formatter' => function($value) use($translator) { + $map = [ + "false" => $translator->trans("facet.flashfired:no"), + "true" => $translator->trans("facet.flashfired:yes"), + '0' => $translator->trans("facet.flashfired:no"), + '1' => $translator->trans("facet.flashfired:yes") + ]; return array_key_exists($value, $map) ? $map[$value] : $value; }, ], '_framerate' => [ 'type' => 'number', - 'label' => 'FrameRate', + 'label' => 'prod::facet:FrameRate_label', 'field' => "meta.FrameRate", 'esfield' => 'metadata_tags.FrameRate', 'query' => 'meta.FrameRate=%s', ], '_audiosamplerate' => [ 'type' => 'number', - 'label' => 'Audio Samplerate', + 'label' => 'prod::facet:AudioSamplerate_label', 'field' => "meta.AudioSamplerate", 'esfield' => 'metadata_tags.AudioSamplerate', 'query' => 'meta.AudioSamplerate=%s', ], '_videocodec' => [ 'type' => 'string', - 'label' => 'Video codec', + 'label' => 'prod::facet:VideoCodec_label', 'field' => "meta.VideoCodec", 'esfield' => 'metadata_tags.VideoCodec', 'query' => 'meta.VideoCodec:%s', ], '_audiocodec' => [ 'type' => 'string', - 'label' => 'Audio codec', + 'label' => 'prod::facet:AudioCodec_label', 'field' => "meta.AudioCodec", 'esfield' => 'metadata_tags.AudioCodec', 'query' => 'meta.AudioCodec:%s', ], '_orientation' => [ 'type' => 'string', - 'label' => 'Orientation', + 'label' => 'prod::facet.Orientation_label', 'field' => "meta.Orientation", 'esfield' => 'metadata_tags.Orientation', 'query' => 'meta.Orientation=%s', ], + '_thumbnail_orientation' => [ + 'type' => 'string', + 'label' => 'prod::facet.ThumbnailOrientation_label', + 'field' => "meta.ThumbnailOrientation", + 'esfield' => 'metadata_tags.ThumbnailOrientation', + 'query' => 'meta.ThumbnailOrientation=%s', + 'choices' => [ + "aggregated (4 values: '', 'S', 'L', 'P')" => -1, + ], + 'output_formatter' => function($value) use($translator) { + $map = [ + "L" => $translator->trans("facet.ThumbnailOrientation:Landscape"), + "P" => $translator->trans("facet.ThumbnailOrientation:Portrait"), + 'S' => $translator->trans("facet.ThumbnailOrientation:Square") + ]; + return array_key_exists($value, $map) ? $map[$value] : $value; + }, + ], '_colorspace' => [ 'type' => 'string', - 'label' => 'Colorspace', + 'label' => 'prod::facet:Colorspace_label', 'field' => "meta.ColorSpace", 'esfield' => 'metadata_tags.ColorSpace', 'query' => 'meta.ColorSpace:%s', ], '_mimetype' => [ 'type' => 'string', - 'label' => 'MimeType', + 'label' => 'prod::facet:MimeType_label', 'field' => "meta.MimeType", 'esfield' => 'metadata_tags.MimeType', 'query' => 'meta.MimeType:%s', diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php index 0b7a3ce9e6..3115055a34 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchSettingsFormType.php @@ -137,7 +137,7 @@ class ElasticsearchSettingsFormType extends AbstractType } // add or replace hardcoded tech fields - foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) { + foreach(ElasticsearchOptions::getAggregableTechnicalFields($this->translator) as $k => $f) { $choices = array_key_exists('choices', $f) ? $f['choices'] : null; // a tech-field can publish it's own choices $help = null; $label = '#' . $k; diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php index a7da16e834..32a06e3781 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/SubDefinitionHydrator.php @@ -18,7 +18,18 @@ use media_Permalink_Adapter; class SubDefinitionHydrator implements HydratorInterface { - /** @var Application */ + const ORIENTATION_SQUARE = 'S'; + const ORIENTATION_LANDSCAPE = 'L'; + const ORIENTATION_PORTRAIT = 'P'; + const ORIENTATION_UNKNOW = ''; + +// const ORIENTATION_SQUARE = 1; +// const ORIENTATION_LANDSCAPE = 2; +// const ORIENTATION_PORTRAIT = 3; +// const ORIENTATION_UNKNOW = 0; + + + /** @var Application */ private $app; /** @var databox */ @@ -38,45 +49,50 @@ class SubDefinitionHydrator implements HydratorInterface { if ($this->populatePermalinks) { $this->hydrateRecordsWithPermalinks($records); - } else { + } + else { $this->hydrateRecordsWithoutPermalinks($records); } } private function hydrateRecordsWithPermalinks(&$records) { - foreach(array_keys($records) as $rid) { + foreach (array_keys($records) as $rid) { + + $record = &$records[$rid]; + try { $subdefs = $this->databox->getRecordRepository()->find($rid)->get_subdefs(); $pls = array_map( /** media_Permalink_Adapter|null $plink */ - function($plink) { - return $plink ? ((string) $plink->get_url()) : null; + function ($plink) { + return $plink ? ((string)$plink->get_url()) : null; }, media_Permalink_Adapter::getMany($this->app, $subdefs, false) // false: don't create missing plinks ); - foreach($subdefs as $subdef) { + foreach ($subdefs as $subdef) { $name = $subdef->get_name(); - if(substr(($path = $subdef->get_path()), -1) !== '/') { + if (substr(($path = $subdef->get_path()), -1) !== '/') { $path .= '/'; } - $records[$rid]['subdefs'][$name] = array( - 'path' => $path . $subdef->get_file(), - 'width' => $subdef->get_width(), - 'height' => $subdef->get_height(), - 'size' => $subdef->get_size(), - 'mime' => $subdef->get_mime(), + $record['subdefs'][$name] = [ + 'path' => $path . $subdef->get_file(), + 'width' => $subdef->get_width(), + 'height' => $subdef->get_height(), + 'size' => $subdef->get_size(), + 'mime' => $subdef->get_mime(), 'permalink' => array_key_exists($name, $pls) ? $pls[$name] : null - ); - + ]; + if ($name == "thumbnail") { + $this->setOrientation($record, $subdef->get_width(), $subdef->get_height()); + } } } catch (\Exception $e) { // cant get record ? ignore } - } } @@ -96,22 +112,42 @@ class SubDefinitionHydrator implements HydratorInterface ORDER BY s.record_id SQL; $statement = $this->databox->get_connection()->executeQuery($sql, - array(array_keys($records)), - array(Connection::PARAM_INT_ARRAY) + [array_keys($records)], + [Connection::PARAM_INT_ARRAY] ); $current_rid = null; $record = null; while ($subdef = $statement->fetch()) { + $rid = $subdef['record_id']; + $record = &$records[$rid]; $name = $subdef['name']; - $records[$subdef['record_id']]['subdefs'][$name] = array( - 'path' => $subdef['path'], - 'width' => $subdef['width'], - 'height' => $subdef['height'], - 'size' => $subdef['size'], - 'mime' => $subdef['mime'], + $record['subdefs'][$name] = [ + 'path' => $subdef['path'], + 'width' => $subdef['width'], + 'height' => $subdef['height'], + 'size' => $subdef['size'], + 'mime' => $subdef['mime'], 'permalink' => null - ); + ]; + if ($name == "thumbnail") { + $this->setOrientation($record, $subdef['width'], $subdef['height']); + } } } + + private function setOrientation(&$record, $w, $h) + { + $o = self::ORIENTATION_UNKNOW; + if ($w !== '' && $h !== '' && !is_null($w) && !is_null($h)) { + $w = (int)$w; + $h = (int)$h; + $o = $w == $h ? self::ORIENTATION_SQUARE : ($w > $h ? self::ORIENTATION_LANDSCAPE : self::ORIENTATION_PORTRAIT); + } + if(!array_key_exists('metadata_tags', $record)) { + $record['metadata_tags'] = []; + } + $record['metadata_tags']['ThumbnailOrientation'] = $o; + } } + diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php index 07d186b4e3..ceb7a0a6d9 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Mapping/MetadataTagToFieldMappingConverter.php @@ -18,6 +18,25 @@ class MetadataTagToFieldMappingConverter { public function convertTag(Tag $tag) + { + if ($tag->getType() === FieldMapping::TYPE_STRING) { + + $fieldMapping = new StringFieldMapping($tag->getName()); + $fieldMapping->addChild((new StringFieldMapping('raw'))->enableRawIndexing()); + if ($tag->isAnalyzable()) { + $fieldMapping->enableAnalysis(); + } + else { + $fieldMapping->disableAnalysis(); + } + + return $fieldMapping; + } + + return new FieldMapping($tag->getName(), $tag->getType()); + } + + public function dead_convertTag(Tag $tag) { if ($tag->getType() === FieldMapping::TYPE_STRING) { $fieldMapping = new StringFieldMapping($tag->getName()); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php index 4849ff4693..6f7d0b4655 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/FacetsResponse.php @@ -24,7 +24,7 @@ class FacetsResponse return; } - $atf = ElasticsearchOptions::getAggregableTechnicalFields(); + $atf = ElasticsearchOptions::getAggregableTechnicalFields($this->translator); // sort facets respecting the order defined in options foreach($options->getAggregableFields() as $name=>$foptions) { @@ -35,9 +35,11 @@ class FacetsResponse $tf = null; $valueFormatter = function($v){ return $v; }; // default equality formatter + $label = $name; if(array_key_exists($name, $atf)) { $tf = $atf[$name]; + $label = $tf['label']; if(array_key_exists('output_formatter', $tf)) { $valueFormatter = $tf['output_formatter']; } @@ -56,7 +58,8 @@ class FacetsResponse if($response['aggregations'][$name . '#empty']['doc_count'] > 0) { // don't add a facet for 0 results $aggregation['buckets'][] = [ 'key' => '_unset_', - 'value' => $this->translator->trans('prod:workzone:facetstab:unset_field_facet_label_(%fieldname%)', ['%fieldname%' =>$name]), // special homemade prop to display a human value instead of the key + 'value' => $this->translator->trans('prod:workzone:facetstab:unset_field_facet_label_(%fieldname%)', ['%fieldname%' =>$label]), // special homemade prop to display a human value instead of the key + // 'value' => 'unset '.$name, // special homemade prop to display a human value instead of the key 'doc_count' => $response['aggregations'][$name . '#empty']['doc_count'] ]; } @@ -70,8 +73,15 @@ class FacetsResponse $key = array_key_exists('key_as_string', $bucket) ? $bucket['key_as_string'] : $bucket['key']; if($tf) { // the field is one of the hardcoded tech fields + if($key == '_unset_' && array_key_exists('value', $bucket)) { + // don't use the valueformatter since 'value' if already translated + $v = $bucket['value']; + } + else { + $v = $valueFormatter($key); + } $value = [ - 'value' => $valueFormatter($key), + 'value' => $v, 'raw_value' => $key, 'count' => $bucket['doc_count'], 'query' => sprintf($tf['query'], $this->escaper->escapeWord($key)) diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php index 8893523fe0..544f838504 100644 --- a/lib/classes/media/subdef.php +++ b/lib/classes/media/subdef.php @@ -109,6 +109,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface const TC_DATA_COLORSPACE = 'ColorSpace'; const TC_DATA_CHANNELS = 'Channels'; const TC_DATA_ORIENTATION = 'Orientation'; + const TC_DATA_THUMBNAILORIENTATION = 'ThumbnailOrientation'; const TC_DATA_COLORDEPTH = 'ColorDepth'; const TC_DATA_DURATION = 'Duration'; const TC_DATA_AUDIOCODEC = 'AudioCodec'; @@ -864,6 +865,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface self::TC_DATA_VIDEOCODEC => ['method' => 'getVideoCodec', 'type' => 'string', 'analyzable' => false], self::TC_DATA_AUDIOCODEC => ['method' => 'getAudioCodec', 'type' => 'string', 'analyzable' => false], self::TC_DATA_ORIENTATION => ['method' => 'getOrientation', 'type' => 'integer', 'analyzable' => false], + self::TC_DATA_THUMBNAILORIENTATION => ['type' => 'string', 'analyzable' => false], self::TC_DATA_LONGITUDE => ['method' => 'getLongitude', 'type' => 'float', 'analyzable' => false], self::TC_DATA_LONGITUDE_REF => ['method' => 'getLongitudeRef'], self::TC_DATA_LATITUDE => ['method' => 'getLatitude', 'type' => 'float', 'analyzable' => false], From 668302301759bcef20584baa925fcb483642b8f7 Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 8 Mar 2022 18:04:08 +0300 Subject: [PATCH 11/22] generate string --- resources/locales/messages.de.xlf | 178 +++++++++++++++++----------- resources/locales/messages.en.xlf | 178 +++++++++++++++++----------- resources/locales/messages.fr.xlf | 178 +++++++++++++++++----------- resources/locales/messages.nl.xlf | 164 +++++++++++++++---------- resources/locales/validators.de.xlf | 2 +- resources/locales/validators.en.xlf | 2 +- resources/locales/validators.fr.xlf | 2 +- resources/locales/validators.nl.xlf | 2 +- 8 files changed, 441 insertions(+), 265 deletions(-) diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index 868442ed3d..352b7e5b2b 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,9 +196,9 @@ Bridge/Dailymotion/element_informations.html.twig
- %number% documents<br/>selectionnes + selectionnes]]> ausgewählt]]> - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %quantity% Stories attached to the WorkZone @@ -279,7 +279,7 @@ %total% reponses %total% Ergebnisse - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %user% a envoye son rapport de validation de %title% @@ -1080,7 +1080,6 @@ Aperture Blende - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1291,21 +1290,11 @@ Media/Subdef/Video.php Media/Subdef/Audio.php - - Audio Samplerate - Audio Samplerate - SearchEngine/Elastic/ElasticsearchOptions.php - Audio channel Audiokanal Media/Subdef/Audio.php - - Audio codec - Audio-Codec - SearchEngine/Elastic/ElasticsearchOptions.php - AudioSamplerate Audio Samplerate @@ -1577,7 +1566,6 @@ Camera Model Kameramodell - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1863,11 +1851,6 @@ Farbraum web/common/technical_datas.html.twig - - Colorspace - Colorspace - SearchEngine/Elastic/ElasticsearchOptions.php - Commande Bestellung @@ -2534,7 +2517,7 @@ Form/Configuration/ActionsFormType.php - Display & action settings + Anzeige und Handlung-Einstellungen admin/fields/templates.html.twig @@ -3352,11 +3335,6 @@ web/common/technical_datas.html.twig web/prod/index.html.twig - - FlashFired - FlashFired - SearchEngine/Elastic/ElasticsearchOptions.php - Flatten layers Flatten Layers @@ -3418,11 +3396,6 @@ Bildfrequenz Media/Subdef/Video.php - - FrameRate - Framerate - SearchEngine/Elastic/ElasticsearchOptions.php - Frequence d'echantillonage Abtastfrequenz @@ -3668,11 +3641,6 @@ IP web/account/sessions.html.twig - - ISO - ISO - SearchEngine/Elastic/ElasticsearchOptions.php - ISO sensibility ISO Empfindlichkeit @@ -4375,11 +4343,6 @@ Mime Typ web/common/technical_datas.html.twig - - MimeType - MimeType - SearchEngine/Elastic/ElasticsearchOptions.php - Minimum number of letters before truncation Mindestzeichenzahl vor der Kürzung @@ -4911,11 +4874,6 @@ Einfach Controller/Root/LoginController.php - - Orientation - Ausrichtung - SearchEngine/Elastic/ElasticsearchOptions.php - Original name ursprünglicher Name @@ -6234,7 +6192,6 @@ Shutter speed Verschlusszeit - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -7458,11 +7415,6 @@ Video Codec Media/Subdef/Video.php - - Video codec - Video-Codec - SearchEngine/Elastic/ElasticsearchOptions.php - Videos Videos @@ -9726,7 +9678,7 @@ ascendant aufsteigend - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php audio @@ -10330,12 +10282,12 @@ date dajout hinzugefügtes Datum - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php date de modification Änderungsdatum - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php decembre @@ -10350,7 +10302,7 @@ descendant absteigend - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php developers:: Events name @@ -10730,6 +10682,33 @@ Untertitelung (vtt) Felder senden prod/WorkZone/ExposeFieldList.html.twig + + facet.ThumbnailOrientation:Landscape + facet.ThumbnailOrientation:Landscape + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Portrait + facet.ThumbnailOrientation:Portrait + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Square + facet.ThumbnailOrientation:Square + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:no + facet.flashfired:no + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:yes + facet.flashfired:yes + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + failed to send mail Email Senden ist fehlgeschlagen @@ -11619,7 +11598,7 @@ pertinence Relevanz - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php php.ini path @@ -11832,7 +11811,7 @@ Controller/Root/AccountController.php - phraseanet::account: << your account can be deleted via admin interface >> + >]]> Ihr Benutzerkonto kann nur durch die Administration Anwendung gelöscht werden. web/account/account.html.twig @@ -12594,20 +12573,85 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben web/lightbox/validate.html.twig web/prod/index.html.twig + + prod::facet.Orientation_label + prod::facet.Orientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet.ThumbnailOrientation_label + prod::facet.ThumbnailOrientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Aperture_label + prod::facet:Aperture_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioCodec_label + prod::facet:AudioCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioSamplerate_label + prod::facet:AudioSamplerate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:CameraModel_label + prod::facet:CameraModel_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Colorspace_label + prod::facet:Colorspace_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FlashFired_label + prod::facet:FlashFired_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FrameRate_label + prod::facet:FrameRate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ISO_label + prod::facet:ISO_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:MimeType_label + prod::facet:MimeType_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ShutterSpeed_label + prod::facet:ShutterSpeed_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:VideoCodec_label + prod::facet:VideoCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + prod::facet:base_label Datenbanken - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:collection_label Kollektionen - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:doctype_label Dokumenttyp - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::feedback:feedback_set_title @@ -13374,7 +13418,7 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben prod:workzone:facetstab:unset_field_facet_label_(%fieldname%) Wert nicht gesetzt für %fieldname% - Elastic/Search/FacetsResponse.php + Elastic/Search/FacetsResponse.php public @@ -14593,7 +14637,7 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben web/thesaurus/thesaurus.html.twig - thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) + web/thesaurus/thesaurus.html.twig diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index 551c3cc264..d1e37a45d0 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,9 +196,9 @@ Bridge/Dailymotion/element_informations.html.twig
- %number% documents<br/>selectionnes + selectionnes]]> selected]]> - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %quantity% Stories attached to the WorkZone @@ -279,7 +279,7 @@ %total% reponses %total% responses - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %user% a envoye son rapport de validation de %title% @@ -1081,7 +1081,6 @@ Aperture Aperture - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1292,21 +1291,11 @@ Media/Subdef/Video.php Media/Subdef/Audio.php - - Audio Samplerate - Audio Samplerate - SearchEngine/Elastic/ElasticsearchOptions.php - Audio channel Audio channel Media/Subdef/Audio.php - - Audio codec - Audio codec - SearchEngine/Elastic/ElasticsearchOptions.php - AudioSamplerate Audio sample rate @@ -1578,7 +1567,6 @@ Camera Model Camera model - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1865,11 +1853,6 @@ Color space web/common/technical_datas.html.twig - - Colorspace - Colorspace - SearchEngine/Elastic/ElasticsearchOptions.php - Commande Order @@ -2537,7 +2520,7 @@ Form/Configuration/ActionsFormType.php - Display & action settings + Display and action settings admin/fields/templates.html.twig @@ -3355,11 +3338,6 @@ web/common/technical_datas.html.twig web/prod/index.html.twig - - FlashFired - FlashFired - SearchEngine/Elastic/ElasticsearchOptions.php - Flatten layers Flatten layers @@ -3421,11 +3399,6 @@ Frame rate Media/Subdef/Video.php - - FrameRate - FrameRate - SearchEngine/Elastic/ElasticsearchOptions.php - Frequence d'echantillonage Sampling frequency @@ -3671,11 +3644,6 @@ IP address web/account/sessions.html.twig - - ISO - ISO - SearchEngine/Elastic/ElasticsearchOptions.php - ISO sensibility ISO sensibility @@ -4378,11 +4346,6 @@ Mime type web/common/technical_datas.html.twig - - MimeType - MimeType - SearchEngine/Elastic/ElasticsearchOptions.php - Minimum number of letters before truncation Minimum number of characters before truncation @@ -4914,11 +4877,6 @@ Ordinary Controller/Root/LoginController.php - - Orientation - Orientation - SearchEngine/Elastic/ElasticsearchOptions.php - Original name Original name @@ -6237,7 +6195,6 @@ Shutter speed Shutter speed - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -7461,11 +7418,6 @@ Video codec Media/Subdef/Video.php - - Video codec - Video codec - SearchEngine/Elastic/ElasticsearchOptions.php - Videos Videos @@ -9729,7 +9681,7 @@ ascendant ascending - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php audio @@ -10333,12 +10285,12 @@ date dajout Add date - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php date de modification Modification date - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php decembre @@ -10353,7 +10305,7 @@ descendant descending - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php developers:: Events name @@ -10733,6 +10685,33 @@ Send video text track files prod/WorkZone/ExposeFieldList.html.twig + + facet.ThumbnailOrientation:Landscape + facet.ThumbnailOrientation:Landscape + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Portrait + facet.ThumbnailOrientation:Portrait + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Square + facet.ThumbnailOrientation:Square + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:no + facet.flashfired:no + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:yes + facet.flashfired:yes + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + failed to send mail failed to send mail @@ -11622,7 +11601,7 @@ pertinence Relevance - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php php.ini path @@ -11835,7 +11814,7 @@ Controller/Root/AccountController.php - phraseanet::account: << your account can be deleted via admin interface >> + >]]> Your rights do not allow to perform this action. Your account can only be deleted via the Administration interface. web/account/account.html.twig @@ -12599,20 +12578,85 @@ Warning: The current values will be overwritten by these new values web/lightbox/validate.html.twig web/prod/index.html.twig + + prod::facet.Orientation_label + prod::facet.Orientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet.ThumbnailOrientation_label + prod::facet.ThumbnailOrientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Aperture_label + prod::facet:Aperture_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioCodec_label + prod::facet:AudioCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioSamplerate_label + prod::facet:AudioSamplerate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:CameraModel_label + prod::facet:CameraModel_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Colorspace_label + prod::facet:Colorspace_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FlashFired_label + prod::facet:FlashFired_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FrameRate_label + prod::facet:FrameRate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ISO_label + prod::facet:ISO_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:MimeType_label + prod::facet:MimeType_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ShutterSpeed_label + prod::facet:ShutterSpeed_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:VideoCodec_label + prod::facet:VideoCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + prod::facet:base_label Base - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:collection_label Collection - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:doctype_label Document type - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::feedback:feedback_set_title @@ -13382,7 +13426,7 @@ It is possible to place several search areas prod:workzone:facetstab:unset_field_facet_label_(%fieldname%) Unset value for %fieldname% - Elastic/Search/FacetsResponse.php + Elastic/Search/FacetsResponse.php public @@ -14601,7 +14645,7 @@ It is possible to place several search areas web/thesaurus/thesaurus.html.twig - thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) + web/thesaurus/thesaurus.html.twig diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index e548a236ea..b98e4b0189 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,9 +196,9 @@ Bridge/Dailymotion/element_informations.html.twig
- %number% documents<br/>selectionnes + selectionnes]]> sélectionnés]]> - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %quantity% Stories attached to the WorkZone @@ -279,7 +279,7 @@ %total% reponses %total% réponses - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %user% a envoye son rapport de validation de %title% @@ -1080,7 +1080,6 @@ Aperture Ouverture - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1291,21 +1290,11 @@ Media/Subdef/Video.php Media/Subdef/Audio.php - - Audio Samplerate - Fréquence d'échantillonnage - SearchEngine/Elastic/ElasticsearchOptions.php - Audio channel Canal audio Media/Subdef/Audio.php - - Audio codec - Encodeur Audio - SearchEngine/Elastic/ElasticsearchOptions.php - AudioSamplerate Taux d’échantillonnage audio @@ -1577,7 +1566,6 @@ Camera Model Type d'appareil numérique - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1863,11 +1851,6 @@ Espace colorimétrique web/common/technical_datas.html.twig - - Colorspace - Espace colorimétrique - SearchEngine/Elastic/ElasticsearchOptions.php - Commande Commande @@ -2534,7 +2517,7 @@ Form/Configuration/ActionsFormType.php - Display & action settings + Paramétrage d'affichage et d'action admin/fields/templates.html.twig @@ -3352,11 +3335,6 @@ web/common/technical_datas.html.twig web/prod/index.html.twig - - FlashFired - Avec Flash - SearchEngine/Elastic/ElasticsearchOptions.php - Flatten layers Aplatir les calques @@ -3418,11 +3396,6 @@ Nombre d'images par seconde Media/Subdef/Video.php - - FrameRate - Cadence - SearchEngine/Elastic/ElasticsearchOptions.php - Frequence d'echantillonage Fréquence d'échantillonnage @@ -3668,11 +3641,6 @@ Adresse IP web/account/sessions.html.twig - - ISO - ISO - SearchEngine/Elastic/ElasticsearchOptions.php - ISO sensibility Sensibilité ISO @@ -4375,11 +4343,6 @@ Type Mime web/common/technical_datas.html.twig - - MimeType - MimeType - SearchEngine/Elastic/ElasticsearchOptions.php - Minimum number of letters before truncation Nombre minimal de caractères avant la troncature @@ -4911,11 +4874,6 @@ Normale Controller/Root/LoginController.php - - Orientation - Orientation - SearchEngine/Elastic/ElasticsearchOptions.php - Original name Le nom de fichier original @@ -6236,7 +6194,6 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Shutter speed Vitesse d'obturateur - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -7460,11 +7417,6 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Codec Vidéos Media/Subdef/Video.php - - Video codec - Codec vidéo - SearchEngine/Elastic/ElasticsearchOptions.php - Videos Vidéos @@ -9729,7 +9681,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le ascendant Ascendant - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php audio @@ -10333,12 +10285,12 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le date dajout Date d'ajout - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php date de modification date de modification - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php decembre @@ -10353,7 +10305,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le descendant Descendant - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php developers:: Events name @@ -10733,6 +10685,33 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le Envoyer les fichiers de sous titrage prod/WorkZone/ExposeFieldList.html.twig + + facet.ThumbnailOrientation:Landscape + facet.ThumbnailOrientation:Landscape + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Portrait + facet.ThumbnailOrientation:Portrait + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Square + facet.ThumbnailOrientation:Square + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:no + facet.flashfired:no + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:yes + facet.flashfired:yes + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + failed to send mail Echec de l'envoi d'e-mail @@ -11622,7 +11601,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le pertinence Pertinence - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php php.ini path @@ -11835,7 +11814,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le Controller/Root/AccountController.php - phraseanet::account: << your account can be deleted via admin interface >> + >]]> Vos droits ne vous permettent pas de réaliser cette action, votre compte ne peut être supprimé que via l'interface d'Administration. web/account/account.html.twig @@ -12599,20 +12578,85 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles web/lightbox/validate.html.twig web/prod/index.html.twig + + prod::facet.Orientation_label + prod::facet.Orientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet.ThumbnailOrientation_label + prod::facet.ThumbnailOrientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Aperture_label + prod::facet:Aperture_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioCodec_label + prod::facet:AudioCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioSamplerate_label + prod::facet:AudioSamplerate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:CameraModel_label + prod::facet:CameraModel_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Colorspace_label + prod::facet:Colorspace_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FlashFired_label + prod::facet:FlashFired_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FrameRate_label + prod::facet:FrameRate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ISO_label + prod::facet:ISO_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:MimeType_label + prod::facet:MimeType_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ShutterSpeed_label + prod::facet:ShutterSpeed_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:VideoCodec_label + prod::facet:VideoCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + prod::facet:base_label Bases - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:collection_label Collections - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:doctype_label Types de documents - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::feedback:feedback_set_title @@ -13385,7 +13429,7 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles prod:workzone:facetstab:unset_field_facet_label_(%fieldname%) Valeur non définie pour %fieldname% - Elastic/Search/FacetsResponse.php + Elastic/Search/FacetsResponse.php public @@ -14604,7 +14648,7 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles web/thesaurus/thesaurus.html.twig - thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) + web/thesaurus/thesaurus.html.twig diff --git a/resources/locales/messages.nl.xlf b/resources/locales/messages.nl.xlf index 177b414e37..96bbc23ced 100644 --- a/resources/locales/messages.nl.xlf +++ b/resources/locales/messages.nl.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -198,7 +198,7 @@ selectionnes]]> selectionnes]]> - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %quantity% Stories attached to the WorkZone @@ -279,7 +279,7 @@ %total% reponses %total% reponses - Controller/Prod/QueryController.php + Controller/Prod/QueryController.php %user% a envoye son rapport de validation de %title% @@ -1082,7 +1082,6 @@ Aperture Diafragma - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1293,21 +1292,11 @@ Media/Subdef/Video.php Media/Subdef/Audio.php - - Audio Samplerate - Audio Samplerate - SearchEngine/Elastic/ElasticsearchOptions.php - Audio channel Audio channel Media/Subdef/Audio.php - - Audio codec - Audio codec - SearchEngine/Elastic/ElasticsearchOptions.php - AudioSamplerate AudioSamplerate @@ -1579,7 +1568,6 @@ Camera Model Cameramodel - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -1867,11 +1855,6 @@ Kleurruimte web/common/technical_datas.html.twig - - Colorspace - Colorspace - SearchEngine/Elastic/ElasticsearchOptions.php - Commande Bestelling @@ -3364,11 +3347,6 @@ web/common/technical_datas.html.twig web/prod/index.html.twig - - FlashFired - FlashFired - SearchEngine/Elastic/ElasticsearchOptions.php - Flatten layers Flatten layers @@ -3430,11 +3408,6 @@ Beelden per Seconden Media/Subdef/Video.php - - FrameRate - FrameRate - SearchEngine/Elastic/ElasticsearchOptions.php - Frequence d'echantillonage Samplefrequentie @@ -3680,11 +3653,6 @@ IP web/account/sessions.html.twig - - ISO - ISO - SearchEngine/Elastic/ElasticsearchOptions.php - ISO sensibility ISO waarde @@ -4387,11 +4355,6 @@ Mime type web/common/technical_datas.html.twig - - MimeType - MimeType - SearchEngine/Elastic/ElasticsearchOptions.php - Minimum number of letters before truncation Minimum aantal tekens alvorens te ledigen @@ -4923,11 +4886,6 @@ Gewoon Controller/Root/LoginController.php - - Orientation - Orientation - SearchEngine/Elastic/ElasticsearchOptions.php - Original name Originele naam @@ -6246,7 +6204,6 @@ Shutter speed Sluitersnelheid - SearchEngine/Elastic/ElasticsearchOptions.php web/common/technical_datas.html.twig @@ -7470,11 +7427,6 @@ Video Codec Media/Subdef/Video.php - - Video codec - Video codec - SearchEngine/Elastic/ElasticsearchOptions.php - Videos Video's @@ -9738,7 +9690,7 @@ ascendant aflopend - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php audio @@ -10342,12 +10294,12 @@ date dajout Datum toegevoegd - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php date de modification date de modification - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php decembre @@ -10362,7 +10314,7 @@ descendant oplopend - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php developers:: Events name @@ -10742,6 +10694,33 @@ expose::setting send vtt field prod/WorkZone/ExposeFieldList.html.twig + + facet.ThumbnailOrientation:Landscape + facet.ThumbnailOrientation:Landscape + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Portrait + facet.ThumbnailOrientation:Portrait + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.ThumbnailOrientation:Square + facet.ThumbnailOrientation:Square + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:no + facet.flashfired:no + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + + + facet.flashfired:yes + facet.flashfired:yes + SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php + failed to send mail email versturen niet gelukt @@ -11631,7 +11610,7 @@ pertinence relevantie - SearchEngine/Elastic/ElasticSearchEngine.php + SearchEngine/Elastic/ElasticSearchEngine.php php.ini path @@ -12605,20 +12584,85 @@ web/lightbox/validate.html.twig web/prod/index.html.twig + + prod::facet.Orientation_label + prod::facet.Orientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet.ThumbnailOrientation_label + prod::facet.ThumbnailOrientation_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Aperture_label + prod::facet:Aperture_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioCodec_label + prod::facet:AudioCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:AudioSamplerate_label + prod::facet:AudioSamplerate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:CameraModel_label + prod::facet:CameraModel_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:Colorspace_label + prod::facet:Colorspace_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FlashFired_label + prod::facet:FlashFired_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:FrameRate_label + prod::facet:FrameRate_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ISO_label + prod::facet:ISO_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:MimeType_label + prod::facet:MimeType_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:ShutterSpeed_label + prod::facet:ShutterSpeed_label + SearchEngine/Elastic/ElasticsearchOptions.php + + + prod::facet:VideoCodec_label + prod::facet:VideoCodec_label + SearchEngine/Elastic/ElasticsearchOptions.php + prod::facet:base_label prod::facet:base_label - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:collection_label prod::facet:collection_label - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:doctype_label prod::facet:doctype_label - SearchEngine/Elastic/ElasticsearchOptions.php + SearchEngine/Elastic/ElasticsearchOptions.php prod::feedback:feedback_set_title @@ -13385,7 +13429,7 @@ prod:workzone:facetstab:unset_field_facet_label_(%fieldname%) prod:workzone:facetstab:unset_field_facet_label_(%fieldname%) - Elastic/Search/FacetsResponse.php + Elastic/Search/FacetsResponse.php public diff --git a/resources/locales/validators.de.xlf b/resources/locales/validators.de.xlf index 7c569b9065..d9ebbe66de 100644 --- a/resources/locales/validators.de.xlf +++ b/resources/locales/validators.de.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.en.xlf b/resources/locales/validators.en.xlf index 54a2ef63be..8d2a1872be 100644 --- a/resources/locales/validators.en.xlf +++ b/resources/locales/validators.en.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.fr.xlf b/resources/locales/validators.fr.xlf index ed3f030055..7419646cf1 100644 --- a/resources/locales/validators.fr.xlf +++ b/resources/locales/validators.fr.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.nl.xlf b/resources/locales/validators.nl.xlf index 05fbe6ddc6..0bb6b94264 100644 --- a/resources/locales/validators.nl.xlf +++ b/resources/locales/validators.nl.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. From b62a63fc752f8e7976d2b099319bb46f26e3119e Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Tue, 8 Mar 2022 15:44:36 +0000 Subject: [PATCH 12/22] Translated using Weblate (English) Currently translated at 99.1% (2802 of 2827 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/en/ --- resources/locales/messages.en.xlf | 52 +++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index d1e37a45d0..cefa42f725 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -1,4 +1,4 @@ - +
@@ -7,8 +7,8 @@
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,7 +196,7 @@ Bridge/Dailymotion/element_informations.html.twig - selectionnes]]> + %number% documents<br/>selectionnes selected]]> Controller/Prod/QueryController.php @@ -2520,7 +2520,7 @@ Form/Configuration/ActionsFormType.php - + Display & action settings Display and action settings admin/fields/templates.html.twig @@ -10687,28 +10687,28 @@ facet.ThumbnailOrientation:Landscape - facet.ThumbnailOrientation:Landscape + Landscape SearchEngine/Elastic/ElasticsearchOptions.php facet.ThumbnailOrientation:Portrait - facet.ThumbnailOrientation:Portrait + Portrait SearchEngine/Elastic/ElasticsearchOptions.php facet.ThumbnailOrientation:Square - facet.ThumbnailOrientation:Square + Square SearchEngine/Elastic/ElasticsearchOptions.php facet.flashfired:no - facet.flashfired:no + Flash Not fired SearchEngine/Elastic/ElasticsearchOptions.php SearchEngine/Elastic/ElasticsearchOptions.php facet.flashfired:yes - facet.flashfired:yes + Flash Fired SearchEngine/Elastic/ElasticsearchOptions.php SearchEngine/Elastic/ElasticsearchOptions.php @@ -11216,7 +11216,7 @@ notification:: mark all notification as read - Mark all notifications as "Read" + Mark all notifications as "Read" web/prod/notifications_dialog.html.twig @@ -11814,7 +11814,7 @@ Controller/Root/AccountController.php - >]]> + phraseanet::account: << your account can be deleted via admin interface >> Your rights do not allow to perform this action. Your account can only be deleted via the Administration interface. web/account/account.html.twig @@ -12580,67 +12580,67 @@ Warning: The current values will be overwritten by these new values prod::facet.Orientation_label - prod::facet.Orientation_label + Exif Orientation SearchEngine/Elastic/ElasticsearchOptions.php prod::facet.ThumbnailOrientation_label - prod::facet.ThumbnailOrientation_label + Thumbnail Orientation SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:Aperture_label - prod::facet:Aperture_label + Aperture SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:AudioCodec_label - prod::facet:AudioCodec_label + Audio Codec SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:AudioSamplerate_label - prod::facet:AudioSamplerate_label + Audio Samplerate SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:CameraModel_label - prod::facet:CameraModel_label + Camera Model SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:Colorspace_label - prod::facet:Colorspace_label + Colorspace SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:FlashFired_label - prod::facet:FlashFired_label + Flash SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:FrameRate_label - prod::facet:FrameRate_label + Video frame rate SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:ISO_label - prod::facet:ISO_label + ISO SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:MimeType_label - prod::facet:MimeType_label + Mime Type SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:ShutterSpeed_label - prod::facet:ShutterSpeed_label + Shutter Speed SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:VideoCodec_label - prod::facet:VideoCodec_label + Video Codec SearchEngine/Elastic/ElasticsearchOptions.php @@ -14645,7 +14645,7 @@ It is possible to place several search areas web/thesaurus/thesaurus.html.twig - + thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) web/thesaurus/thesaurus.html.twig From 801d6ebe7ba8441dcf6604595ae517998d26ad8f Mon Sep 17 00:00:00 2001 From: Jennifer Piva Date: Tue, 8 Mar 2022 15:45:24 +0000 Subject: [PATCH 13/22] Translated using Weblate (German) Currently translated at 99.1% (2802 of 2827 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/de/ --- resources/locales/messages.de.xlf | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index 352b7e5b2b..32395ef631 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -1,4 +1,4 @@ - +
@@ -7,8 +7,8 @@
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,7 +196,7 @@ Bridge/Dailymotion/element_informations.html.twig - selectionnes]]> + %number% documents<br/>selectionnes ausgewählt]]> Controller/Prod/QueryController.php @@ -2517,7 +2517,7 @@ Form/Configuration/ActionsFormType.php - + Display & action settings Anzeige und Handlung-Einstellungen admin/fields/templates.html.twig @@ -10684,28 +10684,28 @@ facet.ThumbnailOrientation:Landscape - facet.ThumbnailOrientation:Landscape + Landschaft SearchEngine/Elastic/ElasticsearchOptions.php facet.ThumbnailOrientation:Portrait - facet.ThumbnailOrientation:Portrait + Porträt SearchEngine/Elastic/ElasticsearchOptions.php facet.ThumbnailOrientation:Square - facet.ThumbnailOrientation:Square + Quadrat SearchEngine/Elastic/ElasticsearchOptions.php facet.flashfired:no - facet.flashfired:no + Blitz nicht benutzt SearchEngine/Elastic/ElasticsearchOptions.php SearchEngine/Elastic/ElasticsearchOptions.php facet.flashfired:yes - facet.flashfired:yes + Blitz benutzt SearchEngine/Elastic/ElasticsearchOptions.php SearchEngine/Elastic/ElasticsearchOptions.php @@ -11811,7 +11811,7 @@ Controller/Root/AccountController.php - >]]> + phraseanet::account: << your account can be deleted via admin interface >> Ihr Benutzerkonto kann nur durch die Administration Anwendung gelöscht werden. web/account/account.html.twig @@ -12575,67 +12575,67 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben prod::facet.Orientation_label - prod::facet.Orientation_label + Exif Ausrichtung SearchEngine/Elastic/ElasticsearchOptions.php prod::facet.ThumbnailOrientation_label - prod::facet.ThumbnailOrientation_label + Ausrichtung SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:Aperture_label - prod::facet:Aperture_label + Blendeöffnung SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:AudioCodec_label - prod::facet:AudioCodec_label + Audio Codec SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:AudioSamplerate_label - prod::facet:AudioSamplerate_label + Audio Sample Rate SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:CameraModel_label - prod::facet:CameraModel_label + Kamera Modell SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:Colorspace_label - prod::facet:Colorspace_label + Farbraum SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:FlashFired_label - prod::facet:FlashFired_label + Blitzlicht SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:FrameRate_label - prod::facet:FrameRate_label + Video Frame Rate SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:ISO_label - prod::facet:ISO_label + ISO SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:MimeType_label - prod::facet:MimeType_label + Mime Type SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:ShutterSpeed_label - prod::facet:ShutterSpeed_label + Belichtungszeit SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:VideoCodec_label - prod::facet:VideoCodec_label + Video Codec SearchEngine/Elastic/ElasticsearchOptions.php @@ -14637,7 +14637,7 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben web/thesaurus/thesaurus.html.twig - + thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) web/thesaurus/thesaurus.html.twig From 20329fc39a9a357832f5cdc53d31ba0a69471885 Mon Sep 17 00:00:00 2001 From: Jennifer Piva Date: Tue, 8 Mar 2022 16:08:49 +0000 Subject: [PATCH 14/22] Translated using Weblate (English) Currently translated at 99.2% (2806 of 2827 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/en/ --- resources/locales/messages.en.xlf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index cefa42f725..e37def3754 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -12135,7 +12135,7 @@ print:: add and remember password to protect the pdf - Define a password to protect the PDF (optional) + Define a password to protect the PDF (optional) prod/actions/printer_default.html.twig @@ -12247,7 +12247,7 @@ print:: some options - Additional settings + Additional settings prod/actions/printer_default.html.twig @@ -12272,7 +12272,7 @@ print:: warning! Only available media for chosen subdef is downloadable - Leave the duration empty for a permanent validity + Leave the duration empty for a permanent validity prod/actions/printer_default.html.twig @@ -12585,7 +12585,7 @@ Warning: The current values will be overwritten by these new values prod::facet.ThumbnailOrientation_label - Thumbnail Orientation + Orientation SearchEngine/Elastic/ElasticsearchOptions.php @@ -13486,7 +13486,7 @@ It is possible to place several search areas publication:: %count% users to notify - %count% users will be notified + %count% users will be notified Controller/Prod/FeedController.php From b48c16eaace849a535777c76b71f11f781225dcb Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Tue, 8 Mar 2022 15:55:21 +0000 Subject: [PATCH 15/22] Translated using Weblate (French) Currently translated at 99.1% (2803 of 2827 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/fr/ --- resources/locales/messages.fr.xlf | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index b98e4b0189..2d795cd1dd 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -1,4 +1,4 @@ - +
@@ -7,8 +7,8 @@
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,7 +196,7 @@ Bridge/Dailymotion/element_informations.html.twig
- selectionnes]]> + %number% documents<br/>selectionnes sélectionnés]]> Controller/Prod/QueryController.php @@ -2517,7 +2517,7 @@ Form/Configuration/ActionsFormType.php - + Display & action settings Paramétrage d'affichage et d'action admin/fields/templates.html.twig @@ -10687,28 +10687,28 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le facet.ThumbnailOrientation:Landscape - facet.ThumbnailOrientation:Landscape + Paysage SearchEngine/Elastic/ElasticsearchOptions.php facet.ThumbnailOrientation:Portrait - facet.ThumbnailOrientation:Portrait + Portrait SearchEngine/Elastic/ElasticsearchOptions.php facet.ThumbnailOrientation:Square - facet.ThumbnailOrientation:Square + Carré SearchEngine/Elastic/ElasticsearchOptions.php facet.flashfired:no - facet.flashfired:no + Flash non déclenché SearchEngine/Elastic/ElasticsearchOptions.php SearchEngine/Elastic/ElasticsearchOptions.php facet.flashfired:yes - facet.flashfired:yes + Flash déclenché SearchEngine/Elastic/ElasticsearchOptions.php SearchEngine/Elastic/ElasticsearchOptions.php @@ -11814,7 +11814,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le Controller/Root/AccountController.php - >]]> + phraseanet::account: << your account can be deleted via admin interface >> Vos droits ne vous permettent pas de réaliser cette action, votre compte ne peut être supprimé que via l'interface d'Administration. web/account/account.html.twig @@ -12580,67 +12580,67 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles prod::facet.Orientation_label - prod::facet.Orientation_label + Orientation exif SearchEngine/Elastic/ElasticsearchOptions.php prod::facet.ThumbnailOrientation_label - prod::facet.ThumbnailOrientation_label + Orientation SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:Aperture_label - prod::facet:Aperture_label + Ouverture SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:AudioCodec_label - prod::facet:AudioCodec_label + Codec audio SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:AudioSamplerate_label - prod::facet:AudioSamplerate_label + Fréquence d'échantillonnage (audio) SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:CameraModel_label - prod::facet:CameraModel_label + Appareil Photographique SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:Colorspace_label - prod::facet:Colorspace_label + Espace colorimétrique SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:FlashFired_label - prod::facet:FlashFired_label + Flash SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:FrameRate_label - prod::facet:FrameRate_label + Cadence SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:ISO_label - prod::facet:ISO_label + ISO SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:MimeType_label - prod::facet:MimeType_label + Type Mime SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:ShutterSpeed_label - prod::facet:ShutterSpeed_label + Vitesse d'obturateur SearchEngine/Elastic/ElasticsearchOptions.php prod::facet:VideoCodec_label - prod::facet:VideoCodec_label + Codec Video SearchEngine/Elastic/ElasticsearchOptions.php @@ -14648,7 +14648,7 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles web/thesaurus/thesaurus.html.twig - + thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) web/thesaurus/thesaurus.html.twig From 7230312b41899fd28f953908b4563bf446a1a4c3 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Tue, 8 Mar 2022 16:35:18 +0000 Subject: [PATCH 16/22] Translated using Weblate (French) Currently translated at 99.1% (2803 of 2827 strings) Translation: Phraseanet/Phraseanet master message Translate-URL: https://hosted.weblate.org/projects/phraseanet/phraseanet-master-message/fr/ --- resources/locales/messages.fr.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index 2d795cd1dd..90d3c06a96 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -12600,7 +12600,7 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles prod::facet:AudioSamplerate_label - Fréquence d'échantillonnage (audio) + Fréquence d'échantillonnage SearchEngine/Elastic/ElasticsearchOptions.php From 642c716c0e7e77c1ebd25e9aed25c6c31c7dd534 Mon Sep 17 00:00:00 2001 From: aynsix Date: Wed, 9 Mar 2022 14:49:08 +0300 Subject: [PATCH 17/22] translate label --- .../Elastic/ElasticsearchOptions.php | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php index 581bd42982..647ebd8730 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php @@ -318,42 +318,42 @@ class ElasticsearchOptions return [ '_base' => [ 'type' => 'string', - 'label' => 'prod::facet:base_label', + 'label' => $translator->trans('prod::facet:base_label'), 'field' => "database", 'esfield' => 'databox_name', 'query' => 'database:%s', ], '_collection' => [ 'type' => 'string', - 'label' => 'prod::facet:collection_label', + 'label' => $translator->trans('prod::facet:collection_label'), 'field' => "collection", 'esfield' => 'collection_name', 'query' => 'collection:%s', ], '_doctype' => [ 'type' => 'string', - 'label' => 'prod::facet:doctype_label', + 'label' => $translator->trans('prod::facet:doctype_label'), 'field' => "type", 'esfield' => 'type', 'query' => 'type:%s', ], '_camera_model' => [ 'type' => 'string', - 'label' => 'prod::facet:CameraModel_label', + 'label' => $translator->trans('prod::facet:CameraModel_label'), 'field' => "meta.CameraModel", 'esfield' => 'metadata_tags.CameraModel', 'query' => 'meta.CameraModel=%s', ], '_iso' => [ 'type' => 'number', - 'label' => 'prod::facet:ISO_label', + 'label' => $translator->trans('prod::facet:ISO_label'), 'field' => "meta.ISO", 'esfield' => 'metadata_tags.ISO', 'query' => 'meta.ISO=%s', ], '_aperture' => [ 'type' => 'number', - 'label' => 'prod::facet:Aperture_label', + 'label' => $translator->trans('prod::facet:Aperture_label'), 'field' => "meta.Aperture", 'esfield' => 'metadata_tags.Aperture', 'query' => 'meta.Aperture=%s', @@ -363,7 +363,7 @@ class ElasticsearchOptions ], '_shutterspeed' => [ 'type' => 'number', - 'label' => 'prod::facet:ShutterSpeed_label', + 'label' => $translator->trans('prod::facet:ShutterSpeed_label'), 'field' => "meta.ShutterSpeed", 'esfield' => 'metadata_tags.ShutterSpeed', 'query' => 'meta.ShutterSpeed=%s', @@ -376,7 +376,7 @@ class ElasticsearchOptions ], '_flashfired' => [ 'type' => 'boolean', - 'label' => 'prod::facet:FlashFired_label', + 'label' => $translator->trans('prod::facet:FlashFired_label'), 'field' => "meta.FlashFired", 'esfield' => 'metadata_tags.FlashFired', 'query' => 'meta.FlashFired=%s', @@ -395,42 +395,42 @@ class ElasticsearchOptions ], '_framerate' => [ 'type' => 'number', - 'label' => 'prod::facet:FrameRate_label', + 'label' => $translator->trans('prod::facet:FrameRate_label'), 'field' => "meta.FrameRate", 'esfield' => 'metadata_tags.FrameRate', 'query' => 'meta.FrameRate=%s', ], '_audiosamplerate' => [ 'type' => 'number', - 'label' => 'prod::facet:AudioSamplerate_label', + 'label' => $translator->trans('prod::facet:AudioSamplerate_label'), 'field' => "meta.AudioSamplerate", 'esfield' => 'metadata_tags.AudioSamplerate', 'query' => 'meta.AudioSamplerate=%s', ], '_videocodec' => [ 'type' => 'string', - 'label' => 'prod::facet:VideoCodec_label', + 'label' => $translator->trans('prod::facet:VideoCodec_label'), 'field' => "meta.VideoCodec", 'esfield' => 'metadata_tags.VideoCodec', 'query' => 'meta.VideoCodec:%s', ], '_audiocodec' => [ 'type' => 'string', - 'label' => 'prod::facet:AudioCodec_label', + 'label' => $translator->trans('prod::facet:AudioCodec_label'), 'field' => "meta.AudioCodec", 'esfield' => 'metadata_tags.AudioCodec', 'query' => 'meta.AudioCodec:%s', ], '_orientation' => [ 'type' => 'string', - 'label' => 'prod::facet.Orientation_label', + 'label' => $translator->trans('prod::facet.Orientation_label'), 'field' => "meta.Orientation", 'esfield' => 'metadata_tags.Orientation', 'query' => 'meta.Orientation=%s', ], '_thumbnail_orientation' => [ 'type' => 'string', - 'label' => 'prod::facet.ThumbnailOrientation_label', + 'label' => $translator->trans('prod::facet.ThumbnailOrientation_label'), 'field' => "meta.ThumbnailOrientation", 'esfield' => 'metadata_tags.ThumbnailOrientation', 'query' => 'meta.ThumbnailOrientation=%s', @@ -448,14 +448,14 @@ class ElasticsearchOptions ], '_colorspace' => [ 'type' => 'string', - 'label' => 'prod::facet:Colorspace_label', + 'label' => $translator->trans('prod::facet:Colorspace_label'), 'field' => "meta.ColorSpace", 'esfield' => 'metadata_tags.ColorSpace', 'query' => 'meta.ColorSpace:%s', ], '_mimetype' => [ 'type' => 'string', - 'label' => 'prod::facet:MimeType_label', + 'label' => $translator->trans('prod::facet:MimeType_label'), 'field' => "meta.MimeType", 'esfield' => 'metadata_tags.MimeType', 'query' => 'meta.MimeType:%s', From 360657e537fed9a05685659755476ccb78622802 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Wed, 9 Mar 2022 18:08:09 +0100 Subject: [PATCH 18/22] PHRAS-3651_tech-facets-no-results: fix 0 results on some facets --- .../SearchEngine/Elastic/ElasticsearchOptions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php index 581bd42982..6b0c98aa7a 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticsearchOptions.php @@ -321,21 +321,21 @@ class ElasticsearchOptions 'label' => 'prod::facet:base_label', 'field' => "database", 'esfield' => 'databox_name', - 'query' => 'database:%s', + 'query' => 'database=%s', ], '_collection' => [ 'type' => 'string', 'label' => 'prod::facet:collection_label', 'field' => "collection", 'esfield' => 'collection_name', - 'query' => 'collection:%s', + 'query' => 'collection=%s', ], '_doctype' => [ 'type' => 'string', 'label' => 'prod::facet:doctype_label', 'field' => "type", 'esfield' => 'type', - 'query' => 'type:%s', + 'query' => 'type=%s', ], '_camera_model' => [ 'type' => 'string', @@ -412,14 +412,14 @@ class ElasticsearchOptions 'label' => 'prod::facet:VideoCodec_label', 'field' => "meta.VideoCodec", 'esfield' => 'metadata_tags.VideoCodec', - 'query' => 'meta.VideoCodec:%s', + 'query' => 'meta.VideoCodec=%s', ], '_audiocodec' => [ 'type' => 'string', 'label' => 'prod::facet:AudioCodec_label', 'field' => "meta.AudioCodec", 'esfield' => 'metadata_tags.AudioCodec', - 'query' => 'meta.AudioCodec:%s', + 'query' => 'meta.AudioCodec=%s', ], '_orientation' => [ 'type' => 'string', @@ -451,14 +451,14 @@ class ElasticsearchOptions 'label' => 'prod::facet:Colorspace_label', 'field' => "meta.ColorSpace", 'esfield' => 'metadata_tags.ColorSpace', - 'query' => 'meta.ColorSpace:%s', + 'query' => 'meta.ColorSpace=%s', ], '_mimetype' => [ 'type' => 'string', 'label' => 'prod::facet:MimeType_label', 'field' => "meta.MimeType", 'esfield' => 'metadata_tags.MimeType', - 'query' => 'meta.MimeType:%s', + 'query' => 'meta.MimeType=%s', ], ]; } From 7e385823865674ca79a5a55e639da2f6d92db086 Mon Sep 17 00:00:00 2001 From: aynsix Date: Mon, 14 Mar 2022 19:03:27 +0300 Subject: [PATCH 19/22] no need to delete file here --- lib/Alchemy/Phrasea/Command/BuildSubdefs.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php index 292495b22f..0edd59b6da 100644 --- a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php +++ b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php @@ -437,11 +437,9 @@ class BuildSubdefs extends Command // here an existing subdef must be (re)done if(isset($subdefNamesToDo[$name])) { if (!$this->dry) { - $subdef->remove_file(); $subdef->set_substituted(false); } $recordChanged = true; - $msg[] = sprintf(" [\"%s\"] deleted", $name); } } From 3782d672dff1eddec629b2e17999461171b937db Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 15 Mar 2022 10:28:53 +0300 Subject: [PATCH 20/22] mark deprecated --- lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php index 3d8d63f3d9..1ee6e8c52b 100644 --- a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php +++ b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php @@ -24,7 +24,7 @@ class BuildMissingSubdefs extends Command { parent::__construct($name); - $this->setDescription('Builds subviews that previously failed to be generated / did not exist when records were added'); + $this->setDescription('(Deprecated) Builds subviews that previously failed to be generated / did not exist when records were added'); } /** From f79be94fce1d7444a7029c37dc06608bfbd9d986 Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 15 Mar 2022 10:52:18 +0300 Subject: [PATCH 21/22] mark deprecated --- lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php index 1ee6e8c52b..f1b559952c 100644 --- a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php +++ b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php @@ -24,7 +24,7 @@ class BuildMissingSubdefs extends Command { parent::__construct($name); - $this->setDescription('(Deprecated) Builds subviews that previously failed to be generated / did not exist when records were added'); + $this->setDescription('(Deprecated please use ‘records:build-subdefs’ instead) Builds subviews that previously failed to be generated / did not exist when records were added'); } /** From 30cebd9b637f50bc3ca96f05f8e16abcd97be6a5 Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 15 Mar 2022 11:50:14 +0300 Subject: [PATCH 22/22] remove build missing subdefs --- bin/console | 1 - .../Phrasea/Command/BuildMissingSubdefs.php | 94 ------------------- 2 files changed, 95 deletions(-) delete mode 100644 lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php diff --git a/bin/console b/bin/console index c7e205b8f1..008465cedd 100755 --- a/bin/console +++ b/bin/console @@ -148,7 +148,6 @@ $cli->command(new UserListCommand('user:list')); $cli->command(new RecordAdd('records:add')); $cli->command(new RescanTechnicalDatas('records:rescan-technical-datas')); -$cli->command(new BuildMissingSubdefs('records:build-missing-subdefs')); $cli->command(new BuildSubdefs('records:build-subdefs')); $cli->command(new AddPlugin()); diff --git a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php deleted file mode 100644 index f1b559952c..0000000000 --- a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php +++ /dev/null @@ -1,94 +0,0 @@ -setDescription('(Deprecated please use ‘records:build-subdefs’ instead) Builds subviews that previously failed to be generated / did not exist when records were added'); - } - - /** - * {@inheritdoc} - */ - protected function doExecute(InputInterface $input, OutputInterface $output) - { - $start = microtime(true); - $progressBar = new ProgressBar($output); - $generatedSubdefs = 0; - - foreach ($this->container->getDataboxes() as $databox) { - $sql = 'SELECT record_id FROM record WHERE parent_record_id = 0'; - $result = $databox->get_connection()->executeQuery($sql)->fetchAll(\PDO::FETCH_ASSOC); - $progressBar->start(count($result)); - - foreach ($result as $row) { - $record = $databox->get_record($row['record_id']); - - $generatedSubdefs += $this->generateRecordMissingSubdefs($record); - - $progressBar->advance(); - } - - $progressBar->finish(); - } - - $this->container['monolog']->addInfo($generatedSubdefs . " subdefs done"); - $stop = microtime(true); - $duration = $stop - $start; - - $this->container['monolog']->addInfo(sprintf("process took %s, (%f sd/s.)", $this->getFormattedDuration($duration), round($generatedSubdefs / $duration, 3))); - $progressBar->finish(); - } - - /** - * Generate subdef generation and return number of subdef - * @param \record_adapter $record - * @return int - */ - protected function generateRecordMissingSubdefs(\record_adapter $record) - { - $wanted_subdefs = $record->get_missing_subdefs(); - - if (!empty($wanted_subdefs)) { - $this->getSubdefGenerator()->generateSubdefs($record, $wanted_subdefs); - - foreach ($wanted_subdefs as $subdef) { - $this->container['monolog']->addInfo("generate " . $subdef . " for record " . $record->getRecordId()); - } - } - - return count($wanted_subdefs); - } - - /** - * @return SubdefGenerator - */ - protected function getSubdefGenerator() - { - if (null === $this->generator) { - $this->generator = $this->container['subdef.generator']; - } - - return $this->generator; - } -}