Modify the Statistics

Moderator: crythias

Locked
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Modify the Statistics

Post by hongphuc »

Hi All,

In OTRS, I created my own stats, but I also want to change the way how can they appear in the exported file.

For Example, in CSV file, I show as below:

Number SR# Title Created Close Time State
1 1090214 Network was looped 2/9/2014 20:30 2/9/2014 20:30 closed successful
2 1230114 Mr.Hung can not insert column in Excel file 1/23/2014 13:27 1/23/2014 13:37 closed successful
3 2220114 Ms.Hanh can not use the https://nhantokhai.gdt.gov.vn website 1/22/2014 13:58 1/24/2014 10:03 closed successful

I want to change the Created by Created Day, Title by Subject....some thing like that.

Or in the .pdf file, I also want to change the appearance of it.

Could you please show me where can I modify the function as I mentioned above?

Thanks for you support in advance and look forward to hearing from all you soon.

Best regards,
Hong Phuc
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Modify the Statistics

Post by crythias »

You might try a custom translation: viewtopic.php?f=61&t=12290#p47838
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

Thanks for your reply, Crythias.

I already try the tips as you give me but it not as I expected. Could you please help more, please?

Image

Image

For clear, please see the pictures below, I want to change the re marked area, could you please show me where can I access to change it.

Thanks again!

Best regards,
Hong Phuc
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

Sorry the imange as below:

Image

Image

Please help me with this. Thanks a lot!
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Modify the Statistics

Post by crythias »

It would be more helpful to have information about your Agent Preference Language Settings, the file contents and filename that you created for translation.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

Sorry but how can I check the Agent Preference Language Settings?

I do the same your example below.

The file name is en_Custom.pm and the content as below:

Code: Select all

package Kernel::Language::en_Custom;

use strict;
use warnings;

sub Data {
    my $Self = shift;

    # $$START$$

    # own translations
    #$Self->{Translation}->{'Lock'}   = 'Lala';
    #$Self->{Translation}->{'Unlock'} = 'Lulu';

    # or a other syntax would be
        $Self->{Translation} = {
            %{$Self->{Translation}},
    #        # own translations
            'Created' => 'Create Time',
		 'CustomerUserID' => 'Customer'
        };

    # $$STOP$$
}
Bu when create start in Statistics, it still the same, nothing change :(
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Modify the Statistics

Post by crythias »

hongphuc wrote:Sorry but how can I check the Agent Preference Language Settings?
Click your name within OTRS.
What language is assigned to your name?
That's what needs a Custom.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

My language is English (United States)

So what do I need to check for the next step?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Modify the Statistics

Post by crythias »

It should work... Changing your language does translate:
Spanish Stats.PNG
And you missed the "1;" at the end of your file, but it does work:
english_custom.PNG
You do not have the required permissions to view the files attached to this post.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

Hic, still not work. It can not change anything. Do I need to check somewhere else?

How about pdf file? I also modify in en_Custom.pm file? Right?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Modify the Statistics

Post by crythias »

hongphuc wrote:Hic, still not work.
Bummer. It should. It does. I used your code.
'Created' => 'Create Time',

The screenshot I showed you says "Create Time"

before you reply "It doesn't work", you need to SPECIFY what doesn't work, and tell us how to reproduce what doesn't work.
Show what you changed.
Tell us what you expect to happen.
Show us what is happening.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

I do these step:

- Firstly, I change the file name xx_Custom.pm to en_Custom.pm
- Then change the content inside like this one:

Code: Select all

package Kernel::Language::en_Custom;

use strict;
use warnings;

sub Data {
    my $Self = shift;

    # $$START$$

    # own translations
    #$Self->{Translation}->{'Lock'}   = 'Lala';
    #$Self->{Translation}->{'Unlock'} = 'Lulu';

    # or a other syntax would be
        $Self->{Translation} = {
            %{$Self->{Translation}},
    # own translations
            'Created' => 'Create Time',
		 'CustomerUserID' => 'Customer',

        };

    # $$STOP$$
}

1;
- I want it appear like your screenshot (the second screenshot) but mine, it doesn't change anything.
- I try to log out then log in again, add new stat but it still the same the picture as I show you before.

Do I made wrong any step?
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

Hi crythias,

Now, I can change the custom file as expected after restart my server. Thanks for your help.

May I asked about .pdf file?

Image

As an example below, I want to:

- Replace the Stat#10011 by another phrase.
- Also want to change the width, height, color... of the row in the file

Can I do that? And where can I modify these function?

Please give me advice. Thanks a lot!
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Modify the Statistics

Post by crythias »

'Stat#' Is custom translatable

Widths, height, etc ... I think you may want to browse Kernel/Modules/AgentStats.pm but I don't really have good information on layout customization at this point.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
hongphuc
Znuny newbie
Posts: 56
Joined: 07 Jan 2014, 10:55
Znuny Version: 3.3.3

Re: Modify the Statistics

Post by hongphuc »

Thanks Crythias for all your help.

I already try to modify the file Kernel/Modules/AgentStats.pm and get some expected results.

Thanks again! :D
Locked