Page 1 of 1

Make comments

Posted: 2019-10-30 09:13
by vladimir
Hi,

I want to use comments with timestamp on my work order app.

Now I'm using text box for comments on particular work order but anyone can edit or delete text in it without trace.

Thanks.

Re: Make comments

Posted: 2019-10-30 10:38
by pbottcher
Hi,
can you please explain in more detail what you try to achieve?

Do you want to disable the editing of comments, or build a comments log with timestamps, or?

Re: Make comments

Posted: 2019-10-30 17:09
by vladimir
I made a simple form to show what I want.

In red square is what I'm missing.

Image

Re: Make comments

Posted: 2019-10-30 19:38
by pbottcher
Hi,

in this case I would create 2 additional fields.
- comment
- comment_log

The comment_log is readonly and the will contain the log of all comments

In the hooks/TABLENAME.php file you can add to the after_insert and after_update a SQL statement that will copy the data from the comment field to comment_log field.

Hope that gives a starting point.

Re: Make comments

Posted: 2019-11-08 16:39
by onoehring
Hi,

I like pbötchers idea.
But it may be easier to have a new table for comments and create 1:n relation to that. Make users only ADD, but not EDIT records for this table and have a ID from your mastertable, timestamp field and a comment field. This way you also would be able to add more fields like username if you like.

Olaf