Customization of AgentTicketActionCommon - bug on dynfiled ?

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:

Customization of AgentTicketActionCommon - bug on dynfiled ?

Post by massimobianchi »

Hi all,
I am customizing the visibility of dynamic field in

AgentTicketActionCommon.dtl

in a custom theme.

Dynamic field FWSHOP is enabled and perfectly modifiable in standard theme.

I have created a custom AgentTicketActionCommon.dl because i want to show ONLY dynfield FWSHOP in this theme.

So I commented out the "generalistic" part:

#<!-- dtl:block:DynamicField -->
# <div class="Row Row_DynamicField_$QData{"Name"}">
# $Data{"Label"}
# <div class="Field">
# $Data{"Field"}
# </div>
# <div class="Clear"></div>
# </div>
#<!-- dtl:block:DynamicField -->

And inserted my static list:

<!-- dtl:block:DynamicField_FWSHOP -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField_FWSHOP -->

The filed is properly selectable from the "freefield" button in agent interface, but if i change the value and press the "submit" button, nothing happens.
No error logged (or, at least, i am not able to find where. I looked at /var/log/message).

If I revert the changes, the filed is editable and submittable.

Am I missing something ?

Thanks for helping.

Massimo
Massimo Bianchi
skype: massimo.bianchi
OTRS:3.1.14, ITSM:3.1.8, httpd, mysql, Centos 6.3 on X86_64
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

I truly think that it's a bug, so I already filed it into bugzilla.

http://bugs.otrs.org/show_bug.cgi?id=8909

But I will be very interested in being in error :P

Kind gregards,
Massimo
Massimo Bianchi
skype: massimo.bianchi
OTRS:3.1.14, ITSM:3.1.8, httpd, mysql, Centos 6.3 on X86_64
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

Hi,
it turned out that i mis-interpreted the function of the "static" dynamic field, they are intended for the sole purpose of layout customization, you cannot use them to hard-code witch field to show. (yes, i know OTRS FORMS and I have them, but they are not applicable in this case).

Following some not-intended-hint, I am trying to force some fixed value for the dynamic fields, since in my scenario in a determinated them, they are really static.

I tried something like these:

<input type="hidden" name="DynamicField_CDC" value=""/>
<input type="hidden" name="DynamicField_CDR" value=""/>
<input type="hidden" name="DynamicField_Cartella" value=""/>
....

for every activated DynField in my screen, but the result is always the same.

My not-hardcode DynField is visible, selectable, but when I press submit nothing happens.
Or any hint on how-to-debug-it would be usefull, even if am I not a perl-monger

Thanks and regards,
Massimo
Last edited by massimobianchi on 15 Nov 2012, 20:05, edited 1 time in total.
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by crythias »

You need to enable the dynamic fields in SysConfig even if you don't want to show them.
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

Hi,
they are enabled.

If I use the standard generalistic DTL they are all present.
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by crythias »

ok. what is the *name* of the field when rendered normally?

It should be DynamicField_fieldname

<input type="hidden" name="DynamicField_CDC" value=""/>
<input type="hidden" name="DynamicField_CDR" value="/>
<input type="hidden" name="DynamicField_Cartella" value=""/>

These say, "Hey, no value, and I'm not going to show you the fields, either"

But if you've rendered the field in a browser, you have the code needed for the dtl.

Code: Select all

<div class="Row Row_DynamicField_dummy">
    <label id="LabelDynamicField_dummy" for="DynamicField_dummy">
        Dummy Field:
    </label>
   <div class="Field">
         <input type="text" class="DynamicFieldText" id="DynamicField_dummy" name="DynamicField_dummy" title="Dummy Field" value="">
   </div>
   <div class="Clear"></div>
</div>
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

Hi,
the scenario is as follows.

I have enabled a lot of dynamics field in freetext.
I have created some custome thems for agents, to see only a subset of the dynamic field.
I know, and I have already implemented "OTRS FORMS", but they are not usefull in this scenario because I would have to maintain too many service-field relation, and associating to customer group is not viable to some other configutation issues.

So I want to hard-wire the activated but un-needed dynamic field.

I will concentate on two of them, CDC and CDR.
<input type="hidden" name="DynamicField_CDC" value=""/>
<input type="hidden" name="DynamicField_CDR" value="/>
<input type="hidden" name="DynamicField_Cartella" value=""/>

These say, "Hey, no value, and I'm not going to show you the fields, either"
This is exactly what I want.

I do not want, if possible, to create all the DTL entries since they will not be used, to have a cleaner file.

