diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index 60a231d120..914ea8516b 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -529,7 +529,7 @@ class Application extends SilexApplication $twig->addFilter('get_collection_logo', new \Twig_Filter_Function('collection::getLogo')); $twig->addFilter('floor', new \Twig_Filter_Function('floor')); $twig->addFilter('min', new \Twig_Filter_Function('min')); - $twig->addFilter('bas_names', new \Twig_Filter_Function('phrasea::bas_names')); + $twig->addFilter('bas_labels', new \Twig_Filter_Function('phrasea::bas_labels')); $twig->addFilter('sbas_names', new \Twig_Filter_Function('phrasea::sbas_names')); $twig->addFilter('sbas_from_bas', new \Twig_Filter_Function('phrasea::sbasFromBas')); $twig->addFilter('key_exists', new \Twig_Filter_Function('array_key_exists')); diff --git a/lib/Alchemy/Phrasea/Command/RecordAdd.php b/lib/Alchemy/Phrasea/Command/RecordAdd.php index 41848ab6c8..6731cd9cce 100644 --- a/lib/Alchemy/Phrasea/Command/RecordAdd.php +++ b/lib/Alchemy/Phrasea/Command/RecordAdd.php @@ -66,7 +66,7 @@ class RecordAdd extends Command $dialog = $this->getHelperSet()->get('dialog'); do { - $continue = strtolower($dialog->ask($output, sprintf("Will add record %s (%s) on collection %s\nContinue ? (y/N)", $file, $media->getType(), $collection->get_name()), 'N')); + $continue = strtolower($dialog->ask($output, sprintf("Will add record %s (%s) on collection %s\nContinue ? (y/N)", $file, $media->getType(), $collection->get_label($this->container['locale.I18n'])), 'N')); } while ( ! in_array($continue, array('y', 'n'))); if (strtolower($continue) !== 'y') { @@ -116,7 +116,7 @@ class RecordAdd extends Command if ($elementCreated instanceof \record_adapter) { $output->writeln( sprintf( - "Record id %d on collection `%s` (databox `%s`) has been created", $elementCreated->get_record_id(), $elementCreated->get_collection()->get_name(), $elementCreated->get_databox()->get_viewname() + "Record id %d on collection `%s` (databox `%s`) has been created", $elementCreated->get_record_id(), $elementCreated->get_collection()->get_label($this->container['locale.I18n']), $elementCreated->get_databox()->get_viewname() ) ); $this->container['phraseanet.SE']->addRecord($elementCreated); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php index 1e1fc3dcde..8a2ec82d81 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php @@ -183,6 +183,10 @@ class Collection implements ControllerProviderInterface ->assert('bas_id', '\d+') ->bind('admin_collection_rename'); + $controllers->post('/{bas_id}/labels/', $this->call('labels')) + ->assert('bas_id', '\d+') + ->bind('admin_collection_labels'); + /** * Empty a collection * @@ -888,6 +892,40 @@ class Collection implements ControllerProviderInterface return $app->redirect('/admin/collection/' . $collection->get_base_id() . '/?success=' . (int) $success . '&reload-tree=1'); } + public function labels(Application $app, Request $request, $bas_id) + { + if (null === $labels = $request->request->get('labels')) { + $app->abort(400, _('Missing labels parameter')); + } + if (false === is_array($labels)) { + $app->abort(400, _('Invalid labels parameter')); + } + + $collection = \collection::get_from_base_id($app, $bas_id); + $success = true; + + try { + foreach ($app['locales.I18n.available'] as $code => $language) { + if (!isset($labels[$code])) { + continue; + } + $value = $labels[$code] ?: null; + $collection->set_label($code, $value); + } + } catch (\Exception $e) { + $success = false; + } + + if ('json' === $app['request']->getRequestFormat()) { + return $app->json(array( + 'success' => $success, + 'msg' => $success ? _('Successful update') : _('An error occured') + )); + } + + return $app->redirect('/admin/collection/' . $collection->get_base_id() . '/?success=' . (int) $success . '&reload-tree=1'); + } + /** * Set public presentation watermark * diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Users.php b/lib/Alchemy/Phrasea/Controller/Admin/Users.php index 7c41ebb5b3..893d2e66d4 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Users.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Users.php @@ -538,9 +538,9 @@ class Users implements ControllerProviderInterface if (\Swift_Validate::email($row['usr_mail'])) { foreach ($bases as $bas => $isok) { if ($isok) { - $accept .= '
  • ' . \phrasea::bas_names($bas, $app) . "
  • \n"; + $accept .= '
  • ' . \phrasea::bas_labels($bas, $app) . "
  • \n"; } else { - $deny .= '
  • ' . \phrasea::bas_names($bas, $app) . "
  • \n"; + $deny .= '
  • ' . \phrasea::bas_labels($bas, $app) . "
  • \n"; } } if (($accept != '' || $deny != '')) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php index 0025abe261..714e155bf9 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php @@ -77,7 +77,7 @@ class MoveCollection implements ControllerProviderInterface } if (!$app['authentication']->getUser()->ACL()->has_right_on_base($request->request->get('base_id'), 'canaddrecord')) { - $datas['message'] = sprintf(_("You do not have the permission to move records to %s"), \phrasea::bas_names($move->getBaseIdDestination(), $app)); + $datas['message'] = sprintf(_("You do not have the permission to move records to %s"), \phrasea::bas_labels($move->getBaseIdDestination(), $app)); return $app->json($datas); } diff --git a/lib/Alchemy/Phrasea/Out/Module/PDF.php b/lib/Alchemy/Phrasea/Out/Module/PDF.php index 61820a9ebf..f78617b771 100644 --- a/lib/Alchemy/Phrasea/Out/Module/PDF.php +++ b/lib/Alchemy/Phrasea/Out/Module/PDF.php @@ -249,7 +249,7 @@ class PDF $y = $this->pdf->GetY(); - $t = \phrasea::bas_names($rec->get_base_id(), $this->app); + $t = \phrasea::bas_labels($rec->get_base_id(), $this->app); $this->pdf->SetFont(PhraseaPDF::FONT, '', 10); $this->pdf->SetFillColor(220, 220, 220); $this->pdf->SetLeftMargin($lmargin); @@ -354,7 +354,7 @@ class PDF } if ($vn == "" || $vn == "1") { - $RIGHT_TEXT = \phrasea::bas_names($rec->get_base_id(), $this->app); + $RIGHT_TEXT = \phrasea::bas_labels($rec->get_base_id(), $this->app); } elseif ($vn == "2") { $RIGHT_IMG = $this->app['phraseanet.registry']->get('GV_RootPath') . "config/minilogos/" . $rec->get_base_id(); } diff --git a/lib/classes/API/V1/adapter.php b/lib/classes/API/V1/adapter.php index 0710cd3167..139a0b6578 100644 --- a/lib/classes/API/V1/adapter.php +++ b/lib/classes/API/V1/adapter.php @@ -666,7 +666,7 @@ class API_V1_adapter extends API_V1_Abstract $collection = \collection::get_from_base_id($this->app, $request->get('base_id')); if (!$app['authentication']->getUser()->ACL()->has_right_on_base($request->get('base_id'), 'canaddrecord')) { - throw new API_V1_exception_forbidden(sprintf('You do not have access to collection %s', $collection->get_name())); + throw new API_V1_exception_forbidden(sprintf('You do not have access to collection %s', $collection->get_label($this->app['locale.I18n']))); } $media = $app['mediavorus']->guess($file->getPathname()); @@ -2019,7 +2019,7 @@ class API_V1_adapter extends API_V1_Abstract $ret = array( 'base_id' => $collection->get_base_id(), 'collection_id' => $collection->get_coll_id(), - 'name' => $collection->get_name(), + 'name' => $collection->get_label($this->app['locale.I18n']), 'record_amount' => $collection->get_record_amount(), ); diff --git a/lib/classes/collection.php b/lib/classes/collection.php index 9c8d100d59..0db1b9fdc1 100644 --- a/lib/classes/collection.php +++ b/lib/classes/collection.php @@ -11,6 +11,8 @@ use Alchemy\Phrasea\Application; +use Alchemy\Phrasea\Exception\InvalidArgumentException; + /** * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 @@ -25,6 +27,7 @@ class collection implements cache_cacheableInterface protected $name; protected $prefs; protected $pub_wm; + protected $labels = array(); private static $_logos = array(); private static $_stamps = array(); private static $_watermarks = array(); @@ -61,6 +64,7 @@ class collection implements cache_cacheableInterface $this->pub_wm = $datas['pub_wm']; $this->name = $datas['name']; $this->prefs = $datas['prefs']; + $this->labels = $datas['labels']; return $this; } catch (Exception $e) { @@ -68,8 +72,10 @@ class collection implements cache_cacheableInterface } $connbas = $this->databox->get_connection(); - $sql = 'SELECT asciiname, prefs, pub_wm, coll_id - FROM coll WHERE coll_id = :coll_id'; + $sql = 'SELECT + asciiname, prefs, pub_wm, coll_id, + label_en, label_fr, label_de, label_nl + FROM coll WHERE coll_id = :coll_id'; $stmt = $connbas->prepare($sql); $stmt->execute(array(':coll_id' => $this->coll_id)); $row = $stmt->fetch(PDO::FETCH_ASSOC); @@ -81,6 +87,12 @@ class collection implements cache_cacheableInterface $this->pub_wm = $row['pub_wm']; $this->name = $row['asciiname']; $this->prefs = $row['prefs']; + $this->labels = array( + 'fr' => $row['label_fr'], + 'en' => $row['label_en'], + 'de' => $row['label_de'], + 'nl' => $row['label_nl'], + ); $conn = connection::getPDOConnection($this->app); @@ -108,6 +120,7 @@ class collection implements cache_cacheableInterface , 'pub_wm' => $this->pub_wm , 'name' => $this->name , 'prefs' => $this->prefs + , 'labels' => $this->labels ); $this->set_data_to_cache($datas); @@ -225,6 +238,40 @@ class collection implements cache_cacheableInterface return $this; } + public function set_label($code, $label) + { + if (!array_key_exists($code, $this->labels)) { + throw new InvalidArgumentException(sprintf('Code %s is not defined', $code)); + } + + $sql = "UPDATE coll SET label_$code = :label + WHERE coll_id = :coll_id"; + $stmt = $this->get_connection()->prepare($sql); + $stmt->execute(array(':label' => $label, ':coll_id' => $this->get_coll_id())); + $stmt->closeCursor(); + + $this->labels[$code] = $label; + + $this->delete_data_from_cache(); + + phrasea::reset_baseDatas($this->databox->get_appbox()); + + return $this; + } + + public function get_label($code, $substitute = true) + { + if (!array_key_exists($code, $this->labels)) { + throw new InvalidArgumentException(sprintf('Code %s is not defined', $code)); + } + + if ($substitute) { + return isset($this->labels[$code]) ? $this->labels[$code] : $this->name; + } else { + return $this->labels[$code]; + } + } + public function get_record_amount() { $sql = "SELECT COUNT(record_id) AS n FROM record WHERE coll_id = :coll_id"; @@ -602,12 +649,12 @@ class collection implements cache_cacheableInterface if ( ! isset(self::$_logos[$base_id_key])) { if (is_file($app['phraseanet.registry']->get('GV_RootPath') . 'config/minilogos/' . $base_id)) { - $name = phrasea::bas_names($base_id, $app); + $name = phrasea::bas_labels($base_id, $app); self::$_logos[$base_id_key] = ''; } elseif ($printname) { - self::$_logos[$base_id_key] = phrasea::bas_names($base_id, $app); + self::$_logos[$base_id_key] = phrasea::bas_labels($base_id, $app); } } diff --git a/lib/classes/deprecated/inscript.api.php b/lib/classes/deprecated/inscript.api.php index 59f131b769..98c51d8453 100644 --- a/lib/classes/deprecated/inscript.api.php +++ b/lib/classes/deprecated/inscript.api.php @@ -86,7 +86,7 @@ function giveMeBases(Application $app, $usr = null) $inscriptions[$sbas_id]['CollsNonactif'] = null; foreach ($databox->get_collections() as $key => $coll) { - $collname[$key] = $coll->get_name(); + $collname[$key] = $coll->get_label($app['locale.I18n']); $basname[$key] = $coll->get_coll_id(); } $sbpcgu = ''; @@ -138,7 +138,7 @@ function giveMeBases(Application $app, $usr = null) $cguSpec = true; } else { if ( ! isset($usrerRegis[$databox->get_dbname()][$collection->get_coll_id()])) - $inscriptions[$sbas_id]['Colls'][$collection->get_coll_id()] = $collection->get_name(); + $inscriptions[$sbas_id]['Colls'][$collection->get_coll_id()] = $collection->get_label($app['locale.I18n']); } } } @@ -158,9 +158,9 @@ function giveMeBases(Application $app, $usr = null) elseif ($usrerRegis[$databox->get_dbname()][$collection->get_coll_id()] === true) $inscriptions[$sbas_id]['CollsRegistered'][$collection->get_coll_id()] = $lacgu; } elseif (! $cguSpec && $collInscript) {//ne va pas.. si l'inscriptio na la coll est explicitement non autorise, je refuse' - $inscriptions[$sbas_id]['Colls'][$collection->get_coll_id()] = $collection->get_name(); + $inscriptions[$sbas_id]['Colls'][$collection->get_coll_id()] = $collection->get_label($app['locale.I18n']); } elseif ($cguSpec) { - $inscriptions[$sbas_id]['CollsCGU'][$collection->get_coll_id()]['name'] = $collection->get_name(); + $inscriptions[$sbas_id]['CollsCGU'][$collection->get_coll_id()]['name'] = $collection->get_label($app['locale.I18n']); $inscriptions[$sbas_id]['CollsCGU'][$collection->get_coll_id()]['CGU'] = $cguColl; $inscriptions[$sbas_id]['CollsCGU'][$collection->get_coll_id()]['CGUrelease'] = $cguCollRelease; } @@ -190,7 +190,7 @@ function giveMeBaseUsr(Application $app, $usr, $lng) if ($baseInsc['CollsRegistered']) { foreach ($baseInsc['CollsRegistered'] as $collId => $isTrue) { $base_id = phrasea::baseFromColl($sbasId, $collId, $app); - $out .= '' . _('login::register: acces authorise sur la collection ') . phrasea::bas_names($base_id, $app); + $out .= '' . _('login::register: acces authorise sur la collection ') . phrasea::bas_labels($base_id, $app); if (trim($isTrue) != '') $out .= ' ' . _('login::register::CGU: lire les CGU') . ''; $out .= ''; @@ -200,7 +200,7 @@ function giveMeBaseUsr(Application $app, $usr, $lng) if ($baseInsc['CollsRefuse']) { foreach ($baseInsc['CollsRefuse'] as $collId => $isTrue) { $base_id = phrasea::baseFromColl($sbasId, $collId, $app); - $out .= '' . _('login::register: acces refuse sur la collection ') . phrasea::bas_names($base_id, $app) . ''; + $out .= '' . _('login::register: acces refuse sur la collection ') . phrasea::bas_labels($base_id, $app) . ''; if (trim($isTrue) != '') $out .= ' ' . _('login::register::CGU: lire les CGU') . ''; $out .= ''; @@ -210,7 +210,7 @@ function giveMeBaseUsr(Application $app, $usr, $lng) if ($baseInsc['CollsWait']) { foreach ($baseInsc['CollsWait'] as $collId => $isTrue) { $base_id = phrasea::baseFromColl($sbasId, $collId, $app); - $out .= '' . _('login::register: en attente d\'acces sur') . ' ' . phrasea::bas_names($base_id, $app) . ''; + $out .= '' . _('login::register: en attente d\'acces sur') . ' ' . phrasea::bas_labels($base_id, $app) . ''; if (trim($isTrue) != '') $out .= ' ' . _('login::register::CGU: lire les CGU') . ''; $out .= ''; @@ -220,7 +220,7 @@ function giveMeBaseUsr(Application $app, $usr, $lng) if ($baseInsc['CollsIntime']) { foreach ($baseInsc['CollsIntime'] as $collId => $isTrue) { $base_id = phrasea::baseFromColl($sbasId, $collId, $app); - $out .= '' . _('login::register: acces temporaire sur') . phrasea::bas_names($base_id, $app) . ''; + $out .= '' . _('login::register: acces temporaire sur') . phrasea::bas_labels($base_id, $app) . ''; if (trim($isTrue) != '') $out .= ' ' . _('login::register::CGU: lire les CGU') . ''; $out .= ''; @@ -230,7 +230,7 @@ function giveMeBaseUsr(Application $app, $usr, $lng) if ($baseInsc['CollsOuttime']) { foreach ($baseInsc['CollsOuttime'] as $collId => $isTrue) { $base_id = phrasea::baseFromColl($sbasId, $collId, $app); - $out .= '' . _('login::register: acces temporaire termine sur ') . phrasea::bas_names($base_id, $app) . ''; + $out .= '' . _('login::register: acces temporaire termine sur ') . phrasea::bas_labels($base_id, $app) . ''; if (trim($isTrue) != '') $out .= ' ' . _('login::register::CGU: lire les CGU') . ''; $out .= ''; @@ -240,7 +240,7 @@ function giveMeBaseUsr(Application $app, $usr, $lng) if ($baseInsc['CollsNonactif']) { foreach ($baseInsc['CollsNonactif'] as $collId => $isTrue) { $base_id = phrasea::baseFromColl($sbasId, $collId, $app); - $out .= '' . _('login::register: acces supendu sur') . phrasea::bas_names($base_id, $app) . ''; + $out .= '' . _('login::register: acces supendu sur') . phrasea::bas_labels($base_id, $app) . ''; if (trim($isTrue) != '') $out .= ' ' . _('login::register::CGU: lire les CGU') . ''; $out .= ''; diff --git a/lib/classes/module/report/dashboard.php b/lib/classes/module/report/dashboard.php index c2f83a3a3a..dbc85e87dc 100644 --- a/lib/classes/module/report/dashboard.php +++ b/lib/classes/module/report/dashboard.php @@ -254,7 +254,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf 'base_id' => $base_id, 'sbas_id' => $sbas_id, 'coll_id' => $collection->get_base_id(), - 'name' => $collection->get_name() + 'name' => $collection->get_label($this->app['locale.I18n']) ); } diff --git a/lib/classes/module/report/download.php b/lib/classes/module/report/download.php index be4b420b89..f750d0164c 100644 --- a/lib/classes/module/report/download.php +++ b/lib/classes/module/report/download.php @@ -79,7 +79,7 @@ class module_report_download extends module_report foreach ($rs as $row) { $value = $row['val']; if ($field == 'coll_id') { - $caption = phrasea::bas_names(phrasea::baseFromColl($this->sbas_id, $value, $this->app), $this->app); + $caption = phrasea::bas_labels(phrasea::baseFromColl($this->sbas_id, $value, $this->app), $this->app); } elseif ($field == 'ddate') $caption = $this->app['date-formatter']->getPrettyString(new DateTime($value)); elseif ($field == 'size') @@ -167,7 +167,7 @@ class module_report_download extends module_report private function formatCollId($value) { - return phrasea::bas_names(phrasea::baseFromColl($this->sbas_id, $value, $this->app), $this->app); + return phrasea::bas_labels(phrasea::baseFromColl($this->sbas_id, $value, $this->app), $this->app); } public static function getNbDl(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id) diff --git a/lib/classes/phrasea.php b/lib/classes/phrasea.php index ddd007df09..8f058252f1 100644 --- a/lib/classes/phrasea.php +++ b/lib/classes/phrasea.php @@ -17,13 +17,13 @@ class phrasea private static $_sbas_names = false; private static $_coll2bas = false; private static $_bas2coll = false; - private static $_bas_names = false; + private static $_bas_labels = false; private static $_sbas_params = false; const CACHE_BAS_2_SBAS = 'bas_2_sbas'; const CACHE_COLL_2_BAS = 'coll_2_bas'; const CACHE_BAS_2_COLL = 'bas_2_coll'; - const CACHE_BAS_NAMES = 'bas_names'; + const CACHE_BAS_LABELS = 'bas_labels'; const CACHE_SBAS_NAMES = 'sbas_names'; const CACHE_SBAS_FROM_BAS = 'sbas_from_bas'; const CACHE_SBAS_PARAMS = 'sbas_params'; @@ -181,12 +181,12 @@ class phrasea public static function reset_baseDatas(appbox $appbox) { - self::$_coll2bas = self::$_bas2coll = self::$_bas_names = self::$_bas2sbas = null; + self::$_coll2bas = self::$_bas2coll = self::$_bas_labels = self::$_bas2sbas = null; $appbox->delete_data_from_cache( array( self::CACHE_BAS_2_COLL , self::CACHE_BAS_2_COLL - , self::CACHE_BAS_NAMES + , self::CACHE_BAS_LABELS , self::CACHE_SBAS_FROM_BAS ) ); @@ -249,23 +249,32 @@ class phrasea return isset(self::$_sbas_names[$sbas_id]) ? self::$_sbas_names[$sbas_id] : 'Unknown base'; } - public static function bas_names($base_id, Application $app) + public static function bas_labels($base_id, Application $app) { - if (!self::$_bas_names) { + if (!self::$_bas_labels) { try { - self::$_bas_names = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_BAS_NAMES); + self::$_bas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_BAS_LABELS); } catch (Exception $e) { foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) { - self::$_bas_names[$collection->get_base_id()] = $collection->get_name(); + self::$_bas_labels[$collection->get_base_id()] = array( + 'fr' => $collection->get_label('fr'), + 'en' => $collection->get_label('en'), + 'de' => $collection->get_label('de'), + 'nl' => $collection->get_label('nl'), + ); } } - $app['phraseanet.appbox']->set_data_to_cache(self::$_bas_names, self::CACHE_BAS_NAMES); + $app['phraseanet.appbox']->set_data_to_cache(self::$_bas_labels, self::CACHE_BAS_LABELS); } } - return isset(self::$_bas_names[$base_id]) ? self::$_bas_names[$base_id] : 'Unknown collection'; + if (isset(self::$_bas_labels[$base_id]) && isset(self::$_bas_labels[$base_id][$app['locale.I18n']])) { + return self::$_bas_labels[$base_id][$app['locale.I18n']]; + } + + return 'Unknown collection'; } public static function scheduler_key(Application $app, $renew = false) diff --git a/lib/classes/recordutils/image.php b/lib/classes/recordutils/image.php index 5c0fdc9a76..2422255ce2 100644 --- a/lib/classes/recordutils/image.php +++ b/lib/classes/recordutils/image.php @@ -354,7 +354,7 @@ class recordutils_image extends recordutils $builder->getProcess()->run(); } elseif ($app['phraseanet.registry']->get('convert_binary')) { - $collname = phrasea::bas_names($base_id, $app); + $collname = phrasea::bas_labels($base_id, $app); $tailleimg = @getimagesize($pathIn); $max = ($tailleimg[0] > $tailleimg[1] ? $tailleimg[0] : $tailleimg[1]); diff --git a/lib/classes/task/period/archive.php b/lib/classes/task/period/archive.php index 2fde1ad613..339299e13c 100644 --- a/lib/classes/task/period/archive.php +++ b/lib/classes/task/period/archive.php @@ -219,7 +219,7 @@ class task_period_archive extends task_abstract dependencyContainer['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) { - print(""); + print(""); } } ?> diff --git a/lib/classes/task/period/ftp.php b/lib/classes/task/period/ftp.php index 657aafa12d..f012a9c6f2 100644 --- a/lib/classes/task/period/ftp.php +++ b/lib/classes/task/period/ftp.php @@ -616,12 +616,12 @@ class task_period_ftp extends task_appboxAbstract '
  • ' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s') , $row["record_id"], $row["filename"] , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $this->dependencyContainer) - , phrasea::bas_names($row['base_id'], $this->dependencyContainer), $row['subdef']) . ' : ' . _('Transfert OK') . '
  • '; + , phrasea::bas_labels($row['base_id'], $this->dependencyContainer), $row['subdef']) . ' : ' . _('Transfert OK') . ''; } else { $transferts[] = '
  • ' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s') , $row["record_id"], $row["filename"] - , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $this->dependencyContainer), phrasea::bas_names($row['base_id'], $this->dependencyContainer) + , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $this->dependencyContainer), phrasea::bas_labels($row['base_id'], $this->dependencyContainer) , $row['subdef']) . ' : ' . _('Transfert Annule') . '
  • '; $transfert_status = _('task::ftp:Certains documents n\'ont pas pu etre tranferes'); } diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml index 18f88b012c..9dd91ce171 100644 --- a/lib/conf.d/bases_structure.xml +++ b/lib/conf.d/bases_structure.xml @@ -4333,6 +4333,38 @@ + + label_en + char(50) + YES + + + + + + label_fr + char(50) + YES + + + + + + label_de + char(50) + YES + + + + + + label_nl + char(50) + YES + + + + prefs text diff --git a/templates/web/admin/collection/collection.html.twig b/templates/web/admin/collection/collection.html.twig index 175da1e5fb..ac0dc1d711 100644 --- a/templates/web/admin/collection/collection.html.twig +++ b/templates/web/admin/collection/collection.html.twig @@ -8,7 +8,7 @@ @@ -91,6 +91,33 @@ +
    +
    +
    +
    + {% for code, language in app['locales.I18n.available'] %} +
    +
    {{ language }}
    +
    + {% endfor %} +
    +
    + {% for code, language in app['locales.I18n.available'] %} +
    + +
    + {% endfor %} +
    + +
    +
    +
    +
    +
    +