These changes apply to results shown on the tickets page, and the customers name shown in the jquery fields on the new ticket pages. If you try this out, let me know if you find some areas that this doesn't cover. This is a work in progress. I am using version 3.0. I am not a perl programmer, so this is a hacked-up hack. Hopefully I documented all my changes.
Is there a better way to do this?
The files that I edited are:
1.) Modules/AdminCustomerUser.pm
around line 532
Code: Select all
if ( $Param{Search} ) {
my %List = $Self->{CustomerUserObject}->CustomerSearch(
Search => $Param{Search},
Valid => 0,
User => $Self->{UserID}, #this line adds the check for the current logged-in agent
around line 145:
Code: Select all
my %List = $CustomerUserObject->CustomerSearch(
Search => '*some*', # also 'hans+huber' possible
Valid => 1, # not required, default 1
User => 3, # i honestly don't remember why I put 3 here
);
my %List = $CustomerUserObject->CustomerSearch(
UserLogin => '*some*',
Valid => 1, # not required, default 1
User => 3, # i honestly don't remember why I put 3 here
);
my %List = $CustomerUserObject->CustomerSearch(
PostMasterSearch => 'email@example.com',
Valid => 1, # not required, default 1
User => 3, # i honestly don't remember why I put 3 here
);
around line 250:
Code: Select all
if ($Param{User} eq 2){ #2 is the id for my admin that I want to have access to all customers - I call him SuperDuperAdmin
$SQL .= " FROM $Self->{CustomerTable} WHERE ";
}
else{ # if this is a regular mortal agent
$SQL .= " FROM $Self->{CustomerTable} WHERE create_by='".$Param{User}."' AND ";
}
around line 69
Code: Select all
# get customer list
my %CustomerUserList = $Self->{CustomerUserObject}->CustomerSearch(
Search => $Search,
User => $Self->{UserID}, #added this to limit the search
);