Enhance and fix some bugs
This commit is contained in:
@@ -34,7 +34,9 @@ class DirectoryController extends AbstractController
|
||||
$searchForm = $this->createForm(SearchBarType::class);
|
||||
$searchForm->handleRequest($request);
|
||||
|
||||
$req = $DirectoryRepository->list()
|
||||
$req = $DirectoryRepository
|
||||
->list()
|
||||
->order(['createdAt' => 'DESC'])
|
||||
->search(
|
||||
(
|
||||
$searchForm->isSubmitted()
|
||||
|
||||
@@ -457,6 +457,16 @@ class Directory
|
||||
*/
|
||||
private $folders;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $gangInfo;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default":"0"})
|
||||
*/
|
||||
private $hasNoPapers = false;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -1438,4 +1448,28 @@ class Directory
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGangInfo(): ?string
|
||||
{
|
||||
return $this->gangInfo;
|
||||
}
|
||||
|
||||
public function setGangInfo(?string $gangInfo): self
|
||||
{
|
||||
$this->gangInfo = $gangInfo;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHasNoPapers(): ?bool
|
||||
{
|
||||
return $this->hasNoPapers;
|
||||
}
|
||||
|
||||
public function setHasNoPapers(bool $hasNoPapers): self
|
||||
{
|
||||
$this->hasNoPapers = $hasNoPapers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,11 +57,14 @@ class DirectoryType extends AbstractType
|
||||
->add('height', HeightType::class)
|
||||
->add('weight', WeightType::class)
|
||||
->add('address', AddressType::class, ['required' => false])
|
||||
->add('hasNoPapers', null, ['label' => 'form_label_hasnopapers'])
|
||||
;
|
||||
|
||||
|
||||
if ($user->getAdminMode() || in_array('general_legal_view', $userPermissions)) {
|
||||
$builder
|
||||
->add('gang', GangListType::class)
|
||||
->add('gangInfo', null, ['label' => 'form_label_gang_info'])
|
||||
->add('wanted', null, ['label' => 'form_label_wanted'])
|
||||
->add('wantedReason', null, ['label' => 'form_label_wantedReason', 'help' => 'form_help_wantedReason'])
|
||||
;
|
||||
|
||||
@@ -22,7 +22,7 @@ class GangListType extends AbstractType
|
||||
'choice_label' => 'title',
|
||||
'placeholder' => 'form_placeholder_gang',
|
||||
'help' => 'form_help_gang',
|
||||
'label' => false,
|
||||
'label' => 'form_label_gang',
|
||||
'required' => false
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@ class DirectoryRepository extends ServiceEntityRepository
|
||||
'medicalBloodGroup',
|
||||
'medicalDrugs',
|
||||
'medicalAlcohol',
|
||||
'medicalTreatment'
|
||||
'medicalTreatment',
|
||||
'gangInfo'
|
||||
]; //list fields we can search in
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user