Merge branch 'master' into feature/timeline
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Controller\Administrative\Document;
|
||||
|
||||
use App\Entity\Upload;
|
||||
use App\Model\DocumentFilterDto;
|
||||
use App\Repository\UploadRepository;
|
||||
use App\Service\Common\DocumentFilterHandler;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
@@ -72,4 +71,4 @@ class IndexController extends AbstractController
|
||||
'status' => $status,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,12 @@ class ApplicationRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('application');
|
||||
|
||||
$qb
|
||||
->select('application', 'assignment', 'destination', 'job_profile', 'teamer')
|
||||
->select('application', 'assignment', 'job_profile', 'destination', 'teamer', 'user')
|
||||
->innerJoin('application.assignment', 'assignment')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('application.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->where($qb->expr()->neq('application.status', ':status'))
|
||||
->setParameter('status', Application::STATUS_REJECTED)
|
||||
;
|
||||
@@ -159,11 +160,12 @@ class ApplicationRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('application');
|
||||
|
||||
return $qb
|
||||
->select('application', 'assignment', 'destination', 'job_profile', 'teamer')
|
||||
->select('application', 'assignment', 'destination', 'job_profile', 'teamer', 'user')
|
||||
->innerJoin('application.assignment', 'assignment')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('application.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->where($qb->expr()->neq('application.status', ':status'))
|
||||
->orderBy('application.createdAt', 'DESC')
|
||||
->setParameter('status', Application::STATUS_REJECTED)
|
||||
|
||||
@@ -155,8 +155,9 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
return $qb
|
||||
->select('disposition', 'assignment', 'destination')
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->orX(
|
||||
@@ -182,9 +183,11 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
$qb
|
||||
->select('disposition', 'assignment', 'destination', 'feedback', 'teamer')
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination', 'feedback', 'teamer', 'user')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('disposition.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->leftJoin('disposition.feedback', 'feedback')
|
||||
->where($qb->expr()->andX(
|
||||
@@ -292,10 +295,13 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
return $qb
|
||||
->select('disposition', 'assignment', 'destination', 'document')
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination', 'document', 'teamer', 'user')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->leftJoin('disposition.documents', 'document')
|
||||
->innerJoin('disposition.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->lte('disposition.createdAt', ':dueDate'),
|
||||
$qb->expr()->eq('disposition.status', ':status'),
|
||||
|
||||
@@ -32,8 +32,9 @@ class FeedbackRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('feedback');
|
||||
|
||||
$qb
|
||||
->select('feedback', 'teamer')
|
||||
->select('feedback', 'teamer', 'user')
|
||||
->innerJoin('feedback.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
;
|
||||
|
||||
if (null !== $name = $filterDto->getName()) {
|
||||
@@ -73,8 +74,9 @@ class FeedbackRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('feedback');
|
||||
|
||||
return $qb
|
||||
->select('feedback', 'teamer')
|
||||
->select('feedback', 'teamer', 'user')
|
||||
->innerJoin('feedback.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->where($qb->expr()->eq('feedback.status', ':status'))
|
||||
->setParameter('status', Feedback::STATUS_NEW)
|
||||
->orderBy('feedback.createdAt', 'DESC')
|
||||
|
||||
@@ -87,12 +87,13 @@ class UploadRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('upload');
|
||||
|
||||
return $qb
|
||||
->select('upload', 'disposition', 'assignment', 'job_profile', 'destination', 'teamer')
|
||||
->select('upload', 'disposition', 'assignment', 'job_profile', 'destination', 'teamer', 'user')
|
||||
->innerJoin('upload.disposition', 'disposition')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('disposition.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('upload.type', ':type'),
|
||||
$qb->expr()->eq('upload.status', ':status'),
|
||||
@@ -120,12 +121,13 @@ class UploadRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('upload');
|
||||
|
||||
$qb
|
||||
->select('upload', 'disposition', 'assignment', 'job_profile', 'destination', 'teamer')
|
||||
->select('upload', 'disposition', 'assignment', 'job_profile', 'destination', 'teamer', 'user')
|
||||
->innerJoin('upload.disposition', 'disposition')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('disposition.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->addOrderBy('FIELD(upload.status, :checked, :new)', 'DESC')
|
||||
->setParameter('new', Upload::STATUS_NEW)
|
||||
->setParameter('checked', Upload::STATUS_CHECKED)
|
||||
@@ -188,9 +190,10 @@ class UploadRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('upload');
|
||||
|
||||
return $qb
|
||||
->select('upload', 'owner', 'teamer', 'disposition', 'assignment')
|
||||
->select('upload', 'owner', 'teamer', 'user', 'disposition', 'assignment')
|
||||
->innerJoin('upload.owner', 'owner')
|
||||
->innerJoin('owner.teamer', 'teamer')
|
||||
->innerJoin('teamer.user', 'user')
|
||||
->leftJoin('upload.disposition', 'disposition')
|
||||
->leftJoin('disposition.assignment', 'assignment')
|
||||
->where($qb->expr()->andX(
|
||||
|
||||
@@ -10,6 +10,7 @@ use Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use function Symfony\Component\String\s;
|
||||
|
||||
class UploadHandler
|
||||
{
|
||||
@@ -119,7 +120,9 @@ class UploadHandler
|
||||
|
||||
public function getUploadFilepath(Upload $upload): string
|
||||
{
|
||||
return sprintf('%s/uploads/%s/%s', $this->projectDir, $upload->getType(), $upload->getFilename());
|
||||
$folder = substr($upload->getFilename(), 0, 1);
|
||||
|
||||
return sprintf('%s/uploads/%s/%s/%s', $this->projectDir, $upload->getType(), $folder, $upload->getFilename());
|
||||
}
|
||||
|
||||
public function getTempUploadFilepath(UploadDto $uploadDto, string $uploadSessionId): string
|
||||
|
||||
@@ -10,6 +10,9 @@ class UploadNamer implements NamerInterface
|
||||
{
|
||||
public function name(FileInterface $file): string
|
||||
{
|
||||
return sprintf('%s.%s', Uuid::v4(), strtolower($file->getExtension()));
|
||||
$fileUuid = Uuid::v7();
|
||||
$folder = substr($fileUuid, 0, 1);
|
||||
|
||||
return sprintf('%s/%s.%s', $folder, $fileUuid, strtolower($file->getExtension()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user