Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jan 24, 2024
2 parents f760397 + 5f8e637 commit 896b16d
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/Http/Transformers/LicenseSeatsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function transformLicenseSeat(LicenseSeat $seat, $seat_count = 0)
'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,
Expand Down
29 changes: 29 additions & 0 deletions app/Models/Accessory.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,35 @@ public function declinedCheckout(User $declinedBy, $signature)
$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 <[email protected]>
* @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
*
Expand Down
31 changes: 31 additions & 0 deletions app/Models/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,37 @@ public function numRemaining()
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 <[email protected]>
* @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
*
Expand Down
29 changes: 29 additions & 0 deletions app/Models/Consumable.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,35 @@ public function numRemaining()
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 <[email protected]>
* @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
*
Expand Down
11 changes: 9 additions & 2 deletions app/Presenters/LicensePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ public static function dataTableLayoutSeats()
'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,
Expand All @@ -236,8 +244,7 @@ public static function dataTableLayoutSeats()
'title' => trans('general.department'),
'visible' => false,
'formatter' => 'departmentNameLinkFormatter',
],
[
], [
'field' => 'assigned_asset',
'searchable' => false,
'sortable' => false,
Expand Down
4 changes: 2 additions & 2 deletions resources/views/settings/ldap.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ function buildLdapTestResults(results) {
html += '<li class="text-success"><i class="fas fa-check" aria-hidden="true"></i> ' + results.bind.message + ' </li>'
html += '</ul>'
html += '<div>{{ trans('admin/settings/message.ldap.sync_success') }}</div>'
html += '<table class="table table-bordered table-condensed" style="background-color: #fff">'
html += '<table class="table table-bordered table-condensed" style=" table-layout:fixed; width:100%; background-color: #fff">'
html += buildLdapResultsTableHeader()
html += buildLdapResultsTableBody(results.user_sync.users)
html += '<table>'
Expand Down Expand Up @@ -729,7 +729,7 @@ function buildLdapResultsTableBody(users)
{
let body = '<tbody>'
for (var i in users) {
body += '<tr><td>' + users[i].employee_number + '</td><td>' + users[i].username + '</td><td>' + users[i].firstname + '</td><td>' + users[i].lastname + '</td><td>' + users[i].email + '</td></tr>'
body += '<tr><td style="overflow:hidden;">' + users[i].employee_number + '</td><td style="overflow:hidden;">' + users[i].username + '</td><td style="overflow:hidden;">' + users[i].firstname + '</td><td style="overflow:hidden;">' + users[i].lastname + '</td><td style="overflow:hidden;">' + users[i].email + '</td></tr>'
}
body += "</tbody>"
return body;
Expand Down

0 comments on commit 896b16d

Please sign in to comment.