If I test the page with the standard DTL all the fields are properly present, visible and editable.

Kind 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: Customization of AgentTicketActionCommon - bug on dynfil

Post by crythias »

massimobianchi wrote:My not-hardcode DynField is visible, selectable, but when I press submit nothing happens.
Or any hint on how-to-debug-it would be usefull, even if am I not a perl-monger
I don't know what you want to happen. When you say, "nothing happens", do you mean that literally, nothing happens? As in, you can't submit a ticket?
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

HI,
I atatched the rendered page, using standard DTL

I used Opera built-in DOM inspector.

From this page i took the dynfield name, in the format DynamicField_NAME

And tried to force the values.

I also tried to update the field with standard DLT and look at history to see which fields are updated.
I confronted my theoric list with that list, and found the FreeText13 was added.

I inserted it, but nothing the same.

Responding to your last post: "Nothing Happens"
Means:
1) I insert the values and choose my drop-down value
2) I press the "submit" button
3) -nothing-, no values updated, page/tab/windows is NOT closed

Normally, instead, the page/tab/windows closes and updates the values.

If you could give some direction on how to debug the submit button, I can try some test...

Kind regards, and thanks for your support.
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by crythias »

please post your dtl as well.
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

Hi,
this is my custom .dtl

With the exception of TicketFreeText13, all others are custom field.
For TicketFreeText13 I used a value obtained from a succesfull update history.
If that matters, FWSHOP is a dropdown list

Many Thanks,
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by crythias »

Why do you bother putting fields in that have a value that is blank? You might as well not include them and achieve the same results.

You've duplicated names, that's not healthy for forms.

Code: Select all

<label id="LabelDynamicField_ExtTicketOutbound" for="DynamicField_ExtTicketOutbound">
        ExtTicketOutbound:
</label>
                <div class="Field">
                  <input type="text" class="DynamicFieldText" id="DynamicField_ExtTicketOutbound" name="DynamicField_ExtTicketOutbound" title="ExtTicketOutbound" value="">
                </div>
                <div class="Clear"></div>
However, the .dtl you sent doesn't appear to reflect in the freetext.zip you sent. There's no input type=hidden at all

Code: Select all

        <input type="hidden" name="FormID" value="1352989429.10666878.6234564">
        <input type="hidden" id="ImpactRC" name="ImpactRC" value="0">
To get rid of the listing, remove this:

Code: Select all

<!-- dtl:block:DynamicField -->
                <div class="Row Row_DynamicField_$QData{"Name"}">
                    $Data{"Label"}
                    <div class="Field">
                        $Data{"Field"}
                    </div>
                    <div class="Clear"></div>
                </div>
