Commit 058af795ef8a831e8238e8af35c6086d2dadc8a6
1 parent
f2dd7d80
Exists in
master
Ajustes para poder colocar unidade no esquema do servico
Showing
4 changed files
with
10 additions
and
12 deletions
Show diff stats
Kernel/Modules/NewTicketWizard.pm
@@ -320,7 +320,6 @@ sub GetForm { | @@ -320,7 +320,6 @@ sub GetForm { | ||
320 | Options => $fields, | 320 | Options => $fields, |
321 | UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID') | 321 | UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID') |
322 | ); | 322 | ); |
323 | - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | ||
324 | 323 | ||
325 | if ( !$Param{ServiceForm} ) { | 324 | if ( !$Param{ServiceForm} ) { |
326 | $schema =~ s/CF_SCHEMA//g; | 325 | $schema =~ s/CF_SCHEMA//g; |
@@ -343,11 +342,12 @@ sub GetForm { | @@ -343,11 +342,12 @@ sub GetForm { | ||
343 | } | 342 | } |
344 | } | 343 | } |
345 | 344 | ||
345 | + # Incluir campos dinâmicos no replace | ||
346 | + ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | ||
347 | + | ||
346 | if ( $Param{"QueueID"} ) { | 348 | if ( $Param{"QueueID"} ) { |
347 | $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; | 349 | $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; |
348 | $fields = $fields . ",\n\"QueueID\": {\n\"type\": \"hidden\"\n}"; | 350 | $fields = $fields . ",\n\"QueueID\": {\n\"type\": \"hidden\"\n}"; |
349 | - print STDERR "schema = \n\n" . $schema . "\n\n fields = \n\n" . $fields; | ||
350 | - | ||
351 | } | 351 | } |
352 | 352 | ||
353 | return ( $schema, $fields, $introduction ); | 353 | return ( $schema, $fields, $introduction ); |
Kernel/Modules/NewTicketWizardPublic.pm
@@ -227,8 +227,7 @@ sub GetForm { | @@ -227,8 +227,7 @@ sub GetForm { | ||
227 | Options => $fields, | 227 | Options => $fields, |
228 | UserID => $Self->{DefaultUserID} | 228 | UserID => $Self->{DefaultUserID} |
229 | ); | 229 | ); |
230 | - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | ||
231 | - | 230 | + |
232 | if ( !$Param{ServiceForm} ) { | 231 | if ( !$Param{ServiceForm} ) { |
233 | $schema =~ s/CF_SCHEMA//g; | 232 | $schema =~ s/CF_SCHEMA//g; |
234 | $fields =~ s/CF_FORM//g; | 233 | $fields =~ s/CF_FORM//g; |
@@ -250,10 +249,12 @@ sub GetForm { | @@ -250,10 +249,12 @@ sub GetForm { | ||
250 | } | 249 | } |
251 | } | 250 | } |
252 | 251 | ||
252 | + # Incluir campos dinâmicos no replace | ||
253 | + ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | ||
254 | + | ||
253 | if ($Param{"QueueID"}) { | 255 | if ($Param{"QueueID"}) { |
254 | $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; | 256 | $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; |
255 | $fields = $fields . ",\n\"QueueID\": {\n\"type\": \"hidden\"\n}"; | 257 | $fields = $fields . ",\n\"QueueID\": {\n\"type\": \"hidden\"\n}"; |
256 | - print STDERR "schema = \n\n" . $schema . "\n\n fields = \n\n" . $fields; | ||
257 | } | 258 | } |
258 | 259 | ||
259 | return ( $schema, $fields, $introduction ); | 260 | return ( $schema, $fields, $introduction ); |
@@ -367,8 +368,7 @@ sub CreateTicket { | @@ -367,8 +368,7 @@ sub CreateTicket { | ||
367 | ServiceID => $Self->{ParamObject}->GetParam( Param => "service" ), | 368 | ServiceID => $Self->{ParamObject}->GetParam( Param => "service" ), |
368 | TypeID => $Self->{ParamObject}->GetParam( Param => "type" ), | 369 | TypeID => $Self->{ParamObject}->GetParam( Param => "type" ), |
369 | CustomerID => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), | 370 | CustomerID => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), |
370 | - | ||
371 | - #CustomerUser => $Self->{UserLogin}, | 371 | + CustomerUser => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), |
372 | OwnerID => $Self->{DefaultUserID}, | 372 | OwnerID => $Self->{DefaultUserID}, |
373 | UserID => $Self->{DefaultUserID}, | 373 | UserID => $Self->{DefaultUserID}, |
374 | ); | 374 | ); |
Kernel/System/TicketWizard.pm
@@ -175,14 +175,12 @@ sub ReplaceOTRSDynamicFields { | @@ -175,14 +175,12 @@ sub ReplaceOTRSDynamicFields { | ||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | - #Debug("schema", $schema); | ||
179 | - #Debug("options", $options); | ||
180 | return ( $schema, $options ); | 178 | return ( $schema, $options ); |
181 | } | 179 | } |
182 | 180 | ||
183 | sub Debug { | 181 | sub Debug { |
184 | my ( $id, $value ) = @_; | 182 | my ( $id, $value ) = @_; |
185 | - ###print STDERR "\n\n $id =" . Dumper($value) . "\n"; | 183 | + print STDERR "\n\n $id =" . Dumper($value) . "\n"; |
186 | } | 184 | } |
187 | 185 | ||
188 | sub GetDynamicFieldValues { | 186 | sub GetDynamicFieldValues { |
NewTicketWizard.sopm
1 | <?xml version="1.0" encoding="utf-8" ?> | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | <otrs_package version="1.0"> | 2 | <otrs_package version="1.0"> |
3 | <Name>NewTicketWizard</Name> | 3 | <Name>NewTicketWizard</Name> |
4 | - <Version>1.2.9</Version> | 4 | + <Version>1.2.10</Version> |
5 | <Framework>3.x.x</Framework> | 5 | <Framework>3.x.x</Framework> |
6 | <Vendor>SeTIC</Vendor> | 6 | <Vendor>SeTIC</Vendor> |
7 | <URL>http://www.setic.ufsc.br</URL> | 7 | <URL>http://www.setic.ufsc.br</URL> |