Commit c02a227bf9f3a4fffc25069966dc4f71bfec6a2c
1 parent
c7f1e941
Exists in
master
Suporte para layout padrao UFSC.
Showing
19 changed files
with
654 additions
and
286 deletions
Show diff stats
Kernel/Config/Files/QueuesPanel.xml
| @@ -76,6 +76,79 @@ | @@ -76,6 +76,79 @@ | ||
| 76 | <Setting> | 76 | <Setting> |
| 77 | <String Regex="">Escolha o local para o qual deseja atendimento</String> | 77 | <String Regex="">Escolha o local para o qual deseja atendimento</String> |
| 78 | </Setting> | 78 | </Setting> |
| 79 | + </ConfigItem> | ||
| 80 | + | ||
| 81 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###IgnoreQueuesIDs" | ||
| 82 | + Required="0" Valid="1"> | ||
| 83 | + <Description>Queues IDs to not show in panel (comma separated).</Description> | ||
| 84 | + <Group>Ticket</Group> | ||
| 85 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 86 | + <Setting> | ||
| 87 | + <String Regex=""></String> | ||
| 88 | + </Setting> | ||
| 89 | + </ConfigItem> | ||
| 90 | + | ||
| 91 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###CustomHeaderFooterID" | ||
| 92 | + Required="0" Valid="1"> | ||
| 93 | + <Description>Customer footer/header suffix, if used.</Description> | ||
| 94 | + <Group>Ticket</Group> | ||
| 95 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 96 | + <Setting> | ||
| 97 | + <String Regex=""></String> | ||
| 98 | + </Setting> | ||
| 99 | + </ConfigItem> | ||
| 100 | + | ||
| 101 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###ExtraQueues" | ||
| 102 | + Required="0" Valid="1"> | ||
| 103 | + <Description>Extra queues to show in panel. Format: One per Line, Name|URL</Description> | ||
| 104 | + <Group>Ticket</Group> | ||
| 105 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 106 | + <Setting> | ||
| 107 | + <TextArea></TextArea> | ||
| 108 | + </Setting> | ||
| 109 | + </ConfigItem> | ||
| 110 | + | ||
| 111 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###ExtraQueuesPublic" | ||
| 112 | + Required="0" Valid="1"> | ||
| 113 | + <Description>Extra queues to show in panel, for public access. Format: One per Line, Name|URL</Description> | ||
| 114 | + <Group>Ticket</Group> | ||
| 115 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 116 | + <Setting> | ||
| 117 | + <TextArea></TextArea> | ||
| 118 | + </Setting> | ||
| 119 | + </ConfigItem> | ||
| 120 | + | ||
| 121 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###CustomJS" | ||
| 122 | + Required="0" Valid="1"> | ||
| 123 | + <Description>Extra JS if necessary</Description> | ||
| 124 | + <Group>Ticket</Group> | ||
| 125 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 126 | + <Setting> | ||
| 127 | + <TextArea></TextArea> | ||
| 128 | + </Setting> | ||
| 129 | + </ConfigItem> | ||
| 130 | + | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###NewTicketURL" | ||
| 134 | + Required="0" Valid="1"> | ||
| 135 | + <Description>Base URL to call to create ticket, queue ID added to the end</Description> | ||
| 136 | + <Group>Ticket</Group> | ||
| 137 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 138 | + <Setting> | ||
| 139 | + <String>/otrs/customer.pl?Action=NewTicketWizard;QueueID=</String> | ||
| 140 | + </Setting> | ||
| 141 | + </ConfigItem> | ||
| 142 | + | ||
| 143 | + <ConfigItem Name="Ticket::Frontend::Customer::QueuesPanel###NewTicketURLPublic" | ||
| 144 | + Required="0" Valid="1"> | ||
| 145 | + <Description>Base URL to call to create ticket, queue ID added to the end</Description> | ||
| 146 | + <Group>Ticket</Group> | ||
| 147 | + <SubGroup>Frontend::Customer::QueuesPanel</SubGroup> | ||
| 148 | + <Setting> | ||
| 149 | + <String>/otrs/public.pl?Action=NewTicketWizardPublic;QueueID=</String> | ||
| 150 | + </Setting> | ||
| 79 | </ConfigItem> | 151 | </ConfigItem> |
| 80 | - | 152 | + |
| 153 | + | ||
| 81 | </otrs_config> | 154 | </otrs_config> |
| 82 | \ No newline at end of file | 155 | \ No newline at end of file |
Kernel/Language/pt_BR_QueuesPanel.pm
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | # the enclosed file COPYING for license information (AGPL). If you | 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. | 9 | # did not receive this file, see http://www.gnu.org/licenses/agpl.txt. |
| 10 | # -- | 10 | # -- |
| 11 | -package Kernel::Language::pt_BR_NewTicketWizard; | 11 | +package Kernel::Language::pt_BR_QueuesPanel; |
| 12 | 12 | ||
| 13 | use strict; | 13 | use strict; |
| 14 | use warnings; | 14 | use warnings; |
| @@ -21,6 +21,18 @@ sub Data { | @@ -21,6 +21,18 @@ sub Data { | ||
| 21 | $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; | 21 | $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; |
| 22 | $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; | 22 | $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; |
| 23 | $Self->{Translation}->{'Choose the service to ask for support'} = 'Escolha o serviço para o qual deseja suporte'; | 23 | $Self->{Translation}->{'Choose the service to ask for support'} = 'Escolha o serviço para o qual deseja suporte'; |
| 24 | + $Self->{Translation}->{'Message to let the user choose a queue.'} = 'Mensagem para o usuário escolher a fila'; | ||
| 25 | + $Self->{Translation}->{'Queues IDs to not show in panel (comma separated).'} = 'IDs das filas que não devem aparecer no painel (separados por vírgula)'; | ||
| 26 | + $Self->{Translation}->{'Customer footer/header suffix, if used.'} = 'Sufixo personalizado de cabeçalho/rodapé, se usado'; | ||
| 27 | + $Self->{Translation}->{'Base URL to call to create ticket, queue ID added to the end'} = 'URl para criar ticket - id da fila adicionado ao final'; | ||
| 28 | + $Self->{Translation}->{'Extra queues to show in panel. Format: One per Line, Name|URL'} = 'Filas extra, com URLs especiais. Formato: Nome|URL'; | ||
| 29 | + $Self->{Translation}->{'Extra queues to show in panel, for public access. Format: One per Line, Name|URL'} = 'Filas extra no modo público, com URLs especiais. Formato: Nome|URL'; | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + | ||
| 24 | return 1; | 36 | return 1; |
| 25 | } | 37 | } |
| 26 | 1; | 38 | 1; |
| 27 | \ No newline at end of file | 39 | \ No newline at end of file |
Kernel/Language/pt_BR_QueuesPanelPublic.pm
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | # the enclosed file COPYING for license information (AGPL). If you | 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. | 10 | # did not receive this file, see http://www.gnu.org/licenses/agpl.txt. |
| 11 | # -- | 11 | # -- |
| 12 | -package Kernel::Language::pt_BR_NewTicketWizard; | 12 | +package Kernel::Language::pt_BR_QueuesPanelPublic; |
| 13 | 13 | ||
| 14 | use strict; | 14 | use strict; |
| 15 | use warnings; | 15 | use warnings; |
Kernel/Modules/QueuesPanel.pm
| @@ -22,7 +22,8 @@ our @ObjectDependencies = ( | @@ -22,7 +22,8 @@ our @ObjectDependencies = ( | ||
| 22 | "Kernel::Output::HTML::Layout", | 22 | "Kernel::Output::HTML::Layout", |
| 23 | "KerneL::System::Log", | 23 | "KerneL::System::Log", |
| 24 | "Kernel::Config", | 24 | "Kernel::Config", |
| 25 | -"Kernel::System::Queue"); | 25 | +"Kernel::System::Queue", |
| 26 | +"Kernel::System::QueuesPanel"); | ||
| 26 | 27 | ||
| 27 | sub new { | 28 | sub new { |
| 28 | my ( $Type, %Param ) = @_; | 29 | my ( $Type, %Param ) = @_; |
| @@ -41,147 +42,30 @@ sub Run { | @@ -41,147 +42,30 @@ sub Run { | ||
| 41 | my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); | 42 | my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); |
| 42 | my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); | 43 | my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); |
| 43 | 44 | ||
| 44 | - $Self->{UrlAtendimento} = '/otrs/customer.pl?Action=NewTicketWizard;QueueID='; | ||
| 45 | - | ||
| 46 | - $Data{"QueueJS"} = $Self->BuildQueuesJS(); | ||
| 47 | - | ||
| 48 | $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::Customer::QueuesPanel"); | 45 | $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::Customer::QueuesPanel"); |
| 49 | my $msgChooseService = $Self->{Config}->{"MessageChooseQueue"}; | 46 | my $msgChooseService = $Self->{Config}->{"MessageChooseQueue"}; |
| 47 | + my $ignoreQueuesIDs = $Self->{Config}->{"IgnoreQueuesIDs"}; | ||
| 48 | + my $customHeaderFooterID = $Self->{Config}->{"CustomHeaderFooterID"}; | ||
| 49 | + my $extraQueues = $Self->{Config}->{"ExtraQueues"}; | ||
| 50 | + my $URL = $Self->{Config}->{"NewTicketURL"}; | ||
| 51 | + my $customJS = $Self->{Config}->{"CustomJS"}; | ||
| 52 | + | ||
| 53 | + my $queuesPanelBuilder = $Kernel::OM->Get("Kernel::System::QueuesPanel"); | ||
| 54 | + | ||
| 55 | + $Data{"CustomJS"} = $customJS; | ||
| 56 | + $Data{"QueueJS"} = $queuesPanelBuilder->BuildQueuesJS(IgnoreQueuesIDs => $ignoreQueuesIDs, ExtraQueues => $extraQueues, URL => $URL); | ||
| 57 | + | ||
| 50 | $Data{MsgChooseQueue} = $msgChooseService; | 58 | $Data{MsgChooseQueue} = $msgChooseService; |
| 51 | 59 | ||
| 52 | # build output | 60 | # build output |
| 53 | - my $Output = $LayoutObject->CustomerHeader( Title => $LayoutObject->{LanguageObject}->Translate("Queues panel") ); | 61 | + my $Output = $LayoutObject->CustomerHeader( Type => $customHeaderFooterID, Title => $LayoutObject->{LanguageObject}->Translate("Queues panel") ); |
| 54 | 62 | ||
| 55 | $Output .= $LayoutObject->Output( | 63 | $Output .= $LayoutObject->Output( |
| 56 | Data => \%Data, | 64 | Data => \%Data, |
| 57 | TemplateFile => 'QueuesPanel', | 65 | TemplateFile => 'QueuesPanel', |
| 58 | ); | 66 | ); |
| 59 | - $Output .= $LayoutObject->CustomerFooter(); | 67 | + $Output .= $LayoutObject->CustomerFooter(Type => $customHeaderFooterID); |
| 60 | return $Output; | 68 | return $Output; |
| 61 | } | 69 | } |
| 62 | 70 | ||
| 63 | -sub BuildQueuesJS { | ||
| 64 | - my ( $Self, %Param ) = @_; | ||
| 65 | - | ||
| 66 | - # Get queues | ||
| 67 | - my %Queues = (); | ||
| 68 | - | ||
| 69 | - my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); | ||
| 70 | - | ||
| 71 | - $DBObject->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); | ||
| 72 | - while ( my @Row = $DBObject->FetchrowArray() ) { | ||
| 73 | - $Queues{ $Row[0] } = $Row[1]; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - my $result = | ||
| 77 | - '$(document).ready(function() {' . "\n\t" | ||
| 78 | - . ' $("#columns").hColumns({' | ||
| 79 | - . "\n\t\t" | ||
| 80 | - . ' nodeSource: function(node_id, callback) {' . "\n"; | ||
| 81 | - | ||
| 82 | - for my $queue ( keys %Queues ) { | ||
| 83 | - $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue ); | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues ); | ||
| 87 | - | ||
| 88 | - $result = $result . "\n\t}});\n});"; | ||
| 89 | - | ||
| 90 | - return $result; | ||
| 91 | -} | ||
| 92 | - | ||
| 93 | -use Data::Dumper; | ||
| 94 | - | ||
| 95 | -sub BuildTopQueuesJS { | ||
| 96 | - my ( $Self, %Param ) = @_; | ||
| 97 | - my %Queues = %{ $Param{"Queues"} }; | ||
| 98 | - | ||
| 99 | - my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; | ||
| 100 | - | ||
| 101 | - my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; | ||
| 102 | - for my $queue (sort {$Queues{$a} cmp $Queues{$b}} @topQueues) { | ||
| 103 | - | ||
| 104 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | ||
| 105 | - $result = $result | ||
| 106 | - . "\t\t\t\t" | ||
| 107 | - . '{ id: ' | ||
| 108 | - . $queue | ||
| 109 | - . ', label: "' | ||
| 110 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 111 | - . '", type: "folder" },' . "\n"; | ||
| 112 | - } | ||
| 113 | - else { | ||
| 114 | - $result = $result | ||
| 115 | - . "\t\t\t\t" | ||
| 116 | - . '{ id: ' | ||
| 117 | - . $queue | ||
| 118 | - . ', label: "' | ||
| 119 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 120 | - . '", type: "link", url: "' | ||
| 121 | - . $Self->{UrlAtendimento} | ||
| 122 | - . $queue . '" },' . "\n"; | ||
| 123 | - } | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | ||
| 127 | - | ||
| 128 | - return $result; | ||
| 129 | -} | ||
| 130 | - | ||
| 131 | -sub BuildQueueJS { | ||
| 132 | - my ( $Self, %Param ) = @_; | ||
| 133 | - my %Queues = %{ $Param{"Queues"} }; | ||
| 134 | - my $BaseQueue = $Param{"Queue"}; | ||
| 135 | - my $BaseQueueID = $Param{"QueueID"}; | ||
| 136 | - | ||
| 137 | - # Get subqueues | ||
| 138 | - my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; | ||
| 139 | - my $level = () = $BaseQueue =~ /::/g; | ||
| 140 | - $level = $level + 1; | ||
| 141 | - | ||
| 142 | - # Remove subsubqueues | ||
| 143 | - @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; | ||
| 144 | - | ||
| 145 | - # When there are no subqueues, there is no need to create a JS | ||
| 146 | - if ( !@subqueues ) { | ||
| 147 | - return; | ||
| 148 | - } | ||
| 149 | - | ||
| 150 | - my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; | ||
| 151 | - | ||
| 152 | - for my $queue (@subqueues) { | ||
| 153 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | ||
| 154 | - $result = $result | ||
| 155 | - . "\t\t\t\t" | ||
| 156 | - . '{ id: ' | ||
| 157 | - . $queue | ||
| 158 | - . ', label: "' | ||
| 159 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 160 | - . '", type: "folder" }, ' . "\n"; | ||
| 161 | - } | ||
| 162 | - else { | ||
| 163 | - $result = $result | ||
| 164 | - . "\t\t\t\t" | ||
| 165 | - . '{ id: ' | ||
| 166 | - . $queue | ||
| 167 | - . ', label: "' | ||
| 168 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 169 | - . '", type: "link", url: "' | ||
| 170 | - . $Self->{UrlAtendimento} | ||
| 171 | - . $queue . '" }, ' . "\n"; | ||
| 172 | - } | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | ||
| 176 | - | ||
| 177 | - return $result; | ||
| 178 | -} | ||
| 179 | - | ||
| 180 | -sub LastQueue { | ||
| 181 | - my $Self = shift; | ||
| 182 | - my $queue = shift; | ||
| 183 | - my @parts = split( "::", $queue ); | ||
| 184 | - return $parts[-1]; | ||
| 185 | -} | ||
| 186 | - | ||
| 187 | 1; | 71 | 1; |
Kernel/Modules/QueuesPanelPublic.pm
| @@ -22,7 +22,8 @@ our @ObjectDependencies = ( | @@ -22,7 +22,8 @@ our @ObjectDependencies = ( | ||
| 22 | "Kernel::Output::HTML::Layout", | 22 | "Kernel::Output::HTML::Layout", |
| 23 | "KerneL::System::Log", | 23 | "KerneL::System::Log", |
| 24 | "Kernel::Config", | 24 | "Kernel::Config", |
| 25 | -"Kernel::System::Queue"); | 25 | +"Kernel::System::Queue", |
| 26 | +"Kernel::System::QueuesPanel"); | ||
| 26 | 27 | ||
| 27 | sub new { | 28 | sub new { |
| 28 | my ( $Type, %Param ) = @_; | 29 | my ( $Type, %Param ) = @_; |
| @@ -60,153 +61,31 @@ sub Run { | @@ -60,153 +61,31 @@ sub Run { | ||
| 60 | . "?Action=QueuesPanelPublic"; | 61 | . "?Action=QueuesPanelPublic"; |
| 61 | return $LayoutObject->Redirect( ExtURL => $url, ); | 62 | return $LayoutObject->Redirect( ExtURL => $url, ); |
| 62 | } | 63 | } |
| 63 | - | ||
| 64 | - $Self->{UrlAtendimento} = '/otrs/public.pl?Action=NewTicketWizardPublic;QueueID='; | ||
| 65 | - $Data{"QueueJS"} = $Self->BuildQueuesJS(); | ||
| 66 | - | 64 | + |
| 67 | $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::QueuesPanel"); | 65 | $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::QueuesPanel"); |
| 68 | my $msgChooseService = $Self->{Config}->{"MessageChooseQueuePublic"}; | 66 | my $msgChooseService = $Self->{Config}->{"MessageChooseQueuePublic"}; |
| 67 | + my $ignoreQueuesIDs = $Self->{Config}->{"IgnoreQueuesIDs"}; | ||
| 68 | + my $customHeaderFooterID = $Self->{Config}->{"CustomHeaderFooterID"}; | ||
| 69 | + my $extraQueues = $Self->{Config}->{"ExtraQueuesPublic"}; | ||
| 70 | + my $URL = $Self->{Config}->{"NewTicketURLPublic"}; | ||
| 71 | + my $customJS = $Self->{Config}->{"CustomJS"}; | ||
| 72 | + | ||
| 73 | + my $queuesPanelBuilder = $Kernel::OM->Get("Kernel::System::QueuesPanel"); | ||
| 74 | + | ||
| 75 | + $Data{"CustomJS"} = $customJS; | ||
| 76 | + $Data{"QueueJS"} = $queuesPanelBuilder->BuildQueuesJS(IgnoreQueuesIDs => $ignoreQueuesIDs, ExtraQueues => $extraQueues, URL => $URL); | ||
| 69 | $Data{MsgChooseQueue} = $msgChooseService; | 77 | $Data{MsgChooseQueue} = $msgChooseService; |
| 70 | 78 | ||
| 71 | # build output | 79 | # build output |
| 72 | my $Output = | 80 | my $Output = |
| 73 | - $LayoutObject->CustomerHeader( Title => $LayoutObject->{LanguageObject}->Translate("New ticket") ); | 81 | + $LayoutObject->CustomerHeader( Type => $customHeaderFooterID, Title => $LayoutObject->{LanguageObject}->Translate("New ticket") ); |
| 74 | 82 | ||
| 75 | $Output .= $LayoutObject->Output( | 83 | $Output .= $LayoutObject->Output( |
| 76 | Data => \%Data, | 84 | Data => \%Data, |
| 77 | TemplateFile => 'QueuesPanel', | 85 | TemplateFile => 'QueuesPanel', |
| 78 | ); | 86 | ); |
| 79 | - $Output .= $LayoutObject->CustomerFooter(); | 87 | + $Output .= $LayoutObject->CustomerFooter(Type => $customHeaderFooterID); |
| 80 | return $Output; | 88 | return $Output; |
| 81 | } | 89 | } |
| 82 | 90 | ||
| 83 | -sub BuildQueuesJS { | ||
| 84 | - my ( $Self, %Param ) = @_; | ||
| 85 | - | ||
| 86 | - # Get queues | ||
| 87 | - my %Queues = (); | ||
| 88 | - | ||
| 89 | - my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); | ||
| 90 | - | ||
| 91 | - $DBObject->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); | ||
| 92 | - while ( my @Row = $DBObject->FetchrowArray() ) { | ||
| 93 | - $Queues{ $Row[0] } = $Row[1]; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - my $result = | ||
| 97 | - '$(document).ready(function() {' . "\n\t" | ||
| 98 | - . ' $("#columns").hColumns({' | ||
| 99 | - . "\n\t\t" | ||
| 100 | - . ' nodeSource: function(node_id, callback) {' . "\n"; | ||
| 101 | - | ||
| 102 | - for my $queue ( keys %Queues ) { | ||
| 103 | - $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue ); | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues ); | ||
| 107 | - | ||
| 108 | - $result = $result . "\n\t}});\n});"; | ||
| 109 | - | ||
| 110 | - return $result; | ||
| 111 | -} | ||
| 112 | - | ||
| 113 | -sub BuildTopQueuesJS { | ||
| 114 | - my ( $Self, %Param ) = @_; | ||
| 115 | - my %Queues = %{ $Param{"Queues"} }; | ||
| 116 | - | ||
| 117 | - my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; | ||
| 118 | - | ||
| 119 | - my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; | ||
| 120 | - for my $queue (sort {$Queues{$a} cmp $Queues{$b}} @topQueues) { | ||
| 121 | - | ||
| 122 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | ||
| 123 | - $result = $result | ||
| 124 | - . "\t\t\t\t" | ||
| 125 | - . '{ id: ' | ||
| 126 | - . $queue | ||
| 127 | - . ', label: "' | ||
| 128 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 129 | - . '", type: "folder" },' . "\n"; | ||
| 130 | - } | ||
| 131 | - else { | ||
| 132 | - $result = $result | ||
| 133 | - . "\t\t\t\t" | ||
| 134 | - . '{ id: ' | ||
| 135 | - . $queue | ||
| 136 | - . ', label: "' | ||
| 137 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 138 | - . '", type: "link", url: "' | ||
| 139 | - . $Self->{UrlAtendimento} | ||
| 140 | - . $queue . '" },' . "\n"; | ||
| 141 | - } | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | ||
| 145 | - | ||
| 146 | - return $result; | ||
| 147 | -} | ||
| 148 | - | ||
| 149 | -sub BuildQueueJS { | ||
| 150 | - my ( $Self, %Param ) = @_; | ||
| 151 | - my %Queues = %{ $Param{"Queues"} }; | ||
| 152 | - my $BaseQueue = $Param{"Queue"}; | ||
| 153 | - my $BaseQueueID = $Param{"QueueID"}; | ||
| 154 | - | ||
| 155 | - # Get subqueues | ||
| 156 | - my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; | ||
| 157 | - my $level = () = $BaseQueue =~ /::/g; | ||
| 158 | - $level = $level + 1; | ||
| 159 | - | ||
| 160 | - # Remove subsubqueues | ||
| 161 | - @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; | ||
| 162 | - | ||
| 163 | - # When there are no subqueues, there is no need to create a JS | ||
| 164 | - if ( !@subqueues ) { | ||
| 165 | - return ""; | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; | ||
| 169 | - | ||
| 170 | - for my $queue (sort {$Self->LastQueue($Queues{$a}) cmp $Self->LastQueue($Queues{$b})} @subqueues) { | ||
| 171 | - if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | ||
| 172 | - $result = $result | ||
| 173 | - . "\t\t\t\t" | ||
| 174 | - . '{ id: ' | ||
| 175 | - . $queue | ||
| 176 | - . ', label: "' | ||
| 177 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 178 | - . '", type: "folder" }, ' . "\n"; | ||
| 179 | - } | ||
| 180 | - else { | ||
| 181 | - $result = $result | ||
| 182 | - . "\t\t\t\t" | ||
| 183 | - . '{ id: ' | ||
| 184 | - . $queue | ||
| 185 | - . ', label: "' | ||
| 186 | - . $Self->LastQueue( $Queues{$queue} ) | ||
| 187 | - . '", type: "link", url: "' | ||
| 188 | - . $Self->{UrlAtendimento} | ||
| 189 | - . $queue . '" }, ' . "\n"; | ||
| 190 | - } | ||
| 191 | - } | ||
| 192 | - | ||
| 193 | - $result = $result . "\t\t\t]);\n\t\t}\n"; | ||
| 194 | - | ||
| 195 | - return $result; | ||
| 196 | -} | ||
| 197 | - | ||
| 198 | -sub FirstQueue { | ||
| 199 | - my $Self = shift; | ||
| 200 | - my $queue = shift; | ||
| 201 | - my @parts = split( "::", $queue ); | ||
| 202 | - return $parts[0]; | ||
| 203 | -} | ||
| 204 | - | ||
| 205 | -sub LastQueue { | ||
| 206 | - my $Self = shift; | ||
| 207 | - my $queue = shift; | ||
| 208 | - my @parts = split( "::", $queue ); | ||
| 209 | - return $parts[-1]; | ||
| 210 | -} | ||
| 211 | - | ||
| 212 | 1; | 91 | 1; |
| @@ -0,0 +1,33 @@ | @@ -0,0 +1,33 @@ | ||
| 1 | +# -- | ||
| 2 | +# CustomerFooterQPUFSC.tt - Footer para Queues Panel na UFSC | ||
| 3 | +# Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ | ||
| 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 id="footerF" align="center" style="position: absolute; bottom: 10px; width: 100%; margin-top: 18px; margin-bottom: 8px;" class="noPrint"> | ||
| 11 | + | ||
| 12 | +<div style="font-size: 0px;"> | ||
| 13 | +<div style="height: 2px; width: 100%; background-image: url('/otrs-web/skins/Customer/default/images/queues-panel/separador.gif'); background-repeat: repeat-x; background-position: 0 50%;"></div> | ||
| 14 | +</div> | ||
| 15 | + <br><a href="http://www.setic.ufsc.br" target="_blank"><img src="/otrs-web/skins/Customer/default/images/queues-panel/setic.png" style="border-style: none"></a> | ||
| 16 | + <br> | ||
| 17 | + <div style="margin-top: 4px;"><span style="color: #BBBBBB;">© SeTIC - Superintendência de Governança Eletrônica e Tecnologia da Informação e Comunicação</span> | ||
| 18 | + </div> | ||
| 19 | + <div id="Footer" class="ARIARoleContentinfo"> | ||
| 20 | +[% RenderBlockStart("Banner") %] | ||
| 21 | + <a href="http://www.otrs.com/" title="[% Config("Product") %] [% Config("Version") %]" target="_blank">[% Translate("Powered by") | html %] [% Config("Product") %] [% Config("Version").remove('\.0\..*') %]</a> | ||
| 22 | +[% RenderBlockEnd("Banner") %] | ||
| 23 | + <div class="Clear"></div> | ||
| 24 | +</div> | ||
| 25 | +</div> | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +[% InsertTemplate("CustomerFooterJS.tt") %] | ||
| 31 | + | ||
| 32 | +</body> | ||
| 33 | +</html> |
| @@ -0,0 +1,159 @@ | @@ -0,0 +1,159 @@ | ||
| 1 | +# -- | ||
| 2 | +# CustomerHTMLHeadUFSC.tt - provides FSC global HTML header | ||
| 3 | +# Copyright (C) 2015, SeTIC - UFSC - http://setic.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 | +<head> | ||
| 10 | + <meta http-equiv="Content-type" content="text/html;charset=utf-8" /> | ||
| 11 | +[% RenderBlockStart("MetaHttpEquivRefresh") %] | ||
| 12 | +[% INCLUDE "HTMLHeadRefresh.tt" %] | ||
| 13 | +[% RenderBlockEnd("MetaHttpEquivRefresh") %] | ||
| 14 | +[% RenderBlockStart("MetaLink") %] | ||
| 15 | + <link rel="[% Data.Rel | html %]" type="[% Data.Type | html %]" title="[% Data.Title | html %]" href="[% Data.Href %]" /> | ||
| 16 | +[% RenderBlockEnd("MetaLink") %] | ||
| 17 | + <link rel="shortcut icon" href="[% Config("Frontend::ImagePath") %]icons/product.ico" type="image/ico" /> | ||
| 18 | + | ||
| 19 | +[% RenderBlockStart("CommonCSS") %] | ||
| 20 | + <link rel="stylesheet" type="text/css" href="[% Config("Frontend::WebPath") %]skins/Customer/[% Data.Skin | uri %]/[% Data.CSSDirectory | html %]/[% Data.Filename | html %]" /> | ||
| 21 | +[% RenderBlockEnd("CommonCSS") %] | ||
| 22 | + | ||
| 23 | +[% RenderBlockStart("CommonCSS_IE8") %] | ||
| 24 | +<!--[if IE 7]> | ||
| 25 | + <link rel="stylesheet" type="text/css" href="[% Config("Frontend::WebPath") %]skins/Customer/[% Data.Skin | uri %]/[% Data.CSSDirectory | html %]/[% Data.Filename | html %]" /> | ||
| 26 | + <![endif]--> | ||
| 27 | +[% RenderBlockEnd("CommonCSS_IE8") %] | ||
| 28 | + | ||
| 29 | +[% RenderBlockStart("ModuleCSS") %] | ||
| 30 | + <link rel="stylesheet" type="text/css" href="[% Config("Frontend::WebPath") %]skins/Customer/[% Data.Skin | uri %]/[% Data.CSSDirectory | html %]/[% Data.Filename | html %]" /> | ||
| 31 | +[% RenderBlockEnd("ModuleCSS") %] | ||
| 32 | + | ||
| 33 | +[% RenderBlockStart("ModuleCSS_IE8") %] | ||
| 34 | +<!--[if IE 7]> | ||
| 35 | + <link rel="stylesheet" type="text/css" href="[% Config("Frontend::WebPath") %]skins/Customer/[% Data.Skin | uri %]/[% Data.CSSDirectory | html %]/[% Data.Filename | html %]" /> | ||
| 36 | + <![endif]--> | ||
| 37 | +[% RenderBlockEnd("ModuleCSS_IE8") %] | ||
| 38 | + | ||
| 39 | + <link rel="stylesheet" type="text/css" href="[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/ui-theme/jquery-ui.css" /> | ||
| 40 | + <link rel="stylesheet" type="text/css" href="[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/jstree-theme/default/style.css" /> | ||
| 41 | + | ||
| 42 | +[% RenderBlockStart("HeaderLogoCSS") %] | ||
| 43 | + <style type="text/css"> | ||
| 44 | + #Header #Logo { | ||
| 45 | + background-image: [% Data.URL | html %]; | ||
| 46 | + top: [% Data.StyleTop | html %]; | ||
| 47 | + right: [% Data.StyleRight | html %]; | ||
| 48 | + width: [% Data.StyleWidth | html %]; | ||
| 49 | + height: [% Data.StyleHeight | html %]; | ||
| 50 | + } | ||
| 51 | + </style> | ||
| 52 | +[% RenderBlockEnd("HeaderLogoCSS") %] | ||
| 53 | + | ||
| 54 | + <style type="text/css"> | ||
| 55 | + @font-face { | ||
| 56 | + font-family: 'FontAwesome'; | ||
| 57 | + src: url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.eot?v=4.1.0'); | ||
| 58 | + src: url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), | ||
| 59 | + url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.woff?v=4.1.0') format('woff'), | ||
| 60 | + url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), | ||
| 61 | + url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.svg#fontawesomeregular?v=4.1.0') format('svg'); | ||
| 62 | + font-weight: normal; | ||
| 63 | + font-style: normal; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /* Fix poor font rendering on chrome based browsers on windows */ | ||
| 67 | + @media all and (-webkit-min-device-pixel-ratio:0) { | ||
| 68 | + @font-face { | ||
| 69 | + font-family: 'FontAwesome'; | ||
| 70 | + src: url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.svg#fontawesomeregular') format('svg'), | ||
| 71 | + url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), | ||
| 72 | + url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.woff?v=4.1.0') format('woff'), | ||
| 73 | + url('[% Config("Frontend::WebPath") %]skins/Customer/default/css/thirdparty/fontawesome/fontawesome-webfont.ttf?v=4.1.0') format('truetype'); | ||
| 74 | + font-weight: normal; | ||
| 75 | + font-style: normal; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + </style> | ||
| 79 | + | ||
| 80 | +<!--[if IE 8]> | ||
| 81 | + <script type="text/javascript"> | ||
| 82 | + /* Fix initial font rendering on IE8 for FontAwesome */ | ||
| 83 | + (function() { | ||
| 84 | + var head = document.getElementsByTagName('head')[0], | ||
| 85 | + style = document.createElement('style'); | ||
| 86 | + style.type = 'text/css'; | ||
| 87 | + style.styleSheet.cssText = ':before,:after{content:none !important;}'; | ||
| 88 | + head.appendChild(style); | ||
| 89 | + setTimeout(function(){ | ||
| 90 | + head.removeChild(style); | ||
| 91 | + }, 0); | ||
| 92 | + }()); | ||
| 93 | + </script> | ||
| 94 | + <![endif]--> | ||
| 95 | + | ||
| 96 | + <style type="text/css"> | ||
| 97 | + #header { | ||
| 98 | + height: 90px; | ||
| 99 | + background-image: url("/otrs-web/skins/Customer/default/images/queues-panel/cabecalhoUFSC.jpg"); | ||
| 100 | + background-position: bottom left; | ||
| 101 | + padding-left: 30px; | ||
| 102 | + padding-top: 0px; | ||
| 103 | + font-family: Verdana, Arial, sans-serif; | ||
| 104 | + margin-bottom: 20px; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + .tabstyles { | ||
| 108 | + border-collapse: separate; | ||
| 109 | + display: inline; | ||
| 110 | + font-family: Verdana, Arial, sans-serif; | ||
| 111 | + font-size: 11px; | ||
| 112 | + height: auto; | ||
| 113 | + margin-bottom: 0px; | ||
| 114 | + margin-left: 0px; | ||
| 115 | + margin-right: 0px; | ||
| 116 | + margin-top: 0px; | ||
| 117 | + padding-bottom: 0px; | ||
| 118 | + padding-left: 0px; | ||
| 119 | + padding-right: 0px; | ||
| 120 | + padding-top: 0px; | ||
| 121 | + width: auto; | ||
| 122 | +vertical-align: bottom; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + .atalhoMenuLogo { | ||
| 126 | + text-align: right; | ||
| 127 | + vertical-align: bottom; | ||
| 128 | + color: #0000ee; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + .titleText { | ||
| 132 | + FONT-SIZE: 16px; | ||
| 133 | + FONT-WEIGHT: bold; | ||
| 134 | + FONT-FAMILY: Arial, Helvetica, sans-serif; | ||
| 135 | + text-align: left; | ||
| 136 | + margin-left: 10px; | ||
| 137 | +} | ||
| 138 | + | ||
| 139 | + body { | ||
| 140 | + background: white; | ||
| 141 | + FONT-FAMILY: Arial, Helvetica, sans-serif; | ||
| 142 | + text-align: left; | ||
| 143 | + font-size: 12px; | ||
| 144 | +} | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + | ||
| 148 | + | ||
| 149 | + </style> | ||
| 150 | + | ||
| 151 | + | ||
| 152 | + <title>[% Data.TitleArea | html %] [% Config("ProductName") %]</title> | ||
| 153 | + | ||
| 154 | + | ||
| 155 | + | ||
| 156 | + | ||
| 157 | +[% INCLUDE "HTMLHeadBlockEvents.tt" %] | ||
| 158 | + | ||
| 159 | +</head> |
| @@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
| 1 | +# -- | ||
| 2 | +# CustomerHeaderQPUFSC.tt - provides global HTML header for UFSC | ||
| 3 | +# Copyright (C) 2015, SeTIC - UFSC - http://setic.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 | +[%- INCLUDE "HTTPHeaders.tt" -%] | ||
| 10 | + | ||
| 11 | +<!DOCTYPE html> | ||
| 12 | +<html> | ||
| 13 | +[% InsertTemplate("Copyright.tt") %] | ||
| 14 | +[% InsertTemplate("CustomerHTMLHeadQPUFSC.tt") %] | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +<body class="NoJavaScript"> | ||
| 18 | + <div id="header" class="noPrint"> | ||
| 19 | + <table border="0" width="100%"> | ||
| 20 | + <tbody> | ||
| 21 | + <tr style="height: 88px; vertical-align: bottom;"> | ||
| 22 | + <td class="atalhoMenuLogo"><span class="tabstyles"> | ||
| 23 | + <a href="http://servicosti.ufsc.br/">Catálogo de serviços</a> | <a href="/otrs/customer.pl?Action=CustomerTicketOverview">Meus chamados</a></span> | ||
| 24 | + </td> | ||
| 25 | + </tr> | ||
| 26 | + </tbody> | ||
| 27 | + </table> | ||
| 28 | + </div> | ||
| 29 | + | ||
| 30 | +<table id="titulo" width="100%" cellpadding="0" cellspacing="0"> | ||
| 31 | + <tbody><tr> | ||
| 32 | + <td align="left" valign="top"><span class="titleText">PAI - <span style="font-weight: bolder">P</span>ortal de <span style="font-weight: bolder">A</span>tendimento <span style="font-weight: bolder">I</span>nstitucional</span></td> | ||
| 33 | + <td align="left" valign="top" width="1"></td> | ||
| 34 | + </tr> | ||
| 35 | + </tbody></table> | ||
| 36 | +<div style="font-size: 0px;"> | ||
| 37 | +<div style="height: 2px; width: 100%; background-image: url('/otrs-web/skins/Customer/default/images/queues-panel/separador.gif'); background-repeat: repeat-x; background-position: 0 50%;"></div> | ||
| 38 | +</div> | ||
| 39 | + | ||
| 40 | +<!-- end header --> |
Kernel/Output/HTML/Standard/QueuesPanel.tt
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | # the enclosed file COPYING for license information (AGPL). If you | 11 | # the enclosed file COPYING for license information (AGPL). If you |
| 12 | # did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | 12 | # did not receive this file, see http://www.gnu.org/licenses/agpl.txt. |
| 13 | # -- | 13 | # -- |
| 14 | -<div class="Queues"> | 14 | +<div id="Queues" class="Queues"> |
| 15 | <div class="ChooseQueue">[% Data.MsgChooseQueue %]</div> | 15 | <div class="ChooseQueue">[% Data.MsgChooseQueue %]</div> |
| 16 | 16 | ||
| 17 | <div id="columns"></div> | 17 | <div id="columns"></div> |
| @@ -20,12 +20,19 @@ | @@ -20,12 +20,19 @@ | ||
| 20 | <div class="QueueCard"> | 20 | <div class="QueueCard"> |
| 21 | <div class="QueueTitle"><a class="QueueTitleLink" href="[% Env("Baselink") %]Action=NewTicketWizard;BaseQueueID=[% Data.QueueID %]">[% Data.QueueName %]</a></div> | 21 | <div class="QueueTitle"><a class="QueueTitleLink" href="[% Env("Baselink") %]Action=NewTicketWizard;BaseQueueID=[% Data.QueueID %]">[% Data.QueueName %]</a></div> |
| 22 | <div class="QueueComments">[% Data.QueueComments %]</div> | 22 | <div class="QueueComments">[% Data.QueueComments %]</div> |
| 23 | - </div> | 23 | + </div> |
| 24 | + | ||
| 24 | [% RenderBlockEnd("ListQueue") %] | 25 | [% RenderBlockEnd("ListQueue") %] |
| 25 | 26 | ||
| 27 | +</div> | ||
| 28 | + | ||
| 26 | [% WRAPPER JSOnDocumentComplete %] | 29 | [% WRAPPER JSOnDocumentComplete %] |
| 27 | <script type="text/javascript"> | 30 | <script type="text/javascript"> |
| 28 | [% Data.QueueJS %] | 31 | [% Data.QueueJS %] |
| 32 | + | ||
| 33 | + | ||
| 34 | + [% Data.CustomJS %] | ||
| 35 | + | ||
| 29 | </script> | 36 | </script> |
| 30 | [% END %] | 37 | [% END %] |
| 31 | 38 |
| @@ -0,0 +1,212 @@ | @@ -0,0 +1,212 @@ | ||
| 1 | +# -- | ||
| 2 | +# Kernel/System/QueuesPanel.pm - logic for queues panel module | ||
| 3 | +# | ||
| 4 | +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ | ||
| 5 | +# Version 29/10/2015 - First version | ||
| 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 | +package Kernel::System::QueuesPanel; | ||
| 13 | + | ||
| 14 | +use strict; | ||
| 15 | +use warnings; | ||
| 16 | + | ||
| 17 | +use Kernel::System::VariableCheck qw(:all); | ||
| 18 | +use Data::Dumper; | ||
| 19 | + | ||
| 20 | +our @ObjectDependencies = ( | ||
| 21 | +"Kernel::System::DB", | ||
| 22 | +"KerneL::System::Log", | ||
| 23 | +"Kernel::System::Queue"); | ||
| 24 | + | ||
| 25 | +sub new { | ||
| 26 | + my ( $Type, %Param ) = @_; | ||
| 27 | + | ||
| 28 | + # allocate new hash for object | ||
| 29 | + my $Self = {%Param}; | ||
| 30 | + bless( $Self, $Type ); | ||
| 31 | + | ||
| 32 | + return $Self; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +=head | ||
| 37 | + | ||
| 38 | +Builds the JavaScript for the Queues Panel component (jQuery hColumns) | ||
| 39 | + | ||
| 40 | +Params: IgnoreQueuesID - comma-separated list of queues to ignore | ||
| 41 | + ExtraQueues - line-break separated list of extra queues to include. Each line has a name for the queue and a link, separated by "||" - example: | ||
| 42 | + SeTIC||http://setic.ufsc.br | ||
| 43 | + | ||
| 44 | +=cut | ||
| 45 | +sub BuildQueuesJS { | ||
| 46 | + my ( $Self, %Param ) = @_; | ||
| 47 | + | ||
| 48 | + # Get queues | ||
| 49 | + my %Queues = (); | ||
| 50 | + my %ExtraQueuesLinks = (); | ||
| 51 | + | ||
| 52 | + my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); | ||
| 53 | + | ||
| 54 | + if ($Param{IgnoreQueuesIDs}) { | ||
| 55 | + $DBObject->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 AND id NOT IN (" . $Param{IgnoreQueuesIDs} . ") ORDER BY name ASC", ); | ||
| 56 | + } else { | ||
| 57 | + $DBObject->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + while ( my @Row = $DBObject->FetchrowArray() ) { | ||
| 61 | + $Queues{ $Row[0] } = $Row[1]; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + if ($Param{ExtraQueues}) { | ||
| 66 | + my @extraQueues = split('\n', $Param{ExtraQueues}); | ||
| 67 | + my $id = -1; | ||
| 68 | + foreach my $extraQueue (@extraQueues) { | ||
| 69 | + my @data = split('\|', $extraQueue); | ||
| 70 | + $Queues{$id} = $data[0]; | ||
| 71 | + $ExtraQueuesLinks{$id} = $data[1]; | ||
| 72 | + $id = $id - 1; | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + my $result = | ||
| 77 | + '$(document).ready(function() {' . "\n\t" | ||
| 78 | + . ' $("#columns").hColumns({' | ||
| 79 | + . "\n\t\t" | ||
| 80 | + . ' nodeSource: function(node_id, callback) {' . "\n"; | ||
| 81 | + | ||
| 82 | + for my $queue ( keys %Queues ) { | ||
| 83 | + $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue, ExtraQueuesLinks => \%ExtraQueuesLinks, URL => | ||
| 84 | + $Param{URL} ); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues, ExtraQueuesLinks => \%ExtraQueuesLinks, URL => | ||
| 88 | + $Param{URL} ); | ||
| 89 | + | ||
| 90 | + $result = $result . "\n\t}});\n});"; | ||
| 91 | + | ||
| 92 | + return $result; | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | +=head | ||
| 96 | + | ||
| 97 | +Builds the top level queues JavaScript | ||
| 98 | + | ||
| 99 | +Params: Queues - queues list | ||
| 100 | + ExtraQueuesLinks - links for custom (id < 0) queues | ||
| 101 | + | ||
| 102 | +=cut | ||
| 103 | +sub BuildTopQueuesJS { | ||
| 104 | + my ( $Self, %Param ) = @_; | ||
| 105 | + my %Queues = %{ $Param{"Queues"} }; | ||
| 106 | + my %ExtraQueuesLinks = %{ $Param{"ExtraQueuesLinks"} }; | ||
| 107 | + | ||
| 108 | + my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; | ||
| 109 | + | ||
| 110 | + my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; | ||
| 111 | + for my $queue (sort {$Queues{$a} cmp $Queues{$b}} @topQueues) { | ||
| 112 | + | ||
| 113 | + if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | ||
| 114 | + $result = $result | ||
| 115 | + . "\t\t\t\t" | ||
| 116 | + . '{ id: ' | ||
| 117 | + . $queue | ||
| 118 | + . ', label: "' | ||
| 119 | + . $Self->LastQueue( $Queues{$queue} ) | ||
| 120 | + . '", type: "folder" },' . "\n"; | ||
| 121 | + } | ||
| 122 | + else { | ||
| 123 | + $result = $result | ||
| 124 | + . "\t\t\t\t" | ||
| 125 | + . '{ id: ' | ||
| 126 | + . $queue | ||
| 127 | + . ', label: "' | ||
| 128 | + . $Self->LastQueue( $Queues{$queue} ) | ||
| 129 | + . '", type: "link", url: "' | ||
| 130 | + . ($queue < 0 ? $ExtraQueuesLinks{$queue} : $Param{"URL"} . $queue) | ||
| 131 | + . '" },' . "\n"; | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + $result = $result . "\t\t\t]);\n\t\t}\n"; | ||
| 136 | + | ||
| 137 | + return $result; | ||
| 138 | +} | ||
| 139 | + | ||
| 140 | +=head | ||
| 141 | + | ||
| 142 | +Builds sub-queues JavaScript | ||
| 143 | + | ||
| 144 | +Params: Queues - queues list | ||
| 145 | + ExtraQueuesLinks - links for custom (id < 0) queues | ||
| 146 | + BaseQueue / BaseQueueID - which upper queue to generate subqueues | ||
| 147 | + | ||
| 148 | +=cut | ||
| 149 | +sub BuildQueueJS { | ||
| 150 | + my ( $Self, %Param ) = @_; | ||
| 151 | + my %Queues = %{ $Param{"Queues"} }; | ||
| 152 | + my $BaseQueue = $Param{"Queue"}; | ||
| 153 | + my $BaseQueueID = $Param{"QueueID"}; | ||
| 154 | + my %ExtraQueuesLinks = %{ $Param{"ExtraQueuesLinks"} }; | ||
| 155 | + | ||
| 156 | + # Get subqueues | ||
| 157 | + my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; | ||
| 158 | + my $level = () = $BaseQueue =~ /::/g; | ||
| 159 | + $level = $level + 1; | ||
| 160 | + | ||
| 161 | + # Remove subsubqueues | ||
| 162 | + @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; | ||
| 163 | + | ||
| 164 | + # When there are no subqueues, there is no need to create a JS | ||
| 165 | + if ( !@subqueues ) { | ||
| 166 | + return ""; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; | ||
| 170 | + | ||
| 171 | + for my $queue (@subqueues) { | ||
| 172 | + if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { | ||
| 173 | + $result = $result | ||
| 174 | + . "\t\t\t\t" | ||
| 175 | + . '{ id: ' | ||
| 176 | + . $queue | ||
| 177 | + . ', label: "' | ||
| 178 | + . $Self->LastQueue( $Queues{$queue} ) | ||
| 179 | + . '", type: "folder" }, ' . "\n"; | ||
| 180 | + } | ||
| 181 | + else { | ||
| 182 | + $result = $result | ||
| 183 | + . "\t\t\t\t" | ||
| 184 | + . '{ id: ' | ||
| 185 | + . $queue | ||
| 186 | + . ', label: "' | ||
| 187 | + . $Self->LastQueue( $Queues{$queue} ) | ||
| 188 | + . '", type: "link", url: "' | ||
| 189 | + . ($queue < 0 ? $ExtraQueuesLinks{$queue} : $Param{"URL"} . $queue) . '" }, ' . "\n"; | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + $result = $result . "\t\t\t]);\n\t\t}\n"; | ||
| 194 | + | ||
| 195 | + return $result; | ||
| 196 | +} | ||
| 197 | + | ||
| 198 | +=head | ||
| 199 | + | ||
| 200 | +Returns last part of the queue name (strips parent queues) | ||
| 201 | + | ||
| 202 | +Params: QueueName | ||
| 203 | + | ||
| 204 | +=cut | ||
| 205 | +sub LastQueue { | ||
| 206 | + my $Self = shift; | ||
| 207 | + my $queue = shift; | ||
| 208 | + my @parts = split( "::", $queue ); | ||
| 209 | + return $parts[-1]; | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | +1; |
| @@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
| 1 | +<?xml version="1.0" encoding="utf-8" ?> | ||
| 2 | +<otrs_package version="1.0"> | ||
| 3 | + <Name>QueuesPanelUFSC</Name> | ||
| 4 | + <Version>1.0.0</Version> | ||
| 5 | + <Framework>4.0.4</Framework> | ||
| 6 | + <Vendor>SeTIC</Vendor> | ||
| 7 | + <URL>http://www.setic.ufsc.br</URL> | ||
| 8 | + <License>GPLv2</License> | ||
| 9 | + <Description>Customer header/footer for QueuesPanel module for UFSC</Description> | ||
| 10 | + <IntroInstall Type="post" Title="Thank you">Module installed successfully!</IntroInstall> | ||
| 11 | + <Description>New Ticket Wizard</Description> | ||
| 12 | + <BuildDate>?</BuildDate> | ||
| 13 | + <BuildHost>?</BuildHost> | ||
| 14 | + <Filelist> | ||
| 15 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/CustomerFooterQPUFSC.tt"></File> | ||
| 16 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/CustomerHeaderQPUFSC.tt"></File> | ||
| 17 | + <File Permission="644" Location="Kernel/Output/HTML/Standard/CustomerHTMLHeadQPUFSC.tt"></File> | ||
| 18 | + <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/queues-panel/cabecalhoUFSC.jpg"></File> | ||
| 19 | + <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/queues-panel/separador.gif"></File> | ||
| 20 | + <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/queues-panel/setic.png"></File> | ||
| 21 | + </Filelist> | ||
| 22 | +</otrs_package> | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
QueuesPanel.sopm
| 1 | <?xml version="1.0" encoding="utf-8" ?> | 1 | <?xml version="1.0" encoding="utf-8" ?> |
| 2 | <otrs_package version="1.0"> | 2 | <otrs_package version="1.0"> |
| 3 | <Name>QueuesPanel</Name> | 3 | <Name>QueuesPanel</Name> |
| 4 | - <Version>1.0.0</Version> | ||
| 5 | - <Framework>4.0.3</Framework> | 4 | + <Version>1.1.0</Version> |
| 5 | + <Framework>4.0.4</Framework> | ||
| 6 | <Vendor>SeTIC</Vendor> | 6 | <Vendor>SeTIC</Vendor> |
| 7 | + <ChangeLog version="1.1.0">Support for custom queues, layout fixes, support for custom layouts for header and footer</ChangeLog> | ||
| 7 | <URL>http://www.setic.ufsc.br</URL> | 8 | <URL>http://www.setic.ufsc.br</URL> |
| 8 | <License>GPLv2</License> | 9 | <License>GPLv2</License> |
| 9 | <Description>Queue choosing panel</Description> | 10 | <Description>Queue choosing panel</Description> |
| 10 | <IntroInstall Type="post" Title="Thank you">Module installed successfully!</IntroInstall> | 11 | <IntroInstall Type="post" Title="Thank you">Module installed successfully!</IntroInstall> |
| 11 | - <Description>New Ticket Wizard</Description> | 12 | + <Description>Queues Panel</Description> |
| 12 | <BuildDate>?</BuildDate> | 13 | <BuildDate>?</BuildDate> |
| 13 | <BuildHost>?</BuildHost> | 14 | <BuildHost>?</BuildHost> |
| 14 | - <PackageRequired>CASAuthentication</PackageRequired> | ||
| 15 | - <PackageRequired>NewTicketWizard</PackageRequired> | 15 | + <PackageRequired Version="1.1.0">CASAuthentication</PackageRequired> |
| 16 | + <PackageRequired Version="1.5.0">NewTicketWizard</PackageRequired> | ||
| 16 | <Filelist> | 17 | <Filelist> |
| 17 | <File Permission="644" Location="Kernel/Config/Files/QueuesPanel.xml"></File> | 18 | <File Permission="644" Location="Kernel/Config/Files/QueuesPanel.xml"></File> |
| 18 | 19 | ||
| @@ -22,15 +23,16 @@ | @@ -22,15 +23,16 @@ | ||
| 22 | <File Permission="644" Location="Kernel/Modules/QueuesPanel.pm"></File> | 23 | <File Permission="644" Location="Kernel/Modules/QueuesPanel.pm"></File> |
| 23 | <File Permission="644" Location="Kernel/Modules/QueuesPanelPublic.pm"></File> | 24 | <File Permission="644" Location="Kernel/Modules/QueuesPanelPublic.pm"></File> |
| 24 | 25 | ||
| 26 | + <File Permission="644" Location="Kernel/System/QueuesPanel.pm"></File> | ||
| 27 | + | ||
| 25 | <File Permission="644" Location="Kernel/Output/HTML/Standard/QueuesPanel.tt"></File> | 28 | <File Permission="644" Location="Kernel/Output/HTML/Standard/QueuesPanel.tt"></File> |
| 26 | 29 | ||
| 27 | <File Permission="644" Location="var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js"></File> | 30 | <File Permission="644" Location="var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js"></File> |
| 28 | 31 | ||
| 29 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css"></File> | 32 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css"></File> |
| 30 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css"></File> | 33 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css"></File> |
| 31 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css"></File> | 34 | + <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css"></File> |
| 32 | 35 | ||
| 33 | - <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png"></File> | ||
| 34 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png"></File> | 36 | <File Permission="644" Location="var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png"></File> |
| 35 | 37 | ||
| 36 | </Filelist> | 38 | </Filelist> |
var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css
var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css
| 1 | -.ChooseQueue { | ||
| 2 | - border-style: solid; | 1 | +/*.ChooseQueue { |
| 2 | + border-bottom-style: solid; | ||
| 3 | border-width: 1px; | 3 | border-width: 1px; |
| 4 | padding: 5px; | 4 | padding: 5px; |
| 5 | margin-top: 5px; | 5 | margin-top: 5px; |
| 6 | margin-left: 10px; | 6 | margin-left: 10px; |
| 7 | +}*/ | ||
| 8 | + | ||
| 9 | +.ChooseQueue { | ||
| 10 | + background-color: rgb(198, 222, 255); | ||
| 11 | +background-image: none; | ||
| 12 | +background-position: 0px 0px; | ||
| 13 | +background-repeat: repeat-x; | ||
| 14 | +border-bottom-color: rgb(255, 255, 255); | ||
| 15 | +border-bottom-style: solid; | ||
| 16 | +border-bottom-width: 0px; | ||
| 17 | +border-collapse: separate; | ||
| 18 | +border-left-color: rgb(255, 255, 255); | ||
| 19 | +border-left-style: solid; | ||
| 20 | +border-left-width: 1px; | ||
| 21 | +border-right-color: rgb(255, 255, 255); | ||
| 22 | +border-right-style: solid; | ||
| 23 | +border-right-width: 1px; | ||
| 24 | +border-top-color: rgb(255, 255, 255); | ||
| 25 | +border-top-style: solid; | ||
| 26 | +border-top-width: 1px; | ||
| 27 | +color: rgb(0, 0, 0); | ||
| 28 | +cursor: default; | ||
| 29 | +display: table-cell; | ||
| 30 | +font-family: Arial, Verdana, sans-serif; | ||
| 31 | +font-size: 14px; | ||
| 32 | +font-weight: bold; | ||
| 33 | +height: 12px; | ||
| 34 | +margin-bottom: 0px; | ||
| 35 | +margin-left: 0px; | ||
| 36 | +margin-right: 0px; | ||
| 37 | +margin-top: 0px; | ||
| 38 | +padding-bottom: 5px; | ||
| 39 | +padding-left: 15px; | ||
| 40 | +padding-right: 15px; | ||
| 41 | +padding-top: 5px; | ||
| 42 | +text-align: center; | ||
| 43 | +vertical-align: middle; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +.Queues { | ||
| 47 | + width: 80%; | ||
| 48 | + margin: 0 auto; | ||
| 49 | + padding-top: 10px; | ||
| 7 | } | 50 | } |
| 8 | 51 | ||
| 9 | /* column view container */ | 52 | /* column view container */ |
| 10 | .column-view-container { | 53 | .column-view-container { |
| 11 | width: 100%; | 54 | width: 100%; |
| 12 | - height: 400px; | ||
| 13 | - padding: 0; | 55 | + margin: 0px; |
| 56 | + padding: 0px; | ||
| 14 | border: 1px solid #ccc; | 57 | border: 1px solid #ccc; |
| 15 | background: #FFF; | 58 | background: #FFF; |
| 16 | display: block; | 59 | display: block; |
var/httpd/htdocs/skins/Customer/default/images/queues-panel/cabecalhoUFSC.jpg
0 → 100644
34.5 KB
var/httpd/htdocs/skins/Customer/default/images/queues-panel/separador.gif
0 → 100644
46 Bytes
var/httpd/htdocs/skins/Customer/default/images/queues-panel/separador.gif.1
0 → 100644
No preview for this file type
5.46 KB