Require Type,Service... at customer new ticket

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
qnetworks
Znuny newbie
Posts: 16
Joined: 21 Oct 2010, 09:24
Znuny Version: 3.0

Require Type,Service... at customer new ticket

Post by qnetworks »

if you want to force the customers to chose ticket type, service, etc you just have to go to Kernel/Modules/CustomerTicketMessage.pm
at type for example you have this:

Code: Select all

# types
  if ( $Self->{ConfigObject}->Get('Ticket::Type') ) {
      my %Type = $Self->{TicketObject}->TicketTypeList(
          %Param,
          Action         => $Self->{Action},
          CustomerUserID => $Self->{UserID},
      );
      $Param{TypeStrg} = $Self->{LayoutObject}->BuildSelection(
          Data         => \%Type,
          Name         => 'TypeID',
          SelectedID   => $Param{TypeID},
          PossibleNone => 1,
          Sort         => 'AlphanumericValue',
          Translation  => 0,
      );
      $Self->{LayoutObject}->Block(
          Name => 'TicketType',
          Data => \%Param,
      );
  }
you just have to add under Translation this code

Code: Select all

Class        => "Validate_RequiredDropdown ",
like this:

Code: Select all

# types
  if ( $Self->{ConfigObject}->Get('Ticket::Type') ) {
      my %Type = $Self->{TicketObject}->TicketTypeList(
          %Param,
          Action         => $Self->{Action},
          CustomerUserID => $Self->{UserID},
      );
      $Param{TypeStrg} = $Self->{LayoutObject}->BuildSelection(
          Data         => \%Type,
          Name         => 'TypeID',
          SelectedID   => $Param{TypeID},
          PossibleNone => 1,
          Sort         => 'AlphanumericValue',
          Translation  => 0,
          Class        => "Validate_RequiredDropdown ",
      );
      $Self->{LayoutObject}->Block(
          Name => 'TicketType',
          Data => \%Param,
      );
  }
and thats all.
OTRS 3.0
Waltero
Znuny newbie
Posts: 18
Joined: 16 Dec 2010, 18:14
Znuny Version: 2.4

Re: Require Type,Service... at customer new ticket

Post by Waltero »

Excellent! Thanks!
Production OTRS: 2.4.7 + ITSM pack
Test OTRS: 3.0.9
MySQL DB
Linux
muschiwolf
Znuny newbie
Posts: 1
Joined: 19 Jan 2011, 17:13
Znuny Version: 3.0.4

Re: Require Type,Service... at customer new ticket

Post by muschiwolf »

I did it, but nothing changes, sorry but it's the first time I using Pearl and otrs.
Thanks
yuri0001
Znuny superhero
Posts: 631
Joined: 17 Mar 2011, 14:40
Znuny Version: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: Require Type,Service... at customer new ticket

Post by yuri0001 »

Hi!
Two questions. :?
1. I must do it in original Kernel/Modules/CustomerTicketMessage.pm or in it copy in another custom folder? Where?
2. How to display an asterisk as the other required fields displays?
Thanks!
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)
maureliosilverio
Znuny newbie
Posts: 17
Joined: 25 Aug 2011, 19:22
Znuny Version: 3
Real Name: Marcos Aurélio Silvério
Company: Suntech

Re: Require Type,Service... at customer new ticket

Post by maureliosilverio »

yuri0001 wrote:Hi!
Two questions. :?
1. I must do it in original Kernel/Modules/CustomerTicketMessage.pm or in it copy in another custom folder? Where?
2. How to display an asterisk as the other required fields displays?
Thanks!
I want to know too :D
OTRS 3.0.8 and ITSM 3.0.4 on Ubuntu Server 10.0.4.3 (running on Citrix XenServer)
micshi
Znuny expert
Posts: 191
Joined: 05 Jul 2011, 16:10
Znuny Version: 3.2.2
Real Name: Micshi
Location: Beijing
Contact:

Re: Require Type,Service... at customer new ticket

Post by micshi »

Just modify the original the file of Kernel/Modules/CustomerTicketMessage.pm

Then excute the command, bin/otrs.DeleteCache.pl.

All mandatory fields will have a asterisk beside them, that means it does not need you make other extra configuation.

Thansk,

micshi
OTRS 3.2.2, ITSM 3.2.2, SystemMonitor
Ubuntu, Apache2, MySQL 5
My OTRS Blog
OTRS Basic Concept Training
OTRS Demo Instance
yuri0001
Znuny superhero
Posts: 631
Joined: 17 Mar 2011, 14:40
Znuny Version: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: Require Type,Service... at customer new ticket

Post by yuri0001 »

Displaying an asterisk for mandatory fields - as example in CustomerTicketMessage.dtl

Code: Select all

<!-- dtl:block:TicketService -->
                <div>
################################                Original line begin                   ####################################
#                    <label for="ServiceID">$Text{"Service"}:</label>
################################                Original line end                    #####################################
################################            Display Service as mandatory begin   ##########################
                    <label for="ServiceID" class="Mandatory">
                        <span class="Marker">*</span>
                        $Text{"Service"}:
                    </label>
                    $Data{"ServiceStrg"}
                    <div id="ServiceIDError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="ServiceIDServerError" class="TooltipErrorMessage NoJavaScriptMessage$QData{"ServiceInvalid"}" ><p>$Text{"This field is required."}</p></div>
                    <div class="Clear"></div>
################################           Display Service as mandatory end  ########################
#                    $Data{"ServiceStrg"}
#                    <div class="Clear"></div>
                </div>
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)
Post Reply