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

Add Checked Out To first and last name to Generate Labels #7005

Closed
mcbmoreno opened this issue May 7, 2019 · 4 comments
Closed

Add Checked Out To first and last name to Generate Labels #7005

mcbmoreno opened this issue May 7, 2019 · 4 comments
Labels

Comments

@mcbmoreno
Copy link

Server (please complete the following information):

  • Snipe-IT Version v4.6.5
  • OS: [e.g. Ubuntu, CentOS] Server 2016
  • Web Server: [e.g. Apache, IIS] IIS
  • PHP Version 7.2.10

Is your feature request related to a problem? Please describe.

Describe the solution you'd like
How can the First and Last name of the Checked Out To user for an asset be added as an option to show on Generate Labels? It looks as though the snipeit\resources\views\hardware\labels.blade.php file gets passed the Snipe internal id of the Checked Out To user but does not have access to the first and last name of that user. Also, can an option be added to ask for a starting label when printing? i.e. if a sheet of labels has 10 rows of 3 labels and the first 3 rows of the sheet of labels you will be printing on are already used, can you put in a starting label # of 10 to start the printing at the left most label of the 4th row on the sheet of labels?

Describe alternatives you've considered
Exporting the assets to a CSV file and using that as the source for a mail merged word file.

Additional context

@gilesytheking
Copy link

gilesytheking commented May 10, 2019

If you want to add custom info to your label you can edit the following file that outputs the label template. Bare in mind that this file maybe overwritten when you update your installation.

/your-snipe-it-install/resources/views/hardware/labels.blade.php

You can add the following code to the labels.blade.php to output the first & last name. This will only display on the label when the asset is Checked out to a user

@if (($asset->assigned_to!=' ') && ($asset->assigned_type=='App\Models\User'))
<div class="pull-left">
Assigned To: {{ $asset->assignedto->first_name }} {{ $asset->assignedto->last_name }}
</div>
@endif

You may have to add some custom CSS to style the label to suit your label size. The size of your label might mean you have to compromise the amount of info you put there.

@stale
Copy link

stale bot commented Jul 9, 2019

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

@stale stale bot added the stale label Jul 9, 2019
@stale
Copy link

stale bot commented Jul 16, 2019

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

@stale stale bot closed this as completed Jul 16, 2019
@mcbmoreno
Copy link
Author

Got this working. Thanks for the help.

I wanted to add a feature that would allow the user to input what the starting label is when printing the labels in case they are using a partially used label sheet.

I was thinking I could add an option for "start at label" field on the Settings > Labels > Update Label Settings page, and then code the starting label into labels.blade.php.

Does this sound like the right way to attack this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants