mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 04:53:26 +00:00
PHRAS-3754 admin - user detail - Record ACL tab (#4148)
* record acl tab in admin * fix email locked, limit record right to 200 * fix * add filter * update * feed element, basket element * feed list * feed entries * when not expand * some improvement
This commit is contained in:
@@ -233,4 +233,50 @@ DQL;
|
||||
|
||||
return $builder->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function getElements(User $user, $databoxId = null, $recordId = null, $nbElement = 200)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('be');
|
||||
$qb->innerJoin('be.basket', 'b');
|
||||
|
||||
$qb->where($qb->expr()->eq('b.user', ':user'));
|
||||
$qb->setParameter(':user', $user);
|
||||
|
||||
if ($databoxId != null) {
|
||||
$qb->andWhere('be.sbas_id = :databoxId');
|
||||
$qb->setParameter(':databoxId', $databoxId);
|
||||
}
|
||||
|
||||
if ($recordId != null) {
|
||||
$qb->andWhere('be.record_id = :recordId');
|
||||
$qb->setParameter(':recordId', $recordId);
|
||||
}
|
||||
|
||||
$qb->orderBy('be.id', 'DESC');
|
||||
$qb->setMaxResults($nbElement);
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function getElementsCount(User $user, $databoxId = null, $recordId = null)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('be');
|
||||
$qb->select('count(be)');
|
||||
$qb->innerJoin('be.basket', 'b');
|
||||
|
||||
$qb->where($qb->expr()->eq('b.user', ':user'));
|
||||
$qb->setParameter(':user', $user);
|
||||
|
||||
if ($databoxId != null) {
|
||||
$qb->andWhere('be.sbas_id = :databoxId');
|
||||
$qb->setParameter(':databoxId', $databoxId);
|
||||
}
|
||||
|
||||
if ($recordId != null) {
|
||||
$qb->andWhere('be.record_id = :recordId');
|
||||
$qb->setParameter(':recordId', $recordId);
|
||||
}
|
||||
|
||||
return $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user