소스 검색

[Frontoffice] Bug adresses

feature/export_comptable
Fab 4 년 전
부모
커밋
5fd7d057c6
3개의 변경된 파일17개의 추가작업 그리고 4개의 파일을 삭제
  1. +14
    -3
      ShopBundle/Model/User.php
  2. +1
    -1
      ShopBundle/Resources/views/backend/default/block/form_address.html.twig
  3. +2
    -0
      ShopBundle/Resources/views/backend/user/edit.html.twig

+ 14
- 3
ShopBundle/Model/User.php 파일 보기

@@ -181,9 +181,20 @@ abstract class User extends UserModelFOS
/**
* @return Collection|Address[]
*/
public function getAddresses(): Collection
{
return $this->addresses;
public function getAddresses($status = null): Collection
{
if($status){
$addressToReturn = new ArrayCollection();
foreach ($this->addresses as $address){
if($address->getStatus() == $status) {
$addressToReturn[] = $address;
}
}
return $addressToReturn;
}else{
return $this->addresses;
}

}

public function addAddress(Address $address): self

+ 1
- 1
ShopBundle/Resources/views/backend/default/block/form_address.html.twig 파일 보기

@@ -71,7 +71,7 @@
<div class="col-12">
{{ form_row(form.status) }}
<p class="callout callout-info">
Sauf si vous avez ce que ce vous faites ce champ doit toujours être "Activer"
Sauf si vous savez ce que ce vous faites ce champ doit toujours être "Activer"
</p>
</div>


+ 2
- 0
ShopBundle/Resources/views/backend/user/edit.html.twig 파일 보기

@@ -19,7 +19,9 @@
<div class="col-5">
<div class="row" id="user-addresses">
{% for address in entity.addresses %}
{% if address.status >=0 %}
{% include '@LcShop/backend/user/block_useraddress.html.twig' %}
{% endif %}
{% endfor %}
</div>
<button type="button" data-url="{{ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': 'new'}) }}"

Loading…
취소
저장