mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
merge master
This commit is contained in:
@@ -30,7 +30,7 @@ class UserListCommand extends Command
|
||||
{
|
||||
parent::__construct('user:list');
|
||||
|
||||
$this->setDescription('List of all user')
|
||||
$this->setDescription('List of all user (experimental)')
|
||||
->addOption('user_id', null, InputOption::VALUE_OPTIONAL, ' The id of user export only info this user ')
|
||||
->addOption('user_email', null, InputOption::VALUE_OPTIONAL, 'The mail of user export only info this user .')
|
||||
->addOption('database_id', null, InputOption::VALUE_OPTIONAL, 'Id of database.')
|
||||
@@ -42,6 +42,7 @@ class UserListCommand extends Command
|
||||
->addOption('application', null, InputOption::VALUE_NONE, 'List application of user work only if --user_id is set')
|
||||
->addOption('right', null, InputOption::VALUE_NONE, 'Show right information')
|
||||
->addOption('adress', null, InputOption::VALUE_NONE, 'Show adress information')
|
||||
->addOption('models', null, InputOption::VALUE_NONE, "Show only defined models, if --user_id is set with --models it's the template owner")
|
||||
->addOption('jsonformat', null, InputOption::VALUE_NONE, 'Output in json format')
|
||||
->setHelp('');
|
||||
|
||||
@@ -62,6 +63,7 @@ class UserListCommand extends Command
|
||||
$created = $input->getOption('created');
|
||||
$updated = $input->getOption('updated');
|
||||
$withRight = $input->getOption('right');
|
||||
$models = $input->getOption('models');
|
||||
$jsonformat = $input->getOption('jsonformat');
|
||||
|
||||
$query = $this->container['phraseanet.user-query'];
|
||||
@@ -70,18 +72,26 @@ class UserListCommand extends Command
|
||||
if($collectionId) $query->on_sbas_ids([$collectionId]);
|
||||
if($created) $this->addFilterDate($created,'created',$query);
|
||||
if($updated) $this->addFilterDate($updated,'updated',$query);
|
||||
if($userId) $query->addSqlFilter('Users.id = ?' ,[$userId]);
|
||||
if($userEmail) $query->addSqlFilter('Users.email = ?' ,[$userEmail]);
|
||||
if($lockStatus) $query->addSqlFilter('Users.mail_locked = 1');
|
||||
if($guest) $query->include_invite(true)->addSqlFilter('Users.guest = 1');
|
||||
if($userId && !$models) $query->addSqlFilter('Users.id = ?' ,[$userId]);
|
||||
if($userEmail && !$models) $query->addSqlFilter('Users.email = ?' ,[$userEmail]);
|
||||
if($lockStatus && !$models) $query->addSqlFilter('Users.mail_locked = 1');
|
||||
if($guest && !$models) $query->include_invite(true)->addSqlFilter('Users.guest = 1');
|
||||
|
||||
if ($application and !$userId) {
|
||||
$output->writeln('<error>You must provide --user_id when using --application option</error>');
|
||||
return 0;
|
||||
}
|
||||
|
||||
$users = $query
|
||||
->execute()->get_results();
|
||||
/** @var UserRepository $userRepository */
|
||||
$userRepository = $this->container['repo.users'];
|
||||
|
||||
if ($models && $userId) {
|
||||
$users = $userRepository->findBy(['templateOwner' => $userId]);
|
||||
} elseif ($models) {
|
||||
$users = $userRepository->findTemplate();
|
||||
} else {
|
||||
$users = $query->execute()->get_results();
|
||||
}
|
||||
|
||||
$userList = [];
|
||||
$showApplication = false;
|
||||
|
@@ -1573,9 +1573,9 @@ class V1Controller extends Controller
|
||||
$options->setFirstResult((int)($request->get('offset_start') ?: 0));
|
||||
$options->setMaxResults((int)$request->get('per_page') ?: 10);
|
||||
|
||||
$this->getSearchEngine()->resetCache();
|
||||
$searchEngine = $this->getSearchEngine();
|
||||
|
||||
$search_result = $this->getSearchEngine()->query((string)$request->get('query'), $options);
|
||||
$search_result = $searchEngine->query((string)$request->get('query'), $options);
|
||||
|
||||
$this->getUserManipulator()->logQuery($this->getAuthenticatedUser(), $search_result->getQueryText());
|
||||
|
||||
@@ -1583,12 +1583,12 @@ class V1Controller extends Controller
|
||||
$collectionsReferencesByDatabox = $options->getCollectionsReferencesByDatabox();
|
||||
foreach ($collectionsReferencesByDatabox as $sbid => $references) {
|
||||
$databox = $this->findDataboxById($sbid);
|
||||
$collectionsIds = array_map(function(CollectionReference $ref){return $ref->getCollectionId();}, $references);
|
||||
$collectionsIds = array_map(function (CollectionReference $ref) {
|
||||
return $ref->getCollectionId();
|
||||
}, $references);
|
||||
$this->getSearchEngineLogger()->log($databox, $search_result->getQueryText(), $search_result->getTotal(), $collectionsIds);
|
||||
}
|
||||
|
||||
$this->getSearchEngine()->clearCache();
|
||||
|
||||
return $search_result;
|
||||
}
|
||||
|
||||
|
@@ -84,10 +84,14 @@ class DatabaseMetaProvider implements ServiceProviderInterface
|
||||
$service = $app['phraseanet.cache-service'];
|
||||
|
||||
$config->setMetadataCacheImpl(
|
||||
$service->factory('ORM_metadata', $app['orm.cache.driver'], $app['orm.cache.options'])
|
||||
$app['orm.cache.factory.filesystem'](array(
|
||||
'path' => $app['cache.path'].'/doctrine/metadata',
|
||||
))
|
||||
);
|
||||
$config->setQueryCacheImpl(
|
||||
$service->factory('ORM_query', $app['orm.cache.driver'], $app['orm.cache.options'])
|
||||
$app['orm.cache.factory.filesystem'](array(
|
||||
'path' => $app['cache.path'].'/doctrine/query',
|
||||
))
|
||||
);
|
||||
$config->setResultCacheImpl(
|
||||
$service->factory('ORM_result', $app['orm.cache.driver'], $app['orm.cache.options'])
|
||||
|
@@ -122,4 +122,15 @@ class UserRepository extends EntityRepository
|
||||
{
|
||||
return $this->findBy(['templateOwner' => $user->getId()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all templates
|
||||
*/
|
||||
public function findTemplate()
|
||||
{
|
||||
$qb = $this->createQueryBuilder('u');
|
||||
$qb->where('u.templateOwner is NOT NULL');
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@
|
||||
"normalize-css": "^2.1.0",
|
||||
"npm": "^6.0.0",
|
||||
"npm-modernizr": "^2.8.3",
|
||||
"phraseanet-production-client": "0.34.139-d",
|
||||
"phraseanet-production-client": "0.34.141-d",
|
||||
"requirejs": "^2.3.5",
|
||||
"tinymce": "^4.0.28",
|
||||
"underscore": "^1.8.3",
|
||||
|
@@ -183,6 +183,9 @@
|
||||
</div>
|
||||
{% if GV_thesaurus %}
|
||||
<div id="proposals" class="PNB thesaurus-from-facets-action">
|
||||
<input type="hidden" id="facet_except" value="{{ 'prod:workzone:facetstab:tooltips:facet_except_filter' | trans }}" />
|
||||
<input type="hidden" id="facet_and" value="{{ 'prod:workzone:facetstab:tooltips:facet_and_filter' | trans }}" />
|
||||
<input type="hidden" id="facet_remove" value="{{ 'prod:workzone:facetstab:tooltips:remove_facet_filter' | trans }}" />
|
||||
<div class="filter-facet-setting look_box_settings">
|
||||
<div id="accordion">
|
||||
<div class="card">
|
||||
|
@@ -7577,10 +7577,10 @@ phraseanet-common@^0.4.5-d:
|
||||
js-cookie "^2.1.0"
|
||||
pym.js "^1.3.1"
|
||||
|
||||
phraseanet-production-client@0.34.139-d:
|
||||
version "0.34.139-d"
|
||||
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.139-d.tgz#27edf283275c427ba226ff8b6c9461511dd6c827"
|
||||
integrity sha512-8lOeLbUpa2qBi08d4Tr3FbtKf4TmSvTWhPtwCm7bZxls14TMXnYl7JRFZoYEMGEB1n1tbYozrl/Oz4qV7Pn6Sg==
|
||||
phraseanet-production-client@0.34.141-d:
|
||||
version "0.34.141-d"
|
||||
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.141-d.tgz#25a137975af873c17837eaa0180ffe500c936f7f"
|
||||
integrity sha512-cYRaVtJPh5poYqOruoBwapM7HMp5Bv9NvW9HkEqPYr5p2nfZMzgEjjpyOQHnNkaEI+6w2kDk8KGNYd37HnOTmw==
|
||||
dependencies:
|
||||
"@mapbox/mapbox-gl-language" "^0.9.2"
|
||||
"@turf/turf" "^5.1.6"
|
||||
|
Reference in New Issue
Block a user