extended time accounting

Moderator: crythias

Locked
logi
Znuny newbie
Posts: 6
Joined: 14 May 2013, 12:25
Znuny Version: OTRS 3.2

extended time accounting

Post by logi »

Hello,

we need some different time accounting for articles in tickets.
Also we need some summary with the complete time in the ticket.
With the normal time accounting feature, which can be enabled, we can only capture one kind of service time.

For example, when an agent create a note in a ticket, he should be able to fill in different times.

"Time Security Service": 1 h
"Time Development Service": 2 h
"Time Default Service": 2 h

With 'dynamic ticket fields" it can only globally inserted.
With 'dynamic article fields" we have no sum of the hours.

Can you give me a hint or is this not possible with otrs?

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

Re: extended time accounting

Post by crythias »

*an* idea is to create article types (time-security-internal, time-development-internal, time-default-internal) akin to note-internal and defined in the same location in sysconfig.
Then you can use a query like from viewtopic.php?f=60&t=12546 but include some testing for the article type.
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
logi
Znuny newbie
Posts: 6
Joined: 14 May 2013, 12:25
Znuny Version: OTRS 3.2

Re: extended time accounting

Post by logi »

Hi,

thanks for that. I created a SQL Query but how do I get the output to the "TicketZoom" overview?
And how is it possible to put the actual ticketid to my sql query?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: extended time accounting

Post by crythias »

logi wrote:how do I get the output to the "TicketZoom" overview?
That would require some programming/development.
logi wrote:how is it possible to put the actual ticketid to my sql query?
WHERE t.id=ticketid
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
logi
Znuny newbie
Posts: 6
Joined: 14 May 2013, 12:25
Znuny Version: OTRS 3.2

Re: extended time accounting

Post by logi »

crythias wrote:
logi wrote:how do I get the output to the "TicketZoom" overview?
That would require some programming/development.
crythias wrote:
logi wrote:how is it possible to put the actual ticketid to my sql query?
WHERE t.id=ticketid
Thats not what I mean.
I want to have the output of my sql query in the "TicketZoom", so I need a possibility to transmit something unique to the query that I have a reference to the actual ticket.
Cause I need a sum of the dynamicArticleFields in -this- ticket. But If the Output is not possible, I have a problem ...

If this is only possible with programming, where could I start to search?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: extended time accounting

Post by crythias »

Kernel/Output/HTML/Standard/AgentTicketZoom.dtl:

Code: Select all

# show article accounted time
<!-- dtl:block:ArticleAccountedTime -->
                    <label>$Text{"$Data{"Key"}"}:</label>
                    <p class="Value">$QData{"Value"}</p>
                    <div class="Clear"></div>
<!-- dtl:block:ArticleAccountedTime -->

# show attachments
 
Kernel/Modules/AgentTicketZoom.pm:

Code: Select all

    # show accounted article time
    if (
        $Self->{ConfigObject}->Get('Ticket::ZoomTimeDisplay')
        && $Self->{ConfigObject}->Get('Ticket::Frontend::AccountTime')
        )
    {
        my $ArticleTime = $Self->{TicketObject}->ArticleAccountedTimeGet(
            ArticleID => $Article{ArticleID}
        );
        $Self->{LayoutObject}->Block(
            Name => 'ArticleAccountedTime',
            Data => {
                Key   => 'Time',
                Value => $ArticleTime,
            },
        );
    }
 
Theory: grab the values in a sql query and add additional fields to the above Block:

Code: Select all

        $Self->{LayoutObject}->Block(
            Name => 'ArticleAccountedTime',
            Data => {
                Key   => 'Time',
                Value => $ArticleTime,
                KeyS => 'Security',
                ValueS => $resultfromsecuritysql,
                KeyD => 'Development',
...
            }, 
then plug the html code into the .dtl for the new fields
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
logi
Znuny newbie
Posts: 6
Joined: 14 May 2013, 12:25
Znuny Version: OTRS 3.2

Re: extended time accounting

Post by logi »

Would this display the sum also in the right corner, named with "Ticket Information" ?
I think I need some time to isert this code, but thank you very much!
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: extended time accounting

Post by crythias »

The dtl will place the code if you reference the proper keys for the Block.
The module determines what values fill the keys.
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
logi
Znuny newbie
Posts: 6
Joined: 14 May 2013, 12:25
Znuny Version: OTRS 3.2

Re: extended time accounting

Post by logi »

AgentTicketZoom.dtl

Code: Select all

<!-- dtl:block:ArticleAccountedTime -->
                    <label>$Text{"$Data{"Key"}"}:</label>
                    <p class="Value">$QData{"Value"}</p>
                    <div class="Clear"></div>
                    <label>$Text{"$Data{"KeyS"}"}:</label>
                    <p class="Value">$QData{"ValueS"}</p>
                    <div class="Clear"></div>
<!-- dtl:block:ArticleAccountedTime -->
AgentTicketZoom.pm

Code: Select all

        $Self->{LayoutObject}->Block(
            Name => 'ArticleAccountedTime',
            Data => {
                Key   => 'Time',
                Value => $ArticleTime,
                KeyS => 'Security',
                ValueS => $resultfromsecuritysql,
            },
        );
    }

This shows me the content of resultfromsecuritysql in every Artikel, not in the ticket information box on the right.
Can you help me to get this to the box ?
logi
Znuny newbie
Posts: 6
Joined: 14 May 2013, 12:25
Znuny Version: OTRS 3.2

Re: extended time accounting

Post by logi »

I think I have found someting that helps me :)
Ich wrote you when its works.
Locked