Is ti possible to override views in an upgrade-safe way?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • telecastg
    replied
    Just in case anyone is interested on how to use modules and create installable extensions, you can check these posts: https://forum.espocrm.com/forum/deve...able-extension and https://forum.espocrm.com/forum/deve...a-custom-field
    Last edited by telecastg; 02-23-2021, 02:17 AM.

    Leave a comment:


  • mozkomor
    replied
    And what about overriding entity's field view? I tried changing entityDefs and setting custom view for the field, but it didn't work.

    EDIT: My problem was, that field was being added as bottomPanel in clientDefs. I tried changing it and it worked just as it should. Thanks everyone for help.
    Last edited by mozkomor; 02-22-2021, 12:14 PM.

    Leave a comment:


  • mozkomor
    commented on 's reply
    I created custom entityDef instead of clientDef. Thank you, your solution works.

  • item
    commented on 's reply
    @emillod,
    not urgent .. is for community..
    i have post about a basic sample for extension to telecastg.. see above comment from me
    after we can go more complexe

  • item
    commented on 's reply
    Hello @telecastg
    i have respond here : https://forum.espocrm.com/forum/gene...7904#post67904

    we need begin "petit" .. real-esteate is big complex extension

    Regards

  • emillod
    commented on 's reply
    I'll try to prepare some example for you, but not today, because i'm still working on paypal integration, and it's already annoying me because it's taking too much time

  • telecastg
    commented on 's reply
    One excellent way to see how this works is to download the free extension Real Estate and see how it is structured.

    Each extension has 2 major folders ("files" and "scrips") and a json file called "manifest.json"

    The folder "files" contains all your module files, structured just like Espo, and the folder "scripts" contains php scripts (optional) that are to be executed after installation and after uninstallation. The scripts make things possible like insert menu options that only used for the module, etc.

    To prepare the extension for packaging once all files have been created, edit the "manifest" to specify a version number and the minimum version of Espo required to use the extension, then compress the "files" folder, the "scripts" folder (if any scripts were created here) and the "manifest".

    In admin mode, you can now upload the compressed extension and install.

    Note: if you are substituting "Custom" files with your extension, make sure that you delete those "duplicated" files because otherwise Espo will always give priority to "Custom" over any "Module"
    Last edited by telecastg; 02-23-2021, 06:11 PM.

  • item
    commented on 's reply
    @telecastg,
    let me understand with my sample
    i have create ParyolItems and Payroll entity..
    i have coded many ... with that there is too new jobs and client files (your help)..
    All 2 entity have many relation to out-of-box or another entity...

    How do you make a extension with this ?
    just copy file and make a zip ?
    rebuild will do the rest (relation with contact, or ... other entity) ?

    Regards

  • telecastg
    commented on 's reply
    I completely agree with emillod using modules instead of dumping everything in the custom namespace is far better.

    For our application, all customizations are stored as modules, grouped by business area or functionality and the these modules are packed as "extensions" that we can install or uninstall just like any other Espo extension,.

    For example if I am working in a module dealing with "Bookkeeping" I can make all changes that I need in the staging server, and when is ready for deployment, I package the client "bookkeeping" and application "Bookkeeping" modules as a "Bookkeeping" extension (complete with scripts, and manifest) and then in the production server all I have to do is uninstall the previous version and upload/install the new version.

    This is great for troubleshooting or for major upgrade debugging since we can isolate and test each module.

    I had asked yuri if it would be possible to incorporate this capability into the Admin GUI but he said it wasn't planned... too bad I think, but doing it manually is not that complicated.

  • item
    replied
    Yes, via composer ... sample https://github.com/thephpleague/flysystem

    so i make extension of all vendor library i use.. so no need composer to install

    Leave a comment:


  • emillod
    replied
    item modules are more hmm clean? You can look at all modules and open only one which you need right now.
    Vendor library? You mean composer?

    Leave a comment:


  • item
    commented on 's reply
    Hello emillod,

    i understand that module are more important..
    but how you add a vendor library ?

    Regards

  • emillod
    replied
    You can also create your own modules, it's great because if you create many modifications you'll have issues with managing them.
    If you create modules, you'll be able to seperate modifications. When i've started using of EspoCRM almost 4 years ago, i've adjusted EspoCRM to needs of my company and now i have everything mixed there. And i'll spent maaaaaaany days to seperate these changes to modules </3

    If you don't now how to create modules in client, you can look at our extension: https://github.com/dubas-pro/ext-dar...client/modules

    Leave a comment:


  • telecastg
    replied
    Yes, Espo is designed to be customized very easily.

    The reason why your implementation did not work is possibly that you didn't create a custom clientDefs metadata file for the entity and specified there that your custom view should be used to render the entity.

    For front-end changes you use the namespace client/custom/.....
    For back-end changes and metadata files you use the namespace custom/Espo/Custom/...

    To implement a custom view class you need to do three things:

    1) Create the custom view class (override view).

    2) Create a custom "clientDefs" metadata file that will tell Espo to apply your custom view class instead of the standard view. Each entity has it's clientDefs metadata file and Espo uses this file to determine which scripts use for front-end operations.

    3) Clear cache and rebuild Espo to implement the changes

    Here are some links that might help

    https://docs.espocrm.com/development/custom-views/

    The idea of this thread is to create a &quot;road map/guide&quot; to help developers find where GUI sections or elements are defined within Espo code so customization projects can be implemented without having to spend a lot of time &quot;finding your way around&quot; the code (like many of us have done) whenever possible.


    One of the most frustrating things when I started to work with Espo was that lacking experience with the Backbone.js framework, on which Espo front end is based, I could not understand which scripts needed to be modified to customize an entity's detail display or why when I made modifications things wouldn't seem to work.

    Leave a comment:


  • Is ti possible to override views in an upgrade-safe way?

    The title pretty much sumarizes my question. Can I somehow override view or do I have to directy edit view's source code? I tried creating view with same path in client/custom folder, but it didn't work.
Working...