Asking for saving javascript inside DB

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • trungtvmso
    commented on 's reply
    Kharg I have sent mess to you already

  • Kharg
    commented on 's reply
    Yes, sure! Send me a message Kharg

  • trungtvmso
    replied
    Kharg

    yes sure, do you have telegram to have conversation about this? I'm working on it but still take times to resolve some situations because of my limitation in reading and coding for Espo Framework.

    Leave a comment:


  • Kharg
    replied
    trungtvmso

    Would you mind sharing your project? It looks really interesting.

    To add a detail/list button globally you can use the Global scope:

    clientDefs/Global.json


    PHP Code:
    {
        "menu": {
            "detail": {
                "buttons": [
                    "__APPEND__",
                    {
                        "name": "myGlobalButton",
                        "action": "globalAction",
                        "style": "default",
                        "acl": "delete",
                        "aclScope": "User",
                        "hidden": true,
                        "iconHtml": "<span title='Global Action' class="icon fas fa-building"></span> ",
                        "data": {
                            "handler": "my-extension:global-action"
                        },
                        "initFunction": "init"
                    }
                ]
            },
            "list": {
                "buttons": [
                    "__APPEND__",
                    {
                        "name": "myGlobalButton",
                        "action": "globalAction",
                        "iconHtml": "<span title='Global Action' class="icon fas fa-building"></span> ",
                        "style": "default",
                        "acl": "delete",
                        "aclScope": "User",
                        "hidden": true,
                        "data": {
                            "handler": "my-extension:global-action"
                        },
                        "initFunction": "init"
                    }
                ]
            }
        }
    }
    

    Leave a comment:


  • esforim
    commented on 's reply
    Offtopic, but do you Github these code? Need to do a follow on you

  • trungtvmso
    replied
    yuri

    Hi yuri, I have a question that can I extend views/detail for adding custom mass button for all entity like "Star" button?

    I'm looking for threads about this question but have no clue. Can you help me to let me know also path to register it in autoload please?

    Thank you so much.

    Leave a comment:


  • trungtvmso
    replied
    Originally posted by yuri
    A code stored in a field won't be executed, unless you will call it explicitly. A user who can edit this code potentially can gain access to an account of another user, if the code will be executed in a browser of that user.
    yea I understand that I just store it in a field and only Root User can use this plugin.

    Leave a comment:


  • yuri
    replied
    A code stored in a field won't be executed, unless you will call it explicitly. A user who can edit this code potentially can gain access to an account of another user, if the code will be executed in a browser of that user.

    Leave a comment:


  • trungtvmso
    started a topic Asking for saving javascript inside DB

    Asking for saving javascript inside DB

    Dear yuri

    I'm planning to build my own custom plugin what It will semi-auto generate code after I create new module(list) of buttons/edit current module from FE.

    I want to ask you that can we save javascript functions into DB? shall it be not conflicted to any classes inside our framework? I'm using Wysiwyg field type for coding field.

    This is my demo:

    ​​​Click image for larger version

Name:	image.png
Views:	327
Size:	76.3 KB
ID:	108911
    Last edited by trungtvmso; 07-29-2024, 12:47 PM.
Working...