Event entity base type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    Event entity base type

    Hello,

    I've created an entity ExternalEventAttendance with type=Event. Is it possible to configure under which entities activities/hisotry panels it shows under?

    E.g. only show ExternalEventAttendance under Contacts not Leads?


  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    #2
    Also there's something up - all objects of type ExternalEventAttendance are showing up under every Entity type with an Activity panel - not just those that have a link specified.

    E.g. all ExternalEventAttendances are showing up under every Opportunity, despite there being no link.

    Comment

    • alasdaircr
      Active Community Member
      • Aug 2014
      • 525

      #3
      Ah I'm seeing getActivitiesSelectParams and getAcitivy<scope>Query

      Looks like that should help

      Comment

      • alasdaircr
        Active Community Member
        • Aug 2014
        • 525

        #4
        So I've got pretty far with moving all my Eventbrite code into an extension. It's working really well - thanks for making these changes.

        There are a couple of niggling issues though -

        1. There's no way to specify the layout used for the expanded-list view (in order to show 'status' rather than 'assignedUser')
        2. There's no way to specify the icon of the event in metadata (not a big fix needed)

        These are only solved by modifying core code: e.g.
        PHP Code:
        diff --git a/client/modules/crm/src/views/record/panels/activities.js b/client/modules/crm/src/views/record/panels/activities.js
        index 7a04d27..a65d797 100644
        --- a/client/modules/crm/src/views/record/panels/activities.js
        +++ b/client/modules/crm/src/views/record/panels/activities.js
        @@ -51,7 +51,23 @@ Espo.define('crm:views/record/panels/activities', ['views/record/panels/relation
                     }
                 ],
        
        -        listLayout: {},
        +        listLayout: {
        +            'Event': {
        +                rows: [
        +                    [
        +                        {name: 'ico', view: 'crm:views/fields/ico'},
        +                        {
        +                            name: 'name',
        +                            link: true,
        +                        },
        +                    ],
        +                    [
        +                        {name: 'status'},
        +                        {name: 'dateSent'}
        +                    ]
        +                ]
        +            }
        +        },
        
                 defaultListLayout: {
                     rows: [ 
        

        and

        PHP Code:
         diff --git a/client/modules/crm/src/views/fields/ico.js b/client/modules/crm/src/views/fields/ico.js
        | index 1e59513..31d815e 100644
        | --- a/client/modules/crm/src/views/fields/ico.js
        | +++ b/client/modules/crm/src/views/fields/ico.js
        | @@ -49,6 +49,9 @@ Espo.define('crm:views/fields/ico', 'views/fields/base', function (Dep) {
        |                  case 'Email':
        |                      tpl = icoTpl.replace('{icoName}', 'envelope');
        |                      break;
        | +                case 'Event':
        | +                    tpl = icoTpl.replace('{icoName}', 'tags');
        | +                    break;
        |                  default:
        |                      tpl = icoTpl.replace('{icoName}', 'calendar');
        |                      break; 
        

        But these could easily be supported by specifying them in the scope file - clientDefs perhaps? Overall this is really great work.

        Comment

        • tanya
          Senior Member
          • Jun 2014
          • 4308

          #5
          Hello
          I am not sure, that changing core files is the best way.... After upgrade you can lose your modification.
          I didn't check, but I think easier is to override activity and history panels for Contact and add this new Entity if you need it only there

          Comment

          • alasdaircr
            Active Community Member
            • Aug 2014
            • 525

            #6
            Thanks - I've overridden the panels as you say and that works great.

            Comment

            • alasdaircr
              Active Community Member
              • Aug 2014
              • 525

              #7
              I think it would be useful to specify activitiesEntityList on a per-entity basis. E.g. only add my Event entity to Contacts & Leads, none other.

              The question is do you specify it in the Contact metadata or the Event metadata. I went with the Contact clientDef file. But it may be more suitable to specify in the clientDef of the Event ?

              this is patch which supports specifying activitiesEntityList by Entity:



              Would be interested in what you think is the best approach - it would be amazing if these things were derived from the actual links between the entities in entityDefs - but that's even more work.

              Comment

              Working...