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

Fixed #12607 - Datestamp on "Print All Assigned" generated form #12636

Merged

Conversation

akemidx
Copy link
Collaborator

@akemidx akemidx commented Mar 8, 2023

Description

Added a datestamp onto the form generated when a user selects "Print All Assigned" from the user detail view window. It is calling the users local time, so will stay relevant to where the user is when they generate the form.
Date formatting is chosen to improve usability around the world as different date formats are common.

Screen Shot 2023-03-08 at 2 57 57 PM

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested locally.

Test Configuration:

  • PHP version: 8.0

Checklist:

Fixes #12607

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #20330: Date on All Assigned PDF.

@what-the-diff
Copy link

what-the-diff bot commented Mar 8, 2023

  • Added a new line to the general.php file
  • Changed print view for users, added date of generation in red color on right side

@floschoepfer
Copy link
Contributor

Maybe, you could add the time too, so it is clear, when exactly this view was created?

@floschoepfer
Copy link
Contributor

Great, thank you!👍🏻

@akemidx
Copy link
Collaborator Author

akemidx commented Mar 9, 2023

Time of day added in 24hr time format.
added to both the form itself and page title.
Screen Shot 2023-03-09 at 3 12 34 PM

@snipe
Copy link
Owner

snipe commented Mar 9, 2023

@akemidx Is it red irl, or just for your screenshot?

@akemidx
Copy link
Collaborator Author

akemidx commented Mar 10, 2023

It is formatted to be red in the file itself

@snipe
Copy link
Owner

snipe commented Mar 10, 2023

Do we want that to be red though? I feel like it should maybe be at the bottom of the page in normal text style? And we should probably use the date format the admin has picked in the Admin Localization settings.

@akemidx
Copy link
Collaborator Author

akemidx commented Mar 10, 2023

The demo was in red, but it can be black. I was hesitant to put it at the bottom in case it could be confused for the "signed" date. But, absolutely we should use the local selected date settings.

<br>
<br>
//needs to fix string/int error
<div style='text-align:left'><div style='color:black'>{{ trans('admin/users/general.all_assigned_list_generation')}} {{ date('d-M-Y H:i', $currenttime) }}
Copy link
Owner

Choose a reason for hiding this comment

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

In general, we try not to inject PHP into blades where we can help it, especially to create a one-off variable that we don't use anywhere else in the blade. Also if we're using the Helper::getFormattedDateObject(), that helper method is going to format it as the user wants it to appear. When you use the date() formatter, you're going to override that.

{{ Helper::getFormattedDateObject(now(), 'date', false) }}

should suffice IMHO

@akemidx
Copy link
Collaborator Author

akemidx commented Mar 15, 2023

updated screenshot
Screen Shot 2023-03-15 at 2 03 08 PM

this date will be localized to a user's settings in 'settings > localization > Time and Date Display'

@snipe
Copy link
Owner

snipe commented Mar 15, 2023

Perfect, thank you! <3

@snipe snipe merged commit fdacd5d into snipe:develop Mar 15, 2023
@floschoepfer
Copy link
Contributor

Thank you for this! I really appreciate your work!

@snipe snipe changed the title Datestamp on "Print All Assigned" generated form Fixed #12636 - Datestamp on "Print All Assigned" generated form Mar 19, 2023
@snipe snipe changed the title Fixed #12636 - Datestamp on "Print All Assigned" generated form Fixed #12607 - Datestamp on "Print All Assigned" generated form Mar 19, 2023
@akemidx akemidx deleted the feature/sc-20330/date-on-all-assigned-pdf branch April 23, 2024 19:03
@akemidx akemidx restored the feature/sc-20330/date-on-all-assigned-pdf branch April 23, 2024 19:03
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.

None yet

3 participants