<!-- dtl:block:DynamicField -->
To show only one field, put this (per your bug report's response, for each SysConfig enabled field) :
This means that you need to have a <!-- dtl:block:DynamicField_NameX --> block for every field that is activate in a particular screen, otherwise you will have problems for sure.

Code: Select all

<!-- dtl:block:DynamicField_CDC -->
<!-- dtl:block:DynamicField_CDC -->
<!-- dtl:block:DynamicField_CDR -->
<!-- dtl:block:DynamicField_CDR -->
<!-- dtl:block:DynamicField_Cartella -->
<!-- dtl:block:DynamicField_Cartella -->
<!-- dtl:block:DynamicField_CodiceFiscale -->
<!-- dtl:block:DynamicField_CodiceFiscale -->
<!-- dtl:block:DynamicField_Cognome -->
<!-- dtl:block:DynamicField_Cognome -->
<!-- dtl:block:DynamicField_CognomeResp -->
<!-- dtl:block:DynamicField_CognomeResp -->
<!-- dtl:block:DynamicField_Contratto -->
<!-- dtl:block:DynamicField_Contratto -->
<!-- dtl:block:DynamicField_Email -->
<!-- dtl:block:DynamicField_Email -->
<!-- dtl:block:DynamicField_ExtTicketInbound -->
<!-- dtl:block:DynamicField_ExtTicketInbound -->
<!-- dtl:block:DynamicField_ExtTicketOutbound -->
<!-- dtl:block:DynamicField_ExtTicketOutbound -->
<!-- dtl:block:DynamicField_FOMCompany -->
<!-- dtl:block:DynamicField_FOMCompany -->
<!-- dtl:block:DynamicField_FOMElencoR -->
<!-- dtl:block:DynamicField_FOMElencoR -->
<!-- dtl:block:DynamicField_FOMElencoRW -->
<!-- dtl:block:DynamicField_FOMElencoRW -->
<!-- dtl:block:DynamicField_FOMIP -->
<!-- dtl:block:DynamicField_FOMIP -->
<!-- dtl:block:DynamicField_FOMUO -->
<!-- dtl:block:DynamicField_FOMUO -->
<!-- dtl:block:DynamicField_TicketFreeText13 -->
<!-- dtl:block:DynamicField_TicketFreeText13 -->
<!-- dtl:block:DynamicField_FuoriSLA -->
<!-- dtl:block:DynamicField_FuoriSLA -->
<!-- dtl:block:DynamicField_Matricola -->
<!-- dtl:block:DynamicField_Matricola -->
<!-- dtl:block:DynamicField_Mobile -->
<!-- dtl:block:DynamicField_Mobile -->
<!-- dtl:block:DynamicField_ModelloTelefono -->
<!-- dtl:block:DynamicField_ModelloTelefono -->
<!-- dtl:block:DynamicField_Motivazione -->
<!-- dtl:block:DynamicField_Motivazione -->
<!-- dtl:block:DynamicField_Nome -->
<!-- dtl:block:DynamicField_Nome -->
<!-- dtl:block:DynamicField_NomeResp -->
<!-- dtl:block:DynamicField_NomeResp -->
<!-- dtl:block:DynamicField_NumTelOggRichiesta -->
<!-- dtl:block:DynamicField_NumTelOggRichiesta -->
<!-- dtl:block:DynamicField_Padiglione -->
<!-- dtl:block:DynamicField_Padiglione -->
<!-- dtl:block:DynamicField_PadiglioneDest -->
<!-- dtl:block:DynamicField_PadiglioneDest -->
<!-- dtl:block:DynamicField_Piano -->
<!-- dtl:block:DynamicField_Piano -->
<!-- dtl:block:DynamicField_PianoDest -->
<!-- dtl:block:DynamicField_PianoDest -->
<!-- dtl:block:DynamicField_Punto -->
<!-- dtl:block:DynamicField_Punto -->
<!-- dtl:block:DynamicField_PuntoDest -->
<!-- dtl:block:DynamicField_PuntoDest -->
<!-- dtl:block:DynamicField_Scadenza -->
<!-- dtl:block:DynamicField_Scadenza -->
<!-- dtl:block:DynamicField_Sito -->
<!-- dtl:block:DynamicField_Sito -->
<!-- dtl:block:DynamicField_Societa -->
<!-- dtl:block:DynamicField_Societa -->
<!-- dtl:block:DynamicField_Stanza -->
<!-- dtl:block:DynamicField_Stanza -->
<!-- dtl:block:DynamicField_StanzaDest -->
<!-- dtl:block:DynamicField_StanzaDest -->
<!-- dtl:block:DynamicField_Telefono -->
<!-- dtl:block:DynamicField_Telefono -->
<!-- dtl:block:DynamicField_UtenzaWindows -->
<!-- dtl:block:DynamicField_UtenzaWindows -->
<!-- dtl:block:DynamicField_VIP -->
<!-- dtl:block:DynamicField_VIP -->

<!-- dtl:block:DynamicField_FWSHOP -->
<div class="Row Row_DynamicField_FWSHOP">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField_FWSHOP -->
</div>
and any other missing fields that show up in the freetext that is missed here and not otherwise addressed.
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: Customization of AgentTicketActionCommon - bug on dynfil

Post by massimobianchi »

Hi Crythias,
Semi Solved.

Rereading your response and the code, I tried many combinations.

Eventually this worked:
For every field of type CHECKBOX, DATE, DATE/TIME you HAVE to put the whole block

<!-- dtl:block:DynamicField_CHKBOXLIKE -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField_CHKBOXLIKE -->

For every other type (freetext, dropdown) put the block in commented format

<!-- dtl:block:DynamicField_CHKBOXLIKE -->
# <div class="Row Row_DynamicField_$QData{"Name"}">
# $Data{"Label"}
# <div class="Field">
# $Data{"Field"}
# </div>
# <div class="Clear"></div>
# </div>
<!-- dtl:block:DynamicField_CHKBOXLIKE -->

From my test if you put only the empty block, at the first dropdown field change the page is refreshed (AJAX ?), then all the blocks are expanded. Magically

Next texts will be to hide also those checkbox-enabled field, but now I have reduced the problem to three of them.

Many thanks for input.

Massimo
Massimo Bianchi
skype: massimo.bianchi
OTRS:3.1.14, ITSM:3.1.8, httpd, mysql, Centos 6.3 on X86_64
Post Reply