Merge remote-tracking branch 'upstream/master' into 20150306-elastic-indexer

Conflicts:
	bin/console
	bower.json
	composer.json
	composer.lock
	lib/Alchemy/Phrasea/Application.php
	lib/Alchemy/Phrasea/Border/Manager.php
	lib/Alchemy/Phrasea/Controller/Api/V1.php
	lib/Alchemy/Phrasea/Core/PhraseaEvents.php
	lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
	lib/classes/caption/field.php
	lib/classes/record/Interface.php
	templates/web/prod/index.html.twig
	www/skins/prod/000000/prodcolor.css
This commit is contained in:
Nicolas Le Goff
2015-03-06 14:35:29 +01:00
committed by Mathieu Darse
1078 changed files with 7964 additions and 16363 deletions

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -87,23 +87,30 @@ class Tools implements ControllerProviderInterface
$controllers->post('/image/', function (Application $app, Request $request) {
$return = ['success' => true];
$selection = RecordsRequest::fromRequest($app, $request, false, ['canmodifrecord']);
$force = $request->request->get('force_substitution') == '1';
$selection = RecordsRequest::fromRequest($app, $request, false, array('canmodifrecord'));
foreach ($selection as $record) {
$substituted = false;
foreach ($record->get_subdefs() as $subdef) {
if ($subdef->is_substituted()) {
$substituted = true;
if ($force) {
// unset flag
$subdef->set_substituted(false);
}
break;
}
}
if (!$substituted || $request->request->get('ForceThumbSubstit') == '1') {
if (!$substituted || $force) {
$record->rebuild_subdefs();
}
}
return $app->json($return);
})->bind('prod_tools_image');