Change template of DashboardStream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MorningStar
    Junior Member
    • Feb 2018
    • 12

    Change template of DashboardStream

    Hello on Dashboard stream i Have message like "Admin Admin posted on lead User User", is it posible to change "user user" on another field?
    i found client/src/views/stream/notes/post.js but do not know how did he give it
  • MorningStar
    Junior Member
    • Feb 2018
    • 12

    #2
    For now if I understand the easiest way is to change parentName default field for leads, but question is how? :-/

    Comment

    • MorningStar
      Junior Member
      • Feb 2018
      • 12

      #3
      In application/Espo/Core/Utils/Database/Orm/Fields/PersonName.php added
      PHP Code:
        if($tableName=='lead')
      {      return array(
               $entityName => array (
                   'fields' => array(
                      $fieldName => array(
                          'type' => 'varchar',
                          'select' => 'TRIM(lead.title)',
                          'where' => array(
                              'LIKE' => "(".implode(" OR ", $like)." OR CONCAT(".implode(", ", $fullList).") LIKE {value} OR CONCAT(".implode(", ", $fullListReverse).") LIKE {value})",
                              '=' => "(".implode(" OR ", $equal)." OR CONCAT(".implode(", ", $fullList).") = {value} OR CONCAT(".implode(", ", $fullListReverse).") = {value})",                     ),
                          'orderBy' =>  ''. $tableName . '.' . Util::toUnderScore($orderByField) . ' {direction}'
                      ),
                  ),
              ),
          ); } 
      
      but still show personName :-(

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Hello,
        wow, how deep you dig....

        For lead enough if one of fields name (person name), accountName, phoneNumber or emailAddress is set.

        application/Espo/Modules/Crm/Entities/Lead.php
        override these methods, if you want

        Comment

        • MorningStar
          Junior Member
          • Feb 2018
          • 12

          #5
          is posible some exaple? function name or file from which I could bounce off?

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            I wrote the file - application/Espo/Modules/Crm/Entities/Lead.php
            it has 2 methods - _hasName and _getName
            if Entity has the method _get(FieldName) - the value gets from this method (application/Espo/ORM/Entity.php defines this)

            Comment

            • MorningStar
              Junior Member
              • Feb 2018
              • 12

              #7
              seems that i'm starting to understand, big thanks :-)
              if someone will need:
              PHP Code:
              class Lead extends \Espo\Core\Entities\Person
              {
                   protected function _getName()
                  {
                      return $this->get('title');
                  }
               } 
              

              Comment

              Working...