Commit 71c2f26d0d0b81a8a74f8fa11266ff19931b8163

Authored by Rodrigo Gonçalves
0 parents
Exists in master

Versao inicial

GenerateOPM.sh 0 → 100755
  1 +++ a/GenerateOPM.sh
... ... @@ -0,0 +1,4 @@
  1 +#!/bin/bash
  2 +LOCAL="$PWD"
  3 +cd /opt/otrs
  4 +bin/otrs.Console.pl Dev::Package::Build "$LOCAL"/InPersonTicket.sopm "$LOCAL"/
... ...
InPersonTicket.sopm 0 → 100755
  1 +++ a/InPersonTicket.sopm
... ... @@ -0,0 +1,24 @@
  1 +<?xml version="1.0" encoding="utf-8" ?>
  2 +<otrs_package version="1.0">
  3 + <Name>InPersonTicket</Name>
  4 + <Version>1.1.0</Version>
  5 + <ChangeLog Version="1.0.1" Date="22/05/2015">First version</ChangeLog>
  6 + <ChangeLog Version="1.1.0" Date="2016-01-26">Fixes for OTRS 5.0.x</ChangeLog>
  7 + <Framework>5.0.x</Framework>
  8 + <Vendor>SeTIC-UFSC</Vendor>
  9 + <URL>setic.ufsc.br</URL>
  10 + <License>Free</License>
  11 + <Description>In person ticket</Description>
  12 + <IntroInstall Type="post" Title="Thank you">Module installed successfully.</IntroInstall>
  13 + <BuildDate>?</BuildDate>
  14 + <BuildHost>?</BuildHost>
  15 + <PackageRequired Version="1.1">Lib_setic</PackageRequired>
  16 + <Filelist>
  17 + <File Permission="644" Location="Kernel/Config/Files/InPersonTicket.xml"></File>
  18 + <File Permission="644" Location="Kernel/Modules/InPersonTicket.pm"></File>
  19 + <File Permission="644" Location="Kernel/Language/pt_BR_InPersonTicket.pm"></File>
  20 +
  21 + <File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/InPersonTicket.tt"></File>
  22 + <File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/InPersonTicketCreated.tt"></File>
  23 + </Filelist>
  24 +</otrs_package>
... ...
Kernel/Config/Files/InPersonTicket.xml 0 → 100644
  1 +++ a/Kernel/Config/Files/InPersonTicket.xml
