Okay
  Public Ticket #3173097
Activity Log
Closed

Comments

  •  1
    Venice Ann started the conversation

    I have a table which I added manually

    What I want is to link the wp_users table to it so, whenever a user adds a new entry I will know his or her name. More of like an Activity Log where I can monitor who added a new entry or who edit and delete an existing entry. I know you have a feature that is called "Users see and edit only own data". But I don't want to enable that feature because I want New or existing users to add new entry on One table only.

    I would really appreciate it if you have a workaround on this or any tutorial that you could point me to make this possible.


  •  1,604
    Miloš replied

    Hi ,Venice 

    Thanks for reaching out to us

    -

    In regards to making a solution that could store the current user's name in tables :

    If you take a look at all our available dynamic Placeholders here, you will notice that amongst them we have 

    • %CURRENT_USER_LOGIN% – this placeholder will be replaced with the currently logged-in username (if the user is logged in).
    • %CURRENT_USER_FIRST_NAME% – this placeholder will be replaced with the First Name of the currently logged-in user. Provide a value here to be used for table generation.
    • %CURRENT_USER_LAST_NAME% – this placeholder will be replaced with the Last Name of the currently logged-in user. Provide a value here to be used for table generation.

    -

    You could add a hidden column to this table, and set the Predefined Editor Value to as %CURRENT_USER_LOGIN%

    2484995138.png

    This would set a predefined editing value to come up as the currently logged-in username (if the user is logged in)

    But it will not stop the user from editing it during adding New Entry.

    If the row gets saved - and someone else comes to edit or delete it,

    it will still look like this until they edit it, so that's not a solution for your use-case.

    -

    That is the best i could come up with, but as you see, unfortunately for this specific use-case, we don't currently have a valid solution with any of our built-in options.

    -

    In terms of sending the edited data via a custom solution with a hook,  i covered everything about that on your other ticket, please refer to https://tmsplugins.ticksy.com/ticket/3167796/.

    And i also explained there that,  if you need new features/solutions that are not yet available, you can suggest a future improvement idea to our developers on our Suggestions Page,

    and they will do their best to create a solution in the future;

    -

    If you need a solution now, you can reach out to someone like WP Kraken, and ask them if they could create a custom workaround,  we just can't advise on their pricing.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Venice Ann replied

    That could work but is there a way to hide user name field when adding new entry and editing an existing entry? If there is a CSS code just to hide it and use placeholder to auto populate it that would be great.

    Attached files:  Hide.png

  •  1,604
    Miloš replied

    Hi, Venice

    I see what you mean, thank you for that - you gave me an idea of what to try.

    Here is what i came up with.

    By selecting the HTML element that has the same CSS class across the entire input / edit Form,  i use the "nth child" CSS selector, in order to figure out exactly which HTML element holds the user ID and the Username on my test table example.

    2386504000.png
    1280840430.png

    This is the CSS i added to the table, in back-end table settings,

    Customize/Custom CSS:

    #table_1_edit_dialog > div.row.wdt-edit-dialog-fields-block > div:nth-child(5){
        
        display :none !important
        
    } #table_1_edit_dialog > div.row.wdt-edit-dialog-fields-block > div:nth-child(6){
        
        display :none !important
        
    }
    8446065295.png


    As you see, on my table it turns out that the div:nth-child numbers are child 5 and child 6,

    for "user ID field" and "userName" field,

    on your table the "div child" numbers will probably be different, 

    but i think you should be able to achieve this by using this method, just to get the right Div child numbers in the CSS code.

    -

    Let me know if that helped.smile.png Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Venice Ann replied

    I'll try your workaround. I was wondering if you have a way to create an Activity Logs for front end. I did sent a suggestion on that feature does it take time for them to add that feature? The reason why I'm persistent with these because this is the missing puzzle to my Add, Edit and Delete Data entry table. Also, how do you make the Date and Time column static? Like if a user added an entry I will be able to see what time and date he or she added the data is this possible? I really appreciate your help..



  •  1,604
    Miloš replied

    Hi, Venice

    1. Regarding the CSS to hide the form elements you need, i can devise the CSS for you,

    if you have the table on a page send me the URL,

     or even in the back-end, the same CSS will work,

    so i can do that on the back-end of the table;

    if you wish you can send me any Admin credentials to log in remotely and let me know  of the table ID.

    Just if you send me any confidential info, make sure to mark reply as PRIVATE so that nobody sees them but us.

    2.

    In regards to a "time stamp" column, to get a log when a new entry is added;

    For example, If you need a simple auto pre-populate for the column Date and Time, to be the current Date Time,

    we have a placeholder,

    that you can use as a predefined editor value.

    -

    Here is how you can do it :

    Set column type to DateTime;

    9626039055.png

    Then, in the Editor Type, set as "one line edit",  and set the predefined editor value as the placeholder %CURRENT_DATETIME% :

    1626344206.png

    And then, if someone tries to add a new row,   this column's value will automatically be default as the current date and time :

    7417353783.png

    -

    We can then hide the column from editing with CSS ( in a similar way as we will do with the user ID and username editing fields)

    2.

    There is also a custom SQL workaround, for SQL tables, if you need a timestamp :

    1. Create a column (for example "Updated") in your table

    2. In column settings set the type to be "DateTime" (in the "Data" tab), and in the "Editing" tab set the "Editor Input Type" to "none".

    3. In the database, run this query:

    ALTER TABLE `table_name` CHANGE `updated` `updated` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
    

    Please note that you need to replace 'table_name' with the actual database table name. You can find the database name of the table in the Editing tab above the table, in the "MySQL query name for editing" field.

    I hope that helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •   Venice Ann replied privately
  •   Venice Ann replied privately
  •   Venice Ann replied privately
  •   Miloš replied privately
  •   Miloš replied privately
  •   Venice Ann replied privately
  •   Venice Ann replied privately
  •   Miloš replied privately
  •  1,604
    Miloš replied

    Hi, Venice 

    Thank you for all your patience and cooperation.

    I have got confirmation on everything from our senior Team.

    1.  For Log solution on editing/deleting rows :

    We are truly sorry, but everything that we have achieved so far is the maximum we can get,

    or in other words, as close as possible to the solution you need.

    -

    With our current plugin's capabilities,  we don't have any solution to provide a Log that will change the username for existing rows if another user edits the row which was already created by "another user".

    -

    The workaround i devised can only for for "new rows",  but not for "editing" and "deleting"  ( unless if the same user edits/deletes that row)

    - We will do our absolute best to work on that in the future, but i can't say an ETA on it.

    You can follow our changeLog and our newsletter if you wish to follow all the new features that are coming out during updates.

    - And for the other points, what i advised still remains, our senior colleagues don't have anything to add, i have correctly pointed those out ( points#  2,  3 and 4)

    -

    If you wish to try to customize the plugin's code to try to achieve what you need, you are free to do so.

    If you have coding skills, you can check out our available hooks for developers here.

    If you need to hire someone for help if you need these solutions right now,

    we are not available for custom work - we can only recommend reaching out to someone like WP Kraken, but can't advise on their pricing.

    -

    And of course, please don't hesitate to reach out to us with new/multiple tickets whenever you have any new/unrelated questions.

    Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Venice Ann replied

    Hi Miloš,

    Thank you for doing your best to provide solutions for my inquires. Fortunately, I was able to figure out the "Audit Logs" feature although this is just a workaround it would be great to share to our community. I used the "Trigger" function of phpMyAdmin. I've set an BEFORE_INSERT and AFTER_UPDATE trigger. But first you need to create a new table and labeled it any name you want then the fields that you created from your main table should be identical to the new table that you will create. After go to phpMyAdmin and locate the table that you want to create trigger works amazing with your plugin once this is executed correctly. Hopefully your team will come up with something like this in your plugin it would be convenient to Administrator side(backend). 


  •  1,604
    Miloš replied

    Hi, Venice 

    Thank you very much for sharing the workaround for your use-case with us.

    I will pass this to our management and to the developers,

    it will be useful to know for future improvements of the plugin.

    Yes, it will be awesome if we can implement a more user-friendly solution for something like this in the near future.

    We will certainly do our best to do so.  I can't say an ETA on it, though.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -

    Thanks again, and please don't hesitate to open new/multiple tickets if you need our help with something else in the meantime,

    and i am passing all these details to our developers.

    We will let you know if they need further details for this workaround along the way when they start their testing for something like that.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,604
    Miloš replied

    Hi, Venice

    I am just following up because the developers told me they plan to implement something new for our Manual Tables in the future, so i wanted to let you know.

    They plan to implement some new "default columns" that will automatically have prepopulated values,

    such as , for example , right now we only have the unique row identifier column as "wdt_ID" for row IDs,

    but they will add columns such as created_at, updated_at, created_by, updated_by and so on.

    I can't say an ETA on it, but as mentioned, you can follow our changeLog

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    Thanks again for this feedback that we covered on the ticket.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables