Customizing the small ticket overview view

Moderator: crythias

Locked
nate
Znuny newbie
Posts: 2
Joined: 26 Jan 2012, 19:06
Znuny Version: 3.0.10

Customizing the small ticket overview view

Post by nate »

I'm looking to customize the small ticket view. What I would like to do is to change the CustomerID column to not show the customer title/name in the second line but rather to show the customer's city name. So basically I want it to show CustomerID + City rather than CustomerID + CustomerName.

I'm getting a little lost in the code as I'm a bit of novice at coding So I'm wondering if someone could point me in the right direction as to how I can make this change.

I know within AagentTicketOverviewSmall.dtl I need to change:

Code: Select all

<div title="$QData{"CustomerName"}">$QData{"CustomerName","15"}</div>
To:

Code: Select all

<div title="$QData{"City"}">$QData{"City","15"}</div>
(assuming City is the correct parameter name)

I assumed at first that City would be available as the customer name was getting pulled from somewhere but the above change didn't work so I either messed up the parameter City or it wasn't being passed to the template. After looking at TicketOverviewSmall.pm it seems like I need to make a change there as well in order to pass the value I want.

I assume I need to change to fit my needs for City (or comment out and add my code for City):

Code: Select all

# customer info (customer name)
        if ( $Param{Config}->{CustomerInfo} ) {
            if ( $Article{CustomerUserID} ) {
                $Article{CustomerName} = $Self->{CustomerUserObject}->CustomerName(
                    UserLogin => $Article{CustomerUserID},
                );
            }
        }
So I'm basically looking for someone to explain this block of text to me so I can better understand the parameter passing going on here. I assume I only have to edit the content of the last if-block and that CustomerName can be changed to City or CustomerCity (and then I'd change City ->CustomerCity in the .dtl) but I need to figure out how to reference city in CustomerUserObject. Anyway I'm sure I could figure this out by just trying a bunch of things until I got it right but I'd really like to understand this better. So if anyone has a few minutes to outline this for me I'd be very grateful.
nate
Znuny newbie
Posts: 2
Joined: 26 Jan 2012, 19:06
Znuny Version: 3.0.10

Re: Customizing the small ticket overview view

Post by nate »

Nevermind. I got it explained to me.

In case it's valuable to anyone else searching:

Code: Select all

my %User = $Self->{CustomerUserObject}->CustomerUserDataGet(
                    User => $Article{CustomerUserID},

$Article{City} = $User{UserCity};
were the relevant bits.
Locked