[SOLVED] Auto-list companies

Moderator: crythias

Locked
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

[SOLVED] Auto-list companies

Post by HervE »

Hello,

I noticed someting new in OTRS 3.x.
When you click on Customers, the Search textbox is already filled with *, and thus the list of customers automatically appears.
It is good. Or maybe not. That's not the question. :)

Strange is, the behaviour is not the same with Companies. Why?
How can I configure it to auto-list, just like Customers?

Additionally, is it possible to disable auto-list for Customers, or to prefill the textbox with another value?

Regards,
HervE
Last edited by HervE on 03 May 2011, 09:53, edited 1 time in total.
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Auto-list companies

Post by HervE »

I managed to do it in Kernel\Modules\AdminCustomerCompany.pm.

(Except the star doesn't come in the search textbox.)

HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
Joool
Znuny newbie
Posts: 16
Joined: 06 Oct 2010, 15:21
Znuny Version: 3.0

Re: [SOLVED] Auto-list companies

Post by Joool »

Here's the actual code you'll have to add:

Code: Select all

sub _Overview {
    my ( $Self, %Param ) = @_;
    my $Search = $Self->{ParamObject}->GetParam( Param => 'Search' ) || '';
$Search
        ||= $Self->{ConfigObject}->Get('AdminCustomerUser::RunInitialWildcardSearch') ? '*' : '';

my $Output = '';
Running: OTRS 3.0.10
Testing: OTRS 3.1.1
On Ubuntu Server 10.4
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: [SOLVED] Auto-list companies

Post by HervE »

Hi Joool,

I'm getting a fatal error:
[Tue Oct 18 17:02:54 2011][Error][Kernel::System::Web::InterfaceAgent::Run][188] Global symbol "$Search" requires explicit package name at C:/PROGRA~1/OTRS/OTRS//Kernel/Modules/AdminCustomerCompany.pm line 402.

For information, what I did is:

Code: Select all

sub _Overview {
    my ( $Self, %Param ) = @_;
    #my $Search = $Self->{ParamObject}->GetParam( Param => 'Search' ) || '';
    my $Search = $Param{Search} || $Self->{ParamObject}->GetParam( Param => 'Search' ) || '';
    my $Output = '';
And it works... except the star doesn't come in the search textbox, like I said.

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
thoqui
Znuny newbie
Posts: 30
Joined: 10 Jun 2015, 14:43
Znuny Version: 3.3.8

Re: [SOLVED] Auto-list companies

Post by thoqui »

Hello,

I'm working on 3.3.8.
I wish auto-list for companies, I added a code in Kernel\Modules\AdminCustomerCompany.pm but it doesn't work.

This is the code :

Code: Select all

sub Run {
    my ( $Self, %Param ) = @_;

    my $Nav = $Self->{ParamObject}->GetParam( Param => 'Nav' ) || 0;
    my $NavigationBarType = $Nav eq 'Agent' ? 'Companies' : 'Admin';
    my $Search = $Self->{ParamObject}->GetParam( Param => 'Search' );
    $Search
        ||= $Self->{ConfigObject}->Get('AdminCustomerCompany::RunInitialWildcardSearch') ? '*' : '';
Thanks for your help.

Thomas
Locked