... ... @@ -0,0 +1,85 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<otrs_config init="Application" version="1.0">
  3 + <ConfigItem Name="Frontend::Module###InPersonTicket" Required="0" Valid="1">
  4 + <Description>Frontend module registration for the agent interface.</Description>
  5 + <Group>Ticket</Group>
  6 + <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
  7 + <Setting>
  8 + <FrontendModuleReg>
  9 + <Description>Module for creating new ticket for in-person reception</Description>
  10 + <NavBarName>Ticket</NavBarName>
  11 + <Title>In person ticket</Title>
  12 + <NavBar>
  13 + <Description>In person ticket</Description>
  14 + <Name>In person ticket</Name>
  15 + <Link>Action=InPersonTicket</Link>
  16 + <NavBar>Ticket</NavBar>
  17 + <Type></Type>
  18 + <Prio>8400</Prio>
  19 + </NavBar>
  20 + </FrontendModuleReg>
  21 + </Setting>
  22 + </ConfigItem>
  23 +
  24 +
  25 + <ConfigItem Name="Ticket::Frontend::InPersonTicket###TypeID"
  26 + Required="1" Valid="1">
  27 + <Description>Default type ID for tickets</Description>
  28 + <Group>Ticket</Group>
  29 + <SubGroup>Frontend::Agent::InPersonTicket</SubGroup>
  30 + <Setting>
  31 + <String Regex="">6</String>
  32 + </Setting>
  33 + </ConfigItem>
  34 +
  35 + <ConfigItem Name="Ticket::Frontend::InPersonTicket###DefaultCustomerID"
  36 + Required="1" Valid="1">
  37 + <Description>Default customer ID for tickets</Description>
  38 + <Group>Ticket</Group>
  39 + <SubGroup>Frontend::Agent::InPersonTicket</SubGroup>
  40 + <Setting>
  41 + <String Regex="">paginas@sistemas.ufsc.br</String>
  42 + </Setting>
  43 + </ConfigItem>
  44 +
  45 + <ConfigItem Name="Ticket::Frontend::InPersonTicket###DefaultOwnerID"
  46 + Required="1" Valid="1">
  47 + <Description>Default Owner ID for tickets</Description>
  48 + <Group>Ticket</Group>
  49 + <SubGroup>Frontend::Agent::InPersonTicket</SubGroup>
  50 + <Setting>
  51 + <String Regex="">1</String>
  52 + </Setting>
  53 + </ConfigItem>
  54 +
  55 + <ConfigItem Name="Ticket::Frontend::InPersonTicket###DefaultUserDomain"
  56 + Required="1" Valid="1">
  57 + <Description>Default domain for user e-mails.</Description>
  58 + <Group>Ticket</Group>
  59 + <SubGroup>Frontend::Agent::InPersonTicket</SubGroup>
  60 + <Setting>
  61 + <String Regex="">ufsc.br,grad.ufsc.br,posgrad.ufsc.br</String>
  62 + </Setting>
  63 + </ConfigItem>
  64 +
  65 + <ConfigItem Name="Ticket::Frontend::InPersonTicket###ReplyModelID"
  66 + Required="1" Valid="1">
  67 + <Description>Model to use for reply to users.</Description>
  68 + <Group>Ticket</Group>
  69 + <SubGroup>Frontend::Agent::InPersonTicket</SubGroup>
  70 + <Setting>
  71 + <String Regex="">22</String>
  72 + </Setting>
  73 + </ConfigItem>
  74 +
  75 + <ConfigItem Name="Ticket::Frontend::InPersonTicket###ReplyModelIDClosed"
  76 + Required="1" Valid="1">
  77 + <Description>Model to use for reply to users when ticket is closed.</Description>
  78 + <Group>Ticket</Group>
  79 + <SubGroup>Frontend::Agent::InPersonTicket</SubGroup>
  80 + <Setting>
  81 + <String Regex="">5</String>
  82 + </Setting>
  83 + </ConfigItem>
  84 +
  85 +</otrs_config>
0 86 \ No newline at end of file
... ...
Kernel/Language/pt_BR_InPersonTicket.pm 0 → 100644
  1 +++ a/Kernel/Language/pt_BR_InPersonTicket.pm
... ... @@ -0,0 +1,26 @@
  1 +# --
  2 +# Kernel/Modules/pt_BR_StatisticsGraphs.pm - translations for StatisticsGraphs Module
  3 +# Translations
  4 +#
  5 +# Copyright (C) 2015 (Rodrigo Goncalves) (rodrigo.g@ufsc.br)
  6 +# --
  7 +# This software comes with ABSOLUTELY NO WARRANTY. For details, see
  8 +# the enclosed file COPYING for license information (AGPL). If you
  9 +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  10 +# --
  11 +package Kernel::Language::pt_BR_InPersonTicket;
  12 +
  13 +use strict;
  14 +use warnings;
  15 +use utf8;
  16 +
  17 +sub Data {
  18 + my $Self = shift;
  19 +
  20 + $Self->{Translation}->{'Concluded'} = 'Concluído';
  21 + $Self->{Translation}->{'In person ticket'} = 'Atendimento presencial';
  22 + $Self->{Translation}->{'The ticket has been created with number:'} = 'Chamado criado com número: ';
  23 +
  24 + return 1;
  25 +}
  26 +1;
0 27 \ No newline at end of file
... ...
Kernel/Modules/InPersonTicket.pm 0 → 100644
  1 +++ a/Kernel/Modules/InPersonTicket.pm
... ... @@ -0,0 +1,320 @@
  1 +# --
  2 +# Kernel/Modules/OcurrenceControl.pm - frontend module
  3 +# Copyright (C) (2013) (Carlos Rebelato) (carlos.rebelato@grad.ufsc.br)
  4 +# --
  5 +# $Id: writing-otrs-application.xml,v 1.1 2010/08/13 08:59:28 mg Exp $
  6 +# --
  7 +# This software comes with ABSOLUTELY NO WARRANTY. For details, see
  8 +# the enclosed file COPYING for license information (AGPL). If you
  9 +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  10 +# --
  11 +# Autor: Rodrigo Gonçalves
  12 +# Data.: 18/05/2015 - Versão inicial
  13 +#
  14 +package Kernel::Modules::InPersonTicket;
  15 +
  16 +use strict;
  17 +use warnings;
  18 +use Data::Dumper;
  19 +
  20 +our @ObjectDependencies = (
  21 + "Kernel::Output::HTML::Layout",
  22 + "Kernel::System::Log",
  23 + "Kernel::System::Web::Request", # OLD ParamObject
  24 + "Kernel::System::DB",
  25 + "Kernel::Config",
  26 + "Kernel::System::CustomerUser",
  27 + "Kernel::System::Service",
  28 +);
  29 +
  30 +sub new {
  31 + my ( $Type, %Param ) = @_;
  32 +
  33 + # allocate new hash for object
  34 + my $Self = {%Param};
  35 + bless( $Self, $Type );
  36 +
  37 + return $Self;
  38 +}
  39 +
  40 +sub Run {
  41 + my ( $Self, %Param ) = @_;
  42 + my %Data = ();
  43 +
  44 + my $layoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
  45 + my $paramObject = $Kernel::OM->Get("Kernel::System::Web::Request");
  46 + my $dbObject = $Kernel::OM->Get("Kernel::System::DB");
  47 + my $serviceObject = $Kernel::OM->Get("Kernel::System::Service");
  48 +
  49 + $Self->BuildServiceBlock();
  50 +
  51 + if ( $paramObject->GetParam( Param => "Subaction" ) && ($paramObject->GetParam( Param => "Subaction" ) eq "GetUserName") ) {
  52 + my $content = $Self->GetUserName(UserID => $paramObject->GetParam( Param => "UserID" ));
  53 +
  54 + return $layoutObject->Attachment(
  55 + ContentType => 'application/text; charset=' . $layoutObject->{Charset},
  56 + Content => $content,
  57 + Type => 'inline',
  58 + NoCache => 1,
  59 + );
  60 + } elsif ( $paramObject->GetParam( Param => "Subaction" ) && ($paramObject->GetParam( Param => "Subaction" ) eq "Add") ) {
  61 + return $Self->CreateTicket();
  62 + }
  63 +
  64 +
  65 + my $Output = $layoutObject->Header( Title => "In person ticket" );
  66 + $Output .= $layoutObject->NavigationBar();
  67 + $Output .= $layoutObject->Output(
  68 + TemplateFile => 'InPersonTicket'
  69 + );
  70 +
  71 + $Output .= $layoutObject->Footer();
  72 + return $Output;
  73 +
  74 + return $Output;
  75 +
  76 +}
  77 +
  78 +sub GetUserName {
  79 + my ( $Self, %Param ) = @_;
  80 +
  81 + my $userObject = $Kernel::OM->Get("Kernel::System::CustomerUser");
  82 + my %dados = $userObject->CustomerUserDataGet(User => $Param{"UserID"});
  83 +
  84 + if (%dados) {
  85 + return $dados{UserFirstname};
  86 + } else {
  87 + return "";
  88 + }
  89 +
  90 +}
  91 +
  92 +sub BuildServiceBlock {
  93 + my ( $Self, %Param ) = @_;
  94 +
  95 + my $layoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
  96 + my $paramObject = $Kernel::OM->Get("Kernel::System::Web::Request");
  97 + my $dbObject = $Kernel::OM->Get("Kernel::System::DB");
  98 + my $ocurrenceObject = $Kernel::OM->Get("Kernel::System::Ocurrence");
  99 + my $serviceObject = $Kernel::OM->Get("Kernel::System::Service");
  100 + my $serviceResponsibility = $Kernel::OM->Get("Kernel::System::ServiceResponsibility");
  101 +
  102 + my $services = $serviceObject->ServiceListGet( Valid => 1, UserID => 1);
  103 + my @services = @$services;
  104 + @services = sort {$a->{Name} cmp $b->{Name}} @services;
  105 +
  106 + foreach my $service (@services) {
  107 + $layoutObject->Block(
  108 + Name => 'selectService',
  109 + Data => {
  110 + ServiceID => $service->{ServiceID},
  111 + ServiceName => $Self->GetServiceName(Services => \@services, ServiceID => $service->{ServiceID}, ServiceName => $service->{Name}),
  112 + Disabled => $Self->LeafService(Services => \@services, ServiceID => $service->{ServiceID}) ? "" : "disabled"
  113 + }
  114 + );
  115 + }
  116 +}
  117 +
  118 +sub GetServiceName {
  119 + my ( $Self, %Param ) = @_;
  120 +
  121 + if ($Self->LeafService(%Param)) {
  122 + my @tokens = split("::", $Param{ServiceName});
  123 + return "&nbsp;&nbsp;" x (@tokens - 1) . @tokens[@tokens - 1];
  124 + } else {
  125 + return $Param{ServiceName};
  126 + }
  127 +}
  128 +
  129 +sub LeafService {
  130 + my ( $Self, %Param ) = @_;
  131 +
  132 + my $services = $Param{Services};
  133 + my @services = @$services;
  134 + my $serviceID = $Param{ServiceID};
  135 +
  136 + foreach my $service (@services) {
  137 + if ((exists $service->{ParentID}) && ($service->{ParentID} == $serviceID)) {
  138 + return 0;
  139 + }
  140 + }
  141 +
  142 + return 1;
  143 +}
  144 +
  145 +sub GetQueueID() {
  146 + my ( $Self, %Param ) = @_;
  147 +
  148 + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request");
  149 + my $QueueObject = $Kernel::OM->Get("Kernel::System::Queue");
  150 + my $ConfigObject = $Kernel::OM->Get("Kernel::Config");
  151 +
  152 + # Gets default Queue
  153 + my $ConfigTicket = $ConfigObject->Get("Ticket::Frontend::CustomerTicketMessage");
  154 +
  155 + my $QueueDefault = $ConfigTicket->{"QueueDefault"};
  156 +
  157 + # Checks if there is a field for the queue
  158 + my %QueueListID = $QueueObject->QueueList( Valid => 1 );
  159 + my %QueueList = reverse $QueueObject->QueueList( Valid => 1 );
  160 + my $QueueID = $QueueList{$QueueDefault};
  161 + my $Queue = $QueueListID{$QueueID};
  162 +
  163 + return ( $Queue, $QueueID );
  164 +}
  165 +
  166 +sub CreateTicket {
  167 + my ( $Self, %Param ) = @_;
  168 + my %Data = ();
  169 +
  170 + my $TicketObject = $Kernel::OM->Get("Kernel::System::Ticket");
  171 + my $ConfigObject = $Kernel::OM->Get("Kernel::Config");
  172 + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request");
  173 + my $BackendObject = $Kernel::OM->Get("Kernel::System::DynamicField::Backend");
  174 + my $DynamicFieldObject = $Kernel::OM->Get("Kernel::System::DynamicField");
  175 + my $CustomerUserObject = $Kernel::OM->Get("Kernel::System::CustomerUser");
  176 + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
  177 +
  178 + # Queue
  179 + my ( $Queue, $QueueID ) = $Self->GetQueueID(%Param);
  180 + $Data{QueueID} = $QueueID;
  181 + my $email = $ParamObject->GetParam( Param => "userID" );
  182 +
  183 + $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::CustomerTicketMessage");
  184 +
  185 + $Self->{ConfigModule} = $ConfigObject->Get("Ticket::Frontend::InPersonTicket");
  186 +
  187 + my $TicketID = $TicketObject->TicketCreate(
  188 + Title => "Atendimento presencial",
  189 + QueueID => $QueueID,
  190 + Priority => $Self->{Config}->{PriorityDefault},
  191 + Lock => 'unlock',
  192 + State => ($ParamObject->GetParam(Param => "concluded") ? 'closed successful' : 'new'),
  193 + ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
  194 + TypeID => $Self->{ConfigModule}->{TypeID},
  195 + CustomerID => $Self->GetUserIDFromEmail( EMail => $email, DefaultUserDomain => $Self->{ConfigModule}->{DefaultUserDomain}, DefaultCustomerID => $Self->{ConfigModule}->{DefaultCustomerID}),
  196 + CustomerUser => $Self->GetUserIDFromEmail( EMail => $email, DefaultUserDomain => $Self->{ConfigModule}->{DefaultUserDomain}, DefaultCustomerID => $Self->{ConfigModule}->{DefaultCustomerID}),
  197 + OwnerID => $Self->{ConfigModule}->{DefaultOwnerID},
  198 + UserID => $Self->{ConfigModule}->{DefaultOwnerID},
  199 + );
  200 +
  201 + my $MimeType = 'text/plain';
  202 +
  203 + # Create article
  204 + my $FullName = $ParamObject->GetParam( Param => "UserName" );
  205 +
  206 + my $From = "\"$FullName\" <$email>";
  207 + my $ArticleID = $TicketObject->ArticleCreate(
  208 + TicketID => $TicketID,
  209 + ArticleType => 'phone',
  210 + SenderType => 'customer',
  211 + From => $email,
  212 + To => $Queue,
  213 + Subject => "Registro de atendimento",
  214 + Body => $ParamObject->GetParam( Param => "Description" ),
  215 + MimeType => $MimeType,
  216 + Charset => $LayoutObject->{UserCharset},
  217 + UserID => $Self->{ConfigModule}->{DefaultOwnerID},
  218 + HistoryType => $Self->{Config}->{HistoryType},
  219 + HistoryComment => $Self->{Config}->{HistoryComment} || '%%',
  220 + AutoResponseType => '',
  221 + OrigHeader => {
  222 + From => $From,
  223 + To => $Queue,
  224 + Subject => "Registro de atendimento",
  225 + Body => $ParamObject->GetParam( Param => "Description" ),
  226 + },
  227 + Queue => $Queue,
  228 + );
  229 +
  230 + my $ReplyUser = $Kernel::OM->Get('Kernel::System::TemplateGenerator')->Template(
  231 + TemplateID => ($ParamObject->GetParam(Param => "concluded") ? $Self->{ConfigModule}->{ReplyModelIDClosed} : $Self->{ConfigModule}->{ReplyModelID}),
  232 + TicketID => $TicketID,
  233 + UserID => $Self->{ConfigModule}->{DefaultOwnerID},
  234 + );
  235 +
  236 + my $corpo = $ParamObject->GetParam( Param => "Description" );
  237 + $ReplyUser =~ s/CONTEUDO/$corpo/g;
  238 +
  239 + my %sysAddr = $Kernel::OM->Get('Kernel::System::SystemAddress')->SystemAddressGet(ID => 1);
  240 +
  241 + my $FromSystem = $sysAddr{Name};
  242 +
  243 + $MimeType = 'text/html';
  244 +
  245 + $ArticleID = $TicketObject->ArticleSend(
  246 + TicketID => $TicketID,
  247 + ArticleType => 'note-internal', # email-external|email-internal|phone|fax|...
  248 + SenderType => 'agent', # agent|system|customer
  249 + From => $FromSystem,
  250 + To => $email, # not required but useful
  251 + Subject => 'Registro de atendimento', # required
  252 + Body => $ReplyUser, # required
  253 + Charset => $LayoutObject->{UserCharset},
  254 + MimeType => $MimeType,
  255 + Loop => 0, # 1|0 used for bulk emails
  256 + HistoryType => 'AddNote', # Move|AddNote|PriorityUpdate|WebRequestCustomer|...
  257 + HistoryComment => 'Auto-reply ao usuário',
  258 + NoAgentNotify => 0, # if you don't want to send agent notifications
  259 + UserID => $Self->{ConfigModule}->{DefaultOwnerID},
  260 + );
  261 +
  262 + $Data{TicketNumber} = $TicketObject->TicketNumberLookup( TicketID => $TicketID );
  263 +
  264 + # build output
  265 + my $Output = $LayoutObject->Header( Title => "In person ticket" );
  266 + my %BlockData = ();
  267 + $BlockData{TicketNumber} = '<a href="/otrs/index.pl?Action=AgentTicketZoom;TicketID=' . $TicketID . '">' . $Data{TicketNumber} . '</a>';
  268 + $LayoutObject->Block(
  269 + Name => 'NewTicketCreated',
  270 + Data => \%BlockData
  271 + );
  272 +
  273 + $Output .= $LayoutObject->NavigationBar();
  274 + $Output .= $LayoutObject->Output(
  275 + Data => \%Data,
  276 + TemplateFile => 'InPersonTicketCreated',
  277 + );
  278 + $Output .= $LayoutObject->Footer();
  279 + return $Output;
  280 +}
  281 +
  282 +
  283 +sub GetUserIDFromEmail {
  284 + my ( $Self, %Param ) = @_;
  285 +
  286 + my $email = $Param{EMail};
  287 + my $result = $Param{DefaultCustomerID};
  288 + my $domainList = $Param{DefaultUserDomain};
  289 +
  290 + if (index($email, '@') == -1) {
  291 + return $email;
  292 + }
  293 +
  294 + my $CustomerUserObject = $Kernel::OM->Get("Kernel::System::CustomerUser");
  295 +
  296 + if ($domainList) {
  297 + my @domains = split( ",", $domainList );
  298 +
  299 + for my $domain (@domains) {
  300 + my @parts = split( "@", $email );
  301 + if ( $parts[1] eq $domain ) {
  302 + my $id = $parts[0];
  303 + my %List = $CustomerUserObject->CustomerSearch(
  304 + UserLogin => $id,
  305 + Valid => 1, # not required, default 1
  306 + );
  307 + if ( keys %List ) {
  308 + $result = $id;
  309 + return $result;
  310 + }
  311 + }
  312 + }
  313 + }
  314 +
  315 + return $result;
  316 +}
  317 +
  318 +
  319 +
  320 +1;
... ...
Kernel/Output/HTML/Templates/Standard/InPersonTicket.tt 0 → 100644
  1 +++ a/Kernel/Output/HTML/Templates/Standard/InPersonTicket.tt
... ... @@ -0,0 +1,128 @@
  1 +# --
  2 +# Kernel/Output/HTML/Standard/EditOcurrence.tt - overview
  3 +# Copyright (C) (2014) (Carlos Rebelatto) (carlos.rebelatto@grad.ufsc.br)
  4 +# --
  5 +# $Id: writing-otrs-application.xml,v 1.1 2010/08/13 08:59:28 mg Exp $
  6 +# --
  7 +# This software comes with ABSOLUTELY NO WARRANTY. For details, see
  8 +# the enclosed file COPYING for license information (AGPL). If you
  9 +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  10 +# --
  11 +<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
  12 +
  13 + <h1>[% Translate("In person ticket") | html %]</h1>
  14 +
  15 +
  16 + <div class="ContentColumn">
  17 + <div class="WidgetSimple">
  18 + <div class="Header">
  19 + <h2>[% Translate("New ticket") | html %]</h2>
  20 + </div>
  21 +
  22 + [% RenderBlockStart("NewTicketCreated") %]
  23 + <div class="Header">
  24 + <h2 style="text-align: right; font-weight: bolder; font-size: larger; color: red">[% Translate("The ticket has been created with number:") | html %][% Data.TicketNumber %]
  25 + </div>
  26 + [% RenderBlockEnd("NewTicketCreated") %]
  27 +
  28 +
  29 + <div class="Content SpacingBottom ">
  30 +
  31 + <form action="[% Env("CGIHandle") %]" method="post" enctype="multipart/form-data" name="compose" id="InPersonTicket" class="Validate PreventMultipleSubmits">
  32 +
  33 + <input type="hidden" name="Action" value="[% Env("Action") %]"/>
  34 + <input type="hidden" name="Subaction" value="Add"/>
  35 +
  36 + <fieldset class="TableLike">
  37 + <label for="userID" class="Mandatory"><span class="Marker">*</span> [% Translate("E-mail") | html %]:</label>
  38 + <input class="Validate_Required" type="text" name="userID" id="userID" style="margin-left: 10px; width: 400px" />
  39 + <div class="Clear"></div>
  40 +
  41 + <label for="UserName" class="Mandatory"><span class="Marker">*</span> [% Translate("Nome") | html %]:</label>
  42 + <input class="Validate_Required" type="text" name="UserName" id="UserName" style="margin-left: 10px; width: 400px" />
  43 + <div class="Clear"></div>
  44 +
  45 + <label for="SelectService" class="Mandatory"><span class="Marker">*</span> [% Translate("Serviço") | html %]:</label>
  46 + <select class="Validate_Required" style="margin-left: 10px" name="ServiceID" id="SelectService">
  47 + <option selected disabled value="0">[% Translate("Select a service") | html %]</option>
  48 + [% RenderBlockStart("selectService") %]
  49 + <option [% Data.Disabled %] value="[% Data.ServiceID | html %]">[% Data.ServiceName %]</option>
  50 + [% RenderBlockEnd("selectService") %]
  51 + </select>
  52 + <div class="Clear"></div>
  53 +
  54 + <label class="OtherMandatory" for="RichTextDescription"><span class="Marker">*</span> [% Translate("Description") | html %]:</label>
  55 + <div id="RichTextField" class="RichTextField" >
  56 +
  57 + [% RenderBlockStart("RichText") %]
  58 + [% InsertTemplate("RichTextEditor.tt") %]
  59 + [% RenderBlockEnd("RichText") %]
  60 +
  61 + <textarea style="width: 800px; height: 200px" id="RichTextDescription" class="RichText Validate_Required [% Data.BodyInvalid | html %]" name="Description" title="Description">[% Data.Description %]</textarea>
  62 + <div id="RichTextError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
  63 + <div id="RichTextServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
  64 +
  65 + <div style="display: block; padding: 5px; border-style: solid; border-color: black; border-width: 1px">
  66 + Atalhos:
  67 + <button type="button" onclick="javascript:modeloServicoConfigurado()">Serviço configurado</button>
  68 + </div>
  69 + </div>
  70 + <div class="Clear"></div>
  71 +
  72 + <label for="UserId" class="Mandatory"><span class="Marker">*</span> [% Translate("Concluded") | html %]:</label>
  73 + <input type="checkbox" name="concluded" id="concluded" checked />
  74 + <div class="Clear"></div>
  75 +
  76 +
  77 + <input id='Cadastro' type='submit' value='Registrar chamado' style="margin-left: 40%; font-weight: bolder; font-size: x-larger"/>
  78 + </fieldset>
  79 + </div>
  80 + </form>
  81 + </div>
  82 + </div>
  83 + </div>
  84 +</div>
  85 +
  86 +<script type="text/javascript" >
  87 +
  88 +function modeloServicoConfigurado() {
  89 + $("#RichTextDescription").val("O serviço foi ativado e/ou configurado no equipamento do usuário. Foram efetuados testes com sucesso.");
  90 + return false;
  91 +}
  92 +
  93 +
  94 +
  95 +function dealEmail(email) {
  96 +
  97 + var arr = email.split("@");
  98 + if (arr[0]) {
  99 +
  100 + var url = "/otrs/index.pl?Action=InPersonTicket;Subaction=GetUserName;UserID=" + arr[0];
  101 +
  102 + $.get(url, function(data) {
  103 + $("#UserName").val(data);
  104 + if (data) {
  105 + $("#SelectService").focus();
  106 + }
  107 +
  108 +
  109 + }).fail(function(jqXHR, textStatus, errorThrown) {
  110 + alert(textStatus);
  111 + });
  112 + }
  113 +
  114 +
  115 +}
  116 +
  117 +</script>
  118 +
  119 +
  120 +[% WRAPPER JSOnDocumentComplete %]
  121 +$("#SelectService").val([% Data.ServiceID %]);
  122 +
  123 +$("#userID").blur(function() {
  124 + dealEmail($("#userID").val());
  125 +});
  126 +
  127 +[% END %]
  128 +
... ...
Kernel/Output/HTML/Templates/Standard/InPersonTicketCreated.tt 0 → 100644
  1 +++ a/Kernel/Output/HTML/Templates/Standard/InPersonTicketCreated.tt
... ... @@ -0,0 +1,31 @@
  1 +# --
  2 +# Kernel/Output/HTML/Standard/EditOcurrence.tt - overview
  3 +# Copyright (C) (2014) (Carlos Rebelatto) (carlos.rebelatto@grad.ufsc.br)
  4 +# --
  5 +# $Id: writing-otrs-application.xml,v 1.1 2010/08/13 08:59:28 mg Exp $
  6 +# --
  7 +# This software comes with ABSOLUTELY NO WARRANTY. For details, see
  8 +# the enclosed file COPYING for license information (AGPL). If you
  9 +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  10 +# --
  11 +<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
  12 +
  13 + <h1>[% Translate("In person ticket") | html %]</h1>
  14 +
  15 +
  16 + <div class="ContentColumn">
  17 + <div class="WidgetSimple">
  18 + <div class="Header">
  19 + <h2>[% Translate("New ticket") | html %]</h2>
  20 + </div>
  21 +
  22 + [% RenderBlockStart("NewTicketCreated") %]
  23 + <div class="Header">
  24 + <h2 style="text-align: center; font-weight: bolder; font-size: x-larger; color: red">[% Translate("The ticket has been created with number:") | html %][% Data.TicketNumber %]
  25 + </div>
  26 + [% RenderBlockEnd("NewTicketCreated") %]
  27 +
  28 + </div>
  29 + </div>
  30 +</div>
  31 +
... ...