Fix latest merge

This commit is contained in:
Nicolas Le Goff
2014-10-09 21:50:32 +02:00
parent 28eecf6a09
commit 10a83bc6c4
37 changed files with 1178 additions and 1848 deletions

2
.gitignore vendored
View File

@@ -55,7 +55,7 @@ composer.phar
behat.yml behat.yml
# Exclude vagrant configuration file # Exclude vagrant configuration file
.vagrant /.vagrant
# Exclude crossdomain.xml file it's generated # Exclude crossdomain.xml file it's generated
/www/crossdomain.xml /www/crossdomain.xml

4
Vagrantfile vendored
View File

@@ -7,7 +7,7 @@ end
root = File.dirname(File.expand_path(__FILE__)) root = File.dirname(File.expand_path(__FILE__))
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
Dir.glob(root+"/vagrant/vms/**/puphpet/config.yaml").each do|f| Dir.glob(root+"/resources/vagrant/vms/**/puphpet/config.yaml").each do|f|
dir = File.dirname(File.expand_path(f+"/..")) dir = File.dirname(File.expand_path(f+"/.."))
base_path = dir base_path = dir
configValues = YAML.load_file(f) configValues = YAML.load_file(f)
@@ -26,7 +26,7 @@ Vagrant.configure("2") do |config|
end end
if data['vm']['network']['private_network'].to_s != '' if data['vm']['network']['private_network'].to_s != ''
node.vm.network "private_network", ip: "#{data['vm']['network']['private_network']}" node.vm.network :private_network, ip: "#{data['vm']['network']['private_network']}"
end end
data['vm']['network']['forwarded_port'].each do |i, port| data['vm']['network']['forwarded_port'].each do |i, port|

View File

@@ -15,7 +15,6 @@ use Alchemy\Phrasea\Command\Plugin\ListPlugin;
use Alchemy\Phrasea\Command\Setup\H264ConfigurationDumper; use Alchemy\Phrasea\Command\Setup\H264ConfigurationDumper;
use Alchemy\Phrasea\Command\Setup\H264MappingGenerator; use Alchemy\Phrasea\Command\Setup\H264MappingGenerator;
use Alchemy\Phrasea\Command\Setup\StaticConfigurationDumper; use Alchemy\Phrasea\Command\Setup\StaticConfigurationDumper;
use Alchemy\Phrasea\Command\Setup\StaticMappingGenerator;
use Alchemy\Phrasea\Command\SearchEngine\IndexFull; use Alchemy\Phrasea\Command\SearchEngine\IndexFull;
use Alchemy\Phrasea\Command\WebsocketServer; use Alchemy\Phrasea\Command\WebsocketServer;
use Alchemy\Phrasea\Core\Version; use Alchemy\Phrasea\Core\Version;
@@ -32,6 +31,7 @@ use Alchemy\Phrasea\Command\Plugin\RemovePlugin;
use Alchemy\Phrasea\Command\CheckConfig; use Alchemy\Phrasea\Command\CheckConfig;
use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator; use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator;
use Alchemy\Phrasea\Command\Setup\XSendFileConfigurationDumper; use Alchemy\Phrasea\Command\Setup\XSendFileConfigurationDumper;
use Alchemy\Phrasea\Command\Setup\StaticMappingGenerator;
use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks; use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks;
use Alchemy\Phrasea\Command\Task\SchedulerState; use Alchemy\Phrasea\Command\Task\SchedulerState;
use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks; use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks;
@@ -120,12 +120,6 @@ $cli->command(new XSendFileMappingGenerator());
$cli->command(new StaticConfigurationDumper()); $cli->command(new StaticConfigurationDumper());
$cli->command(new StaticMappingGenerator()); $cli->command(new StaticMappingGenerator());
if ($cli['phraseanet.SE']->getName() === 'ElasticSearch') {
$cli->command(new IndexFull('searchengine:index'));
}
$cli->command(new WebsocketServer('ws-server:run'));
$cli->loadPlugins(); $cli->loadPlugins();
exit(is_int($cli->run()) ? : 1); exit(is_int($cli->run()) ? : 1);

657
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -939,7 +939,7 @@ class Application extends SilexApplication
// if ($app->getEnvironment() !== Application::ENV_PROD) { // if ($app->getEnvironment() !== Application::ENV_PROD) {
// return $this['cache.dev.path']; // return $this['cache.dev.path'];
// } // }
$path = $this['root.path'].'/cache'; $path = $app['root.path'].'/cache';
if ($app['phraseanet.configuration']->isSetup()) { if ($app['phraseanet.configuration']->isSetup()) {
$path = $app['conf']->get(['main', 'storage', 'cache'], $path); $path = $app['conf']->get(['main', 'storage', 'cache'], $path);
} }

View File

@@ -112,7 +112,7 @@ class IniReset extends Command
} }
// get data paths // get data paths
$dataPath = $this->container['phraseanet.registry']->get('GV_base_datapath_noweb', $this->container['root.path'].'/datas'); $dataPath = $this->container['conf']->get(['main', 'storage', 'subdefs'], $this->container['root.path'].'/datas');
$schema = $this->container['EM']->getConnection()->getSchemaManager(); $schema = $this->container['EM']->getConnection()->getSchemaManager();
$output->writeln('Creating database "'.$dbs['ab'].'"...<info>OK</info>'); $output->writeln('Creating database "'.$dbs['ab'].'"...<info>OK</info>');
@@ -122,12 +122,28 @@ class IniReset extends Command
// inject v3.1 fixtures // inject v3.1 fixtures
if ($input->getOption('run-patches')) { if ($input->getOption('run-patches')) {
$this->container['filesystem']->copy($this->container['root.path'].'/hudson/connexion.inc', $this->container['root.path'].'/config/connexion.inc'); $content = file_get_contents($this->container['root.path'].'/resources/hudson/connexion.inc');
$this->container['filesystem']->copy($this->container['root.path'].'/hudson/_GV.php', $this->container['root.path'].'/config/_GV.php');
$content = file_get_contents($this->container['root.path'] . '/hudson/fixtures.sql'); $content = str_replace('{{dbname}}', $conf['main']['database']['dbname'], $content);
$content = str_replace('{{hostname}}', $conf['main']['database']['host'], $content);
$content = str_replace('{{port}}', $conf['main']['database']['port'], $content);
$content = str_replace('{{user}}', $conf['main']['database']['user'], $content);
$content = str_replace('{{password}}', $conf['main']['database']['password'], $content);
$tmpFile = tempnam(sys_get_temp_dir(), 'connexion.inc-v3.1-');
$this->container['filesystem']->dumpFile($tmpFile, $content);
$this->container['filesystem']->copy($tmpFile, $this->container['root.path'].'/config/connexion.inc');
$this->container['filesystem']->copy($this->container['root.path'].'/resources/hudson/_GV.php', $this->container['root.path'].'/config/_GV.php');
$content = file_get_contents($this->container['root.path'] . '/resources/hudson/fixtures.sql');
$content = str_replace('{{APPLICATION_BOX}}', $dbs['ab'], $content); $content = str_replace('{{APPLICATION_BOX}}', $dbs['ab'], $content);
$content = str_replace('{{DATA_BOX}}', $dbName, $content); $content = str_replace('{{DATA_BOX}}', $dbName, $content);
$content = str_replace('{{DB_HOST}}', $conf['main']['database']['host'], $content);
$content = str_replace('{{DB_PORT}}', $conf['main']['database']['port'], $content);
$content = str_replace('{{DB_USER}}', $conf['main']['database']['user'], $content);
$content = str_replace('{{DB_PASSWORD}}', $conf['main']['database']['password'], $content);
$content = str_replace('{{DATA_BOX}}', $dbName, $content);
$content = str_replace('{{USER_EMAIL}}', $input->getOption('email'), $content); $content = str_replace('{{USER_EMAIL}}', $input->getOption('email'), $content);
$content = str_replace('{{USER_PASSWORD}}', hash('sha256', $input->getOption('password')), $content); $content = str_replace('{{USER_PASSWORD}}', hash('sha256', $input->getOption('password')), $content);
@@ -191,7 +207,7 @@ class IniReset extends Command
)); ));
$command->run($input, $output); $command->run($input, $output);
$this->container['phraseanet.registry']->set('GV_base_datapath_noweb', $dataPath, \registry::TYPE_STRING); $this->container['conf']->set(['main', 'storage', 'subdefs'], $dataPath);
return 0; return 0;
} }

View File

