Index: ether_statistics/web/project/statistics-script.jsp
===================================================================
--- ether_statistics/web/project/statistics-script.jsp	(revision 684)
+++ ether_statistics/web/project/statistics-script.jsp	(revision 685)
@@ -91,28 +91,19 @@
     createAllSlides: function()
     {
-        this.leftTopSlide = new DragSlide( {id:"leftTop", parent:this.parent, width:"170", height:"200", top:"140px", left:"53px",
+        this.middleSlide = new DragSlide( {id:"middle", parent:this.parent, width:"700", height:"480", top:"150px", left:"38px",
             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
 
-        this.leftMiddleSlide = new DragSlide( {id:"leftMiddleSlide", parent:this.parent, width:"170", height:"100", top:"355px", left:"53px",
+        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"320", top:"175px", left:"750px",
             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
-        this.leftMiddleSlide.setTitle( '<spring:message code="statistics.data"/>' );
-
-        this.leftBottomSlide = new DragSlide( {id:"leftBottomSlide", parent:this.parent, width:"170", height:"100", top:"470px", left:"53px",
-            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
-        this.leftBottomSlide.setTitle( '<spring:message code="statistics.duration"/>' );
-
-        this.middleSlide = new DragSlide( {id:"middle", parent:this.parent, width:"430", height:"430", top:"140px", left:"245px",
-            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
-
-        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px",
-            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
-
-        this.rightLoginSlide = new DragSlide( {id:"loginRight", parent:this.parent, width:"200", height:"25", top:"170px", left:"697px",
-            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
+
+        this.loginSlide = new DragSlide( {id:"loginMiddle", parent:this.parent, width:"150", height:"25", top:"115px", left:"39px",
+            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", activeDbClick:"None"} );
     },
 
     createRightSlide: function()
     {
-        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px",
+//        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px",
+//            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
+        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"320", top:"175px", left:"750px",
             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} );
     },
@@ -168,8 +159,5 @@
     handleDataByLogo: function( result )
     {
-        this.changeLeftTopSlide();
-        this.changeLeftMiddleSlide();
-        this.changeLeftBottomSlide();
-        this.displayVisitEvolution();
+        this.displaySummary();
     },
 
@@ -187,5 +175,5 @@
         $( "#login" ).animate( {
             top:'47px',
-            left:'126px'
+            left:'577px'
         }, 2000, function()
         {
@@ -214,8 +202,17 @@
             // User
             if( this.jSONUser.name )
-                this.rightLoginSlide.setTitle( this.jSONUser.name );
+                this.loginSlide.setTitle( this.jSONUser.name );
             else
-                this.rightLoginSlide.setTitle( '<spring:message code="label.unknown"/>' );
+                this.loginSlide.setTitle( '<spring:message code="label.unknown"/>' );
             $( "#logout_button" ).css( "visibility", "visible" );
+
+            // Awstats button
+            if( "ADMINISTRATOR" == this.jSONUser.role )
+            {
+                this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"120", height:"25", top:"114px", left:"197px",
+                    specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent",
+                    title:'<spring:message code="label.awstats"/>&nbsp;&nbsp;', activeDbClick:"None"} );
+                this.awstatsSlide.getDivContainer().dblclick( jQuery.proxy( this.displayAwstatsStatistics, this ) );
+            }
 
             // Logo
@@ -330,7 +327,4 @@
         var printContent = new PrintContent();
         printContent.addContent( $( "#title" ).clone() );
-        printContent.addContent( this.leftTopSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) );
-        printContent.addContent( this.leftMiddleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) );
-        printContent.addContent( this.leftBottomSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) );
         printContent.addContent( this.middleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=120px"} ) );
         printContent.displayPrintPreview();
@@ -456,200 +450,80 @@
     },
 
-    changeLeftTopSlide: function()
-    {
-        this.leftTopSlide.setTitle( '<spring:message code="title"/> : ' + this.selectedLogo.id );
-        this.leftTopSlide.setContent(
-                "<spring:message code="statistics.online"/> : 2006/05/08<BR/>" +
-                        "<span class='text1'><spring:message code="statistics.since"/> : 2009/05/08<BR/><BR/></span>" +
-                        "<spring:message code="statistics.user.registered"/> : 1500<BR/>" +
-                        "<spring:message code="statistics.visit"/> : 150<BR/>" );
-    },
-
-    changeLeftMiddleSlide: function()
-    {
-        this.leftMiddleSlide.setContent( "<spring:message code="statistics.data.download"/> : 15001<BR/><spring:message code="statistics.data.download.size"/> : 50To<BR/>" );
-    },
-
-    changeLeftBottomSlide: function()
-    {
-        this.leftBottomSlide.setContent( "<spring:message code="statistics.duration.total"/> : 15001''<BR/><spring:message code="statistics.duration.average"/> : 50''<BR/>" );
-    },
-
     changeRightSlide: function()
     {
         this.rightSlide.setTitle( '<spring:message code="label.actions"/>' );
         this.rightSlide.getDivContent().empty();
-        new Button( {value:"<spring:message code="statistics.visit"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisitEvolution, this )} );
-        new Button( {value:"<spring:message code="statistics.user.registered"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayRegisteredUserEvolution, this )} );
-        new Button( {value:"<spring:message code="statistics.user.connected"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayConnectedUserEvolution, this )} );
-        new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownloadEvolution, this )} );
-        new Button( {value:"<spring:message code="statistics.map.distribution"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMapDistribution, this )} );
+        new Button( {value:"<spring:message code="statistics.summary"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displaySummary, this )} );
+        new Button( {value:"<spring:message code="statistics.monthly"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMonthly, this )} );
+        new Button( {value:"<spring:message code="statistics.daily"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDaily, this )} );
+        new Button( {value:"<spring:message code="statistics.daysofweek"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDaysOfWeek, this )} );
+        new Button( {value:"<spring:message code="statistics.hours"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayHours, this )} );
+        new Button( {value:"<spring:message code="statistics.visit.duration"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisitDuration, this )} );
+
+        new Button( {value:"<spring:message code="statistics.visit"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisit, this )} );
+        new Button( {value:"<spring:message code="statistics.domain"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDomainCountry, this )} );
+        new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownload, this )} );
+
         new Button( {value:"<spring:message code="label.print"/>", parent:this.rightSlide.getDivContent(), className: "blue export_button print-preview", onClick:jQuery.proxy( this.onClickPrint, this )} );
     },
 
-    changeMiddleSlide: function( titleEvolution, titleDistribution )
-    {
-        if( this.isSelectedLogoEther )
-            this.middleSlide.setTitle( '<spring:message code="statistics.evolution.distribution"/> : ' + this.selectedLogo.id );
-        else
-            this.middleSlide.setTitle( '<spring:message code="statistics.evolution"/> : ' + this.selectedLogo.id );
+    changeMiddleSlide: function( title, url )
+    {
+        this.middleSlide.setTitle( this.selectedLogo.id + ' : ' + title );
         this.middleSlide.getDivContent().empty();
 
-        var linechart = $( document.createElement( "div" ) );
-        linechart.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" );
-        linechart.attr( {id:"wijlinechart"} );
-        this.middleSlide.getDivContent().append( linechart );
-
-        var donut = $( document.createElement( "div" ) );
-        donut.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" );
-        donut.attr( {id:"wijpiechart"} );
-        this.middleSlide.getDivContent().append( donut );
-
-        this.createLinechart( titleEvolution );
-        if( this.isSelectedLogoEther )
-            this.createDonut( titleDistribution );
-    },
-
-    changeMiddleSlideForMap: function()
-    {
-        this.middleSlide.setTitle( '<spring:message code="statistics.map.distribution"/> : ' + this.selectedLogo.id );
-        this.middleSlide.getDivContent().empty();
+        this.middleSlide.getDivContent().load( url + this.selectedLogo.id );
     },
 
 
     // STATISTICS ********************************************************
-    createDonut: function( title )
-    {
-        $( "#wijpiechart" ).wijpiechart( {
-            height: 210,
-            width: 400,
-            radius: 140,
-            legend: { visible: true },
-            hint: {
-                content: function ()
-                {
-                    return this.data.label + " : " + Globalize.format( this.value / this.total, "p2" );
-                }
-            },
-            header: {
-                text: title
-            },
-            seriesList: [
-                {
-                    label: "MacBook Pro",
-                    legendEntry: true,
-                    data: 46.78,
-                    offset: 0
-                },
-                {
-                    label: "iMac",
-                    legendEntry: true,
-                    data: 23.18,
-                    offset: 0
-                },
-                {
-                    label: "MacBook",
-                    legendEntry: true,
-                    data: 20.25,
-                    offset: 0
-                },
-                {
-                    label: "Mac Pro",
-                    legendEntry: true,
-                    data: 5.41,
-                    offset: 0
-                },
-                {
-                    label: "Mac mini",
-                    legendEntry: true,
-                    data: 3.44,
-                    offset: 0
-                }
-            ],
-            seriesStyles: [
-                {
-                    fill: "180-rgb(195,255,0)-rgb(175,229,0)", stroke: "rgb(175,229,0)", "stroke-width": 1.5
-                },
-                {
-                    fill: "90-rgb(142,222,67)-rgb(127,199,60)", stroke: "rgb(127,199,60)", "stroke-width": 1.5
-                },
-                {
-                    fill: "90-rgb(106,171,167)-rgb(95,153,150)", stroke: "rgb(95,153,150)", "stroke-width": 1.5
-                },
-                {
-                    fill: "90-rgb(70,106,133)-rgb(62,95,119)", stroke: "rgb(62,95,119)", "stroke-width": 1.5
-                },
-                {
-                    fill: "90-rgb(166,166,166)-rgb(149,149,149)", stroke: "rgb(149,149,149)", "stroke-width": 1.5
-                }
-            ]
-        } );
-    },
-
-    createLinechart: function( title )
-    {
-        $( "#wijlinechart" ).wijlinechart( {
-            height: 200,
-            width: 400,
-            axis: {
-                y: {
-                    origin: 0
-                }
-            },
-            showChartLabels: false,
-            header: {
-                text: title
-            },
-            hint: {
-                content: function ()
-                {
-                    return this.data.lineSeries.label + '\n' + this.x + '\n' + this.y + '';
-                },
-                contentStyle: { "font-size": 10 },
-                offsetY: -10
-            },
-            legend: {
-                visible: false
-            },
-            seriesList: [
-                {
-                    label: "",
-                    legendEntry: true,
-                    data: {
-                        x: this.xArray,
-                        y: this.yArray
-                    },
-                    markers: {
-                        visible: true,
-                        type: "circle"
-                    }
-                }
-            ]
-        } );
-    },
-
-    displayVisitEvolution: function()
-    {
-        this.changeMiddleSlide( '<spring:message code="statistics.evolution.visit"/>', '<spring:message code="statistics.distribution.visit"/>' );
-    },
-
-    displayRegisteredUserEvolution: function()
-    {
-        this.changeMiddleSlide( '<spring:message code="statistics.evolution.user.registered"/>', '<spring:message code="statistics.distribution.user.registered"/>' );
-    },
-
-    displayConnectedUserEvolution: function()
-    {
-        this.changeMiddleSlide( '<spring:message code="statistics.evolution.user.connected"/>', '<spring:message code="statistics.distribution.user.connected"/>' );
-    },
-
-    displayDownloadEvolution: function()
-    {
-        this.changeMiddleSlide( '<spring:message code="statistics.evolution.download"/>', '<spring:message code="statistics.distribution.download"/>' );
-    },
-
-    displayMapDistribution: function()
-    {
-        this.changeMiddleSlideForMap();
+    displaySummary: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.summary"/>', <%=WebHelper.getProperty(request, "url.summary")%> );
+    },
+
+    displayMonthly: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.monthly"/>', <%=WebHelper.getProperty(request, "url.monthly")%> );
+    },
+
+    displayDaily: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.daily"/>', <%=WebHelper.getProperty(request, "url.daily")%> );
+    },
+
+    displayDaysOfWeek: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.daysofweek"/>', <%=WebHelper.getProperty(request, "url.daysofweek")%> );
+    },
+
+    displayHours: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.hours"/>', <%=WebHelper.getProperty(request, "url.hours")%> );
+    },
+
+    displayVisitDuration: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.visit.duration"/>', <%=WebHelper.getProperty(request, "url.sessions")%> );
+    },
+
+    displayVisit: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.visit"/>', <%=WebHelper.getProperty(request, "url.visited.pages")%> );
+    },
+
+    displayDomainCountry: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.domain"/>', <%=WebHelper.getProperty(request, "url.domains")%> );
+    },
+
+    displayDownload: function()
+    {
+        this.changeMiddleSlide( '<spring:message code="statistics.data.download"/>', <%=WebHelper.getProperty(request, "url.downloads")%> );
+    },
+
+    displayAwstatsStatistics: function()
+    {
+        window.open( "http://www.pole-ether.fr/cgi-bin/awstats/awstats.pl?config=" + this.selectedLogo.id );
     }
 
