diff --git a/lib/Alchemy/Phrasea/Command/Setup/Install.php b/lib/Alchemy/Phrasea/Command/Setup/Install.php index 07b4508265..465caea073 100644 --- a/lib/Alchemy/Phrasea/Command/Setup/Install.php +++ b/lib/Alchemy/Phrasea/Command/Setup/Install.php @@ -94,7 +94,7 @@ class Install extends Command $abConn = $this->getABConn($input, $output, $dialog); list($dbConn, $template) = $this->getDBConn($input, $output, $abConn, $dialog); list($email, $password) = $this->getCredentials($input, $output, $dialog); - $dataPath = $this->getDataPath($input, $output,$dialog); + $dataPath = $this->getDataPath($input, $output, $dialog); $serverName = $this->getServerName($input, $output, $dialog); $indexer = $this->getindexer($input, $output); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php index bfc9dfc73c..87391a5084 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php @@ -871,6 +871,7 @@ class Databox implements ControllerProviderInterface { $msg = _('An error occurred'); $success = false; + $taskCreated = false; try { $databox = $app['phraseanet.appbox']->get_databox($databox_id); @@ -879,11 +880,17 @@ class Databox implements ControllerProviderInterface foreach ($databox->get_collections() as $collection) { if ($collection->get_record_amount() <= 500) { $collection->empty_collection(500); - $msg = _('Base empty successful'); + if (false === $taskCreated) { + $msg = _('Base empty successful'); + } } else { $settings = "" . $collection->get_base_id() . ""; \task_period_emptyColl::create($app, $settings); - $msg = _('A task has been creted, please run it to complete empty collection'); + + if (false === $taskCreated) { + $msg = _('A task has been created, please run it to complete empty collection'); + $taskCreated = true; + } } } } else { diff --git a/lib/Alchemy/Phrasea/Twig/BytesConverter.php b/lib/Alchemy/Phrasea/Twig/BytesConverter.php index 7d51242749..95f6f42b9b 100644 --- a/lib/Alchemy/Phrasea/Twig/BytesConverter.php +++ b/lib/Alchemy/Phrasea/Twig/BytesConverter.php @@ -15,19 +15,19 @@ class BytesConverter extends \Twig_Extension { protected $unit; - public function __construct() - { - $this->unit = array(); - $this->unit['B'] = 'Bytes'; // 8 bits - $this->unit['KB'] = 'Kilobytes'; // 1024 bytes - $this->unit['MB'] = 'Megabytes'; // 1048576 bytes - $this->unit['GB'] = 'Gigabytes'; // 1073741824 bytes - $this->unit['TB'] = 'Terabytes'; // 1099511627776 bytes - $this->unit['PB'] = 'Petabytes'; // 1.12589991e15 bytes - $this->unit['EB'] = 'Exabytes'; // 1.1529215e18 bytes - $this->unit['ZB'] = 'Zettabytes'; // 1.18059162e21 bytes - $this->unit['YB'] = 'Yottabytes'; // 1.20892582e24 bytes - } + public function __construct() + { + $this->unit = array(); + $this->unit['B'] = 'Bytes'; // 8 bits + $this->unit['KB'] = 'Kilobytes'; // 1024 bytes + $this->unit['MB'] = 'Megabytes'; // 1048576 bytes + $this->unit['GB'] = 'Gigabytes'; // 1073741824 bytes + $this->unit['TB'] = 'Terabytes'; // 1099511627776 bytes + $this->unit['PB'] = 'Petabytes'; // 1.12589991e15 bytes + $this->unit['EB'] = 'Exabytes'; // 1.1529215e18 bytes + $this->unit['ZB'] = 'Zettabytes'; // 1.18059162e21 bytes + $this->unit['YB'] = 'Yottabytes'; // 1.20892582e24 bytes + } public function getName() { @@ -35,37 +35,37 @@ class BytesConverter extends \Twig_Extension } public function getFilters() - { - return array( + { + return array( 'bytesTo*' => new \Twig_Filter_Method($this, 'bytes2Filter') ); - } + } - public function bytes2Filter($suffix, $bytes, $precision = 2) - { - $auto = array('Human', 'Auto'); - $unit = array_keys($this->unit); + public function bytes2Filter($suffix, $bytes, $precision = 2) + { + $auto = array('Human', 'Auto'); + $unit = array_keys($this->unit); - if ($bytes <= 0) { - return '0 ' . $unit[0]; - } + if ($bytes <= 0) { + return '0 ' . $unit[0]; + } - if ($suffix == '') { - $suffix = 'Auto'; - } + if ($suffix == '') { + $suffix = 'Auto'; + } - if (array_search($suffix, array_merge($auto, $unit)) === false) { - throw new \Exception('Sorry, you have to specify a legal Byte value or "Human" for automatic. Legal options are: Human, ' . implode(', ', $unit)); - } + if (array_search($suffix, array_merge($auto, $unit)) === false) { + throw new \Exception('Sorry, you have to specify a legal Byte value or "Human" for automatic. Legal options are: Human, ' . implode(', ', $unit)); + } - switch ($suffix) { - case '': - case 'Human': - case 'Auto': - return round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision) . ' ' . $unit[$i]; - default: - $i = array_search($suffix, $unit); - return round($bytes / pow(1024, $i), $precision) . ' ' . $unit[$i]; - } - } + switch ($suffix) { + case '': + case 'Human': + case 'Auto': + return round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision) . ' ' . $unit[$i]; + default: + $i = array_search($suffix, $unit); + return round($bytes / pow(1024, $i), $precision) . ' ' . $unit[$i]; + } + } } diff --git a/lib/classes/task/period/cindexer.php b/lib/classes/task/period/cindexer.php index 8e0563f10f..8954a68475 100644 --- a/lib/classes/task/period/cindexer.php +++ b/lib/classes/task/period/cindexer.php @@ -658,12 +658,10 @@ class task_period_cindexer extends task_abstract */ public static function getDefaultSettings(Configuration $config, array $params = array()) { - $binaries = $config['binaries']; $database = $config['main']['database']; - return "\n\n" - . (array_key_exists('phraseanet_indexer', $binaries) ? str_replace('/phraseanet_indexer', '', $binaries['phraseanet_indexer']) : '') - . "" . $database['host'] . "" + return "\n\n" + ."" . $database['host'] . "" . $database['port'] . "" . $database['dbname'] . "" . $database['user'] . "" diff --git a/lib/classes/task/period/ftp.php b/lib/classes/task/period/ftp.php index f2577790e6..8db4bf150e 100644 --- a/lib/classes/task/period/ftp.php +++ b/lib/classes/task/period/ftp.php @@ -13,7 +13,6 @@ use Alchemy\Phrasea\Exception\InvalidArgumentException; use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender; use Alchemy\Phrasea\Notification\Receiver; - class task_period_ftp extends task_appboxAbstract { protected $proxy; @@ -707,7 +706,6 @@ class task_period_ftp extends task_appboxAbstract return $this; } - /** * @param array $params */ diff --git a/templates/web/admin/collection/collection.html.twig b/templates/web/admin/collection/collection.html.twig index 4efff74717..a1bea7eedb 100644 --- a/templates/web/admin/collection/collection.html.twig +++ b/templates/web/admin/collection/collection.html.twig @@ -238,8 +238,29 @@ {% endif %} +{# Invalid file type modal shown when uploaded logo file is invalid #} + +