@@ -379,8 +379,9 @@ class RegenerateSqliteDb extends Command
private function generateCollection(\Pimple $DI) private function generateCollection(\Pimple $DI)
{ {
$coll = $collection_no_acces = $collection_no_acces_by_status = $db = null; $coll = $collection_no_acces = $collection_no_acces_by_status = $db = null;
$databoxes = $this->container['phraseanet.appbox']->get_databoxes();
foreach ($this->container['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($databoxes as $databox) {
foreach ($databox->get_collections() as $collection) { foreach ($databox->get_collections() as $collection) {
if ($collection_no_acces instanceof \collection && !$collection_no_acces_by_status) { if ($collection_no_acces instanceof \collection && !$collection_no_acces_by_status) {
$collection_no_acces_by_status = $collection; $collection_no_acces_by_status = $collection;
@@ -403,13 +404,13 @@ class RegenerateSqliteDb extends Command
$DI['coll'] = $coll; $DI['coll'] = $coll;
if (!$collection_no_acces instanceof collection) { if (!$collection_no_acces instanceof collection) {
$collection_no_acces = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'BIBOO', $DI['user']); $collection_no_acces = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'COLL_TEST_NO_ACCESS', $DI['user']);
} }
$DI['coll_no_access'] = $collection_no_acces; $DI['coll_no_access'] = $collection_no_acces;
if (!$collection_no_acces_by_status instanceof collection) { if (!$collection_no_acces_by_status instanceof collection) {
$collection_no_acces_by_status = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'BIBOONOACCESBYSTATUS', $DI['user']); $collection_no_acces_by_status = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'COLL_TEST_NO_ACCESS_BY_STATUS', $DI['user']);
} }
$DI['coll_no_status'] = $collection_no_acces_by_status; $DI['coll_no_status'] = $collection_no_acces_by_status;

File diff suppressed because one or more lines are too long

View File

@@ -36,24 +36,8 @@ class Export implements ControllerProviderInterface
$app['firewall']->addMandatoryAuthentication($controllers); $app['firewall']->addMandatoryAuthentication($controllers);
$controllers->before(function (Request $request) use ($app) {
$app['firewall']->requireNotGuest();
});
/** $controllers->post('/multi-export/', 'controller.prod.export:displayMultiExport')
* Display multi export
*
* name : export_multi_export
*
* description : Display multi export
*
* method : POST
*
* parameters : none
*
* return : HTML Response
*/
$controllers->post('/multi-export/', $this->call('displayMultiExport'))
->bind('export_multi_export'); ->bind('export_multi_export');
$controllers->post('/mail/', 'controller.prod.export:exportMail') $controllers->post('/mail/', 'controller.prod.export:exportMail')

View File

@@ -11,57 +11,40 @@
namespace Alchemy\Phrasea\Helper; namespace Alchemy\Phrasea\Helper;
use Alchemy\Phrasea\Model\Entities\User; /**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class Prod extends Helper class Prod extends Helper
{ {
public function get_search_datas() public function get_search_datas()
{ {
$search_datas = [ $searchData = array('bases' => array(), 'dates' => array(), 'fields' => array(), 'sort' => array(),);
'bases' => [],
'dates' => [],
'fields' => []
];
$bases = $fields = $dates = []; $bases = $fields = $dates = $sort = array();
if (! $this->app['authentication']->getUser() instanceof User) { if (!$this->app['authentication']->getUser() instanceof \User_Adapter) {
return $search_datas; return $searchData;
} }
$searchSet = json_decode($this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'search'), true); $searchSet = json_decode($this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'search'), true);
$saveSettings = $this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'advanced_search_reload'); $saveSettings = $this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'advanced_search_reload');
foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_sbas() as $databox) { foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_sbas() as $databox) {
$sbas_id = $databox->get_sbas_id(); $sbasId = $databox->get_sbas_id();
$bases[$sbas_id] = [ $bases[$sbasId] = array('thesaurus' => (trim($databox->get_thesaurus()) !== ""), 'cterms' => false, 'collections' => array(), 'sbas_id' => $sbasId);
'thesaurus' => (trim($databox->get_thesaurus()) != ""),
'cterms' => false,
'collections' => [],
'sbas_id' => $sbas_id
];
foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base([], [$databox->get_sbas_id()]) as $coll) { foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base([], [$databox->get_sbas_id()]) as $coll) {
$selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true) : true; $selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbasId])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbasId])) : true) : true;
$bases[$sbas_id]['collections'][] = $bases[$sbasId]['collections'][] = array('selected' => $selected, 'base_id' => $coll->get_base_id());
[
'selected' => $selected,
'base_id' => $coll->get_base_id()
];
} }
foreach ($databox->get_meta_structure() as $fieldMeta) { foreach ($databox->get_meta_structure() as $fieldMeta) {
if (!$fieldMeta->is_indexable()) { if (!$fieldMeta->is_indexable()) {
continue; continue;
$id = $meta->get_id();
$name = $meta->get_name();
if ($meta->get_type() == 'date') {
if (isset($dates[$id]))
$dates[$id]['sbas'][] = $sbas_id;
else
$dates[$id] = ['sbas' => [$sbas_id], 'fieldname' => $name];
} }
$id = $fieldMeta->get_id(); $id = $fieldMeta->get_id();
$name = $fieldMeta->get_name(); $name = $fieldMeta->get_name();
@@ -88,19 +71,14 @@ class Prod extends Helper
if (isset($fields[$name])) { if (isset($fields[$name])) {
$fields[$name]['sbas'][] = $sbasId; $fields[$name]['sbas'][] = $sbasId;
} else { } else {
$fields[$name] = [ $fields[$name] = $data;
'sbas' => [$sbas_id]
, 'fieldname' => $name
, 'type' => $meta->get_type()
, 'id' => $id
];
} }
} }
if (!$bases[$sbasId]['thesaurus']) { if (!$bases[$sbasId]['thesaurus']) {
continue; continue;
} }
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbas_id, 'bas_modif_th')) { if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbasId, 'bas_modif_th')) {
continue; continue;
} }
@@ -119,6 +97,6 @@ class Prod extends Helper
public function getRandom() public function getRandom()
{ {
return $this->app['random.low']->generateString(16); return md5(time() . mt_rand(100000, 999999));
} }
} }

View File

@@ -27,19 +27,17 @@ class SymLinker
protected $encoder; protected $encoder;
protected $fs; protected $fs;
protected $symlinkDir; protected $symlinkDir;
protected $registry;
public static function create(Application $app) public static function create(Application $app)
{ {
return new SymLinker( return new SymLinker(
$app['phraseanet.thumb-symlinker-encoder'], $app['phraseanet.thumb-symlinker-encoder'],
$app['filesystem'], $app['filesystem'],
$app['phraseanet.registry'],
isset($app['phraseanet.configuration']['static-file']['symlink-directory']) ? $app['phraseanet.configuration']['static-file']['symlink-directory'] : $app['root.path'] . '/tmp/symlinks' isset($app['phraseanet.configuration']['static-file']['symlink-directory']) ? $app['phraseanet.configuration']['static-file']['symlink-directory'] : $app['root.path'] . '/tmp/symlinks'
); );
} }
public function __construct(SymLinkerEncoder $encoder, Filesystem $fs, \registryInterface $registry, $symlinkDir) public function __construct(SymLinkerEncoder $encoder, Filesystem $fs, $symlinkDir)
{ {
$this->encoder = $encoder; $this->encoder = $encoder;
$this->fs = $fs; $this->fs = $fs;

View File

@@ -33,10 +33,9 @@ class Installer
{ {
$this->rollbackInstall($abConn, $dbConn); $this->rollbackInstall($abConn, $dbConn);
$this->createConfigFile($abConn, $serverName, $binaryData); $this->createConfigFile($abConn, $serverName, $binaryData, $dataPath);
try { try {
$this->createAB(); $this->createAB();
$this->populateRegistryData($serverName, $dataPath, $binaryData);
$user = $this->createUser($email, $password); $user = $this->createUser($email, $password);
$this->createDefaultUsers(); $this->createDefaultUsers();
if (null !== $dbConn) { if (null !== $dbConn) {
@@ -57,22 +56,6 @@ class Installer
$this->phraseaIndexer = $path; $this->phraseaIndexer = $path;
} }
private function populateRegistryData($serverName, $dataPath)
{
if (null === $dataPath = realpath($dataPath)) {
throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $dataPath));
}
$this->app['conf']->set(['main', 'storage', 'subdefs'], $dataPath);
$this->app['conf']->set(['main', 'storage', 'cache'], realpath(__DIR__ . '/../../../../cache'));
$this->app['conf']->set(['main', 'storage', 'log'], realpath(__DIR__ . '/../../../../logs'));
$this->app['conf']->set(['main', 'storage', 'download'], realpath(__DIR__ . '/../../../../tmp/download'));
$this->app['conf']->set(['main', 'storage', 'lazaret'], realpath(__DIR__ . '/../../../../tmp/lazaret'));
$this->app['conf']->set(['main', 'storage', 'caption'], realpath(__DIR__ . '/../../../../tmp/caption'));
$this->app['conf']->set('servername', $serverName);
$this->app['conf']->set('registry', $this->app['registry.manipulator']->getRegistryData());
}
private function createDB(Connection $dbConn = null, $template) private function createDB(Connection $dbConn = null, $template)
{ {
$template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml'); $template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml');
@@ -177,7 +160,7 @@ class Installer
$this->app['phraseanet.appbox']->insert_datas($this->app); $this->app['phraseanet.appbox']->insert_datas($this->app);
} }
private function createConfigFile(Connection $abConn, $serverName, $binaryData) private function createConfigFile(Connection $abConn, $serverName, $binaryData, $dataPath)
{ {
$config = $this->app['configuration.store']->initialize()->getConfig(); $config = $this->app['configuration.store']->initialize()->getConfig();
@@ -195,6 +178,20 @@ class Installer
$config['servername'] = $serverName; $config['servername'] = $serverName;
$config['main']['key'] = $this->app['random.medium']->generateString(16); $config['main']['key'] = $this->app['random.medium']->generateString(16);
if (null === $dataPath = realpath($dataPath)) {
throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $dataPath));
}
$config['main']['storage']['subdefs'] = $dataPath;
$config['main']['storage']['cache'] = realpath(__DIR__ . '/../../../../cache');
$config['main']['storage']['log'] = realpath(__DIR__ . '/../../../../logs');
$config['main']['storage']['download'] = realpath(__DIR__ . '/../../../../tmp/download');
$config['main']['storage']['lazaret'] = realpath(__DIR__ . '/../../../../tmp/lazaret');
$config['main']['storage']['caption'] = realpath(__DIR__ . '/../../../../tmp/caption');
$config['registry'] = $this->app['registry.manipulator']->getRegistryData();
$this->app['configuration.store']->setConfig($config); $this->app['configuration.store']->setConfig($config);
} }
} }

View File

@@ -496,7 +496,7 @@ class Migration31 implements MigrationInterface
$stmt->execute([ $stmt->execute([
':key' => 'GV_sit', ':key' => 'GV_sit',
':value' => GV_sit, ':value' => constant("GV_sit"),
':type' => 'string', ':type' => 'string',
]); ]);
@@ -505,7 +505,6 @@ class Migration31 implements MigrationInterface
rename(__DIR__ . '/../../../../../../config/_GV.php', __DIR__ . '/../../../../../../config/_GV.php.old'); rename(__DIR__ . '/../../../../../../config/_GV.php', __DIR__ . '/../../../../../../config/_GV.php.old');
$servername = defined('GV_ServerName') ? constant('GV_ServerName') : ''; $servername = defined('GV_ServerName') ? constant('GV_ServerName') : '';
file_put_contents(__DIR__ . '/../../../../../../config/config.inc', "<?php\n\$servername = \"" . str_replace('"', '\"', $servername) . "\";\n"); file_put_contents(__DIR__ . '/../../../../../../config/config.inc', "<?php\n\$servername = \"" . str_replace('"', '\"', $servername) . "\";\n");
return; return;
} }
} }

View File

@@ -240,17 +240,19 @@ class RecordMoverJob extends AbstractJob
} }
// set status ? // set status ?
$x = $sxtask->to->status['mask']; $x = trim($sxtask->to->status['mask']);
$x = preg_replace('/[^0-1]/', 'x', $x);
$mx = str_replace(' ', '0', ltrim(str_replace(array('0', 'x'), array(' ', ' '), $x))); $mx = str_replace(' ', '0', ltrim(str_replace(array('0', 'x'), array(' ', ' '), $x)));
$ma = str_replace(' ', '0', ltrim(str_replace(array('x', '0'), array(' ', '1'), $x))); $ma = str_replace(' ', '0', ltrim(str_replace(array('x', '0'), array(' ', '1'), $x)));
if ($mx && $ma) { if ($mx && $ma) {
$tws[] = '((status ^ ' . $connbas->quote('0b'.$mx) . ') & ' . $connbas->quote('0b'.$ma) . ')!=0'; $tws[] = '((status ^ 0b' . $mx . ') & 0b' . $ma . ')!=0';
} }
elseif ($mx) { elseif ($mx) {
$tws[] = '(status ^ ' . $connbas->quote('0b'.$mx) . ')!=0'; $tws[] = '(status ^ 0b' . $mx . ')!=0';
} }
elseif ($ma) { elseif ($ma) {
$tws[] = '(status & ' . $connbas->quote('0b'.$ma) . ')!=0'; $tws[] = '(status & 0b' . $ma . ')!=0';
} }
// compute the 'where' clause // compute the 'where' clause
@@ -432,15 +434,17 @@ class RecordMoverJob extends AbstractJob
} }
// criteria <status mask="XXXXX" /> // criteria <status mask="XXXXX" />
$x = $sxtask->from->status['mask']; $x = trim($sxtask->from->status['mask']);
$x = preg_replace('/[^0-1]/', 'x', $x);
$mx = str_replace(' ', '0', ltrim(str_replace(array('0', 'x'), array(' ', ' '), $x))); $mx = str_replace(' ', '0', ltrim(str_replace(array('0', 'x'), array(' ', ' '), $x)));
$ma = str_replace(' ', '0', ltrim(str_replace(array('x', '0'), array(' ', '1'), $x))); $ma = str_replace(' ', '0', ltrim(str_replace(array('x', '0'), array(' ', '1'), $x)));
if ($mx && $ma) { if ($mx && $ma) {
$tw[] = '((status ^ ' . $connbas->quote('0b'.$mx) . ') & ' . $connbas->quote('0b'.$ma) . ')=0'; $tw[] = '((status ^ 0b'. $mx . ') & 0b'. $ma . ')=0';
} elseif ($mx) { } elseif ($mx) {
$tw[] = '(status ^ ' . $connbas->quote('0b'.$mx) . ')=0'; $tw[] = '(status ^ 0b' . $mx . ')=0';
} elseif ($ma) { } elseif ($ma) {
$tw[] = '(status & ' . $connbas->quote('0b'.$ma) . ")=0"; $tw[] = '(status & 0b' . $ma . ")=0";
} }
return array($tw, $join); return array($tw, $join);

View File

@@ -583,20 +583,16 @@ class databox extends base
$stmt->execute(); $stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
if ($row) if ($row) {
$ord = $row['ord'] + 1; $ord = $row['ord'] + 1;
}
$params[':ord'] = $ord;
$sql = 'INSERT INTO sbas (sbas_id, ord, host, port, dbname, sqlengine, user, pwd) $sql = 'INSERT INTO sbas (sbas_id, ord, host, port, dbname, sqlengine, user, pwd)
VALUES (null, :ord, :host, :port, :dbname, "MYSQL", :user, :password)'; VALUES (null, :ord, :host, :port, :dbname, "MYSQL", :user, :password)';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([ $stmt->execute($params);
':ord' => $ord
, ':host' => $host
, ':port' => $port
, ':dbname' => $dbname
, ':user' => $user
, ':password' => $password
]);
$stmt->closeCursor(); $stmt->closeCursor();
$sbas_id = (int) $app['phraseanet.appbox']->get_connection()->lastInsertId(); $sbas_id = (int) $app['phraseanet.appbox']->get_connection()->lastInsertId();

View File

@@ -765,7 +765,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
. "/" . $this->record->get_record_id() . "/" . "/" . $this->record->get_record_id() . "/"
. $this->get_name() . "/"); . $this->get_name() . "/");
return; return;
} }

View File

@@ -45,6 +45,16 @@ class patch_386alpha3a implements patchInterface
return $this->concern; return $this->concern;
} }
/**
* Returns doctrine migrations needed for the patch.
*
* @return array
*/
public function getDoctrineMigrations()
{
return array();
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@@ -1,6 +1,6 @@
<?php <?php
$hostname = '127.0.0.1'; $hostname = '{{hostname}}';
$port = '3306'; $port = '{{port}}';
$user = 'root'; $user = '{{user}}';
$password = ''; $password = '{{password}}';
$dbname = 'ab_test'; $dbname = '{{dbname}}';

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
{ {
"directory" : "tmp-assets", "directory": "www/assets",
"interactive": false "interactive": false
} }

View File

@@ -60,7 +60,6 @@ server:
- imagemagick - imagemagick
- libevent-dev - libevent-dev
- ufraw - ufraw
- ffmpeg
- ghostscript - ghostscript
- xpdf - xpdf
- unoconv - unoconv
@@ -86,6 +85,38 @@ server:
- libgif-dev - libgif-dev
- libjpeg62-dev - libjpeg62-dev
- cachefilesd - cachefilesd
- autoconf
- automake
- build-essential
- libass-dev
- libfreetype6-dev
- libgpac-dev
- libsdl1.2-dev
- libtheora-dev
- libtool
- libva-dev
- libvdpau-dev
- libvorbis-dev
- libx11-dev
- libxext-dev
- libx264-dev
- libxfixes-dev
- libgsm1-dev
- pkg-config
- texi2html
- zlib1g-dev
- yasm
- unzip
- libopus-dev
- libvpx-dev
- libvorbis-dev
- libmp3lame-dev
- libxvidcore-dev
- libfaad-dev
- libopencore-amrnb-dev
- libopencore-amrwb-dev
- libxvidcore-dev
- libdc1394-22-dev
dot_files: dot_files:
- -
bash_aliases: null bash_aliases: null

View File

View File

@@ -16,6 +16,51 @@ sudo sh -c 'echo "nl_NL.UTF-8 UTF-8" >> /etc/locale.gen'
sudo locale-gen en_US en_US.UTF-8 en_GB en_GB.UTF-8 fr_FR fr_FR.UTF-8 de_DE de_DE.UTF-8 nl_NL nl_NL.UTF-8 sudo locale-gen en_US en_US.UTF-8 en_GB en_GB.UTF-8 fr_FR fr_FR.UTF-8 de_DE de_DE.UTF-8 nl_NL nl_NL.UTF-8
sudo dpkg-reconfigure -f noninteractive locales sudo dpkg-reconfigure -f noninteractive locales
#ffmpeg
sudo sh -c 'echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list'
sudo apt-get update
sudo apt-get install --force-yes -y deb-multimedia-keyring
sudo apt-get update
sudo apt-get install --force-yes -y libfaac-dev
cd /tmp
wget quiet https://www.ffmpeg.org/releases/ffmpeg-1.2.8.tar.gz
tar -zxvf ffmpeg-1.2.8.tar.gz
cd ffmpeg-1.2.8
wget quiet -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
sudo -u vagrant unzip fdk-aac.zip
cd mstorsjo-fdk-aac*
autoreconf -fiv
./configure --disable-shared
make
sudo make install
make distclean
cd ..
./configure --enable-gpl \
--enable-nonfree \
--enable-libfaac \
--enable-libgsm \
--enable-libmp3lame \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-libxvid \
--enable-zlib \
--enable-postproc \
--enable-swscale \
--enable-pthreads \
--enable-x11grab \
--enable-libdc1394 \
--enable-version3 \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb
make
sudo make install
# node + npm # node + npm
cd /tmp cd /tmp
wget quiet "http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz" wget quiet "http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz"
@@ -28,6 +73,7 @@ sudo cp -rf * /usr/local/
sudo npm install -g recess sudo npm install -g recess
sudo npm install -g grunt-cli sudo npm install -g grunt-cli
sudo npm install -g bower sudo npm install -g bower
sudo npm install -g uglify-js
# python tools # python tools
sudo easy_install -U taschenmesser scour boto sudo easy_install -U taschenmesser scour boto
@@ -107,7 +153,7 @@ fi
sudo sh -c 'echo "RUN=yes" > /etc/default/cachefilesd' sudo sh -c 'echo "RUN=yes" > /etc/default/cachefilesd'
# copy www.conf # copy www.conf
sudo sh -c "cat /vagrant/resources/vagrant/config/nginx/php5-fpm-www.conf > /etc/php5/fpm/pool.d/www.conf" sudo sh -c 'cat /vagrant/resources/vagrant/config/nginx/php5-fpm-www.conf > /etc/php5/fpm/pool.d/www.conf'
#setup phraseanet #setup phraseanet
if [ ! -f /var/www/phraseanet/config/configuration.yml ] if [ ! -f /var/www/phraseanet/config/configuration.yml ]
@@ -116,13 +162,13 @@ then
mv /var/www/phraseanet/lib/conf.d/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml.bkp mv /var/www/phraseanet/lib/conf.d/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml.bkp
cp /vagrant/resources/vagrant/config/phraseanet/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml cp /vagrant/resources/vagrant/config/phraseanet/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml
mv /var/www/phraseanet/.bowerrc /var/www/phraseanet/.bowerrc.bkp mv /var/www/phraseanet/.bowerrc /var/www/phraseanet/.bowerrc.bkp
cp /vagrant/resources/vagrant/config/bower/.bower.rc /var/www/phraseanet/.bowerrc cp /vagrant/resources/vagrant/config/bower/.bowerrc /var/www/phraseanet/.bowerrc
cd /var/www/phraseanet cd /var/www/phraseanet
composer install -n --prefer-source --dev sudo -u vagrant composer install -n --prefer-source --dev
npm install sudo -u vagrant npm install
grunt install-assets sudo -u vagrant grunt install-assets
bin/developer assets:compile-less sudo -u vagrant bin/developer assets:compile-less
rm -f /var/www/phraseanet/lib/conf.d/configuration.yml sudo -u vagrant rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
rm -f /var/www/phraseanet/.bowerrc rm -f /var/www/phraseanet/.bowerrc
mv /www/phraseanet/.bowerrc.bkp /www/phraseanet/.bowerrc mv /www/phraseanet/.bowerrc.bkp /www/phraseanet/.bowerrc
mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml

View File

@@ -340,7 +340,7 @@
<select name="sort" class="input-small"> <select name="sort" class="input-small">
<option value="" {% if app['phraseanet.SE'].getDefaultSort() is empty %}selected="selected default-selection"{% endif %}>{{ "No sort"|trans }}</option> <option value="" {% if app['phraseanet.SE'].getDefaultSort() is empty %}selected="selected default-selection"{% endif %}>{{ "No sort"|trans }}</option>
{% for sort in search_datas['sort'] %} {% for sort in search_datas['sort'] %}
<option value="{{ sort.fieldname }}" {% if sort.fieldname == app['phraseanet.SE'].getDefaultSort() %}selected="selected default-selection"{% endif %}>{{ sort.fieldname }}</option> <option value="{{ sort.fieldname }}" {% if sort.fieldname == app['phraseanet.SE'].getDefaultSort() %}selected="selected default-selection"{% endif %}>{{ sort.fieldname }}</option>
{% endfor %} {% endfor %}
</select> </select>
<select name="ord" class="input-medium"> <select name="ord" class="input-medium">
@@ -423,7 +423,7 @@
{% set date_field_names = date_field_names|merge([field.fieldname]) %} {% set date_field_names = date_field_names|merge([field.fieldname]) %}
{% endfor %} {% endfor %}
<option value="{{ date_field_names|join('|') }}" selected="selected"> <option value="{{ date_field_names|join('|') }}" selected="selected">
{% trans 'rechercher dans tous les champs' %} {{ 'rechercher dans tous les champs'| trans }}
</option> </option>
</select> </select>
</td> </td>

View File

@@ -1,99 +1,105 @@
{% macro block(record, highlight, searchEngine, prefix, entry_id)%} {% macro block(record, highlight, searchEngine, prefix, entry_id) %}
{% import 'common/thumbnail.html.twig' as thumbnail %} {% import 'common/thumbnail.html.twig' as thumbnail %}
{% import 'common/doctype_icons.html.twig' as doctype_icons %} {% import 'common/doctype_icons.html.twig' as doctype_icons %}
{% import 'common/drop_down_options.html.twig' as drop_down %} {% import 'common/drop_down_options.html.twig' as drop_down %}
{% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')%} {% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size') %}
{% set sbas_id = record.get_sbas_id %} {% set sbas_id = record.get_sbas_id %}
{% set lazyload = not app['phraseanet.static-file-factory'].isStaticFileModeEnabled and app['phraseanet.configuration']['lazyload']|default(false) %} {% set lazyload = app['phraseanet.configuration']['lazyload']|default(false) %}
{% if entry_id %} {% set container_attributes %}
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}" {% if entry_id %}
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}" class="IMGT diapo type-{{ record.get_type }}"
class="IMGT diapo type-{{record.get_type}}" onDblClick="openPreview('FEED',{{ record.get_number() }},{{ entry_id }});"
onDblClick="openPreview('FEED',{{record.get_number()}},{{entry_id}});"> {% elseif record.is_grouping() %}
{% elseif record.is_grouping() %} class="IMGT diapo grouping type-{{ record.get_type }}"
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}" onDblClick="openPreview('REG','0','{{ record.get_serialize_key() }}');"
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}" {% else %}
class="IMGT diapo grouping type-{{record.get_type}}" class="IMGT diapo type-{{ record.get_type }}"
onDblClick="openPreview('REG','0','{{record.get_serialize_key()}}');"> onDblClick="openPreview('RESULT',{{ record.get_number }});"
{% else %} {% endif %}
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}" {% endset %}
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}"
class="IMGT diapo type-{{record.get_type}}"
onDblClick="openPreview('RESULT',{{record.get_number}});">
{% endif %}
<div style="padding: 4px;">
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
<div class="title" style="max-height:100%" title="{{ record.get_title() }}">
{{ record.get_title() }}
</div>
<div class="status">
{{record.get_status_icons|raw}}
</div>
</div>
{% set rollover_gif = record.get_rollover_thumbnail() %}
{% set user_technical_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') %} <div style="width:{{ th_size+30 }}px;" sbas="{{ sbas_id }}"
{% set user_rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %} id="{{ prefix|default('IMGT') }}_{{ record.get_sbas_id }}_{{ record.get_record_id }}" {{ container_attributes }}>
<div style="padding: 4px;">
{% set extraclass = '' %} <div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %} <div class="title" style="max-height:100%" title="{{ record.get_title() }}">
{% set extraclass = extraclass ~ ' captionTips' %} {{ record.get_title() }}
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) %} </div>
{% elseif user_rollover_thumbnail == 'caption' and searchEngine is null %} <div class="status">
{% set extraclass = extraclass ~ ' captionTips' %} {{ record.get_status_icons|raw }}
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'publi' }) %} </div>
{% elseif user_rollover_thumbnail == 'preview' %}
{% set extraclass = extraclass ~ ' captionTips' %}
{% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) %}
{% endif %}
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;">
<div class="doc_infos">
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'doctype_display') == '1' %}
{{doctype_icons.format(record)}}
{% endif %}
<span class="duration">
{{record.get_formated_duration()}}
</span>
</div> </div>
<div class="{% if rollover_gif %}rollovable{% endif %}">
{% set rollover_gif = record.get_rollover_thumbnail() %}
{% set user_technical_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') %}
{% set user_rollover_thumbnail =app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %}
{% set extraclass = '' %} {% set extraclass = '' %}
{% if rollover_gif %}
{% set extraclass = 'rollover-gif-out' %} {% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
{% endif %} {% set extraclass = extraclass ~ ' captionTips' %}
{{thumbnail.format(record.get_thumbnail(), th_size, th_size, extraclass, true, lazyload)}} {% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) %}
{% if rollover_gif %} {% elseif user_rollover_thumbnail == 'caption' and searchEngine is null %}
{{thumbnail.format(rollover_gif, th_size, th_size, 'rollover-gif-hover', true, lazyload)}} {% set extraclass = extraclass ~ ' captionTips' %}
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'publi' }) %}
{% elseif user_rollover_thumbnail == 'preview' %}
{% set extraclass = extraclass ~ ' captionTips' %}
{% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) %}
{% endif %} {% endif %}
<div class="thumb {{ extraclass }} " tooltipsrc="{{ tooltipsrc }}"
style="height:{{ th_size }}px; z-index:90;">
<div class="doc_infos">
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'doctype_display') == '1' %}
{{ doctype_icons.format(record) }}
{% endif %}
<span class="duration">
{{ record.get_formated_duration() }}
</span>
</div>
<div class="{% if rollover_gif %}rollovable{% endif %}">
{% set extraclass = '' %}
{% if rollover_gif %}
{% set extraclass = 'rollover-gif-out' %}
{% endif %}
{{ thumbnail.format(record.get_thumbnail(), th_size, th_size, extraclass, true, lazyload) }}
{% if rollover_gif %}
{{ thumbnail.format(rollover_gif, th_size, th_size, 'rollover-gif-hover', true, lazyload) }}
{% endif %}
</div>
</div>
<div style="height: 25px; position:relative; text-align:left;">
<table class="bottom" style="width:100%; table-layout:fixed;">
<tr>
<td style="text-align:left;text-overflow:ellipsis;overflow:hidden;">
{{ record.get_collection_logo(app)|raw }}
</td>
{% set l_width = 30 %}
{% if user_rollover_thumbnail == 'preview' %}
{% set l_width = l_width + 20 %}
{% endif %}
{% if user_technical_display == '1' %}
{% set l_width = l_width + 20 %}
{% endif %}
<td style='text-align:right;width:{{ l_width }}px;' valign='bottom'>
{{ drop_down.prod(record, entry_id) }}
{% if record.has_preview() and app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(record, 'preview') %}
<div tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}"
class="previewTips"></div>
{% endif %}
{% if user_rollover_thumbnail == 'preview' %}
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) }}"
class="captionRolloverTips"></div>
{% endif %}
{% if user_technical_display == '1' %}
<img class="infoTips"
tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}"
src="/skins/icons/info.gif"/>
{% endif %}
</td>
</tr>
</table>
</div> </div>
</div>
<div style="height: 25px; position:relative; text-align:left;">
<table class="bottom" style="width:100%; table-layout:fixed;">
<tr>
<td style="text-align:left;text-overflow:ellipsis;overflow:hidden;">
{{record.get_collection_logo(app)|raw}}
</td>
{% set l_width = 30 %}
{% if user_rollover_thumbnail == 'preview' %}
{% set l_width = l_width + 20 %}
{% endif %}
{% if user_technical_display == '1' %}
{% set l_width = l_width + 20 %}
{% endif %}
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
{{drop_down.prod(record, entry_id)}}
{% if record.has_preview() and app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(record, 'preview') %}
<div tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}" class="previewTips"></div>
{% endif %}
{% if user_rollover_thumbnail == 'preview' %}
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) }}" class="captionRolloverTips"></div>
{% endif %}
{% if user_technical_display == '1' %}
<img class="infoTips" tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}" src="/skins/icons/info.gif"/>
{% endif %}
</td>
</tr>
</table>
</div> </div>
</div> </div>
</div>
{% endmacro %} {% endmacro %}

