Skip to content

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.php
index c07ebbfecd..c571578172 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -413,15 +413,12 @@ class Asset extends Depreciable
return $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 values
if (($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);
}
}
}