Commit f4f161f0120290b015002e0800e0634e918070de
1 parent
acde0527
Exists in
master
Suporte para OTRS 4.0.3. Separacao do modulo QueuesPanel.
Showing
34 changed files
with
733 additions
and
1661 deletions
Show diff stats
Kernel/Config/Files/NewTicketWizard.xml
1 | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
2 | -<otrs_config init="Application" | |
3 | - version="1.0"> | |
4 | - <!-- TODO: Transformar em módulo de usuário também --> | |
2 | +<otrs_config init="Application" version="1.0"> | |
5 | 3 | <ConfigItem Name="CustomerFrontend::Module###NewTicketWizard" Required="0" Valid="1"> |
6 | - <Description Translatable="1">FrontendModuleRegistration for NewTicketWizard module.</Description> | |
4 | + <Description>Frontend module registration for the customer interface.</Description> | |
7 | 5 | <Group>Ticket</Group> |
8 | 6 | <SubGroup>Frontend::Customer::ModuleRegistration</SubGroup> |
9 | 7 | <Setting> |
... | ... | @@ -11,19 +9,17 @@ |
11 | 9 | <Description>Module for creating custom new ticket interfaces</Description> |
12 | 10 | <NavBarName>NewTicketWizard</NavBarName> |
13 | 11 | <NavBar> |
14 | - <Description Translatable="1">New ticket wizard</Description> | |
15 | - <Name Translatable="1">New ticket</Name> | |
12 | + <Description>New ticket wizard</Description> | |
13 | + <Name>New ticket</Name> | |
16 | 14 | <Link>Action=NewTicketWizard</Link> |
17 | 15 | <NavBar>NewTicketWizard</NavBar> |
18 | 16 | <Type>Menu</Type> |
19 | 17 | <Prio>8400</Prio> |
20 | 18 | </NavBar> |
21 | - <!-- Carrega o alpaca --> | |
19 | + <!-- AlpacaJS --> | |
22 | 20 | <Loader> |
23 | 21 | <JavaScript>NewTicketWizard.js</JavaScript> |
24 | 22 | <JavaScript>thirdparty/alpaca/alpaca-full.min.js</JavaScript> |
25 | - <JavaScript>thirdparty/jquery-ui-1.10.3/jquery-ui.js</JavaScript> | |
26 | - <JavaScript>thirdparty/jquery-validate-1.11.1/jquery.validate.js</JavaScript> | |
27 | 23 | <CSS>alpaca/alpaca-newticketwizard.css</CSS> |
28 | 24 | <CSS>alpaca/alpaca-jqueryui-newticketwizard.css</CSS> |
29 | 25 | </Loader> |
... | ... | @@ -32,19 +28,19 @@ |
32 | 28 | </ConfigItem> |
33 | 29 | |
34 | 30 | <ConfigItem Name="Frontend::Module###NewTicketWizardServiceForm" Required="0" Valid="1"> |
35 | - <Description Translatable="1">Frontend module registration for the agent interface.</Description> | |
31 | + <Description>Frontend module registration for the agent interface.</Description> | |
36 | 32 | <Group>Ticket</Group> |
37 | 33 | <SubGroup>Frontend::Admin::ModuleRegistration</SubGroup> |
38 | 34 | <Setting> |
39 | 35 | <FrontendModuleReg> |
40 | 36 | <Group>admin</Group> |
41 | 37 | <Description>Admin</Description> |
42 | - <Title Translatable="1">Service forms</Title> | |
38 | + <Title>Service forms</Title> | |
43 | 39 | <NavBarName>Admin</NavBarName> |
44 | 40 | <NavBarModule> |
45 | 41 | <Module>Kernel::Output::HTML::NavBarModuleAdmin</Module> |
46 | - <Name Translatable="1">Service forms</Name> | |
47 | - <Description Translatable="1">Create and manage service forms.</Description> | |
42 | + <Name>Service forms</Name> | |
43 | + <Description>Create and manage service forms.</Description> | |
48 | 44 | <Block>Ticket</Block> |
49 | 45 | <Prio>900</Prio> |
50 | 46 | </NavBarModule> |
... | ... | @@ -54,10 +50,7 @@ |
54 | 50 | |
55 | 51 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###BasicSchema" |
56 | 52 | Required="0" Valid="1"> |
57 | - <Description Lang="en">Describe the form basic schema. See documentation for examples.</Description> | |
58 | - <Description Lang="pt_BR"> | |
59 | - Descreva o esquema básico do formulário. Veja a documentação para maiores detalhes. | |
60 | - </Description> | |
53 | + <Description>Describe the form basic schema. See documentation for examples.</Description> | |
61 | 54 | <Group>Ticket</Group> |
62 | 55 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
63 | 56 | <Setting> |
... | ... | @@ -116,10 +109,7 @@ |
116 | 109 | |
117 | 110 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###BasicForm" |
118 | 111 | Required="0" Valid="1"> |
119 | - <Description Lang="en">Describe the form basic fields. See documentation for examples.</Description> | |
120 | - <Description Lang="pt_BR"> | |
121 | - Descreva os campos básicos do formulário. Veja a documentação para maiores detalhes. | |
122 | - </Description> | |
112 | + <Description>Describe the form basic fields. See documentation for examples.</Description> | |
123 | 113 | <Group>Ticket</Group> |
124 | 114 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
125 | 115 | <Setting> |
... | ... | @@ -178,10 +168,7 @@ |
178 | 168 | |
179 | 169 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###QueuePrefix" |
180 | 170 | Required="0" Valid="1"> |
181 | - <Description Lang="en">When the queue comes from a field in the form, a prefix can be attached to the value while searching for the queue. A space is added between this and the queue name.</Description> | |
182 | - <Description Lang="pt_BR"> | |
183 | - Prefixo para ser anexado ao valor do campo que tem a fila para enviar o chamado. Um espaço é adicionado entre o prefixo e o valor o campo. | |
184 | - </Description> | |
171 | + <Description>When the queue comes from a field in the form, a prefix can be attached to the value while searching for the queue. A space is added between this and the queue name.</Description> | |
185 | 172 | <Group>Ticket</Group> |
186 | 173 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
187 | 174 | <Setting> |
... | ... | @@ -191,8 +178,7 @@ |
191 | 178 | |
192 | 179 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###QueueField" |
193 | 180 | Required="0" Valid="1"> |
194 | - <Description Lang="en">Name of the field in the form which indicates the queue to send the form.</Description> | |
195 | - <Description Lang="pt_BR">Nome do campo no formulário que indica para qual fila enviar o chamado.</Description> | |
181 | + <Description>Name of the field in the form which indicates the queue to send the ticket.</Description> | |
196 | 182 | <Group>Ticket</Group> |
197 | 183 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
198 | 184 | <Setting> |
... | ... | @@ -202,8 +188,7 @@ |
202 | 188 | |
203 | 189 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###MessageChooseService" |
204 | 190 | Required="0" Valid="1"> |
205 | - <Description Lang="en">Message to let the user choose a server.</Description> | |
206 | - <Description Lang="pt_BR">Mensagem para o usuário selecionar um serviço.</Description> | |
191 | + <Description>Message to let the user choose a service.</Description> | |
207 | 192 | <Group>Ticket</Group> |
208 | 193 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
209 | 194 | <Setting> |
... | ... | @@ -213,8 +198,7 @@ |
213 | 198 | |
214 | 199 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###MessageChooseServicePublic" |
215 | 200 | Required="0" Valid="1"> |
216 | - <Description Lang="en">Message to let the user choose a server.</Description> | |
217 | - <Description Lang="pt_BR">Mensagem para o usuário selecionar um serviço.</Description> | |
201 | + <Description>Message to let the user choose a service.</Description> | |
218 | 202 | <Group>Ticket</Group> |
219 | 203 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
220 | 204 | <Setting> |
... | ... | @@ -225,8 +209,7 @@ |
225 | 209 | |
226 | 210 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###DefaultCustomerID" |
227 | 211 | Required="1" Valid="1"> |
228 | - <Description Lang="en">Customer ID to use when public ticket is created.</Description> | |
229 | - <Description Lang="pt_BR">ID de usuario a utilizar quando um ticket publico é criado.</Description> | |
212 | + <Description>Customer ID to use when public ticket is created.</Description> | |
230 | 213 | <Group>Ticket</Group> |
231 | 214 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
232 | 215 | <Setting> |
... | ... | @@ -236,8 +219,7 @@ |
236 | 219 | |
237 | 220 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###DefaultUserID" |
238 | 221 | Required="1" Valid="1"> |
239 | - <Description Lang="en">Default agent for tickets.</Description> | |
240 | - <Description Lang="pt_BR">Usuário padrão para tickets.</Description> | |
222 | + <Description>Default agent for tickets.</Description> | |
241 | 223 | <Group>Ticket</Group> |
242 | 224 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
243 | 225 | <Setting> |
... | ... | @@ -247,19 +229,16 @@ |
247 | 229 | |
248 | 230 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###DefaultUserDomain" |
249 | 231 | Required="1" Valid="1"> |
250 | - <Description Lang="en">Default domain for user e-mails.</Description> | |
251 | - <Description Lang="pt_BR">Domínio padrão para e-mails de usuários.</Description> | |
232 | + <Description>Default domain for user e-mails.</Description> | |
252 | 233 | <Group>Ticket</Group> |
253 | 234 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
254 | 235 | <Setting> |
255 | 236 | <String Regex="">ufsc.br</String> |
256 | 237 | </Setting> |
257 | 238 | </ConfigItem> |
258 | - | |
259 | - | |
260 | - <!-- Módulo Público --> | |
239 | + | |
261 | 240 | <ConfigItem Name="PublicFrontend::Module###NewTicketWizardPublic" Required="0" Valid="1"> |
262 | - <Description Translatable="1">FrontendModuleRegistration for NewTicketWizardPublic module.</Description> | |
241 | + <Description>FrontendModuleRegistration for NewTicketWizardPublic module.</Description> | |
263 | 242 | <Group>Framework</Group> |
264 | 243 | <SubGroup>Frontend::Public::ModuleRegistration</SubGroup> |
265 | 244 | <Setting> |
... | ... | @@ -267,34 +246,27 @@ |
267 | 246 | <Description>Module for creating custom new ticket interfaces without logging in</Description> |
268 | 247 | <NavBarName>NewTicketWizardPublic</NavBarName> |
269 | 248 | <NavBar> |
270 | - <Description Translatable="1">New ticket wizard public</Description> | |
271 | - <Name Translatable="1">New ticket public</Name> | |
249 | + <Description>New ticket wizard public</Description> | |
250 | + <Name>New ticket public</Name> | |
272 | 251 | <Link>Action=NewTicketWizardPublic</Link> |
273 | 252 | <NavBar>NewTicketWizardPublic</NavBar> |
274 | 253 | <Type>Menu</Type> |
275 | 254 | <Prio>8400</Prio> |
276 | 255 | </NavBar> |
277 | - <!-- Carrega o alpaca --> | |
256 | + <!-- AlpacaJS --> | |
278 | 257 | <Loader> |
279 | 258 | <JavaScript>NewTicketWizard.js</JavaScript> |
280 | 259 | <JavaScript>thirdparty/alpaca/alpaca-full.min.js</JavaScript> |
281 | - <JavaScript>thirdparty/jquery-ui-1.10.3/jquery-ui.js</JavaScript> | |
282 | - <JavaScript>thirdparty/jquery-validate-1.11.1/jquery.validate.js</JavaScript> | |
283 | 260 | <CSS>alpaca/alpaca-newticketwizard.css</CSS> |
284 | 261 | <CSS>alpaca/alpaca-jqueryui-newticketwizard.css</CSS> |
285 | 262 | </Loader> |
286 | 263 | </FrontendModuleReg> |
287 | 264 | </Setting> |
288 | - </ConfigItem> | |
289 | - | |
290 | - | |
265 | + </ConfigItem> | |
291 | 266 | |
292 | 267 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###BasicSchemaPublic" |
293 | 268 | Required="0" Valid="1"> |
294 | - <Description Lang="en">Describe the form basic schema. See documentation for examples.</Description> | |
295 | - <Description Lang="pt_BR"> | |
296 | - Descreva o esquema básico do formulário. Veja a documentação para maiores detalhes. | |
297 | - </Description> | |
269 | + <Description>Describe the form basic schema. See documentation for examples.</Description> | |
298 | 270 | <Group>Ticket</Group> |
299 | 271 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
300 | 272 | <Setting> |
... | ... | @@ -361,10 +333,7 @@ |
361 | 333 | |
362 | 334 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###BasicFormPublic" |
363 | 335 | Required="0" Valid="1"> |
364 | - <Description Lang="en">Describe the form basic fields. See documentation for examples.</Description> | |
365 | - <Description Lang="pt_BR"> | |
366 | - Descreva os campos básicos do formulário. Veja a documentação para maiores detalhes. | |
367 | - </Description> | |
336 | + <Description>Describe the form basic fields. See documentation for examples.</Description> | |
368 | 337 | <Group>Ticket</Group> |
369 | 338 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
370 | 339 | <Setting> |
... | ... | @@ -434,10 +403,7 @@ |
434 | 403 | |
435 | 404 | <ConfigItem Name="Ticket::Frontend::Customer::NewTicketWizard###ShowQueue" |
436 | 405 | Required="0" Valid="1"> |
437 | - <Description Lang="en">When false, forces the queue to be pre-selected.</Description> | |
438 | - <Description Lang="pt_BR"> | |
439 | - Quando falso, a fila deve ter sido selecionada antes (parametro) | |
440 | - </Description> | |
406 | + <Description>When false, forces the queue to be pre-selected.</Description> | |
441 | 407 | <Group>Ticket</Group> |
442 | 408 | <SubGroup>Frontend::Customer::NewTicketWizard</SubGroup> |
443 | 409 | <Setting> |
... | ... | @@ -445,94 +411,5 @@ |
445 | 411 | </Setting> |
446 | 412 | </ConfigItem> |
447 | 413 | |
448 | - <!-- Painel de setores --> | |
449 | - <ConfigItem Name="CustomerFrontend::Module###QueuesPanel" Required="0" Valid="1"> | |
450 | - <Description Translatable="1">FrontendModuleRegistration for QueuesPanel module.</Description> | |
451 | - <Group>Ticket</Group> | |
452 | - <SubGroup>Frontend::Customer::ModuleRegistration</SubGroup> | |
453 | - <Setting> | |
454 | - <FrontendModuleReg> | |
455 | - <Description>Module for choosing main queues to open tickets</Description> | |
456 | - <NavBarName>QueuesPanel</NavBarName> | |
457 | - <NavBar> | |
458 | - <Description Translatable="1">Queues panel</Description> | |
459 | - <Name Translatable="1">Queues panel</Name> | |
460 | - <Link>Action=QueuesPanel</Link> | |
461 | - <NavBar>QueuesPanel</NavBar> | |
462 | - <Type>Menu</Type> | |
463 | - <Prio>8400</Prio> | |
464 | - </NavBar> | |
465 | - | |
466 | - <!-- Carrega o alpaca --> | |
467 | - <Loader> | |
468 | - <JavaScript>thirdparty/hColumns/jquery.hcolumns.min.js</JavaScript> | |
469 | - | |
470 | -<!-- <JavaScript>thirdparty/jquery-ui-1.10.3/jquery-ui.js</JavaScript> | |
471 | - <JavaScript>thirdparty/jquery-validate-1.11.1/jquery.validate.js</JavaScript> --> | |
472 | - <CSS>QueuesPanel.css</CSS> | |
473 | - <CSS>hColumns/hcolumns.css</CSS> | |
474 | - <CSS>hColumns/hcolumns-intro.css</CSS> | |
475 | - <CSS>hColumns/reset.css</CSS> | |
476 | - | |
477 | - | |
478 | - | |
479 | -<!-- <CSS>alpaca/alpaca-jqueryui-newticketwizard.css</CSS> | |
480 | ---> | |
481 | - </Loader> | |
482 | - </FrontendModuleReg> | |
483 | - </Setting> | |
484 | - </ConfigItem> | |
485 | - | |
486 | - <ConfigItem Name="PublicFrontend::Module###QueuesPanelPublic" Required="0" Valid="1"> | |
487 | - <Description Translatable="1">FrontendModuleRegistration for QueuesPanelPublic module.</Description> | |
488 | - <Group>Framework</Group> | |
489 | - <SubGroup>Frontend::Public::ModuleRegistration</SubGroup> | |
490 | - <Setting> | |
491 | - <FrontendModuleReg> | |
492 | - <Description>Module for choosing main queues to open tickets</Description> | |
493 | - <NavBarName>QueuesPanel</NavBarName> | |
494 | - <NavBar> | |
495 | - <Description Translatable="1">Queues panel</Description> | |
496 | - <Name Translatable="1">Queues panel</Name> | |
497 | - <Link>Action=QueuesPanelPublic</Link> | |
498 | - <NavBar>QueuesPanel</NavBar> | |
499 | - <Type>Menu</Type> | |
500 | - <Prio>8400</Prio> | |
501 | - </NavBar> | |
502 | - <!-- Carrega o alpaca --> | |
503 | - <Loader> | |
504 | - <JavaScript>thirdparty/hColumns/jquery.hcolumns.min.js</JavaScript> | |
505 | - <CSS>QueuesPanel.css</CSS> | |
506 | - <CSS>hColumns/hcolumns.css</CSS> | |
507 | - <CSS>hColumns/hcolumns-intro.css</CSS> | |
508 | - <CSS>hColumns/reset.css</CSS> | |
509 | - </Loader> | |
510 | - </FrontendModuleReg> | |
511 | - </Setting> | |
512 | - </ConfigItem> | |
513 | - | |
514 | - | |
515 | - <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###MessageChooseQueuePublic" | |
516 | - Required="0" Valid="1"> | |
517 | - <Description Lang="en">Message to let the user choose a queue.</Description> | |
518 | - <Description Lang="pt_BR">Mensagem para o usuário selecionar uma fila.</Description> | |
519 | - <Group>Ticket</Group> | |
520 | - <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | |
521 | - <Setting> | |
522 | - <String Regex="">Escolha o local para o qual deseja atendimento</String> | |
523 | - </Setting> | |
524 | - </ConfigItem> | |
525 | - | |
526 | - <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###MessageChooseQueue" | |
527 | - Required="0" Valid="1"> | |
528 | - <Description Lang="en">Message to let the user choose a queue.</Description> | |
529 | - <Description Lang="pt_BR">Mensagem para o usuário selecionar uma fila.</Description> | |
530 | - <Group>Ticket</Group> | |
531 | - <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | |
532 | - <Setting> | |
533 | - <String Regex="">Escolha o local para o qual deseja atendimento</String> | |
534 | - </Setting> | |
535 | - </ConfigItem> | |
536 | - | |
537 | - | |
414 | + | |
538 | 415 | </otrs_config> |
539 | 416 | \ No newline at end of file | ... | ... |
Kernel/Language/pt_BR_NewTicketWizard.pm
1 | 1 | # -- |
2 | -# Kernel/Modules/pt_BR_NewTicketWizard.pm - frontend module for creating custom new ticket interfaces | |
3 | -# Translations | |
2 | +# Kernel/Modules/pt_BR_NewTicketWizard.pm - translations for NewTicketWizardModule | |
4 | 3 | # |
5 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | +# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/08/2015 - Adjustments for OTRS 4 | |
6 | +# | |
6 | 7 | # -- |
7 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
8 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -12,10 +13,30 @@ package Kernel::Language::pt_BR_NewTicketWizard; |
12 | 13 | |
13 | 14 | use strict; |
14 | 15 | use warnings; |
16 | +use utf8; | |
15 | 17 | |
16 | 18 | sub Data { |
17 | 19 | my $Self = shift; |
18 | 20 | |
21 | + $Self->{Translation}->{'Frontend module registration for the customer interface.'} = 'Registro do módulo de abertura de chamados para usuários logados.'; | |
22 | + $Self->{Translation}->{'Frontend module registration for the agent interface.'} = 'Registro do módulo de gestão dos formulários de abertura de chamados.'; | |
23 | + $Self->{Translation}->{'Describe the form basic schema. See documentation for examples.'} = 'Descreve o esquema básico do formulário. Veja a documentação para exemplos.'; | |
24 | + $Self->{Translation}->{'Describe the form basic fields. See documentation for examples.'} = 'Descreve os campos básicos do formulário. Veja a documentação para exemplos.'; | |
25 | + $Self->{Translation}->{'When the queue comes from a field in the form, a prefix can be attached to the value while searching for the queue. A space is added between this and the queue name.'} = | |
26 | + 'Quando a fila vem de um campo do formulário, um prefixo pode ser anexado ao valor do campo ao procurar pela fila. Um espaço é adiciona entre o prefixo e o nome da fila.'; | |
27 | + $Self->{Translation}->{'Name of the field in the form which indicates the queue to send the ticket.'} = | |
28 | + 'Nome do campo no formulário que indica a fila para qual enviar o chamado'; | |
29 | + $Self->{Translation}->{'Message to let the user choose a service.'} = 'Mensagem para deixar o usuário escolher um serviço.'; | |
30 | + $Self->{Translation}->{'Customer ID to use when public ticket is created.'} = 'Customer ID para usar ao criar um chamado público (não autenticado)'; | |
31 | + $Self->{Translation}->{'Default agent for tickets.'} = 'Agente padrão para os tickets.'; | |
32 | + $Self->{Translation}->{'Default domain for user e-mails.'} = 'Domínio padrão para os e-mails dos usuários'; | |
33 | + $Self->{Translation}->{'FrontendModuleRegistration for NewTicketWizardPublic module.'} = 'FrontendModuleRegistration para o módulo NewTicketWizardPublic.'; | |
34 | + $Self->{Translation}->{'Module for creating custom new ticket interfaces without logging in'} = 'Módulo para criar novos tickets sem precisar estar logado no OTRS'; | |
35 | + $Self->{Translation}->{'New ticket wizard public'} = 'Assistente de novo chamado público'; | |
36 | + $Self->{Translation}->{'New ticket public'} = 'Novo chamado público'; | |
37 | + $Self->{Translation}->{'When false, forces the queue to be pre-selected.'} = 'Quando falso, força a fila a ser pré-selecionada.'; | |
38 | + $Self->{Translation}->{'FrontendModuleRegistration for QueuesPanel module.'} = 'FrontendModuleRegistration para o módulo QueuesPanel'; | |
39 | + $Self->{Translation}->{'Module for choosing main queues to open tickets'} = 'Módulo para escolher as principais filas para abrir chamados'; | |
19 | 40 | $Self->{Translation}->{'The following maintenances are in progress'} = 'As seguintes manutenções estão ocorrendo'; |
20 | 41 | $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; |
21 | 42 | $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; | ... | ... |
Kernel/Language/pt_BR_NewTicketWizardPublic.pm
1 | 1 | # -- |
2 | -# Kernel/Modules/pt_BR_NewTicketWizard.pm - frontend module for creating custom new ticket interfaces | |
3 | -# Translations | |
2 | +# Kernel/Modules/pt_BR_NewTicketWizardPublic.pm - translations for NewTicketWizardModulePublic | |
3 | +# | |
4 | +# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/08/2015 - Adjustments for OTRS 4 | |
4 | 6 | # |
5 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
6 | 7 | # -- |
7 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
8 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -12,6 +13,7 @@ package Kernel::Language::pt_BR_NewTicketWizard; |
12 | 13 | |
13 | 14 | use strict; |
14 | 15 | use warnings; |
16 | +use utf8; | |
15 | 17 | |
16 | 18 | sub Data { |
17 | 19 | my $Self = shift; | ... | ... |
Kernel/Language/pt_BR_NewTicketWizardServiceForm.pm
1 | -# -- | |
2 | -# Kernel/Modules/pt_BR_NewTicketWizard.pm - frontend module for creating custom new ticket interfaces | |
3 | -# Translations | |
1 | +# Kernel/Modules/pt_BR_NewTicketWizardServiceForm.pm - translations for NewTicketWizardModuleServiceForm | |
4 | 2 | # |
5 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
3 | +# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ | |
4 | +# Version 01/08/2015 - Adjustments for OTRS 4 | |
5 | +# | |
6 | 6 | # -- |
7 | 7 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
8 | 8 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -12,6 +12,7 @@ package Kernel::Language::pt_BR_NewTicketWizard; |
12 | 12 | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | +use utf8; | |
15 | 16 | |
16 | 17 | sub Data { |
17 | 18 | my $Self = shift; | ... | ... |
Kernel/Language/pt_BR_QueuesPanel.pm
... | ... | @@ -1,36 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Modules/pt_BR_NewTicketWizard.pm - frontend module for creating custom new ticket interfaces | |
3 | -# Translations | |
4 | -# | |
5 | -# Copyright (C) 2014 (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_NewTicketWizard; | |
12 | - | |
13 | -use strict; | |
14 | -use warnings; | |
15 | - | |
16 | -sub Data { | |
17 | - my $Self = shift; | |
18 | - | |
19 | - $Self->{Translation}->{'The following maintenances are in progress'} = 'As seguintes manutenções estão ocorrendo'; | |
20 | - $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; | |
21 | - $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; | |
22 | - $Self->{Translation}->{'Your ticket has been registered with the number: '} = 'Seu chamado foi registrado com sucesso! O número é: '; | |
23 | - $Self->{Translation}->{'New ticket wizard'} = 'Assistente de novo chamado'; | |
24 | - $Self->{Translation}->{'New ticket'} = 'Assistente de chamado'; | |
25 | - $Self->{Translation}->{'Service forms'} = 'Formulários de serviços'; | |
26 | - $Self->{Translation}->{'Service form'} = 'Formulários de serviço'; | |
27 | - $Self->{Translation}->{'Create and manage service forms.'} = 'Criar e gerenciar formulários de serviços'; | |
28 | - $Self->{Translation}->{'Introduction'} = 'Introdução'; | |
29 | - $Self->{Translation}->{'Service'} = 'Serviço'; | |
30 | - $Self->{Translation}->{'Form'} = 'Formulário'; | |
31 | - $Self->{Translation}->{'Choose the service to ask for support'} = 'Escolha o serviço para o qual deseja suporte'; | |
32 | - $Self->{Translation}->{'Ticket created'} = 'Chamado criado com sucesso'; | |
33 | - $Self->{Translation}->{'Click here to open another ticket'} = 'Clique aqui para abrir um outro chamado se desejar'; | |
34 | - return 1; | |
35 | -} | |
36 | -1; | |
37 | 0 | \ No newline at end of file |
Kernel/Language/pt_BR_QueuesPanelPublic.pm
... | ... | @@ -1,36 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Modules/pt_BR_NewTicketWizard.pm - frontend module for creating custom new ticket interfaces | |
3 | -# Translations | |
4 | -# | |
5 | -# Copyright (C) 2014 (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_NewTicketWizard; | |
12 | - | |
13 | -use strict; | |
14 | -use warnings; | |
15 | - | |
16 | -sub Data { | |
17 | - my $Self = shift; | |
18 | - | |
19 | - $Self->{Translation}->{'The following maintenances are in progress'} = 'As seguintes manutenções estão ocorrendo'; | |
20 | - $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; | |
21 | - $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; | |
22 | - $Self->{Translation}->{'Your ticket has been registered with the number: '} = 'Seu chamado foi registrado com sucesso! O número é: '; | |
23 | - $Self->{Translation}->{'New ticket wizard'} = 'Assistente de novo chamado'; | |
24 | - $Self->{Translation}->{'New ticket'} = 'Assistente de chamado'; | |
25 | - $Self->{Translation}->{'Service forms'} = 'Formulários de serviços'; | |
26 | - $Self->{Translation}->{'Service form'} = 'Formulários de serviço'; | |
27 | - $Self->{Translation}->{'Create and manage service forms.'} = 'Criar e gerenciar formulários de serviços'; | |
28 | - $Self->{Translation}->{'Introduction'} = 'Introdução'; | |
29 | - $Self->{Translation}->{'Service'} = 'Serviço'; | |
30 | - $Self->{Translation}->{'Form'} = 'Formulário'; | |
31 | - $Self->{Translation}->{'Choose the service to ask for support'} = 'Escolha o serviço para o qual deseja suporte'; | |
32 | - $Self->{Translation}->{'Ticket created'} = 'Chamado criado com sucesso'; | |
33 | - $Self->{Translation}->{'Click here to open another ticket'} = 'Clique aqui para abrir um outro chamado se desejar'; | |
34 | - return 1; | |
35 | -} | |
36 | -1; | |
37 | 0 | \ No newline at end of file |
Kernel/Modules/NewTicketWizard.pm
1 | 1 | # -- |
2 | 2 | # Kernel/Modules/NewTicketWizard.pm - frontend module for creating custom new ticket interfaces |
3 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/08/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
4 | 7 | # -- |
5 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
6 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -11,21 +14,29 @@ package Kernel::Modules::NewTicketWizard; |
11 | 14 | use strict; |
12 | 15 | use warnings; |
13 | 16 | |
14 | -use Kernel::System::ServiceForm; | |
15 | -use Kernel::System::TicketWizard; | |
16 | -use Kernel::System::CustomerUser; | |
17 | -use Kernel::System::State; | |
18 | -use Kernel::System::SystemAddress; | |
19 | -use Kernel::System::Queue; | |
20 | -use Kernel::System::Web::UploadCache; | |
21 | -use Kernel::System::DynamicField; | |
22 | -use Kernel::System::DynamicField::Backend; | |
23 | -require Kernel::System::QueueService; | |
24 | 17 | use Kernel::System::VariableCheck qw(:all); |
25 | -use Data::Dumper; | |
26 | -use Kernel::System::Maintenance; | |
27 | -use Kernel::System::DateUtils; | |
28 | 18 | |
19 | +our @ObjectDependencies = ( | |
20 | +"Kernel::System::DateUtils", | |
21 | +"Kernel::System::Maintenance", | |
22 | +"Kernel::System::QueueService", | |
23 | +"Kernel::System::Service", | |
24 | +"Kernel::System::ServiceForm", | |
25 | +"Kernel::System::TicketWizard", | |
26 | +"Kernel::System::Web::UploadCache", | |
27 | +"Kernel::System::DynamicField", | |
28 | +"Kernel::System::DynamicField::Backend", | |
29 | +"Kernel::System::State", | |
30 | +"Kernel::System::SystemAddress", | |
31 | +"Kernel::System::CustomerUser", | |
32 | +"Kernel::System::Web::Request", | |
33 | +"Kernel::System::DB", | |
34 | +"Kernel::System::Ticket", | |
35 | +"Kernel::Output::HTML::Layout", | |
36 | +"KerneL::System::Log", | |
37 | +"Kernel::System::Queue", | |
38 | +"Kernel::Config" | |
39 | + ); | |
29 | 40 | |
30 | 41 | sub new { |
31 | 42 | my ( $Type, %Param ) = @_; |
... | ... | @@ -34,48 +45,27 @@ sub new { |
34 | 45 | my $Self = {%Param}; |
35 | 46 | bless( $Self, $Type ); |
36 | 47 | |
37 | - # check needed objects | |
38 | - for ( | |
39 | - qw(ParamObject DBObject TicketObject LayoutObject LogObject QueueObject ConfigObject) | |
40 | - ) | |
41 | - { | |
42 | - if ( !$Self->{$_} ) { | |
43 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
44 | - } | |
45 | - } | |
46 | - | |
47 | - # needed objects | |
48 | - $Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param); | |
49 | - $Self->{StateObject} = Kernel::System::State->new(%Param); | |
50 | - $Self->{SystemAddress} = Kernel::System::SystemAddress->new(%Param); | |
51 | - $Self->{UploadCacheObject} = Kernel::System::Web::UploadCache->new(%Param); | |
52 | - $Self->{DynamicFieldObject} = Kernel::System::DynamicField->new(%Param); | |
53 | - $Self->{BackendObject} = Kernel::System::DynamicField::Backend->new(%Param); | |
54 | - $Self->{TicketWizard} = Kernel::System::TicketWizard->new(%Param); | |
55 | - $Self->{ServiceFormObject} = Kernel::System::ServiceForm->new(%Param); | |
56 | - $Self->{ServiceObject} = Kernel::System::Service->new(%Param); | |
57 | - $Self->{QueueObject} = Kernel::System::Queue->new(%Param); | |
58 | - $Self->{QueueServiceObject} = Kernel::System::QueueService->new(%Param); | |
59 | - $Self->{MaintenanceObject} = Kernel::System::Maintenance->new(%Param); | |
60 | - $Self->{DateUtilsObject} = Kernel::System::DateUtils->new(%Param); | |
61 | - | |
62 | 48 | return $Self; |
63 | 49 | } |
64 | 50 | |
65 | 51 | sub BuildServices { |
66 | 52 | my ( $Self, %Param ) = @_; |
67 | 53 | my %Data = (); |
68 | - | |
54 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
55 | + my $QueueServiceObject = $Kernel::OM->Get("Kernel::System::QueueService"); | |
56 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
57 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
58 | + my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service"); | |
59 | + | |
69 | 60 | # Build service chooser |
70 | 61 | my %Services = (); |
71 | 62 | |
72 | - if ( !$Self->{ParamObject}->GetParam( Param => "QueueID" ) ) { | |
73 | - %Services = $Self->{ServiceObject}->ServiceList( UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID'), ); | |
63 | + if ( !$ParamObject->GetParam( Param => "QueueID" ) ) { | |
64 | + %Services = $ServiceObject->ServiceList( UserID => $ConfigObject->Get('CustomerPanelUserID'), ); | |
74 | 65 | } |
75 | 66 | else { |
76 | 67 | %Services = |
77 | - $Self->{QueueServiceObject} | |
78 | - ->GetServiceList( QueueID => $Self->{ParamObject}->GetParam( Param => "QueueID" ), ); | |
68 | + $QueueServiceObject->GetServiceList( QueueID => $ParamObject->GetParam( Param => "QueueID" ), ); | |
79 | 69 | } |
80 | 70 | my @ServicesCombo = (); |
81 | 71 | |
... | ... | @@ -97,7 +87,7 @@ sub BuildServices { |
97 | 87 | |
98 | 88 | @ServicesCombo = sort { $a->{Value} . "::" cmp $b->{Value} . "::" } @ServicesCombo; |
99 | 89 | |
100 | - my $retorno = $Self->{LayoutObject}->BuildSelection( | |
90 | + my $retorno = $LayoutObject->BuildSelection( | |
101 | 91 | Data => \@ServicesCombo, |
102 | 92 | Name => 'ServiceID', |
103 | 93 | SelectedID => $Param{ServiceID}, |
... | ... | @@ -109,34 +99,37 @@ sub BuildServices { |
109 | 99 | Max => 200 |
110 | 100 | ); |
111 | 101 | |
112 | - $Self->Debug( "\n\n\n Combo " . $retorno . "\n\n\n" ); | |
113 | 102 | return $retorno; |
114 | - | |
115 | 103 | } |
116 | 104 | |
117 | 105 | sub Run { |
118 | 106 | my ( $Self, %Param ) = @_; |
107 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
108 | + my $QueueObject = $Kernel::OM->Get("Kernel::System::Queue"); | |
109 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
110 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
111 | + my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service"); | |
112 | + my $MaintenanceObject = $Kernel::OM->Get("Kernel::System::Maintenance"); | |
113 | + my $DateUtilsObject = $Kernel::OM->Get("Kernel::System::DateUtils"); | |
114 | + | |
119 | 115 | my %Data = (); |
120 | 116 | |
121 | - if ( $Self->{ParamObject}->GetParam( Param => "QueueID" ) ) { | |
122 | - $Data{QueueID} = $Self->{ParamObject}->GetParam( Param => "QueueID" ); | |
123 | - } | |
124 | - else { | |
125 | - | |
117 | + if ( $ParamObject->GetParam( Param => "QueueID" ) ) { | |
118 | + $Data{QueueID} = $ParamObject->GetParam( Param => "QueueID" ); | |
119 | + } else { | |
126 | 120 | # Check if must show queue |
127 | - my $_ConfigTicketWizard = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
121 | + my $_ConfigTicketWizard = $ConfigObject->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
128 | 122 | my $_ShowQueue = $_ConfigTicketWizard->{"ShowQueue"}; |
129 | 123 | if ( !$_ShowQueue ) { |
130 | - $Self->Debug("Sem fila e show queue != 1"); | |
131 | - return $Self->{LayoutObject}->Redirect( OP => "Action=QueuesPanel" ); | |
124 | + return $LayoutObject->Redirect( OP => "Action=QueuesPanel" ); | |
132 | 125 | } |
133 | 126 | } |
134 | 127 | |
135 | - if ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) eq "GetServices" ) { | |
128 | + if ( $ParamObject->GetParam( Param => "Subaction" ) eq "GetServices" ) { | |
136 | 129 | my $content = $Self->BuildServices(); |
137 | 130 | |
138 | - return $Self->{LayoutObject}->Attachment( | |
139 | - ContentType => 'application/text; charset=' . $Self->{LayoutObject}->{Charset}, | |
131 | + return $LayoutObject->Attachment( | |
132 | + ContentType => 'application/text; charset=' . $LayoutObject->{Charset}, | |
140 | 133 | Content => $content, |
141 | 134 | Type => 'inline', |
142 | 135 | NoCache => 1, |
... | ... | @@ -144,25 +137,25 @@ sub Run { |
144 | 137 | } |
145 | 138 | |
146 | 139 | # Build service chooser |
147 | - $Data{ServiceStrg} = $Self->BuildServices(ServiceID => $Self->{ParamObject}->GetParam( Param => "ServiceID" )); | |
140 | + $Data{ServiceStrg} = $Self->BuildServices(ServiceID => $ParamObject->GetParam( Param => "ServiceID" )); | |
148 | 141 | |
149 | - $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
142 | + $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
150 | 143 | my $msgChooseService = $Self->{Config}->{"MessageChooseService"}; |
151 | 144 | |
152 | - if ( $Self->{ParamObject}->GetParam( Param => "QueueID" ) ) { | |
153 | - my %queueData = $Self->{QueueObject}->QueueGet( ID => $Self->{ParamObject}->GetParam( Param => "QueueID" ) ); | |
145 | + if ( $ParamObject->GetParam( Param => "QueueID" ) ) { | |
146 | + my %queueData = $QueueObject->QueueGet( ID => $ParamObject->GetParam( Param => "QueueID" ) ); | |
154 | 147 | my $queueName = $queueData{Name}; |
155 | 148 | $msgChooseService =~ s/PLACE\_NAME/$queueName/g; |
156 | 149 | } |
157 | 150 | |
158 | 151 | $Data{MsgChooseService} = $msgChooseService; |
159 | 152 | |
160 | - if ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) ) { | |
161 | - if ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) eq "CreateTicket" ) { | |
153 | + if ( $ParamObject->GetParam( Param => "Subaction" ) ) { | |
154 | + if ( $ParamObject->GetParam( Param => "Subaction" ) eq "CreateTicket" ) { | |
162 | 155 | return $Self->CreateTicket(); |
163 | 156 | } |
164 | - elsif ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) eq "GetFormJSON" ) { | |
165 | - return $Self->GetFormJSON( ServiceID => $Self->{ParamObject}->GetParam( Param => "ServiceID" ) ); | |
157 | + elsif ( $ParamObject->GetParam( Param => "Subaction" ) eq "GetFormJSON" ) { | |
158 | + return $Self->GetFormJSON( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) ); | |
166 | 159 | } |
167 | 160 | } |
168 | 161 | else { |
... | ... | @@ -172,37 +165,35 @@ sub Run { |
172 | 165 | $Data{FieldsForm} = $fields; |
173 | 166 | |
174 | 167 | # build output |
175 | - my $Output = | |
176 | - $Self->{LayoutObject} | |
177 | - ->CustomerHeader( Title => $Self->{LayoutObject}->{LanguageObject}->Get("New ticket wizard") ); | |
168 | + my $Output = $LayoutObject->CustomerHeader( Title => $LayoutObject->{LanguageObject}->Translate("New ticket wizard") ); | |
178 | 169 | |
179 | 170 | # maintenances |
180 | - my @maintenances = $Self->{MaintenanceObject}->ListCurrentMaintenances(); | |
171 | + my @maintenances = $MaintenanceObject->ListCurrentMaintenances(); | |
181 | 172 | |
182 | 173 | if (@maintenances) { |
183 | - $Self->{LayoutObject}->Block( Name => 'MaintenancesPanel', ); | |
174 | + $LayoutObject->Block( Name => 'MaintenancesPanel', ); | |
184 | 175 | |
185 | 176 | for my $maintenanceHash (@maintenances) { |
186 | 177 | my %maintenance = %{$maintenanceHash}; |
187 | 178 | |
188 | - $Self->{LayoutObject}->Block( | |
179 | + $LayoutObject->Block( | |
189 | 180 | Name => 'MaintenanceLine', |
190 | 181 | Data => { |
191 | 182 | Message => $maintenance{'Description'}, |
192 | - StartDate => $Self->{DateUtilsObject}->BrazilianDate( | |
193 | - Timestamp => $Self->{DateUtilsObject}->FromSQL( StringDate => $maintenance{StartDate} ) | |
183 | + StartDate => $DateUtilsObject->BrazilianDate( | |
184 | + Timestamp => $DateUtilsObject->FromSQL( StringDate => $maintenance{StartDate} ) | |
194 | 185 | ), |
195 | 186 | } |
196 | 187 | ); |
197 | 188 | } |
198 | 189 | } |
199 | 190 | |
200 | - $Output .= $Self->{LayoutObject}->CustomerNavigationBar(); | |
201 | - $Output .= $Self->{LayoutObject}->Output( | |
191 | + $Output .= $LayoutObject->CustomerNavigationBar(); | |
192 | + $Output .= $LayoutObject->Output( | |
202 | 193 | Data => \%Data, |
203 | 194 | TemplateFile => 'NewTicketWizard', |
204 | 195 | ); |
205 | - $Output .= $Self->{LayoutObject}->CustomerFooter(); | |
196 | + $Output .= $LayoutObject->CustomerFooter(); | |
206 | 197 | return $Output; |
207 | 198 | } |
208 | 199 | } |
... | ... | @@ -210,19 +201,21 @@ sub Run { |
210 | 201 | sub GetFormJSON { |
211 | 202 | my ( $Self, %Param ) = @_; |
212 | 203 | my %serviceForm; |
204 | + | |
205 | + my $ServiceFormObject = $Kernel::OM->Get("Kernel::System::ServiceForm"); | |
206 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
207 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
213 | 208 | |
214 | 209 | if ( $Param{ServiceID} ) { |
215 | - %serviceForm = $Self->{ServiceFormObject}->GetServiceForm( ServiceID => $Param{ServiceID} ); | |
210 | + %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} ); | |
216 | 211 | } |
217 | 212 | |
218 | - my $QueueID = $Self->{ParamObject}->GetParam( Param => "QueueID" ); | |
213 | + my $QueueID = $ParamObject->GetParam( Param => "QueueID" ); | |
219 | 214 | |
220 | 215 | my ( $schema, $fields, $introduction ) = $Self->GetForm( ServiceForm => \%serviceForm, QueueID => $QueueID ); |
221 | 216 | |
222 | - $Self->Debug( "[{" . $schema . "}, {" . $fields . "}, \"" . $introduction . "\"]" ); | |
223 | - | |
224 | - return $Self->{LayoutObject}->Attachment( | |
225 | - ContentType => 'application/json; charset=' . $Self->{LayoutObject}->{Charset}, | |
217 | + return $LayoutObject->Attachment( | |
218 | + ContentType => 'application/json; charset=' . $LayoutObject->{Charset}, | |
226 | 219 | Content => "[{" . $schema . "}, {" . $fields . "}, \"" . $introduction . "\"]", |
227 | 220 | Type => 'inline', |
228 | 221 | NoCache => 1, |
... | ... | @@ -231,15 +224,18 @@ sub GetFormJSON { |
231 | 224 | |
232 | 225 | sub GetForm { |
233 | 226 | my ( $Self, %Param ) = @_; |
227 | + | |
228 | + my $TicketWizard = $Kernel::OM->Get("Kernel::System::TicketWizard"); | |
229 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
234 | 230 | |
235 | - my $schema = $Self->{TicketWizard}->GetBasicFieldsSchema(); | |
236 | - my $fields = $Self->{TicketWizard}->GetBasicFieldsOptions(); | |
231 | + my $schema = $TicketWizard->GetBasicFieldsSchema(); | |
232 | + my $fields = $TicketWizard->GetBasicFieldsOptions(); | |
237 | 233 | my $introduction; |
238 | 234 | |
239 | - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSValues( | |
235 | + ( $schema, $fields ) = $TicketWizard->ReplaceOTRSValues( | |
240 | 236 | Schema => $schema, |
241 | 237 | Options => $fields, |
242 | - UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID') | |
238 | + UserID => $ConfigObject->Get('CustomerPanelUserID') | |
243 | 239 | ); |
244 | 240 | |
245 | 241 | if ( !$Param{ServiceForm} ) { |
... | ... | @@ -264,7 +260,7 @@ sub GetForm { |
264 | 260 | } |
265 | 261 | |
266 | 262 | # Incluir campos dinâmicos no replace |
267 | - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | |
263 | + ( $schema, $fields ) = $TicketWizard->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | |
268 | 264 | |
269 | 265 | if ( $Param{"QueueID"} ) { |
270 | 266 | $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; |
... | ... | @@ -276,45 +272,41 @@ sub GetForm { |
276 | 272 | |
277 | 273 | sub GetQueueID() { |
278 | 274 | my ( $Self, %Param ) = @_; |
275 | + | |
276 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
277 | + my $QueueObject = $Kernel::OM->Get("Kernel::System::Queue"); | |
278 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
279 | 279 | |
280 | 280 | # Check if queueID was sent |
281 | - my $QueueID = $Self->{ParamObject}->GetParam( Param => "QueueID" ); | |
282 | - $Self->Debug( "\n\nBSUCANDO $QueueID FILA\n\n"); | |
281 | + my $QueueID = $ParamObject->GetParam( Param => "QueueID" ); | |
283 | 282 | |
284 | 283 | if ($QueueID) { |
285 | - $Self->Debug( "\n\nRecebida fila $QueueID\n\n" ); | |
286 | - my %Queue = $Self->{QueueObject}->QueueGet( ID => $QueueID ); | |
284 | + my %Queue = $QueueObject->QueueGet( ID => $QueueID ); | |
287 | 285 | return ( $Queue{"Name"}, $QueueID ); |
288 | 286 | } |
289 | 287 | |
290 | 288 | # Gets default Queue |
291 | - my $ConfigTicket = $Self->{ConfigObject}->Get("Ticket::Frontend::CustomerTicketMessage"); | |
292 | - my $ConfigTicketWizard = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
289 | + my $ConfigTicket = $ConfigObject->Get("Ticket::Frontend::CustomerTicketMessage"); | |
290 | + my $ConfigTicketWizard = $ConfigObject->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
293 | 291 | |
294 | 292 | my $QueueDefault = $ConfigTicket->{"QueueDefault"}; |
295 | 293 | |
296 | 294 | # Checks if there is a field for the queue |
297 | - $Self->Debug( Dumper($ConfigTicketWizard) ); | |
298 | - | |
299 | 295 | my $QueuePrefix = $ConfigTicketWizard->{"QueuePrefix"}; |
300 | 296 | my $QueueField = $ConfigTicketWizard->{"QueueField"}; |
301 | - $Self->{LogObject}->Log( Priority => 'info', Message => "Searching queue for - $QueuePrefix ($QueueField)!" ); | |
302 | 297 | |
303 | - my %QueueListID = $Self->{QueueObject}->QueueList( Valid => 1 ); | |
304 | - my %QueueList = reverse $Self->{QueueObject}->QueueList( Valid => 1 ); | |
298 | + my %QueueListID = $QueueObject->QueueList( Valid => 1 ); | |
299 | + my %QueueList = reverse $QueueObject->QueueList( Valid => 1 ); | |
305 | 300 | $QueueID = $QueueList{$QueueDefault}; |
306 | 301 | my $Queue = $QueueListID{$QueueID}; |
307 | 302 | |
308 | 303 | if ( $QueuePrefix && $QueueField ) { |
309 | - my $QueueSelected = $Self->{ParamObject}->GetParam( Param => $QueueField ); | |
304 | + my $QueueSelected = $ParamObject->GetParam( Param => $QueueField ); | |
310 | 305 | my $QueueName = "$QueuePrefix $QueueSelected"; |
311 | - $Self->{LogObject} | |
312 | - ->Log( Priority => 'info', Message => "Searching queue for - $QueuePrefix ($QueueField) - [$QueueName]!" ); | |
313 | 306 | |
314 | 307 | if ( $QueueList{$QueueName} ) { |
315 | 308 | $QueueID = $QueueList{$QueueName}; |
316 | 309 | $Queue = $QueueName; |
317 | - $Self->{LogObject}->Log( Priority => 'info', Message => "Custom queue found - $QueueName ($QueueID)!" ); | |
318 | 310 | } |
319 | 311 | |
320 | 312 | } |
... | ... | @@ -325,6 +317,14 @@ sub GetQueueID() { |
325 | 317 | sub CreateTicket { |
326 | 318 | my ( $Self, %Param ) = @_; |
327 | 319 | my %Data = (); |
320 | + | |
321 | + my $TicketObject = $Kernel::OM->Get("Kernel::System::Ticket"); | |
322 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
323 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
324 | + my $BackendObject = $Kernel::OM->Get("Kernel::System::DynamicField::Backend"); | |
325 | + my $DynamicFieldObject = $Kernel::OM->Get("Kernel::System::DynamicField"); | |
326 | + my $CustomerUserObject = $Kernel::OM->Get("Kernel::System::CustomerUser"); | |
327 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
328 | 328 | |
329 | 329 | # Queue |
330 | 330 | my $queueFixed = 0; |
... | ... | @@ -334,111 +334,101 @@ sub CreateTicket { |
334 | 334 | my ( $Queue, $QueueID ) = $Self->GetQueueID(%Param); |
335 | 335 | $Data{QueueID} = $QueueID; |
336 | 336 | |
337 | - $Self->Debug( "\n\nFila achada: " . $Queue . "\n\n" ); | |
338 | - | |
339 | - $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::CustomerTicketMessage"); | |
337 | + $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::CustomerTicketMessage"); | |
340 | 338 | |
341 | - my $TicketID = $Self->{TicketObject}->TicketCreate( | |
342 | - Title => $Self->{ParamObject}->GetParam( Param => "subject" ), | |
339 | + my $TicketID = $TicketObject->TicketCreate( | |
340 | + Title => $ParamObject->GetParam( Param => "subject" ), | |
343 | 341 | QueueID => $QueueID, |
344 | 342 | Priority => $Self->{Config}->{PriorityDefault}, |
345 | 343 | Lock => 'unlock', |
346 | 344 | State => 'new', |
347 | - ServiceID => $Self->{ParamObject}->GetParam( Param => "service" ), | |
348 | - TypeID => $Self->{ParamObject}->GetParam( Param => "type" ), | |
345 | + ServiceID => $ParamObject->GetParam( Param => "service" ), | |
346 | + TypeID => $ParamObject->GetParam( Param => "type" ), | |
349 | 347 | CustomerID => $Self->{UserCustomerID}, |
350 | 348 | CustomerUser => $Self->{UserLogin}, |
351 | - OwnerID => $Self->{ConfigObject}->Get('CustomerPanelUserID'), | |
352 | - UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID'), | |
349 | + OwnerID => $ConfigObject->Get('CustomerPanelUserID'), | |
350 | + UserID => $ConfigObject->Get('CustomerPanelUserID'), | |
353 | 351 | ); |
354 | 352 | |
355 | 353 | my $MimeType = 'text/plain'; |
356 | 354 | my $serviceFields = ""; |
357 | 355 | |
358 | 356 | # Service Fields |
359 | - for ( $Self->{ParamObject}->GetParamNames() ) { | |
357 | + for ( $ParamObject->GetParamNames() ) { | |
360 | 358 | if ( substr( $_, 0, 3 ) eq "SF_" ) { |
361 | - $serviceFields .= substr( $_, 3 ) . ": " . $Self->{ParamObject}->GetParam( Param => $_ ) . "\n"; | |
359 | + $serviceFields .= substr( $_, 3 ) . ": " . $ParamObject->GetParam( Param => $_ ) . "\n"; | |
362 | 360 | } |
363 | 361 | } |
364 | - | |
362 | + $serviceFields .= "Login autenticado: " . $Self->{UserLogin} . "\n"; | |
365 | 363 | $serviceFields .= "\n\n"; |
366 | 364 | |
367 | 365 | # Dynamic Fields |
368 | - for ( $Self->{ParamObject}->GetParamNames() ) { | |
366 | + for ( $ParamObject->GetParamNames() ) { | |
369 | 367 | if ( substr( $_, 0, 3 ) eq "DF_" ) { |
370 | - my $Success = $Self->{BackendObject}->ValueSet( | |
371 | - DynamicFieldConfig => $Self->{DynamicFieldObject}->DynamicFieldGet( Name => substr( $_, 3 ) ), | |
368 | + my $Success = $BackendObject->ValueSet( | |
369 | + DynamicFieldConfig => $DynamicFieldObject->DynamicFieldGet( Name => substr( $_, 3 ) ), | |
372 | 370 | ObjectID => $TicketID, |
373 | - Value => $Self->{ParamObject}->GetParam( Param => $_ ), | |
374 | - UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID'), | |
371 | + Value => $ParamObject->GetParam( Param => $_ ), | |
372 | + UserID => $ConfigObject->Get('CustomerPanelUserID'), | |
375 | 373 | ); |
376 | 374 | } |
377 | 375 | } |
378 | 376 | |
379 | 377 | # Create article |
380 | - my $FullName = $Self->{CustomerUserObject}->CustomerName( UserLogin => $Self->{UserLogin}, ); | |
378 | + my $FullName = $CustomerUserObject->CustomerName( UserLogin => $Self->{UserLogin}, ); | |
381 | 379 | my $From = "\"$FullName\" <$Self->{UserEmail}>"; |
382 | - my $ArticleID = $Self->{TicketObject}->ArticleCreate( | |
380 | + my $ArticleID = $TicketObject->ArticleCreate( | |
383 | 381 | TicketID => $TicketID, |
384 | 382 | ArticleType => $Self->{Config}->{ArticleType}, |
385 | 383 | SenderType => $Self->{Config}->{SenderType}, |
386 | 384 | From => $From, |
387 | 385 | To => $Queue, |
388 | - Subject => $Self->{ParamObject}->GetParam( Param => "subject" ), | |
389 | - Body => $serviceFields . $Self->{ParamObject}->GetParam( Param => "description" ), | |
386 | + Subject => $ParamObject->GetParam( Param => "subject" ), | |
387 | + Body => $serviceFields . $ParamObject->GetParam( Param => "description" ), | |
390 | 388 | MimeType => $MimeType, |
391 | - Charset => $Self->{LayoutObject}->{UserCharset}, | |
392 | - UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID'), | |
389 | + Charset => $LayoutObject->{UserCharset}, | |
390 | + UserID => $ConfigObject->Get('CustomerPanelUserID'), | |
393 | 391 | HistoryType => $Self->{Config}->{HistoryType}, |
394 | 392 | HistoryComment => $Self->{Config}->{HistoryComment} || '%%', |
395 | - AutoResponseType => ( $Self->{ConfigObject}->Get('AutoResponseForWebTickets') ) | |
393 | + AutoResponseType => ( $ConfigObject->Get('AutoResponseForWebTickets') ) | |
396 | 394 | ? 'auto reply' |
397 | 395 | : '', |
398 | 396 | OrigHeader => { |
399 | 397 | From => $From, |
400 | 398 | To => $Queue, |
401 | - Subject => $Self->{ParamObject}->GetParam( Param => "subject" ), | |
402 | - Body => $serviceFields . $Self->{ParamObject}->GetParam( Param => "description" ), | |
399 | + Subject => $ParamObject->GetParam( Param => "subject" ), | |
400 | + Body => $serviceFields . $ParamObject->GetParam( Param => "description" ), | |
403 | 401 | }, |
404 | 402 | Queue => $Queue, |
405 | 403 | ); |
406 | 404 | |
407 | 405 | # Attachments |
408 | - my %UploadStuff = $Self->{ParamObject}->GetUploadAll( Param => "attachment" ); | |
406 | + my %UploadStuff = $ParamObject->GetUploadAll( Param => "attachment" ); | |
409 | 407 | |
410 | 408 | # if (%UploadStuff) { |
411 | - # print STDERR "\nTem anexo!\n"; | |
412 | - $Self->{TicketObject}->ArticleWriteAttachment( | |
409 | + $TicketObject->ArticleWriteAttachment( | |
413 | 410 | %UploadStuff, |
414 | 411 | ArticleID => $ArticleID, |
415 | - UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID'), | |
412 | + UserID => $ConfigObject->Get('CustomerPanelUserID'), | |
416 | 413 | ); |
417 | 414 | |
418 | 415 | # } |
419 | 416 | |
420 | - $Data{TicketNumber} = $Self->{TicketObject}->TicketNumberLookup( TicketID => $TicketID ); | |
417 | + $Data{TicketNumber} = $TicketObject->TicketNumberLookup( TicketID => $TicketID ); | |
421 | 418 | |
422 | 419 | # build output |
423 | 420 | if (! $queueFixed) { |
424 | 421 | delete $Data{QueueID} |
425 | 422 | } |
426 | - my $Output = $Self->{LayoutObject}->CustomerHeader( Title => "Ticket created" ); | |
427 | - $Output .= $Self->{LayoutObject}->CustomerNavigationBar(); | |
428 | - $Output .= $Self->{LayoutObject}->Output( | |
423 | + my $Output = $LayoutObject->CustomerHeader( Title => "Ticket created" ); | |
424 | + $Output .= $LayoutObject->CustomerNavigationBar(); | |
425 | + $Output .= $LayoutObject->Output( | |
429 | 426 | Data => \%Data, |
430 | 427 | TemplateFile => 'NewTicketWizardTicketCreated', |
431 | 428 | ); |
432 | - $Output .= $Self->{LayoutObject}->CustomerFooter(); | |
429 | + $Output .= $LayoutObject->CustomerFooter(); | |
433 | 430 | return $Output; |
434 | 431 | |
435 | 432 | } |
436 | 433 | |
437 | -sub Debug { | |
438 | - my $Self = shift; | |
439 | - my $msg = shift; | |
440 | - | |
441 | - print STDERR "\n\nDEBUG => \n$msg\n\n"; | |
442 | -} | |
443 | - | |
444 | 434 | 1; | ... | ... |
Kernel/Modules/NewTicketWizardPublic.pm
1 | 1 | # -- |
2 | 2 | # Kernel/Modules/NewTicketWizardPublic.pm - frontend module for creating custom new ticket interfaces without user login |
3 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/08/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
4 | 7 | # -- |
5 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
6 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -10,23 +13,30 @@ package Kernel::Modules::NewTicketWizardPublic; |
10 | 13 | |
11 | 14 | use strict; |
12 | 15 | use warnings; |
13 | - | |
14 | -use Kernel::System::DateUtils; | |
15 | -use Kernel::System::ServiceForm; | |
16 | -use Kernel::System::TicketWizard; | |
17 | -use Kernel::System::CustomerUser; | |
18 | -use Kernel::System::State; | |
19 | -use Kernel::System::SystemAddress; | |
20 | -use Kernel::System::Queue; | |
21 | -use Kernel::System::Web::UploadCache; | |
22 | -use Kernel::System::DynamicField; | |
23 | -use Kernel::System::DynamicField::Backend; | |
24 | -require Kernel::System::QueueService; | |
25 | 16 | use Kernel::System::VariableCheck qw(:all); |
26 | -use Data::Dumper; | |
27 | -use Kernel::System::Maintenance; | |
28 | -use Kernel::System::DateUtils; | |
29 | 17 | |
18 | +our @ObjectDependencies = ( | |
19 | +"Kernel::System::DateUtils", | |
20 | +"Kernel::System::Maintenance", | |
21 | +"Kernel::System::QueueService", | |
22 | +"Kernel::System::Service", | |
23 | +"Kernel::System::ServiceForm", | |
24 | +"Kernel::System::TicketWizard", | |
25 | +"Kernel::System::Web::UploadCache", | |
26 | +"Kernel::System::DynamicField", | |
27 | +"Kernel::System::DynamicField::Backend", | |
28 | +"Kernel::System::State", | |
29 | +"Kernel::System::SystemAddress", | |
30 | +"Kernel::System::CustomerUser", | |
31 | +"Kernel::System::Web::Request", | |
32 | +"Kernel::System::DB", | |
33 | +"Kernel::System::Ticket", | |
34 | +"Kernel::Output::HTML::Layout", | |
35 | +"KerneL::System::Log", | |
36 | +"Kernel::System::Queue", | |
37 | +"Kernel::Config" | |
38 | + ); | |
39 | + | |
30 | 40 | sub new { |
31 | 41 | my ( $Type, %Param ) = @_; |
32 | 42 | |
... | ... | @@ -34,75 +44,28 @@ sub new { |
34 | 44 | my $Self = {%Param}; |
35 | 45 | bless( $Self, $Type ); |
36 | 46 | |
37 | - # check needed objects | |
38 | - for ( | |
39 | - qw(ParamObject DBObject LayoutObject LogObject ConfigObject) | |
40 | - ) | |
41 | - { | |
42 | - if ( !$Self->{$_} ) { | |
43 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
44 | - } | |
45 | - } | |
46 | - | |
47 | - # needed objects | |
48 | - $Self->{TicketObject} = Kernel::System::Ticket->new(%Param); | |
49 | - $Self->{QueueObject} = Kernel::System::Queue->new(%Param); | |
50 | - | |
51 | - $Param{QueueObject} = $Self->{QueueObject}; | |
52 | - | |
53 | - $Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param); | |
54 | - $Self->{StateObject} = Kernel::System::State->new(%Param); | |
55 | - $Self->{SystemAddress} = Kernel::System::SystemAddress->new(%Param); | |
56 | - $Self->{UploadCacheObject} = Kernel::System::Web::UploadCache->new(%Param); | |
57 | - $Self->{DynamicFieldObject} = Kernel::System::DynamicField->new(%Param); | |
58 | - $Self->{BackendObject} = Kernel::System::DynamicField::Backend->new(%Param); | |
59 | - $Self->{TicketWizard} = Kernel::System::TicketWizard->new(%Param); | |
60 | - $Self->{ServiceFormObject} = Kernel::System::ServiceForm->new(%Param); | |
61 | - $Self->{ServiceObject} = Kernel::System::Service->new(%Param); | |
62 | - $Self->{QueueServiceObject} = Kernel::System::QueueService->new(%Param); | |
63 | - $Self->{MaintenanceObject} = Kernel::System::Maintenance->new(%Param); | |
64 | - $Self->{DateUtilsObject} = Kernel::System::DateUtils->new(%Param); | |
65 | - | |
66 | 47 | return $Self; |
67 | 48 | } |
68 | 49 | |
69 | -sub Run { | |
50 | +sub BuildServices { | |
70 | 51 | my ( $Self, %Param ) = @_; |
71 | 52 | my %Data = (); |
72 | - | |
73 | - if ($Self->{ParamObject}->GetParam(Param => "QueueID")) { | |
74 | - $Data{QueueID} = $Self->{ParamObject}->GetParam(Param => "QueueID"); | |
75 | - } else { | |
76 | - # Check if must show queue | |
77 | - my $_ConfigTicketWizard = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
78 | - my $_ShowQueue = $_ConfigTicketWizard->{"ShowQueue"}; | |
79 | - if (! $_ShowQueue) { | |
80 | - return $Self->{LayoutObject}->Redirect( OP => "Action=QueuesPanelPublic" ); | |
81 | - } | |
82 | - } | |
83 | - | |
84 | - $Self->{DefaultUserID} = | |
85 | - $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{"DefaultUserID"}; | |
86 | - $Self->{DefaultCustomerID} = | |
87 | - $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{"DefaultCustomerID"}; | |
88 | - $Self->{DefaultUserDomain} = | |
89 | - $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{"DefaultUserDomain"}; | |
90 | - | |
91 | - if ($Self->{ParamObject}->GetParam(Param => "QueueID")) { | |
92 | - $Data{QueueID} = $Self->{ParamObject}->GetParam(Param => "QueueID"); | |
93 | - } | |
53 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
54 | + my $QueueServiceObject = $Kernel::OM->Get("Kernel::System::QueueService"); | |
55 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
56 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
57 | + my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service"); | |
94 | 58 | |
95 | 59 | # Build service chooser |
96 | 60 | my %Services = (); |
97 | - | |
98 | - if ( !$Self->{ParamObject}->GetParam( Param => "QueueID" ) ) { | |
99 | - %Services = $Self->{ServiceObject}->ServiceList( UserID => $Self->{DefaultUserID} ); | |
100 | - } else { | |
101 | - %Services = | |
102 | - $Self->{QueueServiceObject} | |
103 | - ->GetServiceList( QueueID => $Self->{ParamObject}->GetParam( Param => "QueueID" ), ); | |
104 | - } | |
105 | 61 | |
62 | + if ( !$ParamObject->GetParam( Param => "QueueID" ) ) { | |
63 | + %Services = $ServiceObject->ServiceList( UserID => $ConfigObject->Get('CustomerPanelUserID'), ); | |
64 | + } | |
65 | + else { | |
66 | + %Services = | |
67 | + $QueueServiceObject->GetServiceList( QueueID => $ParamObject->GetParam( Param => "QueueID" ), ); | |
68 | + } | |
106 | 69 | my @ServicesCombo = (); |
107 | 70 | |
108 | 71 | for my $serviceID ( keys %Services ) { |
... | ... | @@ -123,10 +86,10 @@ sub Run { |
123 | 86 | |
124 | 87 | @ServicesCombo = sort { $a->{Value} . "::" cmp $b->{Value} . "::" } @ServicesCombo; |
125 | 88 | |
126 | - $Data{ServiceStrg} = $Self->{LayoutObject}->BuildSelection( | |
89 | + my $retorno = $LayoutObject->BuildSelection( | |
127 | 90 | Data => \@ServicesCombo, |
128 | 91 | Name => 'ServiceID', |
129 | - SelectedID => $Self->{ParamObject}->GetParam( Param => "ServiceID" ), | |
92 | + SelectedID => $Param{ServiceID}, | |
130 | 93 | Class => "Validate_Required " . ( $Param{Errors}->{ServiceIDInvalid} || '' ), |
131 | 94 | PossibleNone => 1, |
132 | 95 | TreeView => 1, |
... | ... | @@ -134,24 +97,61 @@ sub Run { |
134 | 97 | Translation => 0, |
135 | 98 | Max => 200 |
136 | 99 | ); |
137 | - $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
100 | + | |
101 | + return $retorno; | |
102 | +} | |
103 | + | |
104 | +sub Run { | |
105 | + my ( $Self, %Param ) = @_; | |
106 | + my %Data = (); | |
107 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
108 | + my $QueueObject = $Kernel::OM->Get("Kernel::System::Queue"); | |
109 | + my $QueueServiceObject = $Kernel::OM->Get("Kernel::System::QueueService"); | |
110 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
111 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
112 | + my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service"); | |
113 | + my $MaintenanceObject = $Kernel::OM->Get("Kernel::System::Maintenance"); | |
114 | + my $DateUtilsObject = $Kernel::OM->Get("Kernel::System::DateUtils"); | |
115 | + | |
116 | + if ($ParamObject->GetParam(Param => "QueueID")) { | |
117 | + $Data{QueueID} = $ParamObject->GetParam(Param => "QueueID"); | |
118 | + } else { | |
119 | + # Check if must show queue | |
120 | + my $_ConfigTicketWizard = $ConfigObject->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
121 | + my $_ShowQueue = $_ConfigTicketWizard->{"ShowQueue"}; | |
122 | + if (! $_ShowQueue) { | |
123 | + return $LayoutObject->Redirect( OP => "Action=QueuesPanelPublic" ); | |
124 | + } | |
125 | + } | |
126 | + | |
127 | + $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
128 | + $Self->{DefaultUserID} = $Self->{Config}->{"DefaultUserID"}; | |
129 | + $Self->{DefaultCustomerID} = $Self->{Config}->{"DefaultCustomerID"}; | |
130 | + $Self->{DefaultUserDomain} = $Self->{Config}->{"DefaultUserDomain"}; | |
131 | + | |
132 | + if ($ParamObject->GetParam(Param => "QueueID")) { | |
133 | + $Data{QueueID} = $ParamObject->GetParam(Param => "QueueID"); | |
134 | + } | |
135 | + | |
136 | + # Build service chooser | |
137 | + $Data{ServiceStrg} = $Self->BuildServices(ServiceID => $ParamObject->GetParam( Param => "ServiceID" )); | |
138 | + | |
138 | 139 | my $msgChooseService = $Self->{Config}->{"MessageChooseServicePublic"}; |
139 | 140 | |
140 | - if ($Self->{ParamObject}->GetParam( Param => "QueueID" ) ) { | |
141 | - my %queueData = $Self->{QueueObject}->QueueGet(ID => $Self->{ParamObject}->GetParam( Param => "QueueID" )); | |
141 | + if ($ParamObject->GetParam( Param => "QueueID" ) ) { | |
142 | + my %queueData = $Self->{QueueObject}->QueueGet(ID => $ParamObject->GetParam( Param => "QueueID" )); | |
142 | 143 | my $queueName = $queueData{Name}; |
143 | 144 | $msgChooseService =~ s/PLACE\_NAME/$queueName/g; |
144 | 145 | } |
145 | 146 | |
146 | - | |
147 | 147 | $Data{MsgChooseService} = $msgChooseService; |
148 | 148 | |
149 | - if ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) ) { | |
150 | - if ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) eq "CreateTicket" ) { | |
149 | + if ( $ParamObject->GetParam( Param => "Subaction" ) ) { | |
150 | + if ( $ParamObject->GetParam( Param => "Subaction" ) eq "CreateTicket" ) { | |
151 | 151 | return $Self->CreateTicket(); |
152 | 152 | } |
153 | - elsif ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) eq "GetFormJSON" ) { | |
154 | - return $Self->GetFormJSON( ServiceID => $Self->{ParamObject}->GetParam( Param => "ServiceID" ) ); | |
153 | + elsif ( $ParamObject->GetParam( Param => "Subaction" ) eq "GetFormJSON" ) { | |
154 | + return $Self->GetFormJSON( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) ); | |
155 | 155 | } |
156 | 156 | } |
157 | 157 | else { |
... | ... | @@ -161,36 +161,33 @@ sub Run { |
161 | 161 | $Data{FieldsForm} = $fields; |
162 | 162 | |
163 | 163 | # build output |
164 | - my $Output = | |
165 | - $Self->{LayoutObject} | |
166 | - ->CustomerHeader( Title => $Self->{LayoutObject}->{LanguageObject}->Get("New ticket wizard") ); | |
164 | + my $Output = $LayoutObject->CustomerHeader( Title => $LayoutObject->{LanguageObject}->Translate("New ticket wizard") ); | |
167 | 165 | |
168 | 166 | # maintenances |
169 | - my @maintenances = $Self->{MaintenanceObject}->ListCurrentMaintenances(); | |
167 | + my @maintenances = $MaintenanceObject->ListCurrentMaintenances(); | |
170 | 168 | |
171 | 169 | if (@maintenances) { |
172 | - $Self->{LayoutObject}->Block( | |
170 | + $LayoutObject->Block( | |
173 | 171 | Name => 'MaintenancesPanel', |
174 | 172 | ); |
175 | 173 | |
176 | 174 | for my $maintenanceHash (@maintenances) { |
177 | 175 | my %maintenance = %{$maintenanceHash}; |
178 | 176 | |
179 | - $Self->{LayoutObject}->Block( | |
177 | + $LayoutObject->Block( | |
180 | 178 | Name => 'MaintenanceLine', |
181 | 179 | Data => { |
182 | 180 | Message => $maintenance{'Description'}, |
183 | - StartDate => $Self->{DateUtilsObject}->BrazilianDate(Timestamp => $Self->{DateUtilsObject}->FromSQL(StringDate => $maintenance{StartDate})), | |
181 | + StartDate => $DateUtilsObject->BrazilianDate(Timestamp => $DateUtilsObject->FromSQL(StringDate => $maintenance{StartDate})), | |
184 | 182 | }); |
185 | 183 | } |
186 | 184 | } |
187 | - | |
188 | 185 | |
189 | - $Output .= $Self->{LayoutObject}->Output( | |
186 | + $Output .= $LayoutObject->Output( | |
190 | 187 | Data => \%Data, |
191 | 188 | TemplateFile => 'NewTicketWizardPublic', |
192 | 189 | ); |
193 | - $Output .= $Self->{LayoutObject}->CustomerFooter(); | |
190 | + $Output .= $LayoutObject->CustomerFooter(); | |
194 | 191 | return $Output; |
195 | 192 | } |
196 | 193 | } |
... | ... | @@ -198,17 +195,21 @@ sub Run { |
198 | 195 | sub GetFormJSON { |
199 | 196 | my ( $Self, %Param ) = @_; |
200 | 197 | my %serviceForm; |
198 | + | |
199 | + my $ServiceFormObject = $Kernel::OM->Get("Kernel::System::ServiceForm"); | |
200 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
201 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
201 | 202 | |
202 | 203 | if ( $Param{ServiceID} ) { |
203 | - %serviceForm = $Self->{ServiceFormObject}->GetServiceForm( ServiceID => $Param{ServiceID} ); | |
204 | + %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} ); | |
204 | 205 | } |
205 | 206 | |
206 | - my $QueueID = $Self->{ParamObject}->GetParam(Param => "QueueID"); | |
207 | + my $QueueID = $ParamObject->GetParam(Param => "QueueID"); | |
207 | 208 | |
208 | 209 | my ( $schema, $fields, $introduction ) = $Self->GetForm( ServiceForm => \%serviceForm, QueueID => $QueueID ); |
209 | 210 | |
210 | - return $Self->{LayoutObject}->Attachment( | |
211 | - ContentType => 'application/json; charset=' . $Self->{LayoutObject}->{Charset}, | |
211 | + return $LayoutObject->Attachment( | |
212 | + ContentType => 'application/json; charset=' . $LayoutObject->{Charset}, | |
212 | 213 | Content => "[{" . $schema . "}, {" . $fields . "}, \"" . $introduction . "\"]", |
213 | 214 | Type => 'inline', |
214 | 215 | NoCache => 1, |
... | ... | @@ -217,12 +218,15 @@ sub GetFormJSON { |
217 | 218 | |
218 | 219 | sub GetForm { |
219 | 220 | my ( $Self, %Param ) = @_; |
221 | + | |
222 | + my $TicketWizard = $Kernel::OM->Get("Kernel::System::TicketWizard"); | |
223 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
220 | 224 | |
221 | - my $schema = $Self->{TicketWizard}->GetBasicFieldsSchemaPublic(); | |
222 | - my $fields = $Self->{TicketWizard}->GetBasicFieldsOptionsPublic(); | |
225 | + my $schema = $TicketWizard->GetBasicFieldsSchemaPublic(); | |
226 | + my $fields = $TicketWizard->GetBasicFieldsOptionsPublic(); | |
223 | 227 | my $introduction; |
224 | 228 | |
225 | - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSValues( | |
229 | + ( $schema, $fields ) = $TicketWizard->ReplaceOTRSValues( | |
226 | 230 | Schema => $schema, |
227 | 231 | Options => $fields, |
228 | 232 | UserID => $Self->{DefaultUserID} |
... | ... | @@ -250,7 +254,7 @@ sub GetForm { |
250 | 254 | } |
251 | 255 | |
252 | 256 | # Incluir campos dinâmicos no replace |
253 | - ( $schema, $fields ) = $Self->{TicketWizard}->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | |
257 | + ( $schema, $fields ) = $TicketWizard->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields ); | |
254 | 258 | |
255 | 259 | if ($Param{"QueueID"}) { |
256 | 260 | $schema = $schema . ",\n\"QueueID\": {\n\"type\": \"string\",\n\"default\": \"" . $Param{"QueueID"} . "\"}"; |
... | ... | @@ -263,81 +267,66 @@ sub GetForm { |
263 | 267 | sub GetQueueID() { |
264 | 268 | my ( $Self, %Param ) = @_; |
265 | 269 | |
270 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
271 | + my $QueueObject = $Kernel::OM->Get("Kernel::System::Queue"); | |
272 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
273 | + | |
266 | 274 | # Check if queueID was sent |
267 | - my $QueueID = $Self->{ParamObject}->GetParam(Param => "QueueID"); | |
268 | - $Self->Debug( "\n\nBSUCANDO $QueueID FILA\n\n"); | |
275 | + my $QueueID = $ParamObject->GetParam(Param => "QueueID"); | |
269 | 276 | |
270 | 277 | if ($QueueID) { |
271 | - $Self->Debug( "\n\nRecebida fila $QueueID\n\n" ); | |
272 | - my %Queue = $Self->{QueueObject}->QueueGet(ID => $QueueID); | |
278 | + my %Queue = $QueueObject->QueueGet(ID => $QueueID); | |
273 | 279 | return ($Queue{"Name"}, $QueueID); |
274 | 280 | } |
275 | 281 | |
276 | 282 | # Gets default Queue |
277 | - my $ConfigTicket = $Self->{ConfigObject}->Get("Ticket::Frontend::CustomerTicketMessage"); | |
278 | - my $ConfigTicketWizard = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
283 | + my $ConfigTicket = $ConfigObject->Get("Ticket::Frontend::CustomerTicketMessage"); | |
284 | + my $ConfigTicketWizard = $ConfigObject->Get("Ticket::Frontend::Customer::NewTicketWizard"); | |
279 | 285 | |
280 | 286 | my $QueueDefault = $ConfigTicket->{"QueueDefault"}; |
281 | 287 | |
282 | 288 | # Checks if there is a field for the queue |
283 | - #print STDERR Dumper($ConfigTicketWizard); | |
284 | - | |
285 | 289 | my $QueuePrefix = $ConfigTicketWizard->{"QueuePrefix"}; |
286 | 290 | my $QueueField = $ConfigTicketWizard->{"QueueField"}; |
287 | - $Self->Debug( "Searching queue for - $QueuePrefix ($QueueField)!" ); | |
288 | 291 | |
289 | - my %QueueListID = $Self->{QueueObject}->QueueList( Valid => 1 ); | |
290 | - my %QueueList = reverse $Self->{QueueObject}->QueueList( Valid => 1 ); | |
292 | + my %QueueListID = $QueueObject->QueueList( Valid => 1 ); | |
293 | + my %QueueList = reverse $QueueObject->QueueList( Valid => 1 ); | |
291 | 294 | $QueueID = $QueueList{$QueueDefault}; |
292 | 295 | my $Queue = $QueueListID{$QueueID}; |
293 | 296 | |
294 | - ### $Self->Debug(Dumper(\%QueueList)); | |
295 | - | |
296 | 297 | if ( $QueuePrefix && $QueueField ) { |
297 | - my $QueueSelected = $Self->{ParamObject}->GetParam( Param => $QueueField ); | |
298 | + my $QueueSelected = $ParamObject->GetParam( Param => $QueueField ); | |
298 | 299 | my $QueueName = "$QueuePrefix $QueueSelected"; |
299 | - ###$Self->Debug( "Searching queue for - $QueuePrefix ($QueueField) - [$QueueName]!" ); | |
300 | 300 | |
301 | 301 | if ( $QueueList{$QueueName} ) { |
302 | 302 | $QueueID = $QueueList{$QueueName}; |
303 | 303 | $Queue = $QueueName; |
304 | - ###$Self->Debug( "Custom queue found - $QueueName ($QueueID)!" ); | |
305 | 304 | } |
306 | - | |
307 | 305 | } |
308 | - | |
306 | + | |
309 | 307 | return ( $Queue, $QueueID ); |
310 | 308 | } |
311 | 309 | |
312 | -sub Debug { | |
313 | - my $Self = shift; | |
314 | - my $msg = shift; | |
315 | - | |
316 | - #print STDERR "\n\nDEBUG => $msg\n\n"; | |
317 | -} | |
318 | - | |
319 | 310 | sub GetUserIDFromEmail { |
320 | 311 | my $Self = shift; |
321 | 312 | my $email = shift; |
322 | 313 | my $result = $Self->{DefaultCustomerID}; |
323 | 314 | my $domainList = $Self->{DefaultUserDomain}; |
315 | + | |
316 | + my $CustomerUserObject = $Kernel::OM->Get("Kernel::System::CustomerUser"); | |
324 | 317 | |
325 | 318 | if ($domainList) { |
326 | - $Self->Debug("Has Domain in config"); | |
327 | 319 | my @domains = split( ",", $domainList ); |
328 | 320 | |
329 | 321 | for my $domain (@domains) { |
330 | - $Self->Debug("Checking domain <$domain>"); | |
331 | 322 | my @parts = split( "@", $email ); |
332 | 323 | if ( $parts[1] eq $domain ) { |
333 | - $Self->Debug("Domain equals config"); | |
334 | 324 | my $id = $parts[0]; |
335 | - my %List = $Self->{CustomerUserObject}->CustomerSearch( | |
325 | + my %List = $CustomerUserObject->CustomerSearch( | |
336 | 326 | UserLogin => $id, |
337 | 327 | Valid => 1, # not required, default 1 |
338 | 328 | ); |
339 | 329 | if ( keys %List ) { |
340 | - $Self->Debug("User found!"); | |
341 | 330 | $result = $id; |
342 | 331 | return $result; |
343 | 332 | } |
... | ... | @@ -352,6 +341,14 @@ sub CreateTicket { |
352 | 341 | my ( $Self, %Param ) = @_; |
353 | 342 | my %Data = (); |
354 | 343 | |
344 | + my $TicketObject = $Kernel::OM->Get("Kernel::System::Ticket"); | |
345 | + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | |
346 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
347 | + my $BackendObject = $Kernel::OM->Get("Kernel::System::DynamicField::Backend"); | |
348 | + my $DynamicFieldObject = $Kernel::OM->Get("Kernel::System::DynamicField"); | |
349 | + my $CustomerUserObject = $Kernel::OM->Get("Kernel::System::CustomerUser"); | |
350 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
351 | + | |
355 | 352 | # Queue |
356 | 353 | my $queueFixed = 0; |
357 | 354 | if ($Data{QueueID}) { |
... | ... | @@ -360,20 +357,18 @@ sub CreateTicket { |
360 | 357 | my ( $Queue, $QueueID ) = $Self->GetQueueID(%Param); |
361 | 358 | $Data{QueueID} = $QueueID; |
362 | 359 | |
363 | - #print STDERR "\n\nFila achada: " . $Queue . "\n\n"; | |
364 | - | |
365 | - $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::CustomerTicketMessage"); | |
360 | + $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::CustomerTicketMessage"); | |
366 | 361 | |
367 | - my $TicketID = $Self->{TicketObject}->TicketCreate( | |
368 | - Title => $Self->{ParamObject}->GetParam( Param => "subject" ), | |
362 | + my $TicketID = $TicketObject->TicketCreate( | |
363 | + Title => $ParamObject->GetParam( Param => "subject" ), | |
369 | 364 | QueueID => $QueueID, |
370 | 365 | Priority => $Self->{Config}->{PriorityDefault}, |
371 | 366 | Lock => 'unlock', |
372 | 367 | State => 'new', |
373 | - ServiceID => $Self->{ParamObject}->GetParam( Param => "service" ), | |
374 | - TypeID => $Self->{ParamObject}->GetParam( Param => "type" ), | |
375 | - CustomerID => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), | |
376 | - CustomerUser => $Self->GetUserIDFromEmail( $Self->{ParamObject}->GetParam( Param => "email" ) ), | |
368 | + ServiceID => $ParamObject->GetParam( Param => "service" ), | |
369 | + TypeID =>$ParamObject->GetParam( Param => "type" ), | |
370 | + CustomerID => $Self->GetUserIDFromEmail( $ParamObject->GetParam( Param => "email" ) ), | |
371 | + CustomerUser => $Self->GetUserIDFromEmail( $ParamObject->GetParam( Param => "email" ) ), | |
377 | 372 | OwnerID => $Self->{DefaultUserID}, |
378 | 373 | UserID => $Self->{DefaultUserID}, |
379 | 374 | ); |
... | ... | @@ -382,61 +377,61 @@ sub CreateTicket { |
382 | 377 | my $serviceFields = ""; |
383 | 378 | |
384 | 379 | # Service Fields |
385 | - for ( $Self->{ParamObject}->GetParamNames() ) { | |
380 | + for ( $ParamObject->GetParamNames() ) { | |
386 | 381 | if ( substr( $_, 0, 3 ) eq "SF_" ) { |
387 | - $serviceFields .= substr( $_, 3 ) . ": " . $Self->{ParamObject}->GetParam( Param => $_ ) . "\n"; | |
382 | + $serviceFields .= substr( $_, 3 ) . ": " . $ParamObject->GetParam( Param => $_ ) . "\n"; | |
388 | 383 | } |
389 | 384 | } |
390 | 385 | |
391 | 386 | $serviceFields .= "\n\n"; |
392 | 387 | |
393 | 388 | # Dynamic Fields |
394 | - for ( $Self->{ParamObject}->GetParamNames() ) { | |
389 | + for ( $ParamObject->GetParamNames() ) { | |
395 | 390 | if ( substr( $_, 0, 3 ) eq "DF_" ) { |
396 | - my $Success = $Self->{BackendObject}->ValueSet( | |
397 | - DynamicFieldConfig => $Self->{DynamicFieldObject}->DynamicFieldGet( Name => substr( $_, 3 ) ), | |
391 | + my $Success = $BackendObject->ValueSet( | |
392 | + DynamicFieldConfig => $DynamicFieldObject->DynamicFieldGet( Name => substr( $_, 3 ) ), | |
398 | 393 | ObjectID => $TicketID, |
399 | - Value => $Self->{ParamObject}->GetParam( Param => $_ ), | |
394 | + Value => $ParamObject->GetParam( Param => $_ ), | |
400 | 395 | UserID => $Self->{DefaultUserID}, |
401 | 396 | ); |
402 | 397 | } |
403 | 398 | } |
404 | 399 | |
405 | 400 | # Create article |
406 | - my $FullName = $Self->{ParamObject}->GetParam( Param => "name" ); | |
407 | - my $Email = $Self->{ParamObject}->GetParam( Param => "email" ); | |
401 | + my $FullName = $ParamObject->GetParam( Param => "name" ); | |
402 | + my $Email = $ParamObject->GetParam( Param => "email" ); | |
408 | 403 | my $From = "\"$FullName\" <$Email>"; |
409 | - my $ArticleID = $Self->{TicketObject}->ArticleCreate( | |
404 | + my $ArticleID = $TicketObject->ArticleCreate( | |
410 | 405 | TicketID => $TicketID, |
411 | 406 | ArticleType => $Self->{Config}->{ArticleType}, |
412 | 407 | SenderType => $Self->{Config}->{SenderType}, |
413 | 408 | From => $From, |
414 | 409 | To => $Queue, |
415 | - Subject => $Self->{ParamObject}->GetParam( Param => "subject" ), | |
416 | - Body => $serviceFields . $Self->{ParamObject}->GetParam( Param => "description" ), | |
410 | + Subject => $ParamObject->GetParam( Param => "subject" ), | |
411 | + Body => $serviceFields . $ParamObject->GetParam( Param => "description" ), | |
417 | 412 | MimeType => $MimeType, |
418 | - Charset => $Self->{LayoutObject}->{UserCharset}, | |
413 | + Charset => $LayoutObject->{UserCharset}, | |
419 | 414 | UserID => $Self->{DefaultUserID}, |
420 | 415 | HistoryType => $Self->{Config}->{HistoryType}, |
421 | 416 | HistoryComment => $Self->{Config}->{HistoryComment} || '%%', |
422 | - AutoResponseType => ( $Self->{ConfigObject}->Get('AutoResponseForWebTickets') ) | |
417 | + AutoResponseType => ( $ConfigObject->Get('AutoResponseForWebTickets') ) | |
423 | 418 | ? 'auto reply' |
424 | 419 | : '', |
425 | 420 | OrigHeader => { |
426 | 421 | From => $From, |
427 | 422 | To => $Queue, |
428 | - Subject => $Self->{ParamObject}->GetParam( Param => "subject" ), | |
429 | - Body => $serviceFields . $Self->{ParamObject}->GetParam( Param => "description" ), | |
423 | + Subject => $ParamObject->GetParam( Param => "subject" ), | |
424 | + Body => $serviceFields . $ParamObject->GetParam( Param => "description" ), | |
430 | 425 | }, |
431 | 426 | Queue => $Queue, |
432 | 427 | ); |
433 | 428 | |
434 | 429 | # Attachments |
435 | - my %UploadStuff = $Self->{ParamObject}->GetUploadAll( Param => "attachment" ); | |
430 | + my %UploadStuff = $ParamObject->GetUploadAll( Param => "attachment" ); | |
436 | 431 | |
437 | 432 | # if (%UploadStuff) { |
438 | 433 | # print STDERR "\nTem anexo!\n"; |
439 | - $Self->{TicketObject}->ArticleWriteAttachment( | |
434 | + $TicketObject->ArticleWriteAttachment( | |
440 | 435 | %UploadStuff, |
441 | 436 | ArticleID => $ArticleID, |
442 | 437 | UserID => $Self->{DefaultUserID}, |
... | ... | @@ -444,27 +439,20 @@ sub CreateTicket { |
444 | 439 | |
445 | 440 | # } |
446 | 441 | |
447 | - $Data{TicketNumber} = $Self->{TicketObject}->TicketNumberLookup( TicketID => $TicketID ); | |
442 | + $Data{TicketNumber} = $TicketObject->TicketNumberLookup( TicketID => $TicketID ); | |
448 | 443 | |
449 | 444 | # build output |
450 | 445 | if (! $queueFixed) { |
451 | 446 | delete $Data{QueueID} |
452 | 447 | } |
453 | - my $Output = $Self->{LayoutObject}->CustomerHeader( Title => "Ticket created" ); | |
454 | - $Output .= $Self->{LayoutObject}->Output( | |
448 | + my $Output = $LayoutObject->CustomerHeader( Title => "Ticket created" ); | |
449 | + $Output .= $LayoutObject->Output( | |
455 | 450 | Data => \%Data, |
456 | 451 | TemplateFile => 'NewTicketWizardTicketCreatedPublic', |
457 | 452 | ); |
458 | - $Output .= $Self->{LayoutObject}->CustomerFooter(); | |
453 | + $Output .= $LayoutObject->CustomerFooter(); | |
459 | 454 | return $Output; |
460 | 455 | |
461 | 456 | } |
462 | 457 | |
463 | -sub Debug { | |
464 | - my $Self = shift; | |
465 | - my $msg = shift; | |
466 | - | |
467 | - print STDERR "\n\nDEBUG => $msg\n"; | |
468 | -} | |
469 | - | |
470 | 458 | 1; | ... | ... |
Kernel/Modules/NewTicketWizardServiceForm.pm
1 | 1 | # -- |
2 | 2 | # Kernel/Modules/NewTicketWizard.pm - frontend module for customizing service forms |
3 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/08/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
4 | 7 | # -- |
5 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
6 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -12,11 +15,17 @@ use strict; |
12 | 15 | use warnings; |
13 | 16 | |
14 | 17 | use Kernel::System::VariableCheck qw(:all); |
15 | -use Data::Dumper; | |
16 | -use Kernel::System::ServiceForm; | |
17 | -use Kernel::System::Service; | |
18 | 18 | |
19 | -# TODO: Traducoes | |
19 | +our @ObjectDependencies = ( | |
20 | +"Kernel::System::Web::Request", | |
21 | +"Kernel::System::DB", | |
22 | +"Kernel::Output::HTML::Layout", | |
23 | +"KerneL::System::Log", | |
24 | +"Kernel::Config", | |
25 | +"Kernel::System::DynamicField::Backend", | |
26 | +"Kernel::System::Service", | |
27 | +"Kernel::System::ServiceForm", | |
28 | +"Kernel::System::SystemAddress" ); | |
20 | 29 | |
21 | 30 | sub new { |
22 | 31 | my ( $Type, %Param ) = @_; |
... | ... | @@ -25,22 +34,6 @@ sub new { |
25 | 34 | my $Self = {%Param}; |
26 | 35 | bless( $Self, $Type ); |
27 | 36 | |
28 | - # check needed objects | |
29 | - for ( | |
30 | - qw(ParamObject DBObject LayoutObject LogObject ConfigObject) | |
31 | - ) | |
32 | - { | |
33 | - if ( !$Self->{$_} ) { | |
34 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
35 | - } | |
36 | - } | |
37 | - | |
38 | - # needed objects | |
39 | - $Self->{SystemAddress} = Kernel::System::SystemAddress->new(%Param); | |
40 | - $Self->{BackendObject} = Kernel::System::DynamicField::Backend->new(%Param); | |
41 | - $Self->{ServiceObject} = Kernel::System::Service->new(%Param); | |
42 | - $Self->{ServiceFormObject} = Kernel::System::ServiceForm->new(%Param); | |
43 | - | |
44 | 37 | return $Self; |
45 | 38 | } |
46 | 39 | |
... | ... | @@ -48,44 +41,46 @@ sub Run { |
48 | 41 | |
49 | 42 | my ( $Self, %Param ) = @_; |
50 | 43 | my %Data = (); |
51 | - | |
52 | - if ( $Self->{ParamObject}->GetParam( Param => "Subaction" ) ) { | |
44 | + | |
45 | + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); | |
46 | + my $ServiceFormObject = $Kernel::OM->Get("Kernel::System::ServiceForm"); | |
47 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
48 | + | |
49 | + if ( $ParamObject->GetParam( Param => "Subaction" ) ) { | |
53 | 50 | if ( $Self->{Subaction} eq 'ServiceEdit' ) { |
54 | 51 | |
55 | 52 | # header |
56 | - my $Output = $Self->{LayoutObject}->Header(); | |
57 | - $Output .= $Self->{LayoutObject}->NavigationBar(); | |
53 | + my $Output = $LayoutObject->Header(); | |
54 | + $Output .= $LayoutObject->NavigationBar(); | |
58 | 55 | |
59 | - my %serviceForm = | |
60 | - $Self->{ServiceFormObject} | |
61 | - ->GetServiceForm( ServiceID => $Self->{ParamObject}->GetParam( Param => "ServiceID" ) ); | |
56 | + my %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) ); | |
62 | 57 | |
63 | 58 | $Data{Introduction} = $serviceForm{Introduction}; |
64 | 59 | $Data{Form} = $serviceForm{Form}; |
65 | 60 | $Data{Schema} = $serviceForm{Schema}; |
66 | - $Data{ServiceID} = $Self->{ParamObject}->GetParam( Param => "ServiceID" ); | |
61 | + $Data{ServiceID} = $ParamObject->GetParam( Param => "ServiceID" ); | |
67 | 62 | |
68 | - $Output .= $Self->{LayoutObject}->Output( | |
63 | + $Output .= $LayoutObject->Output( | |
69 | 64 | Data => \%Data, |
70 | 65 | TemplateFile => 'NewTicketWizardServiceFormEdit', |
71 | 66 | ); |
72 | 67 | |
73 | 68 | # html output |
74 | - $Output .= $Self->{LayoutObject}->Footer(); | |
69 | + $Output .= $LayoutObject->Footer(); | |
75 | 70 | |
76 | 71 | return $Output; |
77 | 72 | } |
78 | 73 | elsif ( $Self->{Subaction} eq 'ServiceSave' ) { |
79 | 74 | |
80 | 75 | # header |
81 | - my $Output = $Self->{LayoutObject}->Header(); | |
82 | - $Output .= $Self->{LayoutObject}->NavigationBar(); | |
83 | - | |
84 | - $Self->{ServiceFormObject}->SaveServiceForm( | |
85 | - ServiceID => $Self->{ParamObject}->GetParam( Param => "ServiceID" ), | |
86 | - Introduction => $Self->{ParamObject}->GetParam( Param => "Introduction" ), | |
87 | - Form => $Self->{ParamObject}->GetParam( Param => "Form" ), | |
88 | - Schema => $Self->{ParamObject}->GetParam( Param => "Schema" ), | |
76 | + my $Output = $LayoutObject->Header(); | |
77 | + $Output .= $LayoutObject->NavigationBar(); | |
78 | + | |
79 | + $ServiceFormObject->SaveServiceForm( | |
80 | + ServiceID => $ParamObject->GetParam( Param => "ServiceID" ), | |
81 | + Introduction => $ParamObject->GetParam( Param => "Introduction" ), | |
82 | + Form => $ParamObject->GetParam( Param => "Form" ), | |
83 | + Schema => $ParamObject->GetParam( Param => "Schema" ), | |
89 | 84 | ); |
90 | 85 | |
91 | 86 | return $Self->Overview(); |
... | ... | @@ -101,20 +96,23 @@ sub Overview { |
101 | 96 | my ( $Self, %Param ) = @_; |
102 | 97 | |
103 | 98 | my %Data = (); |
99 | + | |
100 | + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | |
101 | + my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service"); | |
104 | 102 | |
105 | 103 | # build output |
106 | - $Self->{LayoutObject}->Block( | |
104 | + $LayoutObject->Block( | |
107 | 105 | Name => 'Overview', |
108 | 106 | Data => { %Param, }, |
109 | 107 | ); |
110 | 108 | |
111 | - $Self->{LayoutObject}->Block( | |
109 | + $LayoutObject->Block( | |
112 | 110 | Name => 'OverviewList', |
113 | 111 | Data => { %Param, }, |
114 | 112 | ); |
115 | 113 | |
116 | 114 | # get service list |
117 | - my $ServiceList = $Self->{ServiceObject}->ServiceListGet( | |
115 | + my $ServiceList = $ServiceObject->ServiceListGet( | |
118 | 116 | Valid => 1, |
119 | 117 | UserID => $Self->{UserID}, |
120 | 118 | ); |
... | ... | @@ -129,7 +127,7 @@ sub Overview { |
129 | 127 | if (! grep { index($_->{Name}, $ServiceData->{Name} . "::") >= 0} @{$ServiceList} ) { |
130 | 128 | |
131 | 129 | # output row |
132 | - $Self->{LayoutObject}->Block( | |
130 | + $LayoutObject->Block( | |
133 | 131 | Name => 'OverviewListRow', |
134 | 132 | Data => { %{$ServiceData} }, |
135 | 133 | ); |
... | ... | @@ -137,14 +135,14 @@ sub Overview { |
137 | 135 | } |
138 | 136 | } |
139 | 137 | |
140 | - my $Output = $Self->{LayoutObject}->Header( Title => $Self->{LayoutObject}->{LanguageObject}->Get("Service Form") ); | |
138 | + my $Output = $LayoutObject->Header( Title => $LayoutObject->{LanguageObject}->Translate("Service Form") ); | |
141 | 139 | |
142 | - $Output .= $Self->{LayoutObject}->NavigationBar(); | |
143 | - $Output .= $Self->{LayoutObject}->Output( | |
140 | + $Output .= $LayoutObject->NavigationBar(); | |
141 | + $Output .= $LayoutObject->Output( | |
144 | 142 | Data => \%Data, |
145 | 143 | TemplateFile => 'NewTicketWizardServiceForm', |
146 | 144 | ); |
147 | - $Output .= $Self->{LayoutObject}->Footer(); | |
145 | + $Output .= $LayoutObject->Footer(); | |
148 | 146 | return $Output; |
149 | 147 | } |
150 | 148 | ... | ... |
Kernel/Modules/QueuesPanel.pm
... | ... | @@ -1,193 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Modules/QueuesPanel.pm - frontend module for choosing top queues | |
3 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | -package Kernel::Modules::QueuesPanel; | |
10 | - | |
11 | -use strict; | |
12 | -use warnings; | |
13 | - | |
14 | -use Kernel::System::Queue; | |
15 | -use Kernel::System::VariableCheck qw(:all); | |
16 | -use Data::Dumper; | |
17 | - | |
18 | -sub new { | |
19 | - my ( $Type, %Param ) = @_; | |
20 | - | |
21 | - # allocate new hash for object | |
22 | - my $Self = {%Param}; | |
23 | - bless( $Self, $Type ); | |
24 | - | |
25 | - # check needed objects | |
26 | - for ( | |
27 | - qw(ParamObject DBObject LayoutObject LogObject ConfigObject) | |
28 | - ) | |
29 | - { | |
30 | - if ( !$Self->{$_} ) { | |
31 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
32 | - } | |
33 | - } | |
34 | - | |
35 | - # needed objects | |
36 | - | |
37 | - return $Self; | |
38 | -} | |
39 | - | |
40 | -sub Run { | |
41 | - my ( $Self, %Param ) = @_; | |
42 | - my %Data = (); | |
43 | - | |
44 | - $Self->{UrlAtendimento} = '/otrs/customer.pl?Action=NewTicketWizard;QueueID='; | |
45 | - | |
46 | - $Data{"QueueJS"} = $Self->BuildQueuesJS(); | |
47 | - | |
48 | - $Self->Debug( $Data{"QueueJS"} ); | |
49 | - | |
50 | - $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::QueuesPanel"); | |
51 | - my $msgChooseService = $Self->{Config}->{"MessageChooseQueue"}; | |
52 | - $Data{MsgChooseQueue} = $msgChooseService; | |
53 | - | |
54 | - # build output | |
55 | - my $Output = | |
56 | - $Self->{LayoutObject}->CustomerHeader( Title => $Self->{LayoutObject}->{LanguageObject}->Get("Queues panel") ); | |
57 | - | |
58 | - $Output .= $Self->{LayoutObject}->Output( | |
59 | - Data => \%Data, | |
60 | - TemplateFile => 'QueuesPanel', | |
61 | - ); | |
62 | - $Output .= $Self->{LayoutObject}->CustomerFooter(); | |
63 | - return $Output; | |
64 | -} | |
65 | - | |
66 | -sub BuildQueuesJS { | |
67 | - my ( $Self, %Param ) = @_; | |
68 | - | |
69 | - # Get queues | |
70 | - my %Queues = (); | |
71 | - | |
72 | - $Self->{DBObject}->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); | |
73 | - while ( my @Row = $Self->{DBObject}->FetchrowArray() ) { | |
74 | - $Queues{ $Row[0] } = $Row[1]; | |
75 | - } | |
76 | - | |
77 | - my $result = | |
78 | - '$(document).ready(function() {' . "\n\t" | |
79 | - . ' $("#columns").hColumns({' | |
80 | - . "\n\t\t" | |
81 | - . ' nodeSource: function(node_id, callback) {' . "\n"; | |
82 | - | |
83 | - for my $queue ( keys %Queues ) { | |
84 | - $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue ); | |
85 | - } | |
86 | - | |
87 | - $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues ); | |
88 | - | |
89 | - $result = $result . "\n\t}});\n});"; | |
90 | - | |
91 | - return $result; | |
92 | -} | |
93 | - | |
94 | -sub BuildTopQueuesJS { | |
95 | - my ( $Self, %Param ) = @_; | |
96 | - my %Queues = %{ $Param{"Queues"} }; | |
97 | - | |
98 | - my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; | |
99 | - | |
100 | - my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; | |
101 | - for my $queue (@topQueues) { | |
102 | - | |
103 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | |
104 | - $result = $result | |
105 | - . "\t\t\t\t" | |
106 | - . '{ id: ' | |
107 | - . $queue | |
108 | - . ', label: "' | |
109 | - . $Self->LastQueue( $Queues{$queue} ) | |
110 | - . '", type: "folder" },' . "\n"; | |
111 | - } | |
112 | - else { | |
113 | - $result = $result | |
114 | - . "\t\t\t\t" | |
115 | - . '{ id: ' | |
116 | - . $queue | |
117 | - . ', label: "' | |
118 | - . $Self->LastQueue( $Queues{$queue} ) | |
119 | - . '", type: "link", url: "' | |
120 | - . $Self->{UrlAtendimento} | |
121 | - . $queue . '" },' . "\n"; | |
122 | - } | |
123 | - } | |
124 | - | |
125 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | |
126 | - | |
127 | - return $result; | |
128 | -} | |
129 | - | |
130 | -sub BuildQueueJS { | |
131 | - my ( $Self, %Param ) = @_; | |
132 | - my %Queues = %{ $Param{"Queues"} }; | |
133 | - my $BaseQueue = $Param{"Queue"}; | |
134 | - my $BaseQueueID = $Param{"QueueID"}; | |
135 | - | |
136 | - # Get subqueues | |
137 | - my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; | |
138 | - my $level = () = $BaseQueue =~ /::/g; | |
139 | - $level = $level + 1; | |
140 | - | |
141 | - # Remove subsubqueues | |
142 | - @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; | |
143 | - | |
144 | - # When there are no subqueues, there is no need to create a JS | |
145 | - if ( !@subqueues ) { | |
146 | - return; | |
147 | - } | |
148 | - | |
149 | - my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; | |
150 | - | |
151 | - for my $queue (@subqueues) { | |
152 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | |
153 | - $result = $result | |
154 | - . "\t\t\t\t" | |
155 | - . '{ id: ' | |
156 | - . $queue | |
157 | - . ', label: "' | |
158 | - . $Self->LastQueue( $Queues{$queue} ) | |
159 | - . '", type: "folder" }, ' . "\n"; | |
160 | - } | |
161 | - else { | |
162 | - $result = $result | |
163 | - . "\t\t\t\t" | |
164 | - . '{ id: ' | |
165 | - . $queue | |
166 | - . ', label: "' | |
167 | - . $Self->LastQueue( $Queues{$queue} ) | |
168 | - . '", type: "link", url: "' | |
169 | - . $Self->{UrlAtendimento} | |
170 | - . $queue . '" }, ' . "\n"; | |
171 | - } | |
172 | - } | |
173 | - | |
174 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | |
175 | - | |
176 | - return $result; | |
177 | -} | |
178 | - | |
179 | -sub LastQueue { | |
180 | - my $Self = shift; | |
181 | - my $queue = shift; | |
182 | - my @parts = split( "::", $queue ); | |
183 | - return $parts[-1]; | |
184 | -} | |
185 | - | |
186 | -sub Debug { | |
187 | - my $Self = shift; | |
188 | - my $msg = shift; | |
189 | - | |
190 | - #print STDERR "\n\nDEBUG => \n$msg\n\n"; | |
191 | -} | |
192 | - | |
193 | -1; |
Kernel/Modules/QueuesPanelPublic.pm
... | ... | @@ -1,216 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Modules/QueuesPanelPublic.pm - frontend module for choosing top queues | |
3 | -# Copyright (C) 2014 (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | -package Kernel::Modules::QueuesPanelPublic; | |
10 | - | |
11 | -use strict; | |
12 | -use warnings; | |
13 | - | |
14 | -use Kernel::System::Queue; | |
15 | -use Kernel::System::VariableCheck qw(:all); | |
16 | -use Data::Dumper; | |
17 | - | |
18 | -sub new { | |
19 | - my ( $Type, %Param ) = @_; | |
20 | - | |
21 | - # allocate new hash for object | |
22 | - my $Self = {%Param}; | |
23 | - bless( $Self, $Type ); | |
24 | - | |
25 | - # check needed objects | |
26 | - for ( | |
27 | - qw(ParamObject DBObject LayoutObject LogObject ConfigObject) | |
28 | - ) | |
29 | - { | |
30 | - if ( !$Self->{$_} ) { | |
31 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
32 | - } | |
33 | - } | |
34 | - | |
35 | - # needed objects | |
36 | - | |
37 | - return $Self; | |
38 | -} | |
39 | - | |
40 | -sub Run { | |
41 | - my ( $Self, %Param ) = @_; | |
42 | - my %Data = (); | |
43 | - | |
44 | - ## Se recebeu o ticket, significa que usuario já está autenticado | |
45 | - if ( $Self->{ParamObject}->GetParam( Param => "ticket" ) ) { | |
46 | - $Self->Debug("Recebida URL com ticket"); | |
47 | - my $retorno = $Self->{LayoutObject}->Redirect( OP => "Action=QueuesPanel", ); | |
48 | - $retorno =~ s/public/customer/g; | |
49 | - $Self->Debug( "Redirect feito: " . $retorno ); | |
50 | - return $retorno; | |
51 | - } | |
52 | - | |
53 | - ## Se tiver parametro para tentar autenticar, repassa ao CAS com gateway | |
54 | - if ( $Self->{ParamObject}->GetParam( Param => "autenticar" ) ) { | |
55 | - my $url = | |
56 | - $Self->{ConfigObject}->Get('Customer::AuthModule::CAS::CASUrl') | |
57 | - . "/login?gateway=true&service=" | |
58 | - . "https://" | |
59 | - . $ENV{SERVER_NAME} | |
60 | - . $ENV{SCRIPT_NAME} | |
61 | - . "?Action=QueuesPanelPublic"; | |
62 | - $Self->Debug("Recebida tentativa de autenticar via url $url"); | |
63 | - return $Self->{LayoutObject}->Redirect( ExtURL => $url, ); | |
64 | - } | |
65 | - ## | |
66 | - | |
67 | - $Self->{UrlAtendimento} = '/otrs/public.pl?Action=NewTicketWizardPublic;QueueID='; | |
68 | - | |
69 | - $Data{"QueueJS"} = $Self->BuildQueuesJS(); | |
70 | - | |
71 | - $Self->Debug( $Data{"QueueJS"} ); | |
72 | - | |
73 | - $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::QueuesPanel"); | |
74 | - my $msgChooseService = $Self->{Config}->{"MessageChooseQueuePublic"}; | |
75 | - $Data{MsgChooseQueue} = $msgChooseService; | |
76 | - | |
77 | - # build output | |
78 | - my $Output = | |
79 | - $Self->{LayoutObject}->CustomerHeader( Title => $Self->{LayoutObject}->{LanguageObject}->Get("New ticket") ); | |
80 | - | |
81 | - $Output .= $Self->{LayoutObject}->Output( | |
82 | - Data => \%Data, | |
83 | - TemplateFile => 'QueuesPanel', | |
84 | - ); | |
85 | - $Output .= $Self->{LayoutObject}->CustomerFooter(); | |
86 | - return $Output; | |
87 | -} | |
88 | - | |
89 | -sub BuildQueuesJS { | |
90 | - my ( $Self, %Param ) = @_; | |
91 | - | |
92 | - # Get queues | |
93 | - my %Queues = (); | |
94 | - | |
95 | - $Self->{DBObject}->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); | |
96 | - while ( my @Row = $Self->{DBObject}->FetchrowArray() ) { | |
97 | - $Queues{ $Row[0] } = $Row[1]; | |
98 | - } | |
99 | - | |
100 | - my $result = | |
101 | - '$(document).ready(function() {' . "\n\t" | |
102 | - . ' $("#columns").hColumns({' | |
103 | - . "\n\t\t" | |
104 | - . ' nodeSource: function(node_id, callback) {' . "\n"; | |
105 | - | |
106 | - for my $queue ( keys %Queues ) { | |
107 | - $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue ); | |
108 | - } | |
109 | - | |
110 | - $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues ); | |
111 | - | |
112 | - $result = $result . "\n\t}});\n});"; | |
113 | - | |
114 | - return $result; | |
115 | -} | |
116 | - | |
117 | -sub BuildTopQueuesJS { | |
118 | - my ( $Self, %Param ) = @_; | |
119 | - my %Queues = %{ $Param{"Queues"} }; | |
120 | - | |
121 | - my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; | |
122 | - | |
123 | - my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; | |
124 | - for my $queue (@topQueues) { | |
125 | - | |
126 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | |
127 | - $result = $result | |
128 | - . "\t\t\t\t" | |
129 | - . '{ id: ' | |
130 | - . $queue | |
131 | - . ', label: "' | |
132 | - . $Self->LastQueue( $Queues{$queue} ) | |
133 | - . '", type: "folder" },' . "\n"; | |
134 | - } | |
135 | - else { | |
136 | - $result = $result | |
137 | - . "\t\t\t\t" | |
138 | - . '{ id: ' | |
139 | - . $queue | |
140 | - . ', label: "' | |
141 | - . $Self->LastQueue( $Queues{$queue} ) | |
142 | - . '", type: "link", url: "' | |
143 | - . $Self->{UrlAtendimento} | |
144 | - . $queue . '" },' . "\n"; | |
145 | - } | |
146 | - } | |
147 | - | |
148 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | |
149 | - | |
150 | - return $result; | |
151 | -} | |
152 | - | |
153 | -sub BuildQueueJS { | |
154 | - my ( $Self, %Param ) = @_; | |
155 | - my %Queues = %{ $Param{"Queues"} }; | |
156 | - my $BaseQueue = $Param{"Queue"}; | |
157 | - my $BaseQueueID = $Param{"QueueID"}; | |
158 | - | |
159 | - # Get subqueues | |
160 | - my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; | |
161 | - my $level = () = $BaseQueue =~ /::/g; | |
162 | - $level = $level + 1; | |
163 | - | |
164 | - # Remove subsubqueues | |
165 | - @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; | |
166 | - | |
167 | - # When there are no subqueues, there is no need to create a JS | |
168 | - if ( !@subqueues ) { | |
169 | - return; | |
170 | - } | |
171 | - | |
172 | - my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; | |
173 | - | |
174 | - for my $queue (@subqueues) { | |
175 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | |
176 | - $result = $result | |
177 | - . "\t\t\t\t" | |
178 | - . '{ id: ' | |
179 | - . $queue | |
180 | - . ', label: "' | |
181 | - . $Self->LastQueue( $Queues{$queue} ) | |
182 | - . '", type: "folder" }, ' . "\n"; | |
183 | - } | |
184 | - else { | |
185 | - $result = $result | |
186 | - . "\t\t\t\t" | |
187 | - . '{ id: ' | |
188 | - . $queue | |
189 | - . ', label: "' | |
190 | - . $Self->LastQueue( $Queues{$queue} ) | |
191 | - . '", type: "link", url: "' | |
192 | - . $Self->{UrlAtendimento} | |
193 | - . $queue . '" }, ' . "\n"; | |
194 | - } | |
195 | - } | |
196 | - | |
197 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | |
198 | - | |
199 | - return $result; | |
200 | -} | |
201 | - | |
202 | -sub LastQueue { | |
203 | - my $Self = shift; | |
204 | - my $queue = shift; | |
205 | - my @parts = split( "::", $queue ); | |
206 | - return $parts[-1]; | |
207 | -} | |
208 | - | |
209 | -sub Debug { | |
210 | - my $Self = shift; | |
211 | - my $msg = shift; | |
212 | - | |
213 | - #print STDERR "\n\nDEBUG => \n$msg\n\n"; | |
214 | -} | |
215 | - | |
216 | -1; |
Kernel/Output/HTML/Standard/NewTicketWizard.dtl
... | ... | @@ -1,65 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Output/HTML/Standard/NewTicketWizard.dtl - template for new ticket wizard | |
3 | -# Copyright (C) (2014) (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | - | |
10 | -<div style="margin: 5px; padding: 10px; width: 80%;"> | |
11 | -$Data{"MsgChooseService"} | |
12 | -<div style="margin-top: 10px"> | |
13 | -<form class="Field"> | |
14 | - | |
15 | -<div class="alpaca-controlfield-label"> | |
16 | - $Text{"Service"}: | |
17 | - </div> | |
18 | - <div id="serviceDIV" class="alpaca-field" > | |
19 | - | |
20 | - $Data{"ServiceStrg"} | |
21 | - </div> | |
22 | -</form> | |
23 | -<div id="serviceDescription" style="margin: 5px; padding: 10px; width: 80%; border-style:solid; border-width: 1px; display: none"></div> | |
24 | -</div> | |
25 | -</div> | |
26 | -<div id="formTicket" style="padding-left: 15px; "> | |
27 | - | |
28 | -<!-- dtl:block:MaintenancesPanel --> | |
29 | -<span style="font-weight: bold; color: red">$Text{"The following maintenances are in progress"}</span> | |
30 | -<br/> | |
31 | -<br/> | |
32 | -<ol style="margin-left: 20px; padding: 10px; list-style-type:circle"> | |
33 | -<!-- dtl:block:MaintenanceLine --> | |
34 | -<li>$Data{"Message"} ($Text{"Started at: "} $Data{"StartDate"})</li> | |
35 | -<!-- dtl:block:MaintenanceLine --> | |
36 | -</ol> | |
37 | -<!-- dtl:block:MaintenancesPanel --> | |
38 | - | |
39 | -</div> | |
40 | - | |
41 | -<!-- dtl:js_on_document_complete --> | |
42 | -<script type="text/javascript"> | |
43 | - // To turn on debugging, uncomment this line | |
44 | - // Alpaca.logLevel = Alpaca.DEBUG; | |
45 | - | |
46 | - Alpaca.registerMessages({ | |
47 | - "disallowValue": "{0} não é um valor válido.", | |
48 | - "notOptional": "Este campo é obrigatório.", | |
49 | - "invalidValueOfEnum": "" | |
50 | - }); | |
51 | - | |
52 | - $("#ServiceID").change(function() { | |
53 | - carregaForm(null, "$Text{"Send"}", "$Env{"CGIHandle"}", ";QueueID=$Data{"QueueID"}"); | |
54 | - }); | |
55 | - | |
56 | - if ($("#ServiceID").has('[selected]')) { | |
57 | - if ($("#ServiceID").val() != "") { | |
58 | - carregaForm(null, "$Text{"Send"}", "$Env{"CGIHandle"}", ";QueueID=$Data{"QueueID"}"); | |
59 | - } | |
60 | - } | |
61 | - | |
62 | - | |
63 | - | |
64 | -</script> | |
65 | -<!-- dtl:js_on_document_complete --> | |
66 | 0 | \ No newline at end of file |
... | ... | @@ -0,0 +1,65 @@ |
1 | +# -- | |
2 | +# Kernel/Output/HTML/Standard/NewTicketWizard.tt - template for new ticket wizard | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
7 | +# -- | |
8 | +# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
9 | +# the enclosed file COPYING for license information (AGPL). If you | |
10 | +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
11 | +# -- | |
12 | + | |
13 | +<div style="margin: 5px; padding: 10px; width: 80%;"> | |
14 | +[% Data.MsgChooseService %] | |
15 | +<div style="margin-top: 10px"> | |
16 | +<form class="Field"> | |
17 | + | |
18 | +<div class="alpaca-controlfield-label"> | |
19 | + [% Translate("Service") | html %]: | |
20 | + </div> | |
21 | + <div id="serviceDIV" class="alpaca-field" > | |
22 | + | |
23 | + [% Data.ServiceStrg %] | |
24 | + </div> | |
25 | +</form> | |
26 | +<div id="serviceDescription" style="margin: 5px; padding: 10px; width: 80%; border-style:solid; border-width: 1px; display: none"></div> | |
27 | +</div> | |
28 | +</div> | |
29 | +<div id="formTicket" style="padding-left: 15px; "> | |
30 | + | |
31 | +[% RenderBlockStart("MaintenancesPanel") %] | |
32 | +<span style="font-weight: bold; color: red">[% Translate("The following maintenances are in progress") | html %]</span> | |
33 | +<br/> | |
34 | +<br/> | |
35 | +<ol style="margin-left: 20px; padding: 10px; list-style-type:circle"> | |
36 | +[% RenderBlockStart("MaintenanceLine") %] | |
37 | +<li>[% Data.Message %] ([% Translate("Started at: ") | html %] [% Data.StartDate %])</li> | |
38 | +[% RenderBlockEnd("MaintenanceLine") %] | |
39 | +</ol> | |
40 | +[% RenderBlockEnd("MaintenancesPanel") %] | |
41 | + | |
42 | +</div> | |
43 | + | |
44 | +[% WRAPPER JSOnDocumentComplete %] | |
45 | +<script type="text/javascript"> | |
46 | + // To turn on debugging, uncomment this line | |
47 | + // Alpaca.logLevel = Alpaca.DEBUG; | |
48 | + | |
49 | + Alpaca.registerMessages({ | |
50 | + "disallowValue": "{0} não é um valor válido.", | |
51 | + "notOptional": "Este campo é obrigatório.", | |
52 | + "invalidValueOfEnum": "" | |
53 | + }); | |
54 | + | |
55 | + $("#ServiceID").change(function() { | |
56 | + carregaForm(null, "[% Translate("Send") | html %]", "[% Env("CGIHandle") %]", ";QueueID=[% Data.QueueID %]"); | |
57 | + }); | |
58 | + | |
59 | + if ($("#ServiceID").has('[selected]')) { | |
60 | + if ($("#ServiceID").val() != "") { | |
61 | + carregaForm(null, "[% Translate("Send") | html %]", "[% Env("CGIHandle") %]", ";QueueID=[% Data.QueueID %]"); | |
62 | + } | |
63 | + } | |
64 | +</script> | |
65 | +[% END %] | |
0 | 66 | \ No newline at end of file | ... | ... |
Kernel/Output/HTML/Standard/NewTicketWizardPublic.dtl
... | ... | @@ -1,62 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Output/HTML/Standard/NewTicketWizard.dtl - template for new ticket wizard | |
3 | -# Copyright (C) (2014) (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | - | |
10 | -<div style="margin: 5px; padding: 10px; width: 80%;"> | |
11 | -$Data{"MsgChooseService"} | |
12 | -<div style="margin-top: 10px"> | |
13 | -<form class="Field"> | |
14 | - <span class="alpaca-field" > | |
15 | - <div class="alpaca-controlfield-label"> | |
16 | - $Text{"Service"}: | |
17 | - </div> | |
18 | - $Data{"ServiceStrg"} | |
19 | - </span> | |
20 | -</form> | |
21 | -<div id="serviceDescription" style="margin: 5px; padding: 10px; width: 80%; border-style:solid; border-width: 1px; display: none"></div> | |
22 | -</div> | |
23 | -</div> | |
24 | -<div id="formTicket" style="padding-left: 15px; "> | |
25 | - | |
26 | -<!-- dtl:block:MaintenancesPanel --> | |
27 | -<span style="font-weight: bold; color: red">$Text{"The following maintenances are in progress"}</span> | |
28 | -<br/> | |
29 | -<br/> | |
30 | -<ol style="margin-left: 20px; padding: 10px; list-style-type:circle"> | |
31 | -<!-- dtl:block:MaintenanceLine --> | |
32 | -<li>$Data{"Message"} ($Text{"Started at: "} $Data{"StartDate"})</li> | |
33 | -<!-- dtl:block:MaintenanceLine --> | |
34 | -</ol> | |
35 | -<!-- dtl:block:MaintenancesPanel --> | |
36 | - | |
37 | -</div> | |
38 | - | |
39 | -<!-- dtl:js_on_document_complete --> | |
40 | -<script type="text/javascript"> | |
41 | - // To turn on debugging, uncomment this line | |
42 | - // Alpaca.logLevel = Alpaca.DEBUG; | |
43 | - | |
44 | - | |
45 | - Alpaca.registerMessages({ | |
46 | - "disallowValue": "{0} não é um valor válido.", | |
47 | - "notOptional": "Este campo é obrigatório.", | |
48 | - "invalidValueOfEnum": "" | |
49 | - }); | |
50 | - | |
51 | - $("#ServiceID").change(function() { | |
52 | - carregaFormPublic(null, "$Text{"Send"}", "$Env{"CGIHandle"}", ";QueueID=$Data{"QueueID"}"); | |
53 | - }); | |
54 | - | |
55 | - if ($("#ServiceID").has('[selected]')) { | |
56 | - if ($("#ServiceID").val() != "") { | |
57 | - carregaFormPublic(null, "$Text{"Send"}", "$Env{"CGIHandle"}", ";QueueID=$Data{"QueueID"}"); | |
58 | - } | |
59 | - } | |
60 | - | |
61 | -</script> | |
62 | -<!-- dtl:js_on_document_complete --> |
... | ... | @@ -0,0 +1,65 @@ |
1 | +# -- | |
2 | +# Kernel/Output/HTML/Standard/NewTicketWizard.tt - template for new ticket wizard | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
7 | +# -- | |
8 | +# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
9 | +# the enclosed file COPYING for license information (AGPL). If you | |
10 | +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
11 | +# -- | |
12 | + | |
13 | +<div style="margin: 5px; padding: 10px; width: 80%;"> | |
14 | +[% Data.MsgChooseService %] | |
15 | +<div style="margin-top: 10px"> | |
16 | +<form class="Field"> | |
17 | + <span class="alpaca-field" > | |
18 | + <div class="alpaca-controlfield-label"> | |
19 | + [% Translate("Service") | html %]: | |
20 | + </div> | |
21 | + [% Data.ServiceStrg %] | |
22 | + </span> | |
23 | +</form> | |
24 | +<div id="serviceDescription" style="margin: 5px; padding: 10px; width: 80%; border-style:solid; border-width: 1px; display: none"></div> | |
25 | +</div> | |
26 | +</div> | |
27 | +<div id="formTicket" style="padding-left: 15px; "> | |
28 | + | |
29 | +[% RenderBlockStart("MaintenancesPanel") %] | |
30 | +<span style="font-weight: bold; color: red">[% Translate("The following maintenances are in progress") | html %]</span> | |
31 | +<br/> | |
32 | +<br/> | |
33 | +<ol style="margin-left: 20px; padding: 10px; list-style-type:circle"> | |
34 | +[% RenderBlockStart("MaintenanceLine") %] | |
35 | +<li>[% Data.Message %] ([% Translate("Started at: ") | html %] [% Data.StartDate %])</li> | |
36 | +[% RenderBlockEnd("MaintenanceLine") %] | |
37 | +</ol> | |
38 | +[% RenderBlockEnd("MaintenancesPanel") %] | |
39 | + | |
40 | +</div> | |
41 | + | |
42 | +[% WRAPPER JSOnDocumentComplete %] | |
43 | +<script type="text/javascript"> | |
44 | + // To turn on debugging, uncomment this line | |
45 | + // Alpaca.logLevel = Alpaca.DEBUG; | |
46 | + | |
47 | + | |
48 | + Alpaca.registerMessages({ | |
49 | + "disallowValue": "{0} não é um valor válido.", | |
50 | + "notOptional": "Este campo é obrigatório.", | |
51 | + "invalidValueOfEnum": "" | |
52 | + }); | |
53 | + | |
54 | + $("#ServiceID").change(function() { | |
55 | + carregaFormPublic(null, "[% Translate("Send") | html %]", "[% Env("CGIHandle") %]", ";QueueID=[% Data.QueueID %]"); | |
56 | + }); | |
57 | + | |
58 | + if ($("#ServiceID").has('[selected]')) { | |
59 | + if ($("#ServiceID").val() != "") { | |
60 | + carregaFormPublic(null, "[% Translate("Send") | html %]", "[% Env("CGIHandle") %]", ";QueueID=[% Data.QueueID %]"); | |
61 | + } | |
62 | + } | |
63 | + | |
64 | +</script> | |
65 | +[% END %] | ... | ... |
Kernel/Output/HTML/Standard/NewTicketWizardServiceForm.dtl
... | ... | @@ -1,47 +0,0 @@ |
1 | -# -- | |
2 | -# NewTicketWizardServiceForm.dtl - provides HTML form for NewTicketWizardServiceForm | |
3 | -# Copyright (C) 2014 UFSC | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | - | |
10 | -<!-- dtl:block:Overview --> | |
11 | -<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst"> | |
12 | - <h1>$Text{"Service forms"}</h1> | |
13 | - | |
14 | - | |
15 | - <div class="ContentColumn"> | |
16 | - <div class="WidgetSimple"> | |
17 | -<!-- dtl:block:OverviewList --> | |
18 | - <div class="Content"> | |
19 | - | |
20 | - <table class="DataTable"> | |
21 | - <thead> | |
22 | - <tr> | |
23 | - <th>$Text{"Service"}</th> | |
24 | - </tr> | |
25 | - </thead> | |
26 | - <tbody> | |
27 | -<!-- dtl:block:NoDataFoundMsg --> | |
28 | - <tr> | |
29 | - <td colspan="5"> | |
30 | - $Text{"No data found."} | |
31 | - </td> | |
32 | - </tr> | |
33 | -<!-- dtl:block:NoDataFoundMsg --> | |
34 | -<!-- dtl:block:OverviewListRow --> | |
35 | - <tr> | |
36 | - <td title="$QData{"Name"}">$QData{"LevelSpace"}<a class="AsBlock" href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=ServiceEdit;ServiceID=$LQData{"ServiceID"}">$QData{"Name", "80"}</a></td> | |
37 | - </tr> | |
38 | -<!-- dtl:block:OverviewListRow --> | |
39 | - </tbody> | |
40 | - </table> | |
41 | - </div> | |
42 | -<!-- dtl:block:OverviewList --> | |
43 | - </div> | |
44 | - </div> | |
45 | - <div class="Clear"></div> | |
46 | -</div> | |
47 | -<!-- dtl:block:Overview --> | |
48 | 0 | \ No newline at end of file |
Kernel/Output/HTML/Standard/NewTicketWizardServiceForm.tt
0 → 100644
... | ... | @@ -0,0 +1,50 @@ |
1 | +# -- | |
2 | +# NewTicketWizardServiceForm.tt - provides HTML form for NewTicketWizardServiceForm | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
7 | +# -- | |
8 | +# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
9 | +# the enclosed file COPYING for license information (AGPL). If you | |
10 | +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
11 | +# -- | |
12 | + | |
13 | +[% RenderBlockStart("Overview") %] | |
14 | +<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst"> | |
15 | + <h1>[% Translate("Service forms") | html %]</h1> | |
16 | + | |
17 | + | |
18 | + <div class="ContentColumn"> | |
19 | + <div class="WidgetSimple"> | |
20 | +[% RenderBlockStart("OverviewList") %] | |
21 | + <div class="Content"> | |
22 | + | |
23 | + <table class="DataTable"> | |
24 | + <thead> | |
25 | + <tr> | |
26 | + <th>[% Translate("Service") | html %]</th> | |
27 | + </tr> | |
28 | + </thead> | |
29 | + <tbody> | |
30 | +[% RenderBlockStart("NoDataFoundMsg") %] | |
31 | + <tr> | |
32 | + <td colspan="5"> | |
33 | + [% Translate("No data found.") | html %] | |
34 | + </td> | |
35 | + </tr> | |
36 | +[% RenderBlockEnd("NoDataFoundMsg") %] | |
37 | +[% RenderBlockStart("OverviewListRow") %] | |
38 | + <tr> | |
39 | + <td title="[% Data.Name | html %]">[% Data.LevelSpace | html %]<a class="AsBlock" href="[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=ServiceEdit;ServiceID=[% Data.ServiceID | uri %]">[% Data.Name | truncate(80) | html %]</a></td> | |
40 | + </tr> | |
41 | +[% RenderBlockEnd("OverviewListRow") %] | |
42 | + </tbody> | |
43 | + </table> | |
44 | + </div> | |
45 | +[% RenderBlockEnd("OverviewList") %] | |
46 | + </div> | |
47 | + </div> | |
48 | + <div class="Clear"></div> | |
49 | +</div> | |
50 | +[% RenderBlockEnd("Overview") %] | |
0 | 51 | \ No newline at end of file | ... | ... |
Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.dtl
... | ... | @@ -1,51 +0,0 @@ |
1 | -# -- | |
2 | -# NewTicketWizardServiceForm.dtl - provides HTML form for NewTicketWizardServiceForm | |
3 | -# Copyright (C) 2014 UFSC | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | - | |
10 | - | |
11 | -<!-- dtl:block:HeaderEdit --> | |
12 | - <h2>$Text{"Edit Service"} : $QData{"Name"}</h2> | |
13 | -<!-- dtl:block:HeaderEdit --> | |
14 | - </div> | |
15 | - <div class="Content"> | |
16 | - | |
17 | - <form action="$Env{"CGIHandle"}" method="post" class="Validate"> | |
18 | - <input type="hidden" name="Action" value="$Env{"Action"}"/> | |
19 | - <input type="hidden" name="Subaction" value="ServiceSave"/> | |
20 | - <input type="hidden" name="ServiceID" value="$QData{"ServiceID"}"/> | |
21 | - | |
22 | - <fieldset class="TableLike"> | |
23 | - | |
24 | - <label for="Introduction">$Text{"Introduction"}: </label> | |
25 | - <div class="Field"> | |
26 | - <textarea name="Introduction" id="Introduction" class="W50pc Validate_Required" rows="5">$QData{"Introduction"}</textarea> | |
27 | - </div> | |
28 | - <div class="Clear"></div> | |
29 | - | |
30 | - <label for="Form">$Text{"Form"}: </label> | |
31 | - <div class="Field"> | |
32 | - <textarea name="Form" id="Form" class="W50pc " rows="20">$QData{"Form"}</textarea> | |
33 | - </div> | |
34 | - <div class="Clear"></div> | |
35 | - | |
36 | - <label for="Schema">$Text{"Schema"}: </label> | |
37 | - <div class="Field"> | |
38 | - <textarea name="Schema" id="Schema" class="W50pc " rows="20">$QData{"Schema"}</textarea> | |
39 | - </div> | |
40 | - <div class="Clear"></div> | |
41 | - | |
42 | - <div class="Field SpacingTop"> | |
43 | - <button class="Primary" type="submit" value="$Text{"Submit"}">$Text{"Submit"}</button> | |
44 | - $Text{"or"} | |
45 | - <a href="$Env{"Baselink"}Action=$Env{"Action"}">$Text{"Cancel"}</a> | |
46 | - </div> | |
47 | - <div class="Clear"></div> | |
48 | - </fieldset> | |
49 | - | |
50 | - </form> | |
51 | - </div> |
Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt
0 → 100644
... | ... | @@ -0,0 +1,54 @@ |
1 | +# -- | |
2 | +# NewTicketWizardServiceForm.tt - provides HTML form for NewTicketWizardServiceForm | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
7 | +# -- | |
8 | +# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
9 | +# the enclosed file COPYING for license information (AGPL). If you | |
10 | +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
11 | +# -- | |
12 | + | |
13 | + | |
14 | +[% RenderBlockStart("HeaderEdit") %] | |
15 | + <h2>[% Translate("Edit Service") | html %] : [% Data.Name | html %]</h2> | |
16 | +[% RenderBlockEnd("HeaderEdit") %] | |
17 | + </div> | |
18 | + <div class="Content"> | |
19 | + | |
20 | + <form action="[% Env("CGIHandle") %]" method="post" class="Validate"> | |
21 | + <input type="hidden" name="Action" value="[% Env("Action") %]"/> | |
22 | + <input type="hidden" name="Subaction" value="ServiceSave"/> | |
23 | + <input type="hidden" name="ServiceID" value="[% Data.ServiceID | html %]"/> | |
24 | + | |
25 | + <fieldset class="TableLike"> | |
26 | + | |
27 | + <label for="Introduction">[% Translate("Introduction") | html %]: </label> | |
28 | + <div class="Field"> | |
29 | + <textarea name="Introduction" id="Introduction" class="W50pc Validate_Required" rows="5">[% Data.Introduction | html %]</textarea> | |
30 | + </div> | |
31 | + <div class="Clear"></div> | |
32 | + | |
33 | + <label for="Form">[% Translate("Form") | html %]: </label> | |
34 | + <div class="Field"> | |
35 | + <textarea name="Form" id="Form" class="W50pc " rows="20">[% Data.Form | html %]</textarea> | |
36 | + </div> | |
37 | + <div class="Clear"></div> | |
38 | + | |
39 | + <label for="Schema">[% Translate("Schema") | html %]: </label> | |
40 | + <div class="Field"> | |
41 | + <textarea name="Schema" id="Schema" class="W50pc " rows="20">[% Data.Schema | html %]</textarea> | |
42 | + </div> | |
43 | + <div class="Clear"></div> | |
44 | + | |
45 | + <div class="Field SpacingTop"> | |
46 | + <button class="Primary" type="submit" value="[% Translate("Submit") | html %]">[% Translate("Submit") | html %]</button> | |
47 | + [% Translate("or") | html %] | |
48 | + <a href="[% Env("Baselink") %]Action=[% Env("Action") %]">[% Translate("Cancel") | html %]</a> | |
49 | + </div> | |
50 | + <div class="Clear"></div> | |
51 | + </fieldset> | |
52 | + | |
53 | + </form> | |
54 | + </div> | ... | ... |
Kernel/Output/HTML/Standard/NewTicketWizardTicketCreated.dtl
... | ... | @@ -1,17 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Output/HTML/Standard/NewTicketWizard.dtl - template for new ticket wizard | |
3 | -# Copyright (C) (2013) (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | -<div style="margin: 5px; padding: 10px; width: 80%;"> | |
10 | - <h1>$Text{"Your ticket has been registered with the number: "}$Data{"TicketNumber"}</h1> | |
11 | - </div> | |
12 | - | |
13 | - <div style="margin: 5px; padding: 10px; width: 80%;"> | |
14 | - <A HREF="/otrs/customer.pl?Action=NewTicketWizard;QueueID=$Data{"QueueID"}">$Text{"Click here to open another ticket"}</A> | |
15 | - </div> | |
16 | -<!-- dtl:js_on_document_complete --> | |
17 | -<!-- dtl:js_on_document_complete --> | |
18 | 0 | \ No newline at end of file |
Kernel/Output/HTML/Standard/NewTicketWizardTicketCreated.tt
0 → 100644
... | ... | @@ -0,0 +1,20 @@ |
1 | +# -- | |
2 | +# Kernel/Output/HTML/Standard/NewTicketWizard.tt - template for new ticket wizard | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
7 | +# -- | |
8 | +# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
9 | +# the enclosed file COPYING for license information (AGPL). If you | |
10 | +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
11 | +# -- | |
12 | +<div style="margin: 5px; padding: 10px; width: 80%;"> | |
13 | + <h1>[% Translate("Your ticket has been registered with the number: ") | html %][% Data.TicketNumber %]</h1> | |
14 | + </div> | |
15 | + | |
16 | + <div style="margin: 5px; padding: 10px; width: 80%;"> | |
17 | + <A HREF="/otrs/customer.pl?Action=NewTicketWizard;QueueID=[% Data.QueueID %]">[% Translate("Click here to open another ticket") | html %]</A> | |
18 | + </div> | |
19 | +[% WRAPPER JSOnDocumentComplete %] | |
20 | +[% END %] | |
0 | 21 | \ No newline at end of file | ... | ... |
Kernel/Output/HTML/Standard/NewTicketWizardTicketCreatedPublic.dtl
... | ... | @@ -1,18 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Output/HTML/Standard/NewTicketWizard.dtl - template for new ticket wizard | |
3 | -# Copyright (C) (2013) (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
4 | -# -- | |
5 | -# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
6 | -# the enclosed file COPYING for license information (AGPL). If you | |
7 | -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
8 | -# -- | |
9 | -<div style="margin: 5px; padding: 10px; width: 80%;"> | |
10 | - <h1>$Text{"Your ticket has been registered with the number: "}$Data{"TicketNumber"}</h1> | |
11 | - </div> | |
12 | - | |
13 | - <div style="margin: 5px; padding: 10px; width: 80%;"> | |
14 | - <A HREF="/otrs/public.pl?Action=NewTicketWizardPublic;QueueID=$Data{"QueueID"}">$Text{"Click here to open another ticket"}</A> | |
15 | - </div> | |
16 | - | |
17 | -<!-- dtl:js_on_document_complete --> | |
18 | -<!-- dtl:js_on_document_complete --> | |
19 | 0 | \ No newline at end of file |
Kernel/Output/HTML/Standard/NewTicketWizardTicketCreatedPublic.tt
0 → 100644
... | ... | @@ -0,0 +1,21 @@ |
1 | +# -- | |
2 | +# Kernel/Output/HTML/Standard/NewTicketWizard.tt - template for new ticket wizard | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
7 | +# -- | |
8 | +# This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
9 | +# the enclosed file COPYING for license information (AGPL). If you | |
10 | +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
11 | +# -- | |
12 | +<div style="margin: 5px; padding: 10px; width: 80%;"> | |
13 | + <h1>[% Translate("Your ticket has been registered with the number: ") | html %][% Data.TicketNumber %]</h1> | |
14 | + </div> | |
15 | + | |
16 | + <div style="margin: 5px; padding: 10px; width: 80%;"> | |
17 | + <A HREF="/otrs/public.pl?Action=NewTicketWizardPublic;QueueID=[% Data.QueueID %]">[% Translate("Click here to open another ticket") | html %]</A> | |
18 | + </div> | |
19 | + | |
20 | +[% WRAPPER JSOnDocumentComplete %] | |
21 | +[% END %] | |
0 | 22 | \ No newline at end of file | ... | ... |
Kernel/Output/HTML/Standard/QueuesPanel.dtl
... | ... | @@ -1,29 +0,0 @@ |
1 | -# -- | |
2 | -# Kernel/Output/HTML/Standard/QueuesPanel.dtl - overview | |
3 | -# Copyright (C) (2014) (Rodrigo Gonçalves) (rodrigo.g@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="Queues"> | |
12 | - <div class="ChooseQueue">$Data{"MsgChooseQueue"}</div> | |
13 | - | |
14 | - <div id="columns"></div> | |
15 | - | |
16 | - <!-- dtl:block:ListQueue--> | |
17 | - <div class="QueueCard"> | |
18 | - <div class="QueueTitle"><a class="QueueTitleLink" href="$Env{"Baselink"}Action=NewTicketWizard;BaseQueueID=$Data{"QueueID"}">$Data{"QueueName"}</a></div> | |
19 | - <div class="QueueComments">$Data{"QueueComments"}</div> | |
20 | - </div> | |
21 | -<!-- dtl:block:ListQueue--> | |
22 | - | |
23 | -<!-- dtl:js_on_document_complete --> | |
24 | -<script type="text/javascript"> | |
25 | - $Data{"QueueJS"} | |
26 | -</script> | |
27 | -<!-- dtl:js_on_document_complete --> | |
28 | - | |
29 | - | |
30 | 0 | \ No newline at end of file |
Kernel/System/ServiceForm.pm
1 | 1 | # -- |
2 | 2 | # Kernel/System/ServiceForm.pm - core module |
3 | -# Copyright (C) (2013) (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
4 | 7 | # -- |
5 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
6 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -11,11 +14,11 @@ package Kernel::System::ServiceForm; |
11 | 14 | use strict; |
12 | 15 | use warnings; |
13 | 16 | use utf8; |
14 | -use Kernel::System::Service; | |
15 | -use Kernel::System::Type; | |
16 | -use Kernel::System::YAML; | |
17 | -use Data::Dumper; | |
18 | -use Kernel::System::DynamicField; | |
17 | + | |
18 | +our @ObjectDependencies = ( | |
19 | +"Kernel::System::DB", | |
20 | +"Kernel::System::Log"); | |
21 | + | |
19 | 22 | |
20 | 23 | sub new { |
21 | 24 | my ( $Type, %Param ) = @_; |
... | ... | @@ -24,18 +27,6 @@ sub new { |
24 | 27 | my $Self = {%Param}; |
25 | 28 | bless( $Self, $Type ); |
26 | 29 | |
27 | - # check needed objects | |
28 | - for ( | |
29 | - qw(DBObject LayoutObject LogObject QueueObject ConfigObject) | |
30 | - ) | |
31 | - { | |
32 | - if ( !$Self->{$_} ) { | |
33 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
34 | - } | |
35 | - } | |
36 | - | |
37 | - # required objects | |
38 | - | |
39 | 30 | return $Self; |
40 | 31 | } |
41 | 32 | |
... | ... | @@ -49,8 +40,10 @@ sub GetServiceForm { |
49 | 40 | |
50 | 41 | my ( $Self, %Param ) = @_; |
51 | 42 | |
43 | + my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); | |
44 | + | |
52 | 45 | # get service form from db |
53 | - $Self->{DBObject}->Prepare( | |
46 | + $DBObject->Prepare( | |
54 | 47 | SQL => 'SELECT service_id, introduction, form, form_schema FROM service_form WHERE service_id = ?', |
55 | 48 | Bind => [ \$Param{ServiceID} ], |
56 | 49 | Limit => 1, |
... | ... | @@ -58,7 +51,7 @@ sub GetServiceForm { |
58 | 51 | |
59 | 52 | # fetch the result |
60 | 53 | my %ServiceData; |
61 | - while ( my @Row = $Self->{DBObject}->FetchrowArray() ) { | |
54 | + while ( my @Row = $DBObject->FetchrowArray() ) { | |
62 | 55 | $ServiceData{ServiceID} = $Row[0]; |
63 | 56 | $ServiceData{Introduction} = $Row[1]; |
64 | 57 | $ServiceData{Form} = $Row[2]; |
... | ... | @@ -77,9 +70,11 @@ Saves a service form. |
77 | 70 | sub SaveServiceForm { |
78 | 71 | |
79 | 72 | my ( $Self, %Param ) = @_; |
73 | + my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); | |
74 | + | |
80 | 75 | for my $Argument (qw(ServiceID Introduction)) { |
81 | 76 | if ( !$Param{$Argument} ) { |
82 | - $Self->{LogObject}->Log( | |
77 | + $Kernel::OM->Get("Kernel::System::Log")->Log( | |
83 | 78 | Priority => 'error', |
84 | 79 | Message => "Need $Argument!", |
85 | 80 | ); |
... | ... | @@ -91,12 +86,12 @@ sub SaveServiceForm { |
91 | 86 | my $update = ($serviceForm{ServiceID}); |
92 | 87 | |
93 | 88 | if ($update) { |
94 | - $Self->{DBObject}->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=? where service_id=?', | |
89 | + $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=? where service_id=?', | |
95 | 90 | Bind => [ |
96 | 91 | \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{ServiceID} |
97 | 92 | ]); |
98 | 93 | } else { |
99 | - $Self->{DBObject}->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema) VALUES (?,?,?,?)', | |
94 | + $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema) VALUES (?,?,?,?)', | |
100 | 95 | Bind => [ |
101 | 96 | \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema} |
102 | 97 | ]); | ... | ... |
Kernel/System/TicketWizard.pm
1 | 1 | # -- |
2 | 2 | # Kernel/System/TicketWizard.pm - core module |
3 | -# Copyright (C) (2013) (Rodrigo Goncalves) (rodrigo.g@ufsc.br) | |
3 | +# | |
4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | |
5 | +# Version 01/12/2015 - Support for OTRS 4.0.3 | |
6 | +# | |
4 | 7 | # -- |
5 | 8 | # This software comes with ABSOLUTELY NO WARRANTY. For details, see |
6 | 9 | # the enclosed file COPYING for license information (AGPL). If you |
... | ... | @@ -11,11 +14,21 @@ package Kernel::System::TicketWizard; |
11 | 14 | use strict; |
12 | 15 | use warnings; |
13 | 16 | use utf8; |
14 | -use Kernel::System::Service; | |
15 | -use Kernel::System::Type; | |
16 | -use Kernel::System::YAML; | |
17 | -use Data::Dumper; | |
18 | -use Kernel::System::DynamicField; | |
17 | + | |
18 | +our @ObjectDependencies = ( | |
19 | +"Kernel::System::Web::Request", | |
20 | +"Kernel::System::DB", | |
21 | +"Kernel::Output::HTML::Layout", | |
22 | +"KerneL::System::Log", | |
23 | +"KerneL::System::Ticket", | |
24 | +"KerneL::System::Type", | |
25 | +"Kernel::System::YAM", | |
26 | +"Kernel::Config", | |
27 | +"Kernel::System::DynamicField", | |
28 | +"Kernel::System::Service", | |
29 | +"Kernel::System::ServiceForm", | |
30 | +"Kernel::System::SystemAddress" ); | |
31 | + | |
19 | 32 | |
20 | 33 | sub new { |
21 | 34 | my ( $Type, %Param ) = @_; |
... | ... | @@ -24,23 +37,6 @@ sub new { |
24 | 37 | my $Self = {%Param}; |
25 | 38 | bless( $Self, $Type ); |
26 | 39 | |
27 | - # check needed objects | |
28 | - for ( | |
29 | - qw(DBObject LayoutObject LogObject QueueObject ConfigObject) | |
30 | - ) | |
31 | - { | |
32 | - if ( !$Self->{$_} ) { | |
33 | - $Self->{LayoutObject}->FatalError( Message => "Got no $_!" ); | |
34 | - } | |
35 | - } | |
36 | - | |
37 | - # required objects | |
38 | - $Self->{YAMLObject} = Kernel::System::YAML->new(%Param); | |
39 | - $Self->{ServiceObject} = Kernel::System::Service->new(%Param); | |
40 | - $Self->{TypeObject} = Kernel::System::Type->new(%Param); | |
41 | - $Self->{TicketObject} = Kernel::System::Ticket->new(%Param); | |
42 | - $Self->{DynamicFieldObject} = Kernel::System::DynamicField->new(%Param); | |
43 | - | |
44 | 40 | return $Self; |
45 | 41 | } |
46 | 42 | |
... | ... | @@ -52,7 +48,7 @@ Returns fields structure for new ticket form wizard public |
52 | 48 | |
53 | 49 | sub GetBasicFieldsOptionsPublic { |
54 | 50 | my ( $Self, %Param ) = @_; |
55 | - return $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicFormPublic}; | |
51 | + return $Kernel::OM->Get("Kernel::Config")->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicFormPublic}; | |
56 | 52 | } |
57 | 53 | |
58 | 54 | =head |
... | ... | @@ -63,7 +59,7 @@ Returns fields schema for new ticket wizard public |
63 | 59 | |
64 | 60 | sub GetBasicFieldsSchemaPublic { |
65 | 61 | my ( $Self, %Param ) = @_; |
66 | - return $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicSchemaPublic}; | |
62 | + return $Kernel::OM->Get("Kernel::Config")->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicSchemaPublic}; | |
67 | 63 | } |
68 | 64 | |
69 | 65 | |
... | ... | @@ -75,7 +71,7 @@ Returns fields structure for new ticket form wizard |
75 | 71 | |
76 | 72 | sub GetBasicFieldsOptions { |
77 | 73 | my ( $Self, %Param ) = @_; |
78 | - return $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicForm}; | |
74 | + return $Kernel::OM->Get("Kernel::Config")->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicForm}; | |
79 | 75 | } |
80 | 76 | |
81 | 77 | =head |
... | ... | @@ -86,7 +82,7 @@ Returns fields schema for new ticket wizard |
86 | 82 | |
87 | 83 | sub GetBasicFieldsSchema { |
88 | 84 | my ( $Self, %Param ) = @_; |
89 | - return $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicSchema}; | |
85 | + return $Kernel::OM->Get("Kernel::Config")->Get("Ticket::Frontend::Customer::NewTicketWizard")->{BasicSchema}; | |
90 | 86 | } |
91 | 87 | |
92 | 88 | =head |
... | ... | @@ -113,14 +109,12 @@ sub ReplaceOTRSValues { |
113 | 109 | |
114 | 110 | sub GetOTRSServicesData { |
115 | 111 | my ( $Self, %Param ) = @_; |
116 | - my $services = $Self->{ServiceObject}; | |
112 | + my $services = $Kernel::OM->Get("Kernel::System::Service"); | |
117 | 113 | |
118 | - my %serviceList = $services->ServiceList( Valid => 1, UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID') ); | |
114 | + my %serviceList = $services->ServiceList( Valid => 1, UserID => $Kernel::OM->Get("Kernel::Config")->Get('CustomerPanelUserID') ); | |
119 | 115 | my $serviceNames = ""; |
120 | 116 | my $serviceIDs = ""; |
121 | 117 | |
122 | - ###print STDERR "\n\n\n Servicos: " . Dumper(\%serviceList) . "\n\n\n"; | |
123 | - | |
124 | 118 | foreach ( sort { ( $serviceList{$a} cmp $serviceList{$b} ) } keys %serviceList ) { |
125 | 119 | $serviceNames .= "\"$serviceList{$_}\","; |
126 | 120 | $serviceIDs .= "$_,"; |
... | ... | @@ -132,7 +126,7 @@ sub GetOTRSServicesData { |
132 | 126 | |
133 | 127 | sub GetOTRSTypesData { |
134 | 128 | my ( $Self, %Param ) = @_; |
135 | - my $ticketObject = $Self->{TicketObject}; | |
129 | + my $ticketObject = $Kernel::OM->Get("Kernel::System::Ticket"); | |
136 | 130 | |
137 | 131 | my %typeList = $ticketObject->TicketTypeList( UserID => $Param{UserID} ); |
138 | 132 | my $typeNames = ""; |
... | ... | @@ -156,13 +150,12 @@ sub ReplaceOTRSDynamicFields { |
156 | 150 | my $schema = $Param{Schema}; |
157 | 151 | my $options = $Param{Options}; |
158 | 152 | |
159 | - my $dfields = $Self->{DynamicFieldObject}; | |
153 | + my $dfields = $Kernel::OM->Get("Kernel::System::DynamicField"); | |
160 | 154 | my @dfieldList = @{ $dfields->DynamicFieldListGet( Valid => 1 ) }; |
161 | 155 | |
162 | 156 | foreach (@dfieldList) { |
163 | 157 | my $campo = $_; |
164 | 158 | |
165 | - #Debug("campo", $campo); | |
166 | 159 | my $name = $campo->{Name}; |
167 | 160 | my $config = $campo->{Config}; |
168 | 161 | my $type = $campo->{FieldType}; |
... | ... | @@ -178,11 +171,6 @@ sub ReplaceOTRSDynamicFields { |
178 | 171 | return ( $schema, $options ); |
179 | 172 | } |
180 | 173 | |
181 | -sub Debug { | |
182 | - my ( $id, $value ) = @_; | |
183 | - ###print STDERR "\n\n $id =" . Dumper($value) . "\n"; | |
184 | -} | |
185 | - | |
186 | 174 | sub GetDynamicFieldValues { |
187 | 175 | my ( $Self, %Param ) = @_; |
188 | 176 | my $config = $Param{ConfigDF}; |
... | ... | @@ -198,7 +186,6 @@ sub GetDynamicFieldValues { |
198 | 186 | |
199 | 187 | $dfValues = substr($dfValues, 0, -1); |
200 | 188 | $dfLabels = substr($dfLabels, 0, -1); |
201 | - Debug( "dfvalues", $dfValues ); | |
202 | 189 | return ( $dfValues, $dfLabels ); |
203 | 190 | |
204 | 191 | } | ... | ... |
NewTicketWizard.sopm
1 | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | 2 | <otrs_package version="1.0"> |
3 | 3 | <Name>NewTicketWizard</Name> |
4 | - <Version>1.4.2</Version> | |
5 | - <Framework>3.x.x</Framework> | |
4 | + <Version>1.5.0</Version> | |
5 | + <Framework>4.0.3</Framework> | |
6 | 6 | <Vendor>SeTIC</Vendor> |
7 | 7 | <URL>http://www.setic.ufsc.br</URL> |
8 | - <License>Free</License> | |
9 | - <Description Lang="pt-br">Assistente de chamados | |
10 | - | |
11 | - Versão 1.0.0 - Inicial | |
12 | - Versão 1.0.1 - Ajusta listagem de servicos do Service forms, correcao no formulario de edicao de servico | |
13 | - Versão 1.0.2 - Ajuste na hierarquia de servicos | |
14 | - Versão 1.0.9 - Primeira versao para producao | |
15 | - Versão 1.1.1 - Suporte para abertura pública de tickets. | |
16 | - Versão 1.1.2 - Suporte para múltiplos domínios. | |
17 | - Versão 1.1.3 - Link para abrir segundo chamado na tela de finalização da abertura | |
18 | - Versão 1.1.4 - Aumento na fonte do botao de enviar | |
19 | - Versão 1.2.6 - Painel de navegação de filas | |
20 | - Versão 1.2.9 - Publicacao de manutencoes em progresso | |
21 | - Versão 1.3.0 - Suporte para detecção e auto-encaminhamento em modo autenticado/não autenticado | |
22 | - Versão 1.4.1 - Suporte para definir via URL o serviço selecionado | |
23 | - Versão 1.4.2 - Ajuste nas traduções | |
24 | - | |
25 | - </Description> | |
26 | - <IntroInstall Type="post" Lang="pt-br" Title="Obrigado">Módulo instalado com sucesso!</IntroInstall> | |
27 | - <Description Lang="en">New Ticket Wizard</Description> | |
28 | - <IntroInstall Type="post" Lang="en" Title="Thank you">New Ticket Wizard module installed successfully!</IntroInstall> | |
8 | + <License>GPLv2</License> | |
9 | + <Description>NewTicket Wizard Module</Description> | |
10 | + <ChangeLog version="1.5.0">Support for OTRS 4.0.3, QueuesPanel Module Separation</ChangeLog> | |
11 | + <IntroInstall Type="post" Title="Thank you">New Ticket Wizard module installed successfully!</IntroInstall> | |
29 | 12 | <BuildDate>?</BuildDate> |
30 | 13 | <BuildHost>?</BuildHost> |
31 | 14 | <Filelist> |
... | ... | @@ -34,28 +17,22 @@ |
34 | 17 | <File Permission="644" Location="Kernel/Language/pt_BR_NewTicketWizard.pm"></File> |
35 | 18 | <File Permission="644" Location="Kernel/Language/pt_BR_NewTicketWizardPublic.pm"></File> |
36 | 19 | <File Permission="644" Location="Kernel/Language/pt_BR_NewTicketWizardServiceForm.pm"></File> |
37 | - <File Permission="644" Location="Kernel/Language/pt_BR_QueuesPanel.pm"></File> | |
38 | - <File Permission="644" Location="Kernel/Language/pt_BR_QueuesPanelPublic.pm"></File> | |
39 | 20 | |
40 | 21 | <File Permission="644" Location="Kernel/Modules/NewTicketWizard.pm"></File> |
41 | 22 | <File Permission="644" Location="Kernel/Modules/NewTicketWizardPublic.pm"></File> |
42 | 23 | <File Permission="644" Location="Kernel/Modules/NewTicketWizardServiceForm.pm"></File> |
43 | - <File Permission="644" Location="Kernel/Modules/QueuesPanel.pm"></File> | |
44 | - <File Permission="644" Location="Kernel/Modules/QueuesPanelPublic.pm"></File> | |
45 | 24 | |
46 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizard.dtl"></File> | |
47 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardPublic.dtl"></File> | |
48 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardServiceForm.dtl"></File> | |
49 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.dtl"></File> | |
50 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardTicketCreated.dtl"></File> | |
51 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardTicketCreatedPublic.dtl"></File> | |
52 | - <File Permission="644" Location="Kernel/Output/HTML/Standard/QueuesPanel.dtl"></File> | |
25 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizard.tt"></File> | |
26 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardPublic.tt"></File> | |
27 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardServiceForm.tt"></File> | |
28 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt"></File> | |
29 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardTicketCreated.tt"></File> | |
30 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardTicketCreatedPublic.tt"></File> | |
53 | 31 | |
54 | 32 | <File Permission="644" Location="Kernel/System/ServiceForm.pm"></File> |
55 | 33 | <File Permission="644" Location="Kernel/System/TicketWizard.pm"></File> |
56 | 34 | |
57 | 35 | <File Permission="644" Location="var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js"></File> |
58 | - <File Permission="644" Location="var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js"></File> | |
59 | 36 | <File Permission="644" Location="var/httpd/htdocs/js/NewTicketWizard.js"></File> |
60 | 37 | |
61 | 38 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/alpaca/images/alpaca-icons.png"></File> |
... | ... | @@ -73,13 +50,6 @@ |
73 | 50 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css"></File> |
74 | 51 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca.min.css"></File> |
75 | 52 | |
76 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css"></File> | |
77 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css"></File> | |
78 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css"></File> | |
79 | - | |
80 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png"></File> | |
81 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png"></File> | |
82 | - | |
83 | 53 | </Filelist> |
84 | 54 | <DatabaseInstall> |
85 | 55 | <TableCreate Name="service_form"> | ... | ... |
db_schema.sql
var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js
... | ... | @@ -1,8 +0,0 @@ |
1 | -// hColumns by bu <bu@hax4.in>, BSD License | |
2 | - | |
3 | -(function(b){var k={nodeSource:function(){return window.alert("dummy source, you need to create a node source")},noContentString:"There is no node here",searchPlaceholderString:"Search...",searchable:!1,customNodeTypeIndicator:{},customNodeTypeHandler:{}},l={folder:function(a,d,c){a.nodeSource(c.id,function(d,c){return d?b.error(d):a.columnView._addColumnList(c,a.columnView)})},link:function(b,d,c){return window.open(c.url)}},m={folder:"icon-chevron-right",link:"icon-globe"},h={init:function(a){var d= | |
4 | -b.extend(k,a),c=b.extend(l,d.customNodeTypeHandler),f=b.extend(m,d.customNodeTypeIndicator);return this.each(function(){var a=b(this),g=a.data("columnView");h.settings=d;d.columnView=h;d.handlers=c;d.indicators=f;d.container_node=this;g||(a.data("hColumn",d),a.addClass("column-view-container"),b("<div></div>").addClass("column-view-composition").appendTo(a),a.on("click",".column ul li:not('.search')",d.columnView._entryClick),d.nodeSource(null,function(a,c){return a?b.error(a):d.columnView._addColumnList(c)}))})}, | |
5 | -_entryClick:function(){var a=b(this).parents(".column-view-container").data("hColumn"),d=b(this).parents(".column-view-container"),c=b(this).parents(".column"),f=b(this).parents(".column").index(),e=b(this).data("node-type"),g=b(this).data("node-data");b(d).find(".column-view-composition .column:gt("+f+")").remove();c.find(".active").removeClass("active");b(this).addClass("active");return a.handlers[e](a,this,g)},_addColumnList:function(a,d){var c=d?d:this,f=b("<ul></ul>");if(0===a.length)return f= | |
6 | -b("<p></p>").text(d.settings.noContentString),c._addColumn(f,c);c.settings.searchable&&c._addColumnSearch(f);for(var e=0;e<a.length;e++){var g=b(document.createElement("li")).data("node-id",a[e].id).data("node-type",a[e].type).data("node-data",a[e]).attr("title",a[e].label),h=b(document.createElement("i")).addClass(c.settings.indicators[a[e].type]);g[0].appendChild(document.createTextNode(a[e].label));g[0].appendChild(h[0]);f[0].appendChild(g[0])}return c._addColumn(f,c)},_addColumnSearch:function(a){b('<li class="search"><input type="text" placeholder=" '+ | |
7 | -this.settings.searchPlaceholderString+'"></li>').on("keyup","input",function(a){var c=b(this).val();2<=c.length?b(this).closest("li").siblings().each(function(){""!==c&&-1===b(this).data("node-data").label.toLowerCase().indexOf(c.toLowerCase())?b(this).hide():b(this).show()}):b(this).closest("li").siblings().show()}).appendTo(a)},_addColumn:function(a,d){var c=b("<div></div>").addClass("column");c.append(a);b(d.settings.container_node).find(".column-view-composition").append(c);b(d.settings.container_node).scrollLeft(b(".column-view-composition").width())}}; | |
8 | -b.fn.hColumns=function(a){if(h[a])return h[a].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof a&&a)b.error("Method "+a+" does not exist on jQuery.hColumns");else return h.init.apply(this,arguments)}})(jQuery); |
var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css
... | ... | @@ -1,85 +0,0 @@ |
1 | -body { | |
2 | - background: #f5f5f5; | |
3 | - font-family: "Arial", sans-serif; | |
4 | -} | |
5 | - | |
6 | -.container { | |
7 | - padding: 2em; | |
8 | -} | |
9 | - | |
10 | -h1 { | |
11 | - color: #000; | |
12 | - font-size: 2em; | |
13 | - | |
14 | - margin: 0.75em 0; | |
15 | -} | |
16 | - | |
17 | -h1 small { | |
18 | - color: #ccc; | |
19 | - font-size: 0.5em; | |
20 | -} | |
21 | - | |
22 | -img { | |
23 | - margin: 20px; | |
24 | -} | |
25 | - | |
26 | -h2 { | |
27 | - margin: 1em 0; | |
28 | - | |
29 | - font-size: 1.25em; | |
30 | - color: #999; | |
31 | -} | |
32 | - | |
33 | -ol { | |
34 | - margin-left: 2em; | |
35 | - | |
36 | - list-style: upper-roman; | |
37 | -} | |
38 | - | |
39 | -ol li { | |
40 | - margin: 20px; | |
41 | -} | |
42 | - | |
43 | -.code-block { | |
44 | - border: 1px solid #ccc; | |
45 | - background: #fff; | |
46 | - | |
47 | - margin: 1em; | |
48 | - padding: 1em; | |
49 | -} | |
50 | - | |
51 | -.code-block strong { | |
52 | - display: block; | |
53 | - | |
54 | - margin: 1em; | |
55 | - font-weight: 700; | |
56 | -} | |
57 | - | |
58 | -.code-block strong.minor { | |
59 | - font-weight: 400; | |
60 | - color: #666; | |
61 | -} | |
62 | - | |
63 | -.code-block pre { | |
64 | - padding: 10px; | |
65 | - | |
66 | - font-family: monospace; | |
67 | -} | |
68 | - | |
69 | -.code-block p { | |
70 | - padding: 0 30px; | |
71 | - | |
72 | - margin: 10px 0; | |
73 | - | |
74 | - font-size: 13px; | |
75 | -} | |
76 | - | |
77 | -.code-block ol li { | |
78 | - font-size: 13px; | |
79 | - margin: 5px; | |
80 | - line-height: 20px; | |
81 | -} | |
82 | - | |
83 | -.column-view-container { | |
84 | - margin: 1em; | |
85 | -} |
var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css
... | ... | @@ -1,120 +0,0 @@ |
1 | -.ChooseQueue { | |
2 | - border-style: solid; | |
3 | - border-width: 1px; | |
4 | - padding: 5px; | |
5 | - margin-top: 5px; | |
6 | - margin-left: 10px; | |
7 | -} | |
8 | - | |
9 | -/* column view container */ | |
10 | -.column-view-container { | |
11 | - width: 100%; | |
12 | - height: 400px; | |
13 | - padding: 0; | |
14 | - border: 1px solid #ccc; | |
15 | - background: #FFF; | |
16 | - display: block; | |
17 | - overflow-x: auto; | |
18 | - overflow-y: hidden; | |
19 | -} | |
20 | - | |
21 | -/* the composition div for colums */ | |
22 | -.column-view-composition { | |
23 | - display: table; | |
24 | - white-space: nowrap; | |
25 | -} | |
26 | - | |
27 | -/**/ | |
28 | -.column { | |
29 | - display: table-cell; | |
30 | - border-right: 1px solid #999; | |
31 | -} | |
32 | - | |
33 | -.column:last-child { | |
34 | - border-right: 0; | |
35 | -} | |
36 | - | |
37 | -.column:only-child { | |
38 | - border-right: 1px solid #999; | |
39 | -} | |
40 | - | |
41 | -/* for error messages */ | |
42 | -.column > p { | |
43 | - margin: 10px; | |
44 | - color: #666; | |
45 | -} | |
46 | - | |
47 | -/* for column listing */ | |
48 | -.column ul { | |
49 | - margin: 0; | |
50 | - padding: 0; | |
51 | - height: 400px; | |
52 | - width: 250px; | |
53 | - overflow-y: auto; | |
54 | - list-style: none; | |
55 | -} | |
56 | - | |
57 | -.column ul li { | |
58 | - position: relative; | |
59 | - margin: 0; | |
60 | - padding: 10px 20px 10px 10px; | |
61 | - overflow: hidden; | |
62 | - -o-text-overflow: ellipsis; /* pour Opera 9 */ | |
63 | - text-overflow: ellipsis; /* pour le reste du monde */ | |
64 | -} | |
65 | - | |
66 | -.column ul li:hover { | |
67 | - cursor: pointer; | |
68 | -} | |
69 | - | |
70 | -.column ul li i { | |
71 | - position: absolute; | |
72 | - top: 9px; | |
73 | - right: 5px; | |
74 | -} | |
75 | - | |
76 | -.column ul li:hover, .column ul li.active { | |
77 | - background: #999999; | |
78 | - color: #FFFFFF; | |
79 | -} | |
80 | - | |
81 | -.column ul li:hover a, .column ul li.active a { | |
82 | - color: #FFFFFF; | |
83 | -} | |
84 | - | |
85 | -.column ul li.search { | |
86 | - margin: 0; | |
87 | - padding: 5px; | |
88 | -} | |
89 | - | |
90 | -.column ul li.search input { | |
91 | - width: 100%; | |
92 | - margin: 0; | |
93 | -} | |
94 | - | |
95 | - | |
96 | -/* icon type, could be replace with FontAwesome */ | |
97 | -[class^="icon-"], [class*=" icon-"] { | |
98 | - display: inline-block; | |
99 | - width: 14px; | |
100 | - height: 14px; | |
101 | - margin-top: 1px; | |
102 | - *margin-right: .3em; | |
103 | - line-height: 14px; | |
104 | - vertical-align: text-top; | |
105 | - background-image: url("../img/glyphicons-halflings.png"); | |
106 | - background-position: 14px 14px; | |
107 | - background-repeat: no-repeat; | |
108 | -} | |
109 | - | |
110 | -.icon-chevron-right { | |
111 | - background-position: -456px -72px; | |
112 | -} | |
113 | - | |
114 | -.icon-globe { | |
115 | - background-position: -336px -144px; | |
116 | -} | |
117 | - | |
118 | -.icon-file { | |
119 | - background-position: -23px -24px; | |
120 | -} |
var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css
... | ... | @@ -1,48 +0,0 @@ |
1 | -/* http://meyerweb.com/eric/tools/css/reset/ | |
2 | - v2.0 | 20110126 | |
3 | - License: none (public domain) | |
4 | -*/ | |
5 | - | |
6 | -html, body, div, span, applet, object, iframe, | |
7 | -h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
8 | -a, abbr, acronym, address, big, cite, code, | |
9 | -del, dfn, em, img, ins, kbd, q, s, samp, | |
10 | -small, strike, strong, sub, sup, tt, var, | |
11 | -b, u, i, center, | |
12 | -dl, dt, dd, ol, ul, li, | |
13 | -fieldset, form, label, legend, | |
14 | -table, caption, tbody, tfoot, thead, tr, th, td, | |
15 | -article, aside, canvas, details, embed, | |
16 | -figure, figcaption, footer, header, hgroup, | |
17 | -menu, nav, output, ruby, section, summary, | |
18 | -time, mark, audio, video { | |
19 | - margin: 0; | |
20 | - padding: 0; | |
21 | - border: 0; | |
22 | - font-size: 100%; | |
23 | - font: inherit; | |
24 | - vertical-align: baseline; | |
25 | -} | |
26 | -/* HTML5 display-role reset for older browsers */ | |
27 | -article, aside, details, figcaption, figure, | |
28 | -footer, header, hgroup, menu, nav, section { | |
29 | - display: block; | |
30 | -} | |
31 | -body { | |
32 | - line-height: 1; | |
33 | -} | |
34 | -ol, ul { | |
35 | - list-style: none; | |
36 | -} | |
37 | -blockquote, q { | |
38 | - quotes: none; | |
39 | -} | |
40 | -blockquote:before, blockquote:after, | |
41 | -q:before, q:after { | |
42 | - content: ''; | |
43 | - content: none; | |
44 | -} | |
45 | -table { | |
46 | - border-collapse: collapse; | |
47 | - border-spacing: 0; | |
48 | -} | |
49 | 0 | \ No newline at end of file |
var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png
27.4 KB
var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png
12.5 KB