Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #10015. Archived Assets Showing Under Locations/'Print All Assigned' Feature #10079

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Sep 13, 2021

Description

When viewing a Location we can print all assets assigned to that location, but the report to print shows the Archived ones even if the option to do that is not activated. This is not my finest solution performance-wise but let me know what you think.

I added a condition for when the asset is marked as 'Archived' and the option in settings is not activated, in the report I just skip that asset and continue the loop that prints' em, as I was unable to filter' em from the query, 🤷‍♂️

Fixes #10015

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 7.4.16
  • MySQL version: 8.0.23
  • Webserver version: nginx/1.19.8
  • OS version: Debian 10

Checklist:

… it skips the assets in relation of if they're archived and that option is marked in the settings
@@ -126,7 +126,11 @@
@endphp

@foreach ($assets as $asset)

@php
if($snipeSettings->show_archived_in_list != 1 && $asset->assetstatus->name === 'Archived'){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't always assume the name will be "Archived" though. We'd want to look at the status label type here, I think.

Copy link
Collaborator Author

@inietov inietov Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used $asset->assetstatus->archived instead, I think that is better. Thanks for the input.

@snipe snipe merged commit 179f26c into snipe:develop Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants