Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
MaarchCourrier
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Redmine
Redmine
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Maarch Labs
MaarchCourrier
Commits
a7c3cf66
Verified
Commit
a7c3cf66
authored
Sep 11, 2019
by
Florian Azizian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEAT #11270 TIME 0:20 customFields default_values + order by label
parent
e1ea2194
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
CustomFieldController.php
src/app/customField/controllers/CustomFieldController.php
+7
-5
CustomFieldModel.php
src/app/customField/models/CustomFieldModel.php
+1
-1
No files found.
src/app/customField/controllers/CustomFieldController.php
View file @
a7c3cf66
...
...
@@ -63,9 +63,10 @@ class CustomFieldController
}
$id
=
CustomFieldModel
::
create
([
'label'
=>
$body
[
'label'
],
'type'
=>
$body
[
'type'
],
'values'
=>
empty
(
$body
[
'values'
])
?
null
:
json_encode
(
$body
[
'values'
])
'label'
=>
$body
[
'label'
],
'type'
=>
$body
[
'type'
],
'values'
=>
empty
(
$body
[
'values'
])
?
null
:
json_encode
(
$body
[
'values'
]),
'default_value'
=>
$body
[
'default_value'
]
]);
return
$response
->
withStatus
(
204
)
->
withJson
([
'customFieldId'
=>
$id
]);
...
...
@@ -97,8 +98,9 @@ class CustomFieldController
CustomFieldModel
::
update
([
'set'
=>
[
'label'
=>
$body
[
'label'
],
'values'
=>
empty
(
$body
[
'values'
])
?
null
:
json_encode
(
$body
[
'values'
])
'label'
=>
$body
[
'label'
],
'values'
=>
empty
(
$body
[
'values'
])
?
null
:
json_encode
(
$body
[
'values'
]),
'default_value'
=>
$body
[
'default_value'
]
],
'where'
=>
[
'id = ?'
],
'data'
=>
[
$args
[
'id'
]]
...
...
src/app/customField/models/CustomFieldModel.php
View file @
a7c3cf66
...
...
@@ -29,7 +29,7 @@ class CustomFieldModel
'table'
=>
[
'custom_fields'
],
'where'
=>
empty
(
$args
[
'where'
])
?
[]
:
$args
[
'where'
],
'data'
=>
empty
(
$args
[
'data'
])
?
[]
:
$args
[
'data'
],
'order_by'
=>
empty
(
$args
[
'orderBy'
])
?
[]
:
$args
[
'orderBy'
],
'order_by'
=>
empty
(
$args
[
'orderBy'
])
?
[
'label'
]
:
$args
[
'orderBy'
],
'limit'
=>
empty
(
$args
[
'limit'
])
?
0
:
$args
[
'limit'
]
]);
...
...
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