Create custom dashlet with DynamicField with exception

Moderator: crythias

Locked
Sleepwalker
Znuny newbie
Posts: 15
Joined: 05 Apr 2017, 11:43
Znuny Version: OTRS 4.0.x

Create custom dashlet with DynamicField with exception

Post by Sleepwalker »

Hi. I'm creating dashlet /dashboard that will filter all ticket except ticket with the problem location "GMA" (DynamicField_locprob)

but i don't know how. here are my codes

Code: Select all

<ConfigItem Name="DashboardBackend###730-OTHERS" Required="0" Valid="1">
  <Description Lang="en">Parameters  for the dashboard backend. ...</Description>
  <Description Lang="de">Parameter  für das Dashboard Backend. ... </Description>
  <Group>Ticket</Group>
  <SubGroup>Frontend::Agent::Dashboard</SubGroup>
  <Setting>
   <Hash>
    <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
    <Item Key="Title">Others</Item>
    <Item Key="Description">Others</Item>
    <Item Key="Attributes">StateIDs=1;StateIDs=4;StateIDs=6;StateIDs=7;StateIDs=8;StateIDs=9;StateIDs=10;StateIDs=11;StateIDs=12;DynamicField_locprob_Not_Equals=GMA;</Item>
    <Item Key="Filter">All</Item>
    <Item Key="Time">Age</Item>
    <Item Key="Limit">10</Item>
    <Item Key="Permission">rw</Item>
    <Item Key="Block">ContentLarge</Item>
    <Item Key="Group"></Item>
    <Item Key="Default">1</Item>
    <Item Key="CacheTTLLocal">0.5</Item>
    <Item Key="DefaultColumns">
                    <Hash>
                        <Item Key="TicketNumber">2</Item>
                        <Item Key="Queue">2</Item>
                        <Item Key="State">2</Item>
                        <Item Key="DynamicField_locprob">2</Item>
                    </Hash>
                </Item>
   </Hash>
  </Setting>
 </ConfigItem>
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Create custom dashlet with DynamicField with exception

Post by reneeb »

There is no "NotEquals" operator. So you would need to name all the other possible values:

Code: Select all

...DynamicField_locprob_Equals=<Name1>;DynamicField_locprob_Equals=<Name2>;...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Sleepwalker
Znuny newbie
Posts: 15
Joined: 05 Apr 2017, 11:43
Znuny Version: OTRS 4.0.x

Re: Create custom dashlet with DynamicField with exception

Post by Sleepwalker »

reneeb wrote:There is no "NotEquals" operator. So you would need to name all the other possible values:

Code: Select all

...DynamicField_locprob_Equals=<Name1>;DynamicField_locprob_Equals=<Name2>;...
is it possible to create or edit code to make a Not Equals?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Create custom dashlet with DynamicField with exception

Post by reneeb »

Sure. You have to edit the Driver modules for the DynamicFields... E.g. In sub SearchSQLGet (https://github.com/OTRS/otrs/blob/rel-5 ... xt.pm#L110 ) you can add

Code: Select all

"NotEquals" => '!=',
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Sleepwalker
Znuny newbie
Posts: 15
Joined: 05 Apr 2017, 11:43
Znuny Version: OTRS 4.0.x

Re: Create custom dashlet with DynamicField with exception

Post by Sleepwalker »

reneeb wrote:Sure. You have to edit the Driver modules for the DynamicFields... E.g. In sub SearchSQLGet (https://github.com/OTRS/otrs/blob/rel-5 ... xt.pm#L110 ) you can add

Code: Select all

"NotEquals" => '!=',
thank you so much! its work!

and btw how can I make a AND logical operator in Attributes?

Code: Select all

DynamicField_locprob_NotEquals!=GMA AND DynamicField_locprob_NotEquals!=VISMIN;
Locked