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 0fbf154 + 49dc1dd commit 36f8311
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
22 changes: 12 additions & 10 deletions app/Console/Commands/LdapSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,20 @@ public function handle()
/**
* if a location ID has been specified, use that OU
*/
if ( $this->option('location_id') != '') {
if ( $this->option('location_id') ) {

foreach($this->option('location_id') as $location_id){
$location_ou = Location::where('id', '=', $location_id)->value('ldap_ou');
$search_base = $location_ou;
Log::debug('Importing users from specified location OU: \"'.$search_base.'\".');
}
}

/**
* Otherwise if a manual base DN has been specified, use that
* if a manual base DN has been specified, use that. Allow the Base DN to override
* even if there's a location-based DN - if you picked it, you must have picked it for a reason.
*/
} elseif ($this->option('base_dn') != '') {
if ($this->option('base_dn') != '') {
$search_base = $this->option('base_dn');
Log::debug('Importing users from specified base DN: \"'.$search_base.'\".');
}
Expand All @@ -125,14 +127,14 @@ public function handle()

/* Determine which location to assign users to by default. */
$location = null; // TODO - this would be better called "$default_location", which is more explicit about its purpose
if ($this->option('location') != '') {
if ($location = Location::where('name', '=', $this->option('location'))->first()) {
Log::debug('Location name ' . $this->option('location') . ' passed');
Log::debug('Importing to ' . $location->name . ' (' . $location->id . ')');
}
if ($this->option('location') != '') {
if ($location = Location::where('name', '=', $this->option('location'))->first()) {
Log::debug('Location name ' . $this->option('location') . ' passed');
Log::debug('Importing to ' . $location->name . ' (' . $location->id . ')');
}

} elseif ($this->option('location_id') != '') {
foreach($this->option('location_id') as $location_id) {
} elseif ($this->option('location_id')) {
foreach($this->option('location_id') as $location_id) {
if ($location = Location::where('id', '=', $location_id)->first()) {
Log::debug('Location ID ' . $location_id . ' passed');
Log::debug('Importing to ' . $location->name . ' (' . $location->id . ')');
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/ReportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,10 @@ public function postCustom(CustomAssetReportRequest $request)
if ($request->filled('exclude_archived')) {
$assets->notArchived();
}
if ($request->input('deleted_assets') == '1') {
if ($request->input('deleted_assets') == 'include_deleted') {
$assets->withTrashed();
}
if ($request->input('deleted_assets') == '0') {
if ($request->input('deleted_assets') == 'only_deleted') {
$assets->onlyTrashed();
}

Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en-US/admin/manufacturers/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return array(

'support_url_help' => 'Variables <code>{LOCALE}</code>, <code>{SERIAL}</code>, <code>{MODEL_NUMBER}</code>, and <code>{MODEL_NAME}</code> may be used in your URL to have those values auto-populate when viewing assets - for example https://support.apple.com/{LOCALE}/{SERIAL}.',
'support_url_help' => 'Variables <code>{LOCALE}</code>, <code>{SERIAL}</code>, <code>{MODEL_NUMBER}</code>, and <code>{MODEL_NAME}</code> may be used in your URL to have those values auto-populate when viewing assets - for example https://checkcoverage.apple.com/{LOCALE}/{SERIAL}.',
'does_not_exist' => 'Manufacturer does not exist.',
'assoc_users' => 'This manufacturer is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this manufacturer and try again. ',

Expand Down
6 changes: 3 additions & 3 deletions resources/views/reports/custom.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@
<div class="col-md-9 col-md-offset-3">

<label class="form-control">
{{ Form::radio('deleted_assets', '', true, ['aria-label'=>'deleted_assets', 'id'=>'deleted_assets_exclude_deleted'])}}
{{ Form::radio('deleted_assets', 'exclude_deleted', true, ['aria-label'=>'deleted_assets', 'id'=>'deleted_assets_exclude_deleted'])}}
{{ trans('general.exclude_deleted') }}
</label>
<label class="form-control">
{{ Form::radio('deleted_assets', '1', old('deleted_assets'), ['aria-label'=>'deleted_assets', 'id'=>'deleted_assets_include_deleted']) }}
{{ Form::radio('deleted_assets', 'include_deleted', old('deleted_assets'), ['aria-label'=>'deleted_assets', 'id'=>'deleted_assets_include_deleted']) }}
{{ trans('general.include_deleted') }}
</label>
<label class="form-control">
{{ Form::radio('deleted_assets', '0', old('deleted_assets'), ['aria-label'=>'deleted_assets','id'=>'deleted_assets_only_deleted']) }}
{{ Form::radio('deleted_assets', 'only_deleted', old('deleted_assets'), ['aria-label'=>'deleted_assets','id'=>'deleted_assets_only_deleted']) }}
{{ trans('general.only_deleted') }}
</label>
</div>
Expand Down

0 comments on commit 36f8311

Please sign in to comment.