mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
adding in item=>asset, missed in first commit
This commit is contained in:
parent
4b9727067b
commit
ca57f6de85
|
@ -906,6 +906,25 @@ class AssetsController extends Controller
|
||||||
$asset->location_id = $request->input('location_id');
|
$asset->location_id = $request->input('location_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (($asset->model->fieldset)) {
|
||||||
|
foreach ($asset->model->fieldset->fields as $field) {
|
||||||
|
if ($field->field_encrypted == '1') {
|
||||||
|
if (Gate::allows('admin')) {
|
||||||
|
if (is_array($request->input($field->db_column))) {
|
||||||
|
$asset->{$field->db_column} = Crypt::encrypt(implode(', ', $request->input($field->db_column)));
|
||||||
|
} else {
|
||||||
|
$asset->{$field->db_column} = Crypt::encrypt($request->input($field->db_column));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (is_array($request->input($field->db_column))) {
|
||||||
|
$asset->{$field->db_column} = implode(', ', $request->input($field->db_column));
|
||||||
|
} else {
|
||||||
|
$asset->{$field->db_column} = $request->input($field->db_column);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoke Watson Validating to check the asset itself and check to make sure it saved correctly.
|
* Invoke Watson Validating to check the asset itself and check to make sure it saved correctly.
|
||||||
|
|
Loading…
Reference in a new issue