View File

@@ -2,131 +2,142 @@
{% block extrahead %} {% block extrahead %}
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function(){
$('button').button(); $('button').button();
$('.databox_create').bind('change', function(){
$('.databox_create').bind('change', function () {
var $this = $(this); var $this = $(this);
var $current = $this.closest('.steps'); var $current = $this.closest('.steps');
$('.databox_creation_input', $current).attr('disabled', $this.attr('checked')); $('.databox_creation_input', $current).attr('disabled', $this.attr('checked'));
$('.db_tester', $current).attr('disabled', $this.attr('checked')).toggleClass("ui-state-disabled", $this.attr('checked')); $('.db_tester', $current).attr('disabled', $this.attr('checked')).toggleClass( "ui-state-disabled", $this.attr('checked') );
}); });
$('.ab_opt_toggler').bind('click', function(){
$('.ab_opt_toggler').bind('click', function () { $('.optional_ab_datas').fadeToggle();
$('.optional_ab_data').fadeToggle();
return false; return false;
}); });
$('button.ab_tester').bind('click', function () { $('button.ab_tester').bind('click', function (){
if(window.console)
console.log('application box connection test');
test_connection_appbox(); test_connection_appbox();
return false; return false;
}); });
$('button.db_tester').bind('click', function (){
$('button.db_tester').bind('click', function () { if(window.console)
console.log('data box connection test');
test_connection_databox(); test_connection_databox();
return false; return false;
}); });
var language = { var language = {
ajaxError : "{% trans 'Erreur lors du contact avec le serveur WEB' %}", ajaxError : "{{ 'Erreur lors du contact avec le serveur WEB' | trans }}",
ajaxTimeout : "{% trans 'Delai depasse lors du contact avec le serveur WEB' %}", ajaxTimeout : "{{ 'Delai depasse lors du contact avec le serveur WEB' | trans }}",
requiredField : "{% trans 'Required' %}", requiredField : "{{ 'Required' | trans }}",
validateEmail : "{% trans 'forms::merci d\'entrer une adresse e-mail valide' %}", validateEmail : "{{ 'forms::merci d\'entrer une adresse e-mail valide' | trans }}",
validatePassword : "{% trans 'forms::ce champ est requis' %}", validatePassword : "{{ 'forms::ce champ est requis' | trans }}",
validatePasswordConfirm : "{% trans 'forms::ce champ est requis' %}", validatePasswordConfirm : "{{ 'forms::ce champ est requis' | trans }}",
validatePasswordEqual : "{% trans 'forms::les mots de passe ne correspondent pas' %}", validatePasswordEqual : "{{ 'forms::les mots de passe ne correspondent pas' | trans }}",
wrongCredentials : "{% trans 'Vous devez specifier une adresse email et un mot de passe valides' %}", wrongCredentials : "{{ 'Vous devez specifier une adresse email et un mot de passe valides' | trans }}",
wrongDatabasename : "{% trans 'Le nom de base de donnee est incorrect' %}", wrongDatabasename : "{{ 'Le nom de base de donnee est incorrect' | trans }}",
someErrors : "{% trans 'Il y a des erreurs, merci de les corriger avant de continuer' %}" someErrors : "{{ 'Il y a des erreurs, merci de les corriger avant de continuer' | trans }}"
} }
$.validator.passwordRating.messages = { $.validator.passwordRating.messages = {
"similar-to-username": "{% trans 'forms::le mot de passe est trop similaire a l\'identifiant' %}", "similar-to-username": "{{ 'forms::le mot de passe est trop similaire a l\'identifiant' | trans }}",
"too-short": "{% trans 'forms::la valeur donnee est trop courte' %}", "too-short": "{{ 'forms::la valeur donnee est trop courte' | trans }}",
"very-weak": "{% trans 'forms::le mot de passe est trop simple' %}", "very-weak": "{{ 'forms::le mot de passe est trop simple' | trans }}",
"weak": "{% trans 'forms::le mot de passe est trop simple' %}", "weak": "{{ 'forms::le mot de passe est trop simple' | trans }}",
"good": "{% trans 'forms::le mot de passe est bon' %}", "good": "{{ 'forms::le mot de passe est bon' | trans }}",
"strong": "{% trans 'forms::le mot de passe est tres bon' %}" "strong": "{{ 'forms::le mot de passe est tres bon' | trans }}"
}; };
$("#create_admin").validate({ $("#create_admin").validate({
rules: { rules: {
email: {email: true}, email:{ email:true},
password: {password: "#create_admin input[name=email]"},
password_confirm: {equalTo: "#create_admin input[name=password]"},
hostname: {required: true},
user: {required: true},
ab_name: {required: true}
},
messages: {
email: {
email: language.validateEmail
},
hostname: {
required: language.requiredField
},
password: {
required: language.validatePassword
},
password_confirm: {
required: language.validatePasswordConfirm,
equalTo: language.validatePasswordEqual
}
},
errorPlacement: function (error, element) {
error.appendTo(element.parent());
}
}
);
password : {password:"#create_admin input[name=email]"},
password_confirm : {equalTo:"#create_admin input[name=password]"},
ab_hostname : {required:true},
ab_user : {required:true},
ab_name : {required:true}
},
messages: {
email:{
email : language.validateEmail
},
ab_hostname : {
required : language.requiredField
},
password : {
required : language.validatePassword
},
password_confirm : {
required : language.validatePasswordConfirm,
equalTo : language.validatePasswordEqual
}
},
errorPlacement: function(error, element) {
error.appendTo( element.parent() );
}
}
);
$("#create_admin").valid(); $("#create_admin").valid();
$('.path_to_test').path_file_test({'url': '/setup/test/path/'});
$('.url_to_test').url_test({'url': '/setup/test/url/'}); $('.path_to_test').path_file_test({'url':'/setup/test/path/'});
$('.url_to_test').url_test({'url':'/setup/test/url/'});
$('.steps:not(:first)').hide(); $('.steps:not(:first)').hide();
$('.steps .next').bind('click', function () { $('.steps .next').bind('click', function(){
var $current = $(this).closest('.steps'); var $current = $(this).closest('.steps');
if($('input.field_error, input.error', $current).length > 0) if($('input.field_error, input.error', $current).length > 0)
{ {
alert('{% trans "Veuillez corriger les erreurs avant de poursuivre" %}'); alert('{{ "Veuillez corriger les erreurs avant de poursuivre" | trans }}');
return false; return false;
} }
if (!$(this).hasClass('install')) { if(!$(this).hasClass('install'))
var callback = function () { {
var callback = function(){
$current.hide(); $current.hide();
$current.next().show(); $current.next().show();
}; };
} else { }
var callback = function () { else
{
var callback = function(){
if(window.console)
console.log('Processing install....');
$(this).attr('disabled', 'disabled'); $(this).attr('disabled', 'disabled');
var dialog = $('#install_wait'); var dialog = $('#install_wait');
dialog.dialog({ dialog.dialog({
modal: true, modal:true,
resizable: false, resizable:false,
draggable: false, draggable:false,
closeOnEscape: false closeOnEscape:false
}); });
$('.ui-dialog-titlebar-close', dialog.closest('.ui-dialog')).remove(); $('.ui-dialog-titlebar-close', dialog.closest('.ui-dialog')).remove();
setTimeout("$('form#create_admin').submit();", 500); setTimeout("$('form#create_admin').submit();",500);
}; };
} }
if ($current.hasClass('appbox_settings')) { if($current.hasClass('appbox_settings'))
{
test_connection_appbox(callback); test_connection_appbox(callback);
} else if ($current.hasClass('databox_settings') && $('.databox_create', $current).is(':not(:checked)')) { }
else if($current.hasClass('databox_settings') && $('.databox_create', $current).is(':not(:checked)'))
{
test_connection_databox(callback); test_connection_databox(callback);
} else { }
else{
callback(); callback();
} }
return false; return false;
}); });
$('.steps .previous').bind('click', function () { $('.steps .previous').bind('click', function(){
var $current = $(this).closest('.steps'); var $current = $(this).closest('.steps');
$current.hide(); $current.hide();
$current.prev().show(); $current.prev().show();
@@ -134,7 +145,9 @@
return false; return false;
}); });
function test_connection_appbox(callback) {
function test_connection_appbox(callback)
{
var scope = $('.appbox_settings'); var scope = $('.appbox_settings');
var hostname_input = $('input[name="hostname"]:visible', scope); var hostname_input = $('input[name="hostname"]:visible', scope);
var port_input = $('input[name="port"]:visible', scope); var port_input = $('input[name="port"]:visible', scope);
@@ -146,27 +159,31 @@
var password = password_input.val(); var password = password_input.val();
var db_name = db_name_input.val(); var db_name = db_name_input.val();
var data = { var datas = {
user: user, user:user,
password: password, password:password,
db_name: db_name db_name:db_name
}; };
if (hostname_input.length > 0) { if(hostname_input.length > 0)
data.hostname = hostname_input.val(); {
datas.hostname = hostname_input.val();
} }
if (port_input.length > 0) { if(port_input.length > 0)
data.port = port_input.val(); {
datas.port = port_input.val();
} }
var el_loader = $('.tester_loader', scope); var el_loader = $('.tester_loader', scope);
var el_status = $('.tester_status', scope); var el_status = $('.tester_status', scope);
var el_message = $('.tester_message', scope); var el_message = $('.tester_message', scope);
test_connection(el_loader, el_status, el_message, data, callback); test_connection(el_loader, el_status, el_message, datas, callback);
} }
function test_connection_databox(callback) {
function test_connection_databox(callback)
{
var appbox_scope = $('.appbox_settings'); var appbox_scope = $('.appbox_settings');
var databox_scope = $('.databox_settings'); var databox_scope = $('.databox_settings');
@@ -181,26 +198,30 @@
var password = password_input.val(); var password = password_input.val();
var db_name = db_name_input.val(); var db_name = db_name_input.val();
var data = { var datas = {
user: user, user:user,
password: password, password:password,
db_name: db_name db_name:db_name
}; };
if (hostname_input.length > 0) { if(hostname_input.length > 0)
data.hostname = hostname_input.val(); {
datas.hostname = hostname_input.val();
} }
if (port_input.length > 0) { if(port_input.length > 0)
data.port = port_input.val(); {
datas.port = port_input.val();
} }
var el_loader = $('.tester_loader', databox_scope); var el_loader = $('.tester_loader', databox_scope);
var el_status = $('.tester_status', databox_scope); var el_status = $('.tester_status', databox_scope);
var el_message = $('.tester_message', databox_scope); var el_message = $('.tester_message', databox_scope);
test_connection(el_loader, el_status, el_message, data, callback); test_connection(el_loader, el_status, el_message, datas, callback);
} }
function test_connection(el_loader, el_status, el_message, data, callback) { function test_connection(el_loader, el_status, el_message, datas, callback)
{
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/setup/connection_test/mysql/', url: '/setup/connection_test/mysql/',
@@ -259,11 +280,14 @@
<form id="create_admin" method="post" action="{{ path('install_do_install') }}"> <form id="create_admin" method="post" action="{{ path('install_do_install') }}">
<div class="steps"> <div class="steps">
<div class="wrapper"> <div class="wrapper">
<div class="PNB10 wrapper_left"> <div class="PNB10 wrapper_left">
<div class="PNB10 section_title"> <div class="PNB10 section_title">
<h2></h2> <h2>
</h2>
</div> </div>
<div class="PNB10" style="top:50px;overflow-x:hidden;"> <div class="PNB10" style="top:50px;overflow-x:hidden;">
<table class="main_content_wrapper"> <table class="main_content_wrapper">
@@ -274,37 +298,21 @@
<td> <td>
<p> <p>
{% if error is not none %} {% if error is not none %}
<p class='error'> <p class='error'>
{{ error }} {{error}}
</p> </p>
{% endif %} {% endif %}
{% trans %} {% trans %}Bonjour, vous etes sur le point d'installer Phraseanet.{% endtrans %}
Bonjour, vous etes sur le point d'installer Phraseanet.
{% endtrans %}
</p> </p>
<p> <p>
{% trans %} {% trans %}Consultez en ligne les pré-requis et la configuration du serveur web{% endtrans %}
Consultez en ligne les pré-requis et la
configuration du serveur web
{% endtrans %}
</p> </p>
<p> <p>
{% trans %} {% trans %}Vous aurez besoin de spécifier un serveur MySQL, des repertoires de stockage pour vos documents, et de configurer votre serveur web pour qu'il publie certains de ces dossiers de stockage.{% endtrans %}
Vous aurez besoin de spécifier un serveur MySQL, des
repertoires de stockage pour vos documents, et de
configurer votre serveur web pour qu'il publie
certains de ces dossiers de stockage.
{% endtrans %}
</p> </p>
{% if warnings|length > 0 %} {% if warnings|length > 0 %}
<p> <p>
{% trans %} {% trans %}Avant de continuer, prenez connaissance des points ci-dessous. Vous pouvez continuer sans corriger ces problèmes.{% endtrans %}
Avant de continuer, prenez connaissance des
points ci-dessous. Vous pouvez continuer sans
corriger ces problèmes.
{% endtrans %}
</p> </p>
{% endif %} {% endif %}
</td> </td>
@@ -319,7 +327,7 @@
{% if warnings is not empty %} {% if warnings is not empty %}
<tr> <tr>
<td> <td>
<a href="{{ path('install_root') }}">{% trans 'Review system configuration' %}</a> <a href="{{ path('install_root') }}">{{ 'Review system configuration' | trans }}</a>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
@@ -335,9 +343,8 @@
<tr> <tr>
<td> <td>
<p> <p>
<a href="https://docs.phraseanet.com/3.8/Admin/" <a href="https://docs.phraseanet.com/3.8/Admin/" target="_blank">
target="_blank"> {{ 'Prerequisite and Configuration' | trans }}
{% trans 'Prerequisite and Configuration' %}
</a> </a>
</p> </p>
</td> </td>
@@ -352,7 +359,7 @@
<td> <td>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="next">{% trans 'boutton::suivant' %}</button> <button class="next">{{ 'boutton::suivant' | trans }}</button>
</td> </td>
</tr> </tr>
</table> </table>
@@ -365,7 +372,7 @@
<div class="PNB10 wrapper_left"> <div class="PNB10 wrapper_left">
<div class="PNB10 section_title"> <div class="PNB10 section_title">
<h2> <h2>
1/5 {% trans 'Executables externes' %} 1/5 {{ 'Executables externes' | trans }}
</h2> </h2>
</div> </div>
<div class="PNB10" style="top:50px;overflow-x:hidden;"> <div class="PNB10" style="top:50px;overflow-x:hidden;">
@@ -379,12 +386,8 @@
{% set required = '1' %} {% set required = '1' %}
{% endif %} {% endif %}
<tr> <tr>
<td><label>{{ binary['name'] }}</label></td> <td><label>{{ binary['name'] }}</label> </td>
<td><input autocomplete="off" name="binary_{{ key }}" <td><input autocomplete="off" name="binary_{{key}}" class="path_to_test test_executable {% if required == "1" %}required{% endif %}" type="text" value="{{ binary['binary'] }}" /> {% if required == "1" %}{{ 'Required field' | trans }}{% endif %}</td>
class="path_to_test test_executable {% if required == "1" %}required{% endif %}"
type="text"
value="{{ binary['binary'] }}"/> {% if required == "1" %}{% trans 'Required field' %}{% endif %}
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
@@ -399,15 +402,13 @@
<tr> <tr>
<td> <td>
<p> <p>
{% trans 'Phraseanet may require many binaries.' %} {{ 'Phraseanet may require many binaries.' | trans }}
</p> </p>
<p> <p>
{% trans 'Some of them are required, like the indexer, Exiftool or ImageMagick components, some others are optionnal, like FFmpeg which is used to preview video files.' %} {{ 'Some of them are required, like the indexer, Exiftool or ImageMagick components, some others are optionnal, like FFmpeg which is used to preview video files.' | trans }}
</p> </p>
<p> <p>
{% trans 'Don\'t worry, You can modify your configuration later' %} {{ 'Don\'t worry, You can modify your configuration later' | trans }}
</p> </p>
</td> </td>
</tr> </tr>
@@ -419,10 +420,10 @@
<table> <table>
<tr> <tr>
<td> <td>
<button class="previous">{% trans 'boutton::precedent' %}</button> <button class="previous">{{ 'boutton::precedent' | trans }}</button>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="next">{% trans 'boutton::suivant' %}</button> <button class="next">{{ 'boutton::suivant' | trans }}</button>
</td> </td>
</tr> </tr>
</table> </table>
@@ -430,12 +431,14 @@
</div> </div>
<div class="steps"> <div class="steps">
<div class="wrapper"> <div class="wrapper">
<div class="PNB10 wrapper_left"> <div class="PNB10 wrapper_left">
<div class="PNB10 section_title"> <div class="PNB10 section_title">
<h2>2/5 <h2>2/5
{% trans 'Creation de votre compte' %} {{ 'Creation de votre compte' | trans }}
</h2> </h2>
</div> </div>
<div class="PNB10" style="top:50px;overflow-x:hidden;"> <div class="PNB10" style="top:50px;overflow-x:hidden;">
@@ -444,16 +447,12 @@
<td> <td>
<table class="main_content_table"> <table class="main_content_table">
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Votre adresse email' | trans }}</label></td>
<label>{% trans 'Votre adresse email' %}</label></td> <td><input class="error" type="text" name="email" value="" /></td>
<td><input class="error" type="text" name="email" value=""/>
</td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Votre mot de passe' | trans }}</label></td>
<label>{% trans 'Votre mot de passe' %}</label></td> <td><input autocomplete="off" type="password" name="password" value="" /></td>
<td><input autocomplete="off" type="password"
name="password" value=""/></td>
</tr> </tr>
<tr> <tr>
<td> <td>
@@ -468,24 +467,20 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Confirmation de votre mot de passe' | trans }}</label></td>
<label>{% trans 'Confirmation de votre mot de passe' %}</label> <td><input autocomplete="off" type="password" name="password_confirm" value="" /></td>
</td>
<td><input autocomplete="off" type="password"
name="password_confirm" value=""/></td>
</tr> </tr>
<tr> <tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div style="border:1px solid #404040;padding:0 10px;margin:20px 0"> <div style="border:1px solid #404040;padding:0 10px;margin:20px 0">
<h3>{% trans 'admin::compte-utilisateur A propos de la securite des mots de passe :' %}</h3> <h3>{{ 'admin::compte-utilisateur A propos de la securite des mots de passe :' | trans }}</h3>
<p>{{ 'admin::compte-utilisateur Les mots de passe doivent etre clairement distincts du login et contenir au moins deux types parmis les caracteres suivants :' | trans }}</p>
<p>{% trans 'admin::compte-utilisateur Les mots de passe doivent etre clairement distincts du login et contenir au moins deux types parmis les caracteres suivants :' %}</p>
<dl style="border:none;float:none;"> <dl style="border:none;float:none;">
<dt>{% trans 'admin::compte-utilisateur::securite caracteres speciaux' %}</dt> <dt>{{ 'admin::compte-utilisateur::securite caracteres speciaux' | trans }}</dt>
<dt>{% trans 'admin::compte-utilisateur::securite caracteres majuscules' %}</dt> <dt>{{ 'admin::compte-utilisateur::securite caracteres majuscules' | trans }}</dt>
<dt>{% trans 'admin::compte-utilisateur::securite caracteres minuscules' %}</dt> <dt>{{ 'admin::compte-utilisateur::securite caracteres minuscules' | trans }}</dt>
<dt>{% trans 'admin::compte-utilisateur::securite caracteres numeriques' %}</dt> <dt>{{ 'admin::compte-utilisateur::securite caracteres numeriques' | trans }}</dt>
</dl> </dl>
</div> </div>
</td> </td>
@@ -502,9 +497,8 @@
<tr> <tr>
<td> <td>
<p> <p>
{% trans 'Your email will be used to log in the application.' %} {{ 'Your email will be used to log in the application.' | trans }} <br/><br/>
<br/><br/> {{ 'Please be sure it is still valid and you can access it' | trans }}
{% trans 'Please be sure it is still valid and you can access it' %}
</p> </p>
</td> </td>
</tr> </tr>
@@ -516,10 +510,10 @@
<table> <table>
<tr> <tr>
<td> <td>
<button class="previous">{% trans 'boutton::precedent' %}</button> <button class="previous">{{ 'boutton::precedent' | trans }}</button>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="next">{% trans 'boutton::suivant' %}</button> <button class="next">{{ 'boutton::suivant' | trans }}</button>
</td> </td>
</tr> </tr>
</table> </table>
@@ -527,15 +521,20 @@
</div> </div>
<div class="steps appbox_settings"> <div class="steps appbox_settings">
<div class="wrapper"> <div class="wrapper">
<div class="PNB10 wrapper_left"> <div class="PNB10 wrapper_left">
<div class="PNB10 section_title"> <div class="PNB10 section_title">
<h2> <h2>
3/5 3/5
{% trans %} {% trans %}setup::Configuration de la base de compte ApplicationBox{% endtrans %}
setup::Configuration de la base de compte ApplicationBox
{% endtrans %}
</h2> </h2>
</div> </div>
<div class="PNB10" style="top:50px;overflow-x:hidden;"> <div class="PNB10" style="top:50px;overflow-x:hidden;">
@@ -545,45 +544,34 @@
<table class="main_content_table"> <table class="main_content_table">
<tr> <tr>
<td colspan="2"> <td colspan="2">
<h3>{% trans 'MySQL database connection parameters' %}</h3> <h3>{{ 'MySQL database connection parameters' | trans }}</h3>
</td> </td>
</tr> </tr>
<tr class="optional_ab_data"> <tr class="optional_ab_datas">
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'phraseanet:: adresse' | trans }}</label></td>
<label>{% trans 'phraseanet:: adresse' %}</label></td> <td><input autocomplete="off" type="text" name="hostname" value="localhost" /></td>
<td><input autocomplete="off" type="text" name="hostname"
value="localhost"/></td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Database user' | trans }}</label></td>
<label>{% trans 'Database user' %}</label></td> <td><input type="text" name="user" value="" /></td>
<td><input type="text" name="user" value=""/></td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'admin::compte-utilisateur mot de passe' | trans }}</label></td>
<label>{% trans 'admin::compte-utilisateur mot de passe' %}</label> <td><input type="password" name="db_password" value="" autocomplete="off" /></td>
</td>
<td><input type="password" name="db_password" value=""
autocomplete="off"/></td>
</tr> </tr>
<tr class="optional_ab_data"> <tr class="optional_ab_datas">
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'phraseanet:: port' | trans }}</label></td>
<label>{% trans 'phraseanet:: port' %}</label></td> <td><input autocomplete="off" type="text" name="port" value="3306" /></td>
<td><input autocomplete="off" type="text" name="port"
value="3306"/></td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Database' | trans }}</label></td>
<label>{% trans 'Database' %}</label></td> <td><input type="text" name="ab_name" value="" /></td>
<td><input type="text" name="ab_name" value=""/></td>
</tr> </tr>
<tr style="height:40px;"> <tr style="height:40px;">
<td style="text-align:center;"> <td style="text-align:center;">
<button class="ab_tester error">{% trans 'boutton::tester' %}</button> <button class="ab_tester error">{{ 'boutton::tester' | trans }}</button>
<img class="tester_loader" style="visibility:hidden;" <img class="tester_loader" style="visibility:hidden;" src="/skins/icons/loader-black.gif"/>
src="/skins/icons/loader-black.gif"/> <img class="tester_status" style="display:none;" src="/skins/icons/delete.png"/>
<img class="tester_status" style="display:none;"
src="/skins/icons/delete.png"/>
</td> </td>
<td> <td>
<span class="tester_message"> </span> <span class="tester_message"> </span>
@@ -594,11 +582,7 @@
<p style="margin:10px 0;"> <p style="margin:10px 0;">
{% set debut_lien = '<a href="#" class="ab_opt_toggler">' %} {% set debut_lien = '<a href="#" class="ab_opt_toggler">' %}
{% set fin_lien = '</a>' %} {% set fin_lien = '</a>' %}
{% trans %} {% trans with {'%debut_lien%' : debut_lien, '%fin_lien%' : fin_lien} %}Si vous aviez besoin de plus de parametres, %debut_lien%Afficher d'avantage d'options%fin_lien%{% endtrans %}
Si vous aviez besoin de plus de
parametres, {{ debut_lien }}Afficher d'avantage
d'options{{ fin_lien }}
{% endtrans %}
</p> </p>
</td> </td>
</tr> </tr>
@@ -614,25 +598,19 @@
<tr> <tr>
<td> <td>
<p> <p>
{% trans 'ApplicationBox is a Mysql database.' %} {{ 'ApplicationBox is a Mysql database.' | trans }}
</p> </p>
<p> <p>
{% trans 'It stores users data, rights, and references to DataBoxes where records are stored.' %} {{ 'It stores users datas, rights, and references to DataBoxes where records are stored.' | trans }}
</p> </p>
<p> <p>
{% set link_start = '<a href="https://mariadb.org/" target="_blank">' %} {% set link_start = '<a href="https://mariadb.org/" target="_blank">' %}
{% set link_end = '</a>' %} {% set link_end = '</a>' %}
{% trans %} {% trans with {'%link_start%' : link_start, '%link_end%' : link_end} %}Phraseanet strongly recommends the use of %link_start%MariaDB%link_end% as a replacement for MySQL.{% endtrans %}
Phraseanet strongly recommends the use of {{ link_start }}
MariaDB{{ link_end }} as a replacement for MySQL.
{% endtrans %}
<br/> <br/>
<br/> <br/>
<a href="https://mariadb.org/" target="_blank"> <a href="https://mariadb.org/" target="_blank">
<img src="/skins/icons/Mariadb-big.png" <img src="/skins/icons/Mariadb-big.png" style="width:100%;" />
style="width:100%;"/>
</a> </a>
</p> </p>
</td> </td>
@@ -645,10 +623,10 @@
<table> <table>
<tr> <tr>
<td> <td>
<button class="previous">{% trans 'boutton::precedent' %}</button> <button class="previous">{{ 'boutton::precedent' | trans }}</button>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="next">{% trans 'boutton::suivant' %}</button> <button class="next">{{ 'boutton::suivant' | trans }}</button>
</td> </td>
</tr> </tr>
</table> </table>
@@ -656,12 +634,14 @@
</div> </div>
<div class="steps"> <div class="steps">
<div class="wrapper"> <div class="wrapper">
<div class="PNB10 wrapper_left"> <div class="PNB10 wrapper_left">
<div class="PNB10 section_title"> <div class="PNB10 section_title">
<h2>4/5 <h2>4/5
{% trans 'setup::Configuration des repertoires de stockage' %} {{ 'setup::Configuration des repertoires de stockage' | trans }}
</h2> </h2>
</div> </div>
<div class="PNB10" style="top:50px;overflow-x:hidden;"> <div class="PNB10" style="top:50px;overflow-x:hidden;">
@@ -670,11 +650,8 @@
<td> <td>
<table class="main_content_table"> <table class="main_content_table">
<tr> <tr>
<td> <td><label>{{ 'Repertoire de stockage des fichiers' | trans }}</label></td>
<label>{% trans 'Repertoire de stockage des fichiers' %}</label> <td><input class="path_to_test test_writeable required" type="text" name="datapath_noweb" value="" /></td>
</td>
<td><input class="path_to_test test_writeable required"
type="text" name="datapath_noweb" value=""/></td>
</tr> </tr>
</table> </table>
</td> </td>
@@ -688,15 +665,13 @@
<tr> <tr>
<td> <td>
<p> <p>
{% trans 'Your medias and their subdefinitions (previews, thumbnails..) will be stored in these directories.' %} {{ 'Your medias and their subdefinitions (previews, thumbnails..) will be stored in these directories.' | trans }}
</p> </p>
<p> <p>
{% trans 'Thumbnails directory is mounted to be accessible via HTTP, while other files are not.' %} {{ 'Thumbnails directory is mounted to be accessible via HTTP, while other files are not.' | trans }}
</p> </p>
<p> <p>
{% trans 'If you plan to store large files, be sure it will fit in these directories.' %} {{ 'If you plan to store large files, be sure it will fit in these directories.' | trans }}
</p> </p>
</td> </td>
</tr> </tr>
@@ -708,10 +683,10 @@
<table> <table>
<tr> <tr>
<td> <td>
<button class="previous">{% trans 'boutton::precedent' %}</button> <button class="previous">{{ 'boutton::precedent' | trans }}</button>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="next">{% trans 'boutton::suivant' %}</button> <button class="next">{{ 'boutton::suivant' | trans }}</button>
</td> </td>
</tr> </tr>
</table> </table>
@@ -719,14 +694,13 @@
</div> </div>
<div class="steps databox_settings"> <div class="steps databox_settings">
<div class="wrapper"> <div class="wrapper">
<div class="PNB10 wrapper_left"> <div class="PNB10 wrapper_left">
<div class="PNB10 section_title"> <div class="PNB10 section_title">
<h2>5/5 <h2>5/5
{% trans %} {% trans %}setup::Configuration de la base de stockage DataBox{% endtrans %}
setup::Configuration de la base de stockage DataBox
{% endtrans %}
</h2> </h2>
</div> </div>
<div class="PNB10" style="top:50px;overflow-x:hidden;"> <div class="PNB10" style="top:50px;overflow-x:hidden;">
@@ -735,41 +709,32 @@
<td> <td>
<table class="main_content_table"> <table class="main_content_table">
<tr> <tr>
<td colspan="2"> <td colspan="2"><h3>{{ 'MySQL database connection parameters' | trans }}</h3></td>
<h3>{% trans 'MySQL database connection parameters' %}</h3>
</td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Ne pas creer de DataBox maintenant' | trans }}</label></td>
<label>{% trans 'Ne pas creer de DataBox maintenant' %}</label> <td><input type="checkbox" class="databox_create" /></td>
</td>
<td><input type="checkbox" class="databox_create"/></td>
</tr> </tr>
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;"><label>{{ 'Database' | trans }}</label></td>
<label>{% trans 'Database' %}</label></td> <td><input class="databox_creation_input" type="text" name="db_name" value="" /></td>
<td><input class="databox_creation_input" type="text"
name="db_name" value=""/></td>
</tr> </tr>
<tr style="height:40px;"> <tr style="height:40px;">
<td style="text-align:center;"> <td style="text-align:center;">
<button class="db_tester error">{% trans 'boutton::tester' %}</button> <button class="db_tester error">{{ 'boutton::tester' | trans }}</button>
<img class="tester_loader" style="visibility:hidden;" <img class="tester_loader" style="visibility:hidden;" src="/skins/icons/loader-black.gif"/>
src="/skins/icons/loader-black.gif"/> <img class="tester_status" style="display:none;" src="/skins/icons/delete.png"/>
<img class="tester_status" style="display:none;"
src="/skins/icons/delete.png"/>
</td> </td>
<td> <td>
<span class="tester_message"> </span> <span class="tester_message"> </span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><label>{% trans 'Modele de donnees' %}</label></td> <td><label>{{ 'Modele de donnees' | trans }}</label></td>
<td> <td>
<select name="db_template" <select name="db_template" class="databox_creation_input">
class="databox_creation_input">
{% for template in available_templates %} {% for template in available_templates %}
<option value="{{ template }}">{{ template }}</option> <option value="{{ template }}">{{ template }}</option>
{% endfor %} {% endfor %}
@@ -781,40 +746,29 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<h3> <h3>
{% trans %} {% trans %}Creation des taches{% endtrans %}
Creation des taches
{% endtrans %}
</h3> </h3>
{% trans 'Phraseanet embarque un moteur de taches pour la lecture / ecriture des metadonnes, et autre operations' %} {{ 'Phraseanet embarque un moteur de taches pour la lecture / ecriture des metadonnes, et autre operations' | trans }}
<br/><br/> <br/><br/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width:100px;text-align:right;"> <td style="width:100px;text-align:right;">
<input type="checkbox" name="create_task[]" <input type="checkbox" name="create_task[]" value="writemeta" checked />
value="writemeta" checked/>
</td>
<td>
<label>{% trans 'Creer la tache d\'ecriture des metadonnees' %}</label>
</td> </td>
<td><label>{{ 'Creer la tache d\'ecriture des metadonnees' | trans }}</label></td>
</tr> </tr>
<tr> <tr>
<td style="width:100px;text-align:right;"> <td style="width:100px;text-align:right;">
<input type="checkbox" name="create_task[]" <input type="checkbox" name="create_task[]" value="subdef" checked />
value="subdef" checked/>
</td>
<td>
<label>{% trans 'Creer la tache de creation des sous-definitions' %}</label>
</td> </td>
<td><label>{{ 'Creer la tache de creation des sous-definitions' | trans }}</label></td>
</tr> </tr>
<tr> <tr>
<td style="width:100px;text-align:right;"> <td style="width:100px;text-align:right;">
<input type="checkbox" name="create_task[]" <input type="checkbox" name="create_task[]" value="cindexer" checked />
value="cindexer" checked/>
</td>
<td>
<label>{% trans 'Creer la tache d\'indexation' %}</label>
</td> </td>
<td><label>{{ 'Creer la tache d\'indexation' | trans }}</label></td>
</tr> </tr>
</table> </table>
</td> </td>
@@ -828,9 +782,8 @@
<tr> <tr>
<td> <td>
<p> <p>
{% trans 'Phraseanet DataBoxes are MySQL databases, queryable by Phraseanet ApplicationBox.' %} {{ 'Phraseanet DataBoxes are MySQL databases, queryable by Phraseanet ApplicationBox.' | trans }}<br/><br/>
<br/><br/> {{ 'Databoxes store records, metadatas and their classifications' | trans }}
{% trans 'Databoxes store records, metadatas and their classifications' %}
</p> </p>
</td> </td>
</tr> </tr>
@@ -842,23 +795,20 @@
<table> <table>
<tr> <tr>
<td> <td>
<button class="previous">{% trans 'boutton::precedent' %}</button> <button class="previous">{{ 'boutton::precedent' | trans }}</button>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="next install" <button class="next install" type="submit">{{ 'button::Install' | trans }}</button>
type="submit">{% trans 'button::Install' %}</button>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</form> </form>
<div id="install_wait" style="display:none;" title="{% trans 'Install in progess' %}"> <div id="install_wait" style="display:none;" title="{{ 'Install in progess' | trans }}">
<p> <p>
<img src="/skins/icons/loader111111.gif"/> <img src="/skins/icons/loader111111.gif"/>
{% trans %} {% trans %}Installation is currenlty processing, please wait...{% endtrans %}
Installation is currenlty processing, please wait...
{% endtrans %}
</p> </p>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -39,7 +39,7 @@ class ApiJSONPTest extends ApiTestCase
protected function unserialize($data) protected function unserialize($data)
{ {
if (strpos($data, 'jsFunction(') !== 0) { if (strpos($data, 'jsFunction(') !== 4) {
$this->fail('Invalid JSONP response'); $this->fail('Invalid JSONP response');
} }
@@ -47,7 +47,7 @@ class ApiJSONPTest extends ApiTestCase
$this->fail('Invalid JSONP response'); $this->fail('Invalid JSONP response');
} }
return json_decode(substr($data, 11, -2), true); return json_decode(substr($data, 15, -2), true);
} }
protected function getAcceptMimeType() protected function getAcceptMimeType()

