Announcement

Collapse
No announcement yet.

Simple Meeting Management Tab

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

  • Simple Meeting Management Tab

    /#Admin/layouts/scope=Meeting&type=list where I am talking about...

    Hello guys. I am trying to make simple meeting management tab on my Espo. Could you give me any idea where can I manage them?

    I am working on meetings tab but how can I add "Attendees" on my layout page? I do not see it on layout manager. Is there any way to add anything layout manager? As a default I can see account or parent or name but I want to change it then list them with description and I am going to use stream.. It would be great meeting management system.

    Thanks a lot in advance.

    Happy Espo Days,
    ag.

  • #2
    Hello
    Attendees is a side panel. Look for it in side panel layouts

    Comment


    • #3
      Hello Tanya, Yes,, I saw it in side panel but How can I put it in the list?
      I need to see them like a excel page on the list...
      For instance
      Name: Marketing Meeting
      Date:23/02/17
      Attendees: John Henry, Herrison Ford, Michael Lori
      Description: lorem ipsum lorem lorem ipsun text....

      I can input attendees there is no any problem I checked them they are enabled. I want to make them show in the meeting tab like a report.. I hope I could explain.

      Thanks for help.

      Comment


      • #4
        You need to create notStorable field, set it on server side, and then add it to layout.
        Look at application/Espo/Modules/Crm/Services/TargetList.php as example, set the value of you field in method loadAdditionalFieldsForList. How to do it upgrade save, search on forum.

        Comment


        • EdmondDantes
          EdmondDantes commented
          Editing a comment
          Tanya Please, if there another way to keep our meeting records in Espo I am ready to do it that way. Only problem is I can not fetch contacts or attendees to the list in layout.. (

      • #5
        Thank you Tanya for your kindly help.

        I found TargetList.php file. But it is quite hard to understand for me.. Only way if you give me some snippet I put it them on there. I made a picture with Photoshop exactly what I mean. I hope we are on the same topic mentioning. Please don't withhold your help from me.

        By the way if there another way to keep our meeting records in Espo I am ready to do it that way.

        Regards,
        ag

        Comment


        • #6
          At first you have to add notStorable text field

          /custom/Espo/Custom/Resources/metadata/entityDefs/Metting.json
          Code:
          {
              "fields": {
                  "attendeesNames": {
                      "type": "text",
                      "required": false,
                      "notStorable": true,
                      "readOnly": true
                  }
              }
          }
          Fill the value of the field in entity Service
          custom/Espo/Custom/Services/Meeting.php

          Code:
          namespace Espo\Custom\Services;
          
          use \Espo\ORM\Entity;
          
          class Meeting extends \Espo\Modules\Crm\Services\Meeting
          {
          
              public function loadAdditionalFieldsForList(Entity $entity)
              {
                  parent::loadAdditionalFieldsForList($entity);
                  $this->loadEntryAttendeesNamesField($entity);
              }
          
              protected function loadEntryAttendeesNamesField(Entity $entity)
              {
                  $attendeesRels = ["users", "contacts", "leads"];
                  $valueArray = [];
          
                  foreach ($attendeesRels as $rel) {
                      $entity->loadLinkMultipleField($rel);
                      $attendeesNames = $entity->get($rel . 'Names');
                      $attendeesIds = $entity->get($rel . 'Ids');
                      foreach ($attendeesIds as $attendeeId) {
                          if (isset($attendeesNames->$attendeeId)) {
                              $valueArray[] = $attendeesNames->$attendeeId;
                          }
                      }
                  }
                  $entity->set('attendeesNames', implode("\n ", $valueArray) );
              }
          }

          If you need this field for detail view as well, override the method loadAdditionalFields as well.

          Rebuild EspoCRM.

          Add field to layout (and disable ordering by this field)
          Last edited by tanya; 07-17-2017, 08:04 AM.

          Comment


          • EdmondDantes
            EdmondDantes commented
            Editing a comment
            I am going to try it immediately.. I'll let you know result.. Thanks a ton Tanya.

        • #7
          I'd like to add this same thing to my meeting section. When I add in the code and set this up I get a bad server response with a warning and error in my logs. Any idea how these can be compatible with the base files?

          []
          [2017-07-14 16:21:09] Espo.WARNING: E_WARNING: Declaration of Espo\Custom\Services\Meeting::loadAdditionalFields ForList(Espo\Custom\Services\Entity $entity) should be compatible with Espo\Services\Record::loadAdditionalFieldsForList( Espo\ORM\Entity $entity) {"code":2,"message":"Declaration of Espo\\Custom\\Services\\Meeting::loadAdditionalFie ldsForList(Espo\\Custom\\Services\\Entity $entity) should be compatible with Espo\\Services\\Record::loadAdditionalFieldsForLis t(Espo\\ORM\\Entity $entity)","file":"/home/crm2/public_html/custom/Espo/Custom/Services/Meeting.php","line":32,"context":{"file":"/home/crm2/public_html/vendor/composer/../../custom/Espo/Custom/Services/Meeting.php"}}

          []
          [2017-07-14 16:21:09] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\Custom\Services\Meeting::loadAdditionalFields ForList() must be an instance of Espo\Custom\Services\Entity, instance of Espo\Modules\Crm\Entities\Meeting given, called in /home/crm2/public_html/application/Espo/Services/Record.php on line 759" at /home/crm2/public_html/custom/Espo/Custom/Services/Meeting.php line 35 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\Custom\\Services\\Meeting::loadAdditionalFie ldsForList() must be an instance of Espo\\Custom\\Services\\Entity, instance of Espo\\Modules\\Crm\\Entities\\Meeting given, called in /home/crm2/public_html/application/Espo/Services/Record.php on line 759 at /home/crm2/public_html/custom/Espo/Custom/Services/Meeting.php:35)"} []

          Comment


          • tanya
            tanya commented
            Editing a comment
            Add this row before class declaration
            use \Espo\ORM\Entity;

        • #8
          That did the trick. Thanks tanya!

          Comment

          Working...
          X