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
ee9446be
Commit
ee9446be
authored
Nov 29, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comment field to User for admin
parent
11bdb966
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
User.php
src/Entity/User.php
+17
-0
UserFormType.php
src/Form/Type/UserFormType.php
+7
-0
Version20221129140532.php
src/Migrations/Version20221129140532.php
+33
-0
No files found.
src/Entity/User.php
View file @
ee9446be
...
...
@@ -202,6 +202,11 @@ class User extends BaseUser
*/
public
$canValidateAchat
;
/**
* @ORM\Column(type="text", nullable=true)
*/
private
$comment
;
public
function
__construct
()
{
parent
::
__construct
();
...
...
@@ -809,4 +814,16 @@ class User extends BaseUser
return
$this
;
}
public
function
getComment
()
:
?
string
{
return
$this
->
comment
;
}
public
function
setComment
(
?
string
$comment
)
:
self
{
$this
->
comment
=
$comment
;
return
$this
;
}
}
src/Form/Type/UserFormType.php
View file @
ee9446be
...
...
@@ -46,6 +46,13 @@ class UserFormType extends AbstractType
->
add
(
'enabled'
,
null
,
[
'label'
=>
'Activé ?'
,
])
->
add
(
'comment'
,
null
,
[
'label'
=>
'Commentaire'
,
'required'
=>
false
,
'attr'
=>
array
(
'placeholder'
=>
'Indiquez par exemple pourquoi ce compte a été désactivé'
)
])
;
}
...
...
src/Migrations/Version20221129140532.php
0 → 100644
View file @
ee9446be
<?php
declare
(
strict_types
=
1
);
namespace
DoctrineMigrations
;
use
Doctrine\DBAL\Schema\Schema
;
use
Doctrine\Migrations\AbstractMigration
;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final
class
Version20221129140532
extends
AbstractMigration
{
public
function
getDescription
()
:
string
{
return
''
;
}
public
function
up
(
Schema
$schema
)
:
void
{
// this up() migration is auto-generated, please modify it to your needs
$this
->
addSql
(
'ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\''
);
$this
->
addSql
(
'ALTER TABLE user ADD comment LONGTEXT DEFAULT NULL'
);
}
public
function
down
(
Schema
$schema
)
:
void
{
// this down() migration is auto-generated, please modify it to your needs
$this
->
addSql
(
'ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8mb3 DEFAULT NULL COLLATE `utf8mb3_general_ci` COMMENT \'(DC2Type:personal_data)\''
);
$this
->
addSql
(
'ALTER TABLE user DROP comment'
);
}
}
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