View File

@@ -2156,7 +2156,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
$this->assertArrayHasKey('response', $content); $this->assertArrayHasKey('response', $content);
$this->assertTrue(is_array($content['meta']), 'Le bloc meta est un array'); $this->assertTrue(is_array($content['meta']), 'Le bloc meta est un array');
$this->assertTrue(is_array($content['response']), 'Le bloc reponse est un array'); $this->assertTrue(is_array($content['response']), 'Le bloc reponse est un array');
$this->assertEquals('1.3', $content['meta']['api_version']); $this->assertEquals('1.4.1', $content['meta']['api_version']);
$this->assertNotNull($content['meta']['response_time']); $this->assertNotNull($content['meta']['response_time']);
$this->assertEquals('UTF-8', $content['meta']['charset']); $this->assertEquals('UTF-8', $content['meta']['charset']);
} }

View File

@@ -111,7 +111,7 @@ class ResultTest extends \PhraseanetAuthenticatedTestCase
$return = $apiResult->createResponse()->getContent(); $return = $apiResult->createResponse()->getContent();
$this->assertInternalType(\PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $return); $this->assertInternalType(\PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $return);
$this->assertRegexp("/my_callback_function\\(\\{.+\\}\\);/", $return); $this->assertRegexp("/my_callback_function\\(\\{.+\\}\\);/", $return);
$response = json_decode(substr($return, 21, strlen($return) - 23), true); $response = json_decode(substr($return, 25, -2), true);
$this->assertSame([], $response['response']); $this->assertSame([], $response['response']);
} }

