Make comments

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
vladimir
Posts: 11
Joined: 2018-12-06 22:31

Make comments

Post by vladimir » 2019-10-30 09:13

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.

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 628
Joined: 2018-04-01 10:12

Re: Make comments

Post by pböttcher » 2019-10-30 10:38

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?

vladimir
Posts: 11
Joined: 2018-12-06 22:31

Re: Make comments

Post by vladimir » 2019-10-30 17:09

I made a simple form to show what I want.

In red square is what I'm missing.

Image

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 628
Joined: 2018-04-01 10:12

Re: Make comments

Post by pböttcher » 2019-10-30 19:38

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.

onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 325
Joined: 2019-05-21 22:42
Contact:

Re: Make comments

Post by onoehring » 2019-11-08 16:39

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

Post Reply