feat: status 'draft' for assignments
This commit is contained in:
@@ -21,6 +21,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
use TimestampableEntity;
|
||||
use SoftDeletableEntity;
|
||||
|
||||
public const STATUS_DRAFT = 'draft';
|
||||
public const STATUS_OPEN = 'open';
|
||||
public const STATUS_CLOSED = 'closed';
|
||||
|
||||
@@ -90,7 +91,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
public function __construct()
|
||||
{
|
||||
$this->uuid = Uuid::v4();
|
||||
$this->status = static::STATUS_OPEN;
|
||||
$this->status = static::STATUS_DRAFT;
|
||||
$this->fees = new ArrayCollection();
|
||||
$this->applications = new ArrayCollection();
|
||||
$this->dispositions = new ArrayCollection();
|
||||
|
||||
@@ -32,6 +32,14 @@ class AssignmentType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('status', ChoiceType::class, [
|
||||
'label' => 'Status',
|
||||
'choices' => [
|
||||
'Entwurf' => Assignment::STATUS_DRAFT,
|
||||
'offen' => Assignment::STATUS_OPEN,
|
||||
'geschlossen' => Assignment::STATUS_CLOSED,
|
||||
],
|
||||
])
|
||||
->add('availableDispositions', IntegerType::class, [
|
||||
'label' => 'zu vergeben',
|
||||
'required' => false,
|
||||
|
||||
@@ -223,10 +223,12 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer'))
|
||||
->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('assignment.status', ':status'),
|
||||
$qb->expr()->in('assignment.jobProfile', ':jobProfiles'),
|
||||
$qb->expr()->isNull('application'),
|
||||
$qb->expr()->isNull('disposition')
|
||||
))
|
||||
->setParameter('status', Assignment::STATUS_OPEN)
|
||||
->setParameter('jobProfiles', $teamer->getJobProfiles())
|
||||
->setParameter('teamer', $teamer)
|
||||
;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<div class="lg:col-span-3">
|
||||
{{ form_row(form.destination) }}
|
||||
</div>
|
||||
{{ form_row(form.status) }}
|
||||
{{ form_row(form.availableDispositions) }}
|
||||
<div>
|
||||
<h4 class="font-bold pb-2">
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<span>{{ assignment.validApplications|length }}/{{ assignment.availableDispositions - assignment.dispositions|length }}</span>
|
||||
{% if assignment.status == 'closed' %}
|
||||
{{ icon('locked', 'w-4 h-4 text-red-500') }}
|
||||
{% elseif assignment.status == 'draft' %}
|
||||
{{ icon('hourglass', 'w-4 h-4 text-yellow-500') }}
|
||||
{% else %}
|
||||
{{ icon('unlocked', 'w-4 h-4') }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user