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