View File

@@ -29,7 +29,6 @@ class QueryTest extends \PhraseanetAuthenticatedWebTestCase
self::$DI['client']->request('POST', $route); self::$DI['client']->request('POST', $route);
$response = self::$DI['client']->getResponse(); $response = self::$DI['client']->getResponse();
$this->assertEquals('application/json', $response->headers->get('Content-type')); $this->assertEquals('application/json', $response->headers->get('Content-type'));
$data = json_decode($response->getContent(), true); $data = json_decode($response->getContent(), true);
$this->assertInternalType('array', $data); $this->assertInternalType('array', $data);

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Http\StaticFile;
use Alchemy\Phrasea\Http\StaticFile\Apache; use Alchemy\Phrasea\Http\StaticFile\Apache;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class ApacheModeTest extends \PhraseanetPHPUnitAbstract class ApacheModeTest extends \PhraseanetWebTestCase
{ {
public function testGetVirtualHost() public function testGetVirtualHost()
{ {

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Http\StaticFile;
use Alchemy\Phrasea\Http\StaticFile\Nginx; use Alchemy\Phrasea\Http\StaticFile\Nginx;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class NginxModeTest extends \PhraseanetPHPUnitAbstract class NginxModeTest extends \PhraseanetWebTestCase
{ {
public function testGetVirtualHost() public function testGetVirtualHost()
{ {

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Http\XSendFile;
use Alchemy\Phrasea\Http\StaticFile\StaticFileFactory; use Alchemy\Phrasea\Http\StaticFile\StaticFileFactory;
class StaticFileFactoryTest extends \PhraseanetPHPUnitAbstract class StaticFileFactoryTest extends \PhraseanetWebTestCase
{ {
public function testFactoryCreation() public function testFactoryCreation()
{ {

View File

@@ -52,7 +52,7 @@ class InstallerTest extends \PhraseanetTestCase
'port' => 3306, 'port' => 3306,
'user' => $credentials['user'], 'user' => $credentials['user'],
'password' => $credentials['password'], 'password' => $credentials['password'],
'dbname' => 'ab_unitTests', 'dbname' => 'ab_setup_test',
]); ]);
$abConn->connect(); $abConn->connect();
$dbConn = self::$DI['app']['dbal.provider']->get([ $dbConn = self::$DI['app']['dbal.provider']->get([
@@ -60,14 +60,14 @@ class InstallerTest extends \PhraseanetTestCase
'port' => 3306, 'port' => 3306,
'user' => $credentials['user'], 'user' => $credentials['user'],
'password' => $credentials['password'], 'password' => $credentials['password'],
'dbname' => 'db_unitTests', 'dbname' => 'db_setup_test',
]); ]);
$dbConn->connect(); $dbConn->connect();
// empty databases // empty databases
$stmt = $abConn->prepare('DROP DATABASE ab_unitTests; CREATE DATABASE ab_unitTests'); $stmt = $abConn->prepare('DROP DATABASE ab_setup_test; CREATE DATABASE ab_setup_test');
$stmt->execute(); $stmt->execute();
$stmt = $abConn->prepare('DROP DATABASE db_unitTests; CREATE DATABASE db_unitTests'); $stmt = $abConn->prepare('DROP DATABASE db_setup_test; CREATE DATABASE db_setup_test');
$stmt->execute(); $stmt->execute();
unset($stmt); unset($stmt);
@@ -81,7 +81,7 @@ class InstallerTest extends \PhraseanetTestCase
$databoxes = $app['phraseanet.appbox']->get_databoxes(); $databoxes = $app['phraseanet.appbox']->get_databoxes();
$databox = array_pop($databoxes); $databox = array_pop($databoxes);
$this->assertContains('<path>'.realpath($dataPath).'/db_unitTests/subdefs</path>', $databox->get_structure()); $this->assertContains('<path>'.realpath($dataPath).'/db_setup_test/subdefs</path>', $databox->get_structure());
$conf = $app['configuration.store']->getConfig(); $conf = $app['configuration.store']->getConfig();
$this->assertArrayHasKey('main', $conf); $this->assertArrayHasKey('main', $conf);

View File

@@ -1,4 +0,0 @@
{
"directory": "www/assets",
"interactive": false
}

View File

@@ -1,169 +0,0 @@
main:
servername: 'http://local.phrasea/'
maintenance: false
languages: []
key: ''
database:
host: 'sql-host'
port: 3306
user: 'sql-user'
password: 'sql-password'
dbname: ab_phraseanet
driver: pdo_mysql
charset: UTF8
database-test:
driver: pdo_sqlite
path: '/tmp/db.sqlite'
charset: UTF8
api-timers: false
cache:
type: ArrayCache
options:
options: []
opcodecache:
type: ArrayCache
options: []
search-engine:
type: Alchemy\Phrasea\SearchEngine\Phrasea\PhraseaEngine
options: []
task-manager:
enabled: true
logger:
max-files: 10
enabled: true
level: INFO
trusted-proxies: []
debugger:
allowed-ips: ['192.168.56.1']
binaries:
ghostscript_binary: null
php_binary: null
swf_extract_binary: null
pdf2swf_binary: null
swf_render_binary: null
unoconv_binary: null
ffmpeg_binary: null
ffprobe_binary: null
mp4box_binary: null
pdftotext_binary: null
recess_binary: null
phraseanet_indexer: null
ffmpeg_timeout: 3600
ffprobe_timeout: 60
gs_timeout: 60
mp4box_timeout: 60
swftools_timeout: 60
unoconv_timeout: 60
border-manager:
enabled: true
extension-mapping: { }
checkers:
-
type: Checker\Sha256
enabled: true
-
type: Checker\UUID
enabled: true
-
type: Checker\Colorspace
enabled: false
options:
colorspaces: [cmyk, grayscale, rgb]
-
type: Checker\Dimension
enabled: false
options:
width: 80
height: 160
-
type: Checker\Extension
enabled: false
options:
extensions: [jpg, jpeg, bmp, tif, gif, png, pdf, doc, odt, mpg, mpeg, mov, avi, xls, flv, mp3, mp2]
-
type: Checker\Filename
enabled: false
options:
sensitive: true
-
type: Checker\MediaType
enabled: false
options:
mediatypes: [Audio, Document, Flash, Image, Video]
authentication:
auto-create:
templates: { }
captcha:
enabled: true
trials-before-display: 9
providers:
facebook:
enabled: false
options:
app-id: ''
secret: ''
twitter:
enabled: false
options:
consumer-key: ''
consumer-secret: ''
google-plus:
enabled: false
options:
client-id: ''
client-secret: ''
github:
enabled: false
options:
client-id: ''
client-secret: ''
viadeo:
enabled: false
options:
client-id: ''
client-secret: ''
linkedin:
enabled: false
options:
client-id: ''
client-secret: ''
registration-fields:
-
name: company
required: true
-
name: lastname
required: true
-
name: firstname
required: true
-
name: geonameid
required: true
xsendfile:
enabled: false
type: nginx
mapping: []
h264-pseudo-streaming:
enabled: false
type: nginx
mapping: []
plugins: []
api_cors:
enabled: false
allow_credentials: false
allow_origin: []
allow_headers: []
allow_methods: []
expose_headers: []
max_age: 0
hosts: []
session:
idle: 0
# 1 week
lifetime: 604800
crossdomain:
allow-access-from:
-
domain: '*.cooliris.com'
secure: 'false'

View File

@@ -1,3 +0,0 @@
!.gitignore
*
!insecure_private_key