mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Added field to controller and tranformer
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
7c21158680
commit
52dc5aa4ba
|
@ -94,6 +94,7 @@ class CustomFieldsController extends Controller
|
|||
"field_encrypted" => $request->get("field_encrypted", 0),
|
||||
"show_in_email" => $request->get("show_in_email", 0),
|
||||
"is_unique" => $request->get("is_unique", 0),
|
||||
"display_in_user_view" => $request->get("display_in_user_view", 0),
|
||||
"user_id" => Auth::id()
|
||||
]);
|
||||
|
||||
|
@ -228,6 +229,7 @@ class CustomFieldsController extends Controller
|
|||
$field->help_text = $request->get("help_text");
|
||||
$field->show_in_email = $request->get("show_in_email", 0);
|
||||
$field->is_unique = $request->get("is_unique", 0);
|
||||
$field->display_in_user_view = $request->get("display_in_user_view", 0);
|
||||
|
||||
if ($request->get('format') == 'CUSTOM REGEX') {
|
||||
$field->format = e($request->get('custom_format'));
|
||||
|
|
|
@ -47,6 +47,7 @@ class CustomFieldsTransformer
|
|||
'field_values_array' => ($field->field_values) ? explode("\r\n", e($field->field_values)) : null,
|
||||
'type' => e($field->element),
|
||||
'required' => (($field->pivot) && ($field->pivot->required=='1')) ? true : false,
|
||||
'display_in_user_view' => ($field->display_in_user_view =='1') ? true : false,
|
||||
'created_at' => Helper::getFormattedDateObject($field->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($field->updated_at, 'datetime'),
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue