From 058af795ef8a831e8238e8af35c6086d2dadc8a6 Mon Sep 17 00:00:00 2001 From: Rodrigo Goncalves Date: Wed, 4 Jun 2014 18:17:49 -0300 Subject: [PATCH] Ajustes para poder colocar unidade no esquema do servico --- Kernel/Modules/NewTicketWizard.pm | 6 +++--- Kernel/Modules/NewTicketWizardPublic.pm | 10 +++++----- Kernel/System/TicketWizard.pm | 4 +--- NewTicketWizard.sopm | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Kernel/Modules/NewTicketWizard.pm b/Kernel/Modules/NewTicketWizard.pm index aa78a80..4c3968a 100644 --- a/Kernel/Modules/NewTicketWizard.pm +++ b/Kernel/Modules/NewTicketWizard.pm @@ -320,7 +320,6 @@ sub GetForm { Options => $fields, UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID') ); - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); if ( !$Param{ServiceForm} ) { $schema =~ s/CF_SCHEMA//g; @@ -343,11 +342,12 @@ sub GetForm { } } + # Incluir campos dinĂ¢micos no replace + ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); + if ( $Param{"QueueID"} ) { $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; $fields = $fields . ",\n\"QueueID\": {\n\"type\": \"hidden\"\n}"; - print STDERR "schema = \n\n" . $schema . "\n\n fields = \n\n" . $fields; - } return ( $schema, $fields, $introduction ); diff --git a/Kernel/Modules/NewTicketWizardPublic.pm b/Kernel/Modules/NewTicketWizardPublic.pm index 68e0d92..7442bb5 100644 --- a/Kernel/Modules/NewTicketWizardPublic.pm +++ b/Kernel/Modules/NewTicketWizardPublic.pm @@ -227,8 +227,7 @@ sub GetForm { Options => $fields, UserID => $Self->{DefaultUserID} ); - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); - + if ( !$Param{ServiceForm} ) { $schema =~ s/CF_SCHEMA//g; $fields =~ s/CF_FORM//g; @@ -250,10 +249,12 @@ sub GetForm { } } + # Incluir campos dinĂ¢micos no replace + ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); + if ($Param{"QueueID"}) { $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; $fields = $fields . ",\n\"QueueID\": {\n\"type\": \"hidden\"\n}"; - print STDERR "schema = \n\n" . $schema . "\n\n fields = \n\n" . $fields; } return ( $schema, $fields, $introduction ); @@ -367,8 +368,7 @@ sub CreateTicket { ServiceID => $Self->{ParamObject}->GetParam( Param => "service" ), TypeID => $Self->{ParamObject}->GetParam( Param => "type" ), CustomerID => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), - - #CustomerUser => $Self->{UserLogin}, + CustomerUser => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), OwnerID => $Self->{DefaultUserID}, UserID => $Self->{DefaultUserID}, ); diff --git a/Kernel/System/TicketWizard.pm b/Kernel/System/TicketWizard.pm index 9b1cb6e..d667df8 100644 --- a/Kernel/System/TicketWizard.pm +++ b/Kernel/System/TicketWizard.pm @@ -175,14 +175,12 @@ sub ReplaceOTRSDynamicFields { } } - #Debug("schema", $schema); - #Debug("options", $options); return ( $schema, $options ); } sub Debug { my ( $id, $value ) = @_; - ###print STDERR "\n\n $id =" . Dumper($value) . "\n"; + print STDERR "\n\n $id =" . Dumper($value) . "\n"; } sub GetDynamicFieldValues { diff --git a/NewTicketWizard.sopm b/NewTicketWizard.sopm index 4a02062..b591bf6 100755 --- a/NewTicketWizard.sopm +++ b/NewTicketWizard.sopm @@ -1,7 +1,7 @@ NewTicketWizard - 1.2.9 + 1.2.10 3.x.x SeTIC http://www.setic.ufsc.br -- libgit2 0.21.2