diff --git a/app/Http/Transformers/LicenseSeatsTransformer.php b/app/Http/Transformers/LicenseSeatsTransformer.php index 62614db4d3..47133a9b95 100644 --- a/app/Http/Transformers/LicenseSeatsTransformer.php +++ b/app/Http/Transformers/LicenseSeatsTransformer.php @@ -29,6 +29,7 @@ class LicenseSeatsTransformer 'assigned_user' => ($seat->user) ? [ 'id' => (int) $seat->user->id, 'name'=> e($seat->user->present()->fullName), + 'email' => e($seat->user->email), 'department'=> ($seat->user->department) ? [ 'id' => (int) $seat->user->department->id, diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index 86502dc7e7..9a93c386fc 100755 --- a/app/Models/Accessory.php +++ b/app/Models/Accessory.php @@ -365,6 +365,35 @@ class Accessory extends SnipeModel $accessory_user->limit(1)->delete(); } + /** + * ----------------------------------------------- + * BEGIN MUTATORS + * ----------------------------------------------- + **/ + + /** + * This sets a value for qty if no value is given. The database does not allow this + * field to be null, and in the other areas of the code, we set a default, but the importer + * does not. + * + * This simply checks that there is a value for quantity, and if there isn't, set it to 0. + * + * @author A. Gianotto + * @since v6.3.4 + * @param $value + * @return void + */ + public function setQtyAttribute($value) + { + $this->attributes['qty'] = (!$value) ? 0 : intval($value); + } + + /** + * ----------------------------------------------- + * BEGIN QUERY SCOPES + * ----------------------------------------------- + **/ + /** * Query builder scope to order on company * diff --git a/app/Models/Component.php b/app/Models/Component.php index 052ec1219d..671b0101c4 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -224,6 +224,37 @@ class Component extends SnipeModel return $this->qty - $this->numCheckedOut(); } + + /** + * ----------------------------------------------- + * BEGIN MUTATORS + * ----------------------------------------------- + **/ + + /** + * This sets a value for qty if no value is given. The database does not allow this + * field to be null, and in the other areas of the code, we set a default, but the importer + * does not. + * + * This simply checks that there is a value for quantity, and if there isn't, set it to 0. + * + * @author A. Gianotto + * @since v6.3.4 + * @param $value + * @return void + */ + public function setQtyAttribute($value) + { + $this->attributes['qty'] = (!$value) ? 0 : intval($value); + } + + /** + * ----------------------------------------------- + * BEGIN QUERY SCOPES + * ----------------------------------------------- + **/ + + /** * Query builder scope to order on company * diff --git a/app/Models/Consumable.php b/app/Models/Consumable.php index a3a0d59178..008dffa4ca 100644 --- a/app/Models/Consumable.php +++ b/app/Models/Consumable.php @@ -339,6 +339,35 @@ class Consumable extends SnipeModel return $remaining; } + /** + * ----------------------------------------------- + * BEGIN MUTATORS + * ----------------------------------------------- + **/ + + /** + * This sets a value for qty if no value is given. The database does not allow this + * field to be null, and in the other areas of the code, we set a default, but the importer + * does not. + * + * This simply checks that there is a value for quantity, and if there isn't, set it to 0. + * + * @author A. Gianotto + * @since v6.3.4 + * @param $value + * @return void + */ + public function setQtyAttribute($value) + { + $this->attributes['qty'] = (!$value) ? 0 : intval($value); + } + + /** + * ----------------------------------------------- + * BEGIN QUERY SCOPES + * ----------------------------------------------- + **/ + /** * Query builder scope to order on company * diff --git a/app/Presenters/LicensePresenter.php b/app/Presenters/LicensePresenter.php index e76c9152cb..4b86a35069 100644 --- a/app/Presenters/LicensePresenter.php +++ b/app/Presenters/LicensePresenter.php @@ -228,6 +228,14 @@ class LicensePresenter extends Presenter 'title' => trans('admin/licenses/general.user'), 'visible' => true, 'formatter' => 'usersLinkObjFormatter', + ], [ + 'field' => 'assigned_user.email', + 'searchable' => false, + 'sortable' => false, + 'switchable' => true, + 'title' => trans('admin/users/table.email'), + 'visible' => true, + 'formatter' => 'emailFormatter', ], [ 'field' => 'department', 'searchable' => false, @@ -236,8 +244,7 @@ class LicensePresenter extends Presenter 'title' => trans('general.department'), 'visible' => false, 'formatter' => 'departmentNameLinkFormatter', - ], - [ + ], [ 'field' => 'assigned_asset', 'searchable' => false, 'sortable' => false, diff --git a/resources/views/settings/ldap.blade.php b/resources/views/settings/ldap.blade.php index 016d54f48f..87b0bb69d5 100644 --- a/resources/views/settings/ldap.blade.php +++ b/resources/views/settings/ldap.blade.php @@ -701,7 +701,7 @@ html += '
  • ' + results.bind.message + '
  • ' html += '' html += '
    {{ trans('admin/settings/message.ldap.sync_success') }}
    ' - html += '' + html += '
    ' html += buildLdapResultsTableHeader() html += buildLdapResultsTableBody(results.user_sync.users) html += '
    ' @@ -729,7 +729,7 @@ { let body = '' for (var i in users) { - body += '' + body += '' } body += "" return body;
    ' + users[i].employee_number + '' + users[i].username + '' + users[i].firstname + '' + users[i].lastname + '' + users[i].email + '
    ' + users[i].employee_number + '' + users[i].username + '' + users[i].firstname + '' + users[i].lastname + '' + users[i].email + '