mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
make somes changes on model: to manage isVisible field option + others
This commit is contained in:
@@ -248,6 +248,16 @@ class ActivityType
|
||||
*/
|
||||
private string $socialActionsLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
*/
|
||||
private int $locationVisible = self::FIELD_INVISIBLE;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default"=""})
|
||||
*/
|
||||
private string $locationLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="float", options={"default"="0.0"})
|
||||
*/
|
||||
@@ -820,4 +830,29 @@ class ActivityType
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLocationVisible(): ?int
|
||||
{
|
||||
return $this->locationVisible;
|
||||
}
|
||||
|
||||
public function setLocationVisible(int $locationVisible): self
|
||||
{
|
||||
$this->locationVisible = $locationVisible;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLocationLabel(): ?string
|
||||
{
|
||||
return $this->locationLabel;
|
||||
}
|
||||
|
||||
public function setLocationLabel(string $locationLabel): self
|
||||
{
|
||||
$this->locationLabel = $locationLabel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -302,18 +302,9 @@ class ActivityType extends AbstractType
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
if ($activityType->isVisible('location')) {
|
||||
$builder
|
||||
->add('location', HiddenType::class)
|
||||
->get('location')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function () {},
|
||||
function () {}
|
||||
))
|
||||
;
|
||||
$builder->add('location', HiddenType::class);
|
||||
}
|
||||
*/
|
||||
|
||||
if ($activityType->isVisible('emergency')) {
|
||||
$builder->add('emergency', CheckboxType::class, [
|
||||
|
@@ -65,7 +65,7 @@ export default {
|
||||
}))
|
||||
},
|
||||
customLabel(value) {
|
||||
return `${value.type.title.fr} ${value.name}`;
|
||||
return `${value.locationType.title.fr} ${value.name}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,10 @@
|
||||
{{ form_row(edit_form.date) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="location"></div>
|
||||
{%- if edit_form.location is defined -%}
|
||||
{{ form_row(edit_form.location) }}
|
||||
<div id="location"></div>
|
||||
{% endif %}
|
||||
|
||||
{%- if edit_form.durationTime is defined -%}
|
||||
{{ form_row(edit_form.durationTime) }}
|
||||
|
@@ -55,7 +55,10 @@
|
||||
{{ form_row(form.date) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="location"></div>
|
||||
{%- if form.location is defined -%}
|
||||
{{ form_row(form.location) }}
|
||||
<div id="location"></div>
|
||||
{% endif %}
|
||||
|
||||
{%- if form.durationTime is defined -%}
|
||||
{{ form_row(form.durationTime) }}
|
||||
|
Reference in New Issue
Block a user