Announcement

Collapse
No announcement yet.

Display user_name instead of concat user.first_name user.last_name in UI

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

  • Display user_name instead of concat user.first_name user.last_name in UI

    How difficult would it be to modify the ORM so that all the createdByName / modifiedByName / assignedUserName 's etc show my username rather than my real name?

    We like to use initals for usernames so that the UI could be neater

  • #2
    Not sure how to implement this. It seems requires some tricks.

    Comment


    • #3
      I looked into code. It's bit difficult. We need to refactor classes that build internal metadata for ORM.

      Comment


      • #4
        Ah I see. Well maybe I'll have a go at it when I understand the code a bit better. Thanks for looking.

        Comment


        • #5
          Take a look to data/cache/ormMetadata

          Find assignedUser relationships. There is foreign property. This property is built in classes application\Espo\Core\Utils\Database\Orm\*

          These classes are not pretty good and need some refactoring.

          .../Relations/BelongsTo.php is where foreign built. You need to make check if it's a relation with User and set 'userName' as foreign field.

          Comment


          • #6
            Thank you - although it feels like a hack, it's working where I need it (when you modify the assigned user, before a refresh you see the full name but that can be fixed later on).

            Here is the patch for interested folk: http://sprunge.us/NJJD
            Last edited by alasdaircr; 08-20-2014, 12:36 PM.

            Comment


            • #7
              Hi there, this is working great for me, except in two places 'Activities' and 'History' side panels. In the 'Tasks' side-panel this is shown correctly.

              Does any one have a thought about what is different between these two views / models that would mean the username is shown on one, but the user's full name in another for 'assignedUser'.

              Looking at entityDefs for Calls, Meetings, Tasks I can't see anything obvious, so I'm wondering if it's because tasks are not many-to-many whereas the other's are?

              Comment


              • #8
                I'm presuming that the problem isn't in the client code, this is how the representation happens in application side?

                Comment


                • #9
                  Hi

                  SQL queries here:
                  application/Espo/Modules/Crm/Services/Activities.php

                  Comment

                  Working...
                  X