Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
a57bd0d8
Commit
a57bd0d8
authored
Feb 15, 2022
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comptoir export : add dates, groupe local and contacts
parent
76759821
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
ComptoirAdmin.php
src/Admin/ComptoirAdmin.php
+22
-0
Comptoir.php
src/Entity/Comptoir.php
+10
-0
No files found.
src/Admin/ComptoirAdmin.php
View file @
a57bd0d8
...
...
@@ -272,4 +272,26 @@ class ComptoirAdmin extends AbstractAdmin
$em
->
persist
(
$comptoir
);
$em
->
flush
();
}
public
function
getDataSourceIterator
()
{
$iterator
=
parent
::
getDataSourceIterator
();
$iterator
->
setDateTimeFormat
(
'd/m/Y H:i:s'
);
//change this to suit your needs
return
$iterator
;
}
public
function
getExportFields
()
{
return
[
'Id'
=>
'id'
,
'Activé ?'
=>
'enabled'
,
'Nom'
=>
'name'
,
'Groupe local'
=>
'groupe.name'
,
'Adresse'
=>
'fullAddresse'
,
'Contacts'
=>
'contactsString'
,
'Crée le'
=>
'createdAt'
,
'Mise à jour le'
=>
'updatedAt'
,
];
}
}
src/Entity/Comptoir.php
View file @
a57bd0d8
...
...
@@ -281,6 +281,16 @@ class Comptoir extends AccountableObject implements AccountableInterface
return
$this
;
}
public
function
getContactsString
()
{
return
join
(
' - '
,
array_map
(
function
(
$contact
)
{
$return
=
ucwords
(
$contact
->
getName
())
.
(
$contact
->
getEmail
()
==
$contact
->
getName
()
?
''
:
(
':'
.
$contact
->
getEmail
()));
$return
.=
$contact
->
getTel
()
?
','
.
$contact
->
getTel
()
:
''
;
return
$return
;
},
$this
->
contacts
->
getValues
()));
}
public
function
__toString
()
:
string
{
return
!
empty
(
$this
->
name
)
?
$this
->
name
:
'Comptoir'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment