Announcement

Collapse
No announcement yet.

Factoring Activites maybe possible ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Factoring Activites maybe possible ?

    Hi Yuri,
    it's not a feature request, but if you can look and say it's possible to refactor somes files for Activities :

    application/Espo/Modules/Crm/Tools/Activities/Service.php​
    line +- 412
    PHP Code:
            switch ($entityType) {
                case 
    Contact::ENTITY_TYPE:
                    
    $link 'contacts';

                    break;

                case 
    Lead::ENTITY_TYPE:
                    
    $link 'leads';

                    break;

                case 
    User::ENTITY_TYPE:
                    
    $link 'users';

                    break;
            }
    ​ 

    and make something so if it's possible of course :

    PHP Code:
            switch ($entityTemplateType) {
                case 
    TEMPLATE:PERSON:
                    
    $link strlower$entityType ) .'s';

                    break;

            }
    ​ 
    so we are free to add any entity template person to : activities

    same in Espo\Modules\Crm\Tools\Lead\ConvertService

    PHP Code:
          Contact::ENTITY_TYPE 
    so we are free to use convert leads to any entity

    I think, in this case, we need to use TemplateType in place of Contact or Lead or ..

    I just don't know what kind of templateType is Case or Opportunuity ..

    If not possible.. no problem or add in backlog

    Best Regards

  • #2
    For information. Tricks like $link = strlower($entityType) . 's'; are no-no.

    Comment


    • #3
      It looks to me that this fix will break the system. If we ever to support custom attendee types, it will be a big endeavor to implement, not a small fix.

      Comment


      • #4
        Thank you Yuri... i imagine it's a big work... so no problem.

        Thank you for your response.

        Comment


        • #5
          Hi Yuri, ... my last chance
          i will be more "precise" ..
          you don't need to add out-of-box possibility to add new entity as attendee.

          Maybe, if you refactor and use "Template:Person ... Template:Company" in some files, i think, the rest can be done by a developper with some metadata.. some custom files without breaking all core files

          I do actually that, i have a custom entity as attendee.. all work perfect.. i have some file not "upgrade safe" as you can see entityName is "hard-coded".

          Best Regards

          Comment


          • Kharg
            Kharg commented
            Editing a comment
            So basically a way to convert leads into other Company/Person entities

          • item
            item commented
            Editing a comment
            Hi Kharg,
            no, optimize and make "customisable" (for developper).

            This resume what i try to explain.. all is personBuilder as on bottom on the sample here.
            I have not skill of Yuri or many other forum user.. but i can say, this files can be "optimized" in many place.

            switch ($entityType) {
            case Contact::ENTITY_TYPE:
            $link = 'contacts';

            break;

            case Lead::ENTITY_TYPE:
            $link = 'leads';

            break;

            case User::ENTITY_TYPE:
            $link = 'users';

            break;
            }

            if (!$link) {
            return $queryList;
            }

            $personBuilder = clone $baseBuilder;

        • #6
          Moved to metadata: https://github.com/espocrm/espocrm/c...c592c86e975350

          Comment


          • rabii
            rabii commented
            Editing a comment
            Nice, what about converting a custom entity from lead ? is there any chance to allow such functionality in Espo\Modules\Crm\Tools\Lead\ConvertService

          • yuri
            yuri commented
            Editing a comment
            This is another topic. I did this work on my weekend to not to interfere with my work plan. ConvertService is not on plan. Getting more work after finishing a task is not enjoyable.

            It's more hardcoded. You can always bind another implementation.

          • rabii
            rabii commented
            Editing a comment
            Thanks
            Yes binding should do the job.
            have a great weekend

        • #7
          Thank you many much Yuri..
          your solution is "perfect".

          Comment

          Working...
          X