From e66ff1110e52fd0734b6354f23c7b6f24f99b5f8 Mon Sep 17 00:00:00 2001 From: Rodrigo Goncalves Date: Mon, 12 Jan 2015 18:30:52 -0200 Subject: [PATCH] First commit. --- .project | 17 +++++++++++++++++ CreateOpm.sh | 5 +++++ Kernel/Config/Files/QueuesPanel.xml | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Kernel/Language/pt_BR_QueuesPanel.pm | 26 ++++++++++++++++++++++++++ Kernel/Language/pt_BR_QueuesPanelPublic.pm | 27 +++++++++++++++++++++++++++ Kernel/Modules/QueuesPanel.pm | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Kernel/Modules/QueuesPanelPublic.pm | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Kernel/Output/HTML/Standard/QueuesPanel.tt | 32 ++++++++++++++++++++++++++++++++ QueuesPanel.sopm | 37 +++++++++++++++++++++++++++++++++++++ var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js | 8 ++++++++ var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png | Bin 0 -> 28102 bytes var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png | Bin 0 -> 12799 bytes 15 files changed, 876 insertions(+), 0 deletions(-) create mode 100644 .project create mode 100755 CreateOpm.sh create mode 100644 Kernel/Config/Files/QueuesPanel.xml create mode 100644 Kernel/Language/pt_BR_QueuesPanel.pm create mode 100644 Kernel/Language/pt_BR_QueuesPanelPublic.pm create mode 100644 Kernel/Modules/QueuesPanel.pm create mode 100644 Kernel/Modules/QueuesPanelPublic.pm create mode 100644 Kernel/Output/HTML/Standard/QueuesPanel.tt create mode 100755 QueuesPanel.sopm create mode 100755 var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js create mode 100755 var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css create mode 100644 var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css create mode 100644 var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css create mode 100644 var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png create mode 100644 var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png diff --git a/.project b/.project new file mode 100644 index 0000000..fa82ae6 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + otrs-queues-panel + + + + + + org.epic.perleditor.perlbuilder + + + + + + org.epic.perleditor.perlnature + + diff --git a/CreateOpm.sh b/CreateOpm.sh new file mode 100755 index 0000000..59688e8 --- /dev/null +++ b/CreateOpm.sh @@ -0,0 +1,5 @@ +#!/bin/bash +LOCAL="$PWD" +cd /opt/otrs/bin +./otrs.PackageManager.pl -a build -p "$LOCAL"/QueuesPanel.sopm -o "$LOCAL"/ +cd $LOCAL diff --git a/Kernel/Config/Files/QueuesPanel.xml b/Kernel/Config/Files/QueuesPanel.xml new file mode 100644 index 0000000..463400d --- /dev/null +++ b/Kernel/Config/Files/QueuesPanel.xml @@ -0,0 +1,81 @@ + + + + FrontendModuleRegistration for QueuesPanel module. + Ticket + Frontend::Customer::ModuleRegistration + + + Module for choosing main queues to open tickets + QueuesPanel + + Queues panel + Queues panel + Action=QueuesPanel + QueuesPanel + Menu + 8400 + + + + + thirdparty/hColumns/jquery.hcolumns.min.js + QueuesPanel.css + hColumns/hcolumns.css + hColumns/hcolumns-intro.css + hColumns/reset.css + + + + + + + FrontendModuleRegistration for QueuesPanelPublic module. + Framework + Frontend::Public::ModuleRegistration + + + Module for choosing main queues to open tickets + QueuesPanel + + Queues panel + Queues panel + Action=QueuesPanelPublic + QueuesPanel + Menu + 8400 + + + + thirdparty/hColumns/jquery.hcolumns.min.js + QueuesPanel.css + hColumns/hcolumns.css + hColumns/hcolumns-intro.css + hColumns/reset.css + + + + + + + + Message to let the user choose a queue. + Ticket + Frontend::Customer::QueuesPanel + + Escolha o local para o qual deseja atendimento + + + + + Message to let the user choose a queue. + Ticket + Frontend::Customer::QueuesPanel + + Escolha o local para o qual deseja atendimento + + + + \ No newline at end of file diff --git a/Kernel/Language/pt_BR_QueuesPanel.pm b/Kernel/Language/pt_BR_QueuesPanel.pm new file mode 100644 index 0000000..670f660 --- /dev/null +++ b/Kernel/Language/pt_BR_QueuesPanel.pm @@ -0,0 +1,26 @@ +# Kernel/Modules/pt_BR_QueuesPanel.pm - translations for QueuesPanel +# +# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ +# Version 01/08/2015 - Adjustments for OTRS 4 +# +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- +package Kernel::Language::pt_BR_NewTicketWizard; + +use strict; +use warnings; +use utf8; + +sub Data { + my $Self = shift; + + $Self->{Translation}->{'The following maintenances are in progress'} = 'As seguintes manutenções estão ocorrendo'; + $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; + $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; + $Self->{Translation}->{'Choose the service to ask for support'} = 'Escolha o serviço para o qual deseja suporte'; + return 1; +} +1; \ No newline at end of file diff --git a/Kernel/Language/pt_BR_QueuesPanelPublic.pm b/Kernel/Language/pt_BR_QueuesPanelPublic.pm new file mode 100644 index 0000000..0b55537 --- /dev/null +++ b/Kernel/Language/pt_BR_QueuesPanelPublic.pm @@ -0,0 +1,27 @@ +# Kernel/Modules/pt_BR_QueuesPanelPublic.pm - translations for QueuesPanelPublic +# +# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ +# Version 01/08/2015 - Adjustments for OTRS 4 +# +# -- +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- +package Kernel::Language::pt_BR_NewTicketWizard; + +use strict; +use warnings; +use utf8; + +sub Data { + my $Self = shift; + + $Self->{Translation}->{'The following maintenances are in progress'} = 'As seguintes manutenções estão ocorrendo'; + $Self->{Translation}->{'Started at: '} = 'Iniciada em:'; + $Self->{Translation}->{'Queues panel'} = 'Novo chamado'; + $Self->{Translation}->{'Choose the service to ask for support'} = 'Escolha o serviço para o qual deseja suporte'; + return 1; +} +1; \ No newline at end of file diff --git a/Kernel/Modules/QueuesPanel.pm b/Kernel/Modules/QueuesPanel.pm new file mode 100644 index 0000000..7c6eee9 --- /dev/null +++ b/Kernel/Modules/QueuesPanel.pm @@ -0,0 +1,185 @@ +# -- +# Kernel/Modules/QueuesPanel.pm - frontend module for choosing top queues +# +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ +# Version 01/08/2015 - Support for OTRS 4.0.3 +# +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- +package Kernel::Modules::QueuesPanel; + +use strict; +use warnings; + +use Kernel::System::VariableCheck qw(:all); + +our @ObjectDependencies = ( +"Kernel::System::Web::Request", +"Kernel::System::DB", +"Kernel::Output::HTML::Layout", +"KerneL::System::Log", +"Kernel::Config", +"Kernel::System::Queue"); + +sub new { + my ( $Type, %Param ) = @_; + + # allocate new hash for object + my $Self = {%Param}; + bless( $Self, $Type ); + + return $Self; +} + +sub Run { + my ( $Self, %Param ) = @_; + my %Data = (); + + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); + + $Self->{UrlAtendimento} = '/otrs/customer.pl?Action=NewTicketWizard;QueueID='; + + $Data{"QueueJS"} = $Self->BuildQueuesJS(); + + $Self->{Config} = $ConfigObject->Get("Ticket::Frontend::Customer::QueuesPanel"); + my $msgChooseService = $Self->{Config}->{"MessageChooseQueue"}; + $Data{MsgChooseQueue} = $msgChooseService; + + # build output + my $Output = $LayoutObject->CustomerHeader( Title => $LayoutObject->{LanguageObject}->Translate("Queues panel") ); + + $Output .= $LayoutObject->Output( + Data => \%Data, + TemplateFile => 'QueuesPanel', + ); + $Output .= $LayoutObject->CustomerFooter(); + return $Output; +} + +sub BuildQueuesJS { + my ( $Self, %Param ) = @_; + + # Get queues + my %Queues = (); + + my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); + + $DBObject->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); + while ( my @Row = $DBObject->FetchrowArray() ) { + $Queues{ $Row[0] } = $Row[1]; + } + + my $result = + '$(document).ready(function() {' . "\n\t" + . ' $("#columns").hColumns({' + . "\n\t\t" + . ' nodeSource: function(node_id, callback) {' . "\n"; + + for my $queue ( keys %Queues ) { + $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue ); + } + + $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues ); + + $result = $result . "\n\t}});\n});"; + + return $result; +} + +sub BuildTopQueuesJS { + my ( $Self, %Param ) = @_; + my %Queues = %{ $Param{"Queues"} }; + + my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; + + my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; + for my $queue (@topQueues) { + + if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "folder" },' . "\n"; + } + else { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "link", url: "' + . $Self->{UrlAtendimento} + . $queue . '" },' . "\n"; + } + } + + $result = $result . "\t\t\t]);\n\t\t}\n"; + + return $result; +} + +sub BuildQueueJS { + my ( $Self, %Param ) = @_; + my %Queues = %{ $Param{"Queues"} }; + my $BaseQueue = $Param{"Queue"}; + my $BaseQueueID = $Param{"QueueID"}; + + # Get subqueues + my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; + my $level = () = $BaseQueue =~ /::/g; + $level = $level + 1; + + # Remove subsubqueues + @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; + + # When there are no subqueues, there is no need to create a JS + if ( !@subqueues ) { + return; + } + + my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; + + for my $queue (@subqueues) { + if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "folder" }, ' . "\n"; + } + else { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "link", url: "' + . $Self->{UrlAtendimento} + . $queue . '" }, ' . "\n"; + } + } + + $result = $result . "\t\t\t]);\n\t\t}\n"; + + return $result; +} + +sub LastQueue { + my $Self = shift; + my $queue = shift; + my @parts = split( "::", $queue ); + return $parts[-1]; +} + +1; diff --git a/Kernel/Modules/QueuesPanelPublic.pm b/Kernel/Modules/QueuesPanelPublic.pm new file mode 100644 index 0000000..10493db --- /dev/null +++ b/Kernel/Modules/QueuesPanelPublic.pm @@ -0,0 +1,205 @@ +# -- +# Kernel/Modules/QueuesPanelPublic.pm - frontend module for choosing top queues +# +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ +# Version 01/12/2015 - Support for OTRS 4.0.3 +# +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- +package Kernel::Modules::QueuesPanelPublic; + +use strict; +use warnings; + +use Kernel::System::VariableCheck qw(:all); + +our @ObjectDependencies = ( +"Kernel::System::Web::Request", # OLD ParamObject +"Kernel::System::DB", +"Kernel::Output::HTML::Layout", +"KerneL::System::Log", +"Kernel::Config", +"Kernel::System::Queue"); + +sub new { + my ( $Type, %Param ) = @_; + + # allocate new hash for object + my $Self = {%Param}; + bless( $Self, $Type ); + + return $Self; +} + +sub Run { + my ( $Self, %Param ) = @_; + my %Data = (); + + my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request"); + my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout"); + my $ConfigObject = $Kernel::OM->Get("Kernel::Config"); + + ## Se recebeu o ticket, significa que usuario já está autenticado + if ( $ParamObject->GetParam( Param => "ticket" ) ) { + my $retorno = $LayoutObject->Redirect( OP => "Action=QueuesPanel", ); + $retorno =~ s/public/customer/g; + return $retorno; + } + + ## Se tiver parametro para tentar autenticar, repassa ao CAS com gateway + if ( $ParamObject->GetParam( Param => "autenticar" ) ) { + my $url = + $ConfigObject->Get('Customer::AuthModule::CAS::CASUrl') + . "/login?gateway=true&service=" + . "https://" + . $ENV{SERVER_NAME} + . $ENV{SCRIPT_NAME} + . "?Action=QueuesPanelPublic"; + return $LayoutObject->Redirect( ExtURL => $url, ); + } + + $Self->{UrlAtendimento} = '/otrs/public.pl?Action=NewTicketWizardPublic;QueueID='; + $Data{"QueueJS"} = $Self->BuildQueuesJS(); + + $Self->{Config} = $Self->{ConfigObject}->Get("Ticket::Frontend::Customer::QueuesPanel"); + my $msgChooseService = $Self->{Config}->{"MessageChooseQueuePublic"}; + $Data{MsgChooseQueue} = $msgChooseService; + + # build output + my $Output = + $LayoutObject->CustomerHeader( Title => $LayoutObject->{LanguageObject}->Translate("New ticket") ); + + $Output .= $LayoutObject->Output( + Data => \%Data, + TemplateFile => 'QueuesPanel', + ); + $Output .= $LayoutObject->CustomerFooter(); + return $Output; +} + +sub BuildQueuesJS { + my ( $Self, %Param ) = @_; + + # Get queues + my %Queues = (); + + my $DBObject = $Kernel::OM->Get("Kernel::System::DB"); + + $DBObject->Prepare( SQL => "SELECT id, name FROM queue WHERE valid_id = 1 ORDER BY name ASC", ); + while ( my @Row = $DBObject->FetchrowArray() ) { + $Queues{ $Row[0] } = $Row[1]; + } + + my $result = + '$(document).ready(function() {' . "\n\t" + . ' $("#columns").hColumns({' + . "\n\t\t" + . ' nodeSource: function(node_id, callback) {' . "\n"; + + for my $queue ( keys %Queues ) { + $result = $result . $Self->BuildQueueJS( Queues => \%Queues, Queue => $Queues{$queue}, QueueID => $queue ); + } + + $result = $result . $Self->BuildTopQueuesJS( Queues => \%Queues ); + + $result = $result . "\n\t}});\n});"; + + return $result; +} + +sub BuildTopQueuesJS { + my ( $Self, %Param ) = @_; + my %Queues = %{ $Param{"Queues"} }; + + my @topQueues = grep { index( $Queues{$_}, '::' ) == -1 } keys %Queues; + + my $result = "\t\tif (node_id === null) { \n\t\t\treturn callback(null, [\n"; + for my $queue (@topQueues) { + + if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "folder" },' . "\n"; + } + else { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "link", url: "' + . $Self->{UrlAtendimento} + . $queue . '" },' . "\n"; + } + } + + $result = $result . "\t\t\t]);\n\t\t}\n"; + + return $result; +} + +sub BuildQueueJS { + my ( $Self, %Param ) = @_; + my %Queues = %{ $Param{"Queues"} }; + my $BaseQueue = $Param{"Queue"}; + my $BaseQueueID = $Param{"QueueID"}; + + # Get subqueues + my @subqueues = grep { index( $Queues{$_}, $BaseQueue . "::" ) >= 0 } keys %Queues; + my $level = () = $BaseQueue =~ /::/g; + $level = $level + 1; + + # Remove subsubqueues + @subqueues = grep { ( () = $Queues{$_} =~ /::/g ) == $level } @subqueues; + + # When there are no subqueues, there is no need to create a JS + if ( !@subqueues ) { + return; + } + + my $result = "\t\tif (node_id === " . $BaseQueueID . ") { \n\t\t\treturn callback(null, [\n"; + + for my $queue (@subqueues) { + if ( grep { index( $Queues{$_}, $Queues{$queue} . "::" ) >= 0 } keys %Queues ) { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "folder" }, ' . "\n"; + } + else { + $result = $result + . "\t\t\t\t" + . '{ id: ' + . $queue + . ', label: "' + . $Self->LastQueue( $Queues{$queue} ) + . '", type: "link", url: "' + . $Self->{UrlAtendimento} + . $queue . '" }, ' . "\n"; + } + } + + $result = $result . "\t\t\t]);\n\t\t}\n"; + + return $result; +} + +sub LastQueue { + my $Self = shift; + my $queue = shift; + my @parts = split( "::", $queue ); + return $parts[-1]; +} + +1; diff --git a/Kernel/Output/HTML/Standard/QueuesPanel.tt b/Kernel/Output/HTML/Standard/QueuesPanel.tt new file mode 100644 index 0000000..b14d595 --- /dev/null +++ b/Kernel/Output/HTML/Standard/QueuesPanel.tt @@ -0,0 +1,32 @@ +# -- +# Kernel/Output/HTML/Standard/QueuesPanel.tt - overview +# +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/ +# Version 01/12/2015 - Support for OTRS 4.0.3 +# +# -- +# $Id: writing-otrs-application.xml,v 1.1 2010/08/13 08:59:28 mg Exp $ +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- +
+
[% Data.MsgChooseQueue %]
+ +
+ + [% RenderBlockStart("ListQueue") %] +
+ +
[% Data.QueueComments %]
+
+[% RenderBlockEnd("ListQueue") %] + +[% WRAPPER JSOnDocumentComplete %] + +[% END %] + + \ No newline at end of file diff --git a/QueuesPanel.sopm b/QueuesPanel.sopm new file mode 100755 index 0000000..eb42479 --- /dev/null +++ b/QueuesPanel.sopm @@ -0,0 +1,37 @@ + + + QueuesPanel + 1.0.0 + 4.0.3 + SeTIC + http://www.setic.ufsc.br + GPLv2 + Queue choosing panel + Module installed successfully! + New Ticket Wizard + ? + ? + CASAuthentication + NewTicketWizard + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js b/var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js new file mode 100755 index 0000000..3638cc9 --- /dev/null +++ b/var/httpd/htdocs/js/thirdparty/hColumns/jquery.hcolumns.min.js @@ -0,0 +1,8 @@ +// hColumns by bu , BSD License + +(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= +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("
").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)}))})}, +_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("
    ");if(0===a.length)return f= +b("

    ").text(d.settings.noContentString),c._addColumn(f,c);c.settings.searchable&&c._addColumnSearch(f);for(var e=0;e').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("
    ").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())}}; +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); diff --git a/var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css b/var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css new file mode 100755 index 0000000..897cec4 --- /dev/null +++ b/var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns-intro.css @@ -0,0 +1,85 @@ +body { + background: #f5f5f5; + font-family: "Arial", sans-serif; +} + +.container { + padding: 2em; +} + +h1 { + color: #000; + font-size: 2em; + + margin: 0.75em 0; +} + +h1 small { + color: #ccc; + font-size: 0.5em; +} + +img { + margin: 20px; +} + +h2 { + margin: 1em 0; + + font-size: 1.25em; + color: #999; +} + +ol { + margin-left: 2em; + + list-style: upper-roman; +} + +ol li { + margin: 20px; +} + +.code-block { + border: 1px solid #ccc; + background: #fff; + + margin: 1em; + padding: 1em; +} + +.code-block strong { + display: block; + + margin: 1em; + font-weight: 700; +} + +.code-block strong.minor { + font-weight: 400; + color: #666; +} + +.code-block pre { + padding: 10px; + + font-family: monospace; +} + +.code-block p { + padding: 0 30px; + + margin: 10px 0; + + font-size: 13px; +} + +.code-block ol li { + font-size: 13px; + margin: 5px; + line-height: 20px; +} + +.column-view-container { + margin: 1em; +} diff --git a/var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css b/var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css new file mode 100644 index 0000000..bbd3015 --- /dev/null +++ b/var/httpd/htdocs/skins/Customer/default/css/hColumns/hcolumns.css @@ -0,0 +1,120 @@ +.ChooseQueue { + border-style: solid; + border-width: 1px; + padding: 5px; + margin-top: 5px; + margin-left: 10px; +} + +/* column view container */ +.column-view-container { + width: 100%; + height: 400px; + padding: 0; + border: 1px solid #ccc; + background: #FFF; + display: block; + overflow-x: auto; + overflow-y: hidden; +} + +/* the composition div for colums */ +.column-view-composition { + display: table; + white-space: nowrap; +} + +/**/ +.column { + display: table-cell; + border-right: 1px solid #999; +} + +.column:last-child { + border-right: 0; +} + +.column:only-child { + border-right: 1px solid #999; +} + +/* for error messages */ +.column > p { + margin: 10px; + color: #666; +} + +/* for column listing */ +.column ul { + margin: 0; + padding: 0; + height: 400px; + width: 250px; + overflow-y: auto; + list-style: none; +} + +.column ul li { + position: relative; + margin: 0; + padding: 10px 20px 10px 10px; + overflow: hidden; + -o-text-overflow: ellipsis; /* pour Opera 9 */ + text-overflow: ellipsis; /* pour le reste du monde */ +} + +.column ul li:hover { + cursor: pointer; +} + +.column ul li i { + position: absolute; + top: 9px; + right: 5px; +} + +.column ul li:hover, .column ul li.active { + background: #999999; + color: #FFFFFF; +} + +.column ul li:hover a, .column ul li.active a { + color: #FFFFFF; +} + +.column ul li.search { + margin: 0; + padding: 5px; +} + +.column ul li.search input { + width: 100%; + margin: 0; +} + + +/* icon type, could be replace with FontAwesome */ +[class^="icon-"], [class*=" icon-"] { + display: inline-block; + width: 14px; + height: 14px; + margin-top: 1px; + *margin-right: .3em; + line-height: 14px; + vertical-align: text-top; + background-image: url("../img/glyphicons-halflings.png"); + background-position: 14px 14px; + background-repeat: no-repeat; +} + +.icon-chevron-right { + background-position: -456px -72px; +} + +.icon-globe { + background-position: -336px -144px; +} + +.icon-file { + background-position: -23px -24px; +} diff --git a/var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css b/var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css new file mode 100644 index 0000000..af94440 --- /dev/null +++ b/var/httpd/htdocs/skins/Customer/default/css/hColumns/reset.css @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png b/var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png new file mode 100644 index 0000000..bd4b7ea Binary files /dev/null and b/var/httpd/htdocs/skins/Customer/default/images/hColumns/demo.png differ diff --git a/var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png b/var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png new file mode 100644 index 0000000..a996999 Binary files /dev/null and b/var/httpd/htdocs/skins/Customer/default/images/hColumns/glyphicons-halflings.png differ -- libgit2 0.21.2