A free open source IT asset/license management system
Compact the method just a little
snipe9abf3029ef45
diff --git a/app/Models/Asset.php b/app/Models/Asset.phpindex c07ebbfecd..c571578172 100644--- a/app/Models/Asset.php+++ b/app/Models/Asset.php@@ -413,15 +413,12 @@ class Asset extends Depreciablereturn $this->rules;}- public function customFieldsForCheckinCheckout($type) {+ public function customFieldsForCheckinCheckout($checkin_checkout) {// Check to see if any of the custom fields were included on the form and if they have any valuesif (($this->model) && ($this->model->fieldset) && ($this->model->fieldset->fields)) {foreach ($this->model->fieldset->fields as $field) {-- if ($field->{$type} == 1) {- if (request()->has($field->db_column)) {- $this->{$field->db_column} = request()->get($field->db_column);- }+ if (($field->{$checkin_checkout} == 1) && (request()->has($field->db_column))){+ $this->{$field->db_column} = request()->get($field->db_column);}}}