Adding a DynamicField to AgentTicketOverviewSmall.dtl

Moderator: crythias

Post Reply
massimobianchi
Znuny newbie
Posts: 67
Joined: 02 Apr 2012, 12:18
Znuny Version: 3.1.14
Real Name: Massimo Bianchi
Company: NPO Sistemi S.p.A.
Contact:

Adding a DynamicField to AgentTicketOverviewSmall.dtl

Post by massimobianchi »

Hi all,
I have searched the forum but no luck till now.

I want to make a custom theme, where I change some of the fields presented in AgentTicketOverviewSmall.dtl.

I already succeded in substituing queue with service, and now I need to add a dynamic field.

Because I want this dynamic field to be shown only in this theme I cannot enable it via sysconfig.

I looked at the file, and found the section related to dynamic field. Since I do not want other dynamic fields, I commented the general section out, and used the Field1 example to hardwire my desidered field.

Field name is FWSHOP, and is "valid"

relevant section from the file:
...
#<!-- dtl:block:OverviewNavBarPageDynamicField -->
# <th class="DynamicField Last $QData{"CSS"}">
#<!-- dtl:block:OverviewNavBarPageDynamicFieldSortable -->
# <a name="OverviewControl" href="$Env{"Baselink"}Action=$Env{"Action"};$Data{"LinkSort"};SortBy=DynamicField_$LQData{"DynamicFieldName"};OrderBy
=$LQData{"OrderBy"}">$Text{"$Data{"Label"}"}</a>
#<!-- dtl:block:OverviewNavBarPageDynamicFieldSortable -->
#<!-- dtl:block:OverviewNavBarPageDynamicFieldNotSortable -->
# <span>$Text{"$Data{"Label"}"}</span>
#<!-- dtl:block:OverviewNavBarPageDynamicFieldNotSortable -->
# </th>
#<!-- dtl:block:OverviewNavBarPageDynamicField -->
# example of how to use fixed dynamic field blocks for customizations
# Note: FWSHOP and Field2 are the names of the fields and had to be replaced with the actual
# field names
<!-- dtl:block:OverviewNavBarPageDynamicField_FWSHOP -->
<th class="DynamicField Last $QData{"CSS"}">
<!-- dtl:block:OverviewNavBarPageDynamicField_FWSHOP_Sortable -->
<a name="OverviewControl" href="$Env{"Baselink"}Action=$Env{"Action"};$Data{"LinkSort"};SortBy=DynamicField_$LQData{"DynamicFieldName"};OrderBy=
$LQData{"OrderBy"}">$Text{"$Data{"Label"}"}</a>
<!-- dtl:block:OverviewNavBarPageDynamicField_FWSHOP_Sortable -->
<!-- dtl:block:OverviewNavBarPageDynamicField_FWSHOP_NotSortable -->
<span>$Text{"$Data{"Label"}"}</span>
<!-- dtl:block:OverviewNavBarPageDynamicField_FWSHOP_NotSortable -->
</th>
<!-- dtl:block:OverviewNavBarPageDynamicField_FWSHOP -->
....
#<!-- dtl:block:RecordDynamicField -->
# <td>
# <div title="$QData{"Title"}">
#<!-- dtl:block:RecordDynamicFieldLink -->
# <a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a>
#<!-- dtl:block:RecordDynamicFieldLink -->
#<!-- dtl:block:RecordDynamicFieldPlain -->
# $Data{"Value"}
#<!-- dtl:block:RecordDynamicFieldPlain -->
# </div>
# </td>
#<!-- dtl:block:RecordDynamicField -->
# example of how to use fixed dynamic field blocks for customizations
# Note: FWSHOP and Field2 are the names of the fields and had to be replaced with the actual
# field names
<!-- dtl:block:RecordDynamicField_FWSHOP -->
<td>
<div title="$QData{"Title"}">
<!-- dtl:block:RecordDynamicFieldLink_FWSHOP -->
<a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a>
<!-- dtl:block:RecordDynamicFieldLink_FWSHOP -->
<!-- dtl:block:RecordDynamicFieldPlain_FWSHOP -->
$Data{"Value"}
<!-- dtl:block:RecordDynamicFieldPlain_FWSHOP -->
</div>
</td>
<!-- dtl:block:RecordDynamicField_FWSHOP -->
......



Obviously is not working.... What am I missing ?

Thanks and regards,
Massimo
Massimo Bianchi
skype: massimo.bianchi
OTRS:3.1.14, ITSM:3.1.8, httpd, mysql, Centos 6.3 on X86_64
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding a DynamicField to AgentTicketOverviewSmall.dtl

Post by crythias »

massimobianchi wrote:Because I want this dynamic field to be shown only in this theme I cannot enable it via sysconfig.
You still must enable the field to show if you want it to show, whether you use the loop or per-field entries.

If you don't want it to show in the other theme, hide it with css/javascript.
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
massimobianchi
Znuny newbie
Posts: 67
Joined: 02 Apr 2012, 12:18
Znuny Version: 3.1.14
Real Name: Massimo Bianchi
Company: NPO Sistemi S.p.A.
Contact:

Re: Adding a DynamicField to AgentTicketOverviewSmall.dtl

Post by massimobianchi »

ok, thanks for the input.
let's assume that I will create as many theme as necessary, showing in each only the desidered dynamic fields.

In the standard dtl, all dynamic fields are enabled.

In each custom dtl, i will comment out the standard dynamic field list, and enable just the custom one, that is described in the dtl as "Field1" example.

I tested this using an already activated dynamic field, but it's not working.

In my example the activated field is FWSHOP.

And it's not working.

If I disable the custom one and re-enable the standard view, the field us properly showed.

Has someone a working configuration with "static" dynamic fileds ?

I will attach my OverviewSmall, I think I am missing some substitution.

Kind regards,
Massimo
You do not have the required permissions to view the files attached to this post.
Massimo Bianchi
skype: massimo.bianchi
OTRS:3.1.14, ITSM:3.1.8, httpd, mysql, Centos 6.3 on X86_64
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding a DynamicField to AgentTicketOverviewSmall.dtl

Post by crythias »

Code: Select all

# example of how to use fixed dynamic field blocks for customizations
# Note: Field1 and Field2 are the names of the fields and had to be replaced with the actual
# field names
#<!-- dtl:block:RecordDynamicField_Field1 -->
#                    <td>
#                        <div title="$QData{"Title"}">
#<!-- dtl:block:RecordDynamicField1Link -->
#                            <a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a>
#<!-- dtl:block:RecordDynamicField1Link -->
#<!-- dtl:block:RecordDynamicField1Plain -->
#                            $Data{"Value"}
#<!-- dtl:block:RecordDynamicField1Plain -->
#                        </div>
#                    </td>
#<!-- dtl:block:RecordDynamicField_Field1 -->
 
For you:

Code: Select all

<!-- dtl:block:RecordDynamicField_FWSHOP -->
                    <td>
                        <div title="$QData{"Title"}">
<!-- dtl:block:RecordDynamicFWSHOPLink -->
                            <a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a>
<!-- dtl:block:RecordDynamicFWSHOPLink -->
<!-- dtl:block:RecordDynamicFWSHOPPlain -->
                            $Data{"Value"}
<!-- dtl:block:RecordDynamicFWSHOPPlain -->
                        </div>
                    </td>
<!-- dtl:block:RecordDynamicField_FWSHOP --> 
At least, that's what it *SAYS* to do ...
And this is verified by (Kernel/Output/TicketOverviewSmall.pm):

Code: Select all

           # example of dynamic fields order customization
            $Self->{LayoutObject}->Block(
                Name => 'RecordDynamicField' . $DynamicFieldConfig->{Name},
                Data => {
                    Value => $ValueStrg->{Value},
                    Title => $ValueStrg->{Title},
                },
            );

            if ( $ValueStrg->{Link} ) {
                $Self->{LayoutObject}->Block(
                    Name => 'RecordDynamicField' . $DynamicFieldConfig->{Name} . 'Link',
                    Data => {
                        Value                       => $ValueStrg->{Value},
                        Title                       => $ValueStrg->{Title},
                        Link                        => $ValueStrg->{Link},
                        $DynamicFieldConfig->{Name} => $ValueStrg->{Title},
                    },
                );
            }
 
Actually, it doesn't verify the first part...
                Name => 'RecordDynamicField' . $DynamicFieldConfig->{Name},
says
RecordDynamicFieldFWSHOP
is proper without the underscore character.
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
massimobianchi
Znuny newbie
Posts: 67
Joined: 02 Apr 2012, 12:18
Znuny Version: 3.1.14
Real Name: Massimo Bianchi
Company: NPO Sistemi S.p.A.
Contact:

SOLVEDRe: Adding a DynamicField to AgentTicketOverviewSmall.

Post by massimobianchi »

to whom it might interest, there are some more lines to edit:

proper working example with a "static" Dynamic field is as follows, with "Padiglione" my own dynamic field:

<!-- dtl:block:RecordDynamicFieldPadiglione -->
<td>
<div title="$QData{"Title"}">
<!-- dtl:block:RecordDynamicFieldPadiglioneLink -->
<a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a>
<!-- dtl:block:RecordDynamicFieldPadiglioneLink -->
<!-- dtl:block:RecordDynamicFieldPadiglionePlain -->
$Data{"Value"}
<!-- dtl:block:RecordDynamicFieldPadiglionePlain -->
</div>
</td>
<!-- dtl:block:RecordDynamicFieldPadiglione -->
Massimo Bianchi
skype: massimo.bianchi
OTRS:3.1.14, ITSM:3.1.8, httpd, mysql, Centos 6.3 on X86_64
Post Reply