SuiteCRM icon indicating copy to clipboard operation
SuiteCRM copied to clipboard

Show hour on datetime fields when parsing AOS_PDF_Templates

Open sanchezfauste opened this issue 7 years ago • 6 comments

When you add a datetime field on a template, the final result is to show only the date part. We have modified the behaviour of template parser to show only the date part of the field if the field is defined as data type. If the field is of type datetime, the final result is to show the date and the time.

Description

We store the type of each field on an array when we load all the variables needed to parse the template, to be able to check the type of field when we parse the template later.

The actual behaviour is to display only the date part of a field if the name of the field contains 'date' or 'expiration'. We have modified this behaviour to show the only the date part if the field is of type date. So the datetime fileds will display the date and the time.

Issue #2694

Motivation and Context

We need to create a template to notify the date and the time of a meeting to the related Customer. A part of showing the start date of the meeting it's also important to show the time.

How To Test This

  1. Create a email template and insert a datetime field in email body/subject.
  2. Send email via workflow.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • [x] My code follows the code style of this project found here.
  • [ ] My change requires a change to the documentation.
  • [x] I have read the How to Contribute guidelines.

sanchezfauste avatar Jul 21 '17 12:07 sanchezfauste

@sanchezfauste , Thanks for proposing the solution. I am able to receive the email via WorkFlow and date & time are being parsed. However, time is being parsed only in UTC time. I want it to be parsed it as I mention it. Where do I need to make changes?

With thanks,

RK

LuminisIndia avatar Jul 27 '17 13:07 LuminisIndia

Hello @LuminisIndia, we have a workaround for this. See my comment on #3468

sanchezfauste avatar Jul 27 '17 17:07 sanchezfauste

Please resolve the conflicts on this pull request bringing it up to date.

Mac-Rae avatar Aug 05 '19 13:08 Mac-Rae

Please resolve the conflicts on this pull request bringing it up to date.

Hi! Done.

sanchezfauste avatar Aug 05 '19 13:08 sanchezfauste

@sanchezfauste Your PR here is for PDF templates, but the issue you are fixing #2694 appears to be related to Email Templates. Also, I have tested the functionality and this is working in the latest SuiteCRM releases i.e. date time fields are represented as such in Email and PDF Templates. Please can you clarify if your fix is still valid and if so what bug specifically you are addressing? Thanks.

willrennie avatar Oct 24 '19 15:10 willrennie

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
6 out of 7 committers have signed the CLA.

:white_check_mark: isleshocky77
:white_check_mark: sanchezfauste
:white_check_mark: cameronblaikie
:white_check_mark: Dillon-Brown
:white_check_mark: lazka
:white_check_mark: samus-aran
:x: code-ph0y
You have signed the CLA already but the status is still pending? Let us recheck it.

SuiteBot avatar Aug 27 '20 13:08 SuiteBot

Hello @sanchezfauste

The PR has been marked as stale because there has been no recent activity. It will be closed if no further activity occurs. Thanks for your contributions.

Regards, Serhii

serhiisamko091184 avatar Mar 13 '24 13:03 serhiisamko091184

Hey @sanchezfauste

Closing this PR due to inactivity. Thank you.

Regards, Serhii

serhiisamko091184 avatar Apr 11 '24 10:04 serhiisamko091184