-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
FIX adding tms and datec to email templates #36189
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
base: develop
Are you sure you want to change the base?
FIX adding tms and datec to email templates #36189
Conversation
|
build STILL complains about non escaped string, but you clearly see that it is being escaped Why? |
|
@hregis You commented on my other PR with changes to the database, so maybe you can help me here with the build system? Why does it complain about a non escaped string when it clearly says escape in the string it complains about? |
0bfbe2f to
cc12caf
Compare
|
@JonBendtsen don't use dol_print_date |
why not? it is a function in Dolibarr? And I even escape the output? What other code to check? |
|
Change Code to label to match the database content
AND this also matches what is shown in the json from the API Fixes #29116 |
|
@JonBendtsen use this code, and remove the field "tms"
.......
|
I replaced |
|
now using idate in almost all places @hregis |
|
@JonBendtsen What I meant was that the SQL server should handle the timestamp of the "tms" field. The "tms" field is only used in SELECT statements. |
Okay, but didn't both you @hregis and @eldy state that you wanted to shift away from letting the database server handle timestamps since the database server might be in a different time zone? |
|
@JonBendtsen For datec we use dol_now, but for tms we let the SQL server handle it. |
|
@JonBendtsen i send a fix for the travis error : #36195 |
In a future we will have to manage the tms field in php code too. Just not the current priority. |
|
htdocs/admin/mails_templates.php
Outdated
| $tabname = array(); | ||
| $tabname[25] = MAIN_DB_PREFIX."c_email_templates"; | ||
|
|
||
| // Used by the GUI during creation so we don't ask the user to fill in tms and datec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to introduce another table.
We know that tms and datec are date update and creation and should not be requested.
We can just add a hard coded if on this 2 fields when we forge the form to not show them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy requested changes has been made, it builds cleanup and test works
…o make the build system happy?
f725f0f to
52b1215
Compare
|
You're told not to modify TMS, and you modify TMS anyway! |
@hregis Please comment in the code the line you mean - that is much easier to find the line you think is erroneous |
htdocs/admin/mails_templates.php
Outdated
| if (GETPOST($keycode) == '' && $keycode != 'langcode') { | ||
| if ($keycode == 'datec') { | ||
| $sql .= "'".$db->idate($now)."'"; | ||
| } elseif ($keycode == 'tms') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hregis you probably mean this line nr 439 - 441
This is during
if ($ok && GETPOST('actionadd')) {
in line 396, meaning this is during INSERT, and the configuration of the tms field is
![]()
So it only uses CURRENT_TIMESTAMP() during update, not during INSERT. So if I remove the tms line, then it does not get a value in tms, and I'd argue that creation of an object is a modification of the current state.
|
@JonBendtsen remove "datec" from the update function, datec is never update |
|
1 remove tms |
This is the new INSERT line from dolibarr.log - no tms |
|
latest hurl tests |







FIX #32457 adding tms and datec to email templates
This PR adds tms and datec to email templates. It's added but not shown on creation and modify, where as it is shown when just listing email templates. The fields already existed in the database. A few more hurl tests are introduced to ensure that API post and create are not done with wrong fields.
This PR also adds id="" fields to the forms and the tables - so it easier to find them if you inspect the html.
This PR fixes #32457 but changing the
Codecolumn toLabelwhich matches what you get in the json using the API