source: ether_statistics/web/data/plateform.jsp @ 569

Last change on this file since 569 was 569, checked in by vmipsl, 12 years ago

Nouveau projet

File size: 8.4 KB
Line 
1<%@ page language="java" contentType="text/html; charset=UTF-8" %>
2<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
3<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
4<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
5<%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %>
6
7<tiles:insert page="/resources/templates/templateMegapoli.jsp" flush="true">
8
9    <tiles:put name="insertCss" type="string"></tiles:put>
10    <tiles:put name="insertJsOrJsp" type="string">
11        <ether:htmlJs jsFile="classesForJQuery/Loading"/>
12        <ether:htmlJs jsFile="calendar/anytime"/>
13    </tiles:put>
14
15
16    <tiles:put name="title" type="string"><bean:message key="app.title"/> - <bean:message key="data.access.plat"/></tiles:put>
17    <tiles:put name="nav" type="string">
18        <html:link page="/index.jsp"><bean:message key="app.home"/></html:link>&nbsp;&gt;
19        <html:link page="/data?methodName=viewCatalogResume"><bean:message key="data.access"/></html:link>&nbsp;&gt;
20        <html:link page="/data?methodName=viewPlateforms"><bean:message key="data.access.plat"/></html:link>
21    </tiles:put>
22
23    <%--****************** CONTENT ****************** --%>
24    <tiles:put name="bodytitle" type="string"><bean:message key="data.access.plat"/></tiles:put>
25
26    <tiles:put name="body" type="string">
27
28        <div id="containerNumberPlateforms" class="title2"></div>
29        <BR/>
30
31        <div id="messages"><bean:message key="data.access.plat.mobile"/>&nbsp;:</div>
32        <div id="containerMobilePlateforms" class="plateformElement"></div>
33
34        <div id="messages"><bean:message key="data.access.plat.fixe"/>&nbsp;:</div>
35        <div id="containerFixePlateforms" class="plateformElement"></div>
36
37        <div class="hdp" align="right">
38            <html:link href="#top" titleKey="app.hdp"><html:img page="/resources/images/utils/fleche_haut.gif" width="20px" height="20px"/></html:link>
39        </div>
40
41
42        <script type="text/javascript">
43            var interfaceTexts = $A( "" );
44            interfaceTexts["visualization.noPlateform"] = '<bean:message key="visualization.noPlateform"/>';
45            interfaceTexts["data.access.plat2"] = '<bean:message key="data.access.plat2" arg0=""/>';
46            interfaceTexts["data.access.plat2.s"] = '<bean:message key="data.access.plat2" arg0="s"/>';
47            interfaceTexts["app.measure.days"] = '<bean:message key="app.measure.days"/>';
48
49            var InterfacePlateform = Class.create( {
50
51                initialize: function( nbPlateforms, jSonPlateforms, mapPlateforms )
52                {
53                    this.numberPlateforms = nbPlateforms || false;
54                    this.jSonPlateforms = jSonPlateforms || null;
55                    this.mapPlateforms = mapPlateforms || false;
56                    this.containerMobilePlateforms = $( "#containerMobilePlateforms" );
57                    this.containerFixePlateforms = $( "#containerFixePlateforms" );
58                    this.containerNumberParameters = $( "#containerNumberPlateforms" );
59
60                    /** *********** LOADING *********** **/
61                    var param = new Object();
62                    param.id = "loadingForMobilePlateforms";
63                    param.parent = this.containerMobilePlateforms;
64                    param.className = "loadingForPlateforms_meta";
65                    this.loadingMobilePlateforms = new Loading( param );
66                    this.loadingMobilePlateforms.display();
67
68                    var param = new Object();
69                    param.id = "loadingForFixelateforms";
70                    param.parent = this.containerFixePlateforms;
71                    param.className = "loadingForPlateforms_meta";
72                    this.loadingFixePlateforms = new Loading( param );
73                    this.loadingFixePlateforms.display();
74
75                    this.displayPlateforms();
76                },
77
78                // DISPLAYS ********************************************************
79                displayPlateforms: function()
80                {
81                    if( this.numberPlateforms )
82                        if( 1 < this.numberPlateforms )
83                            this.containerNumberParameters.html( this.numberPlateforms + " " + interfaceTexts["data.access.plat2.s"] );
84                        else
85                            this.containerNumberParameters.html( this.numberPlateforms + " " + interfaceTexts["data.access.plat2.s"] );
86
87                    var numberMobilePlateforms = 0;
88                    var numberFixePlateforms = 0;
89                    jQuery.each( this.jSonPlateforms, jQuery.proxy( function( i, item )
90                    {
91                        var divMainPlateform = $( document.createElement( "div" ) );
92                        divMainPlateform.addClass( "containerElement_main_plateform" );
93
94                        var divPlateform = $( document.createElement( "div" ) );
95                        divPlateform.html( item.name );
96                        divPlateform.addClass( "containerElement containerElement_plateform" );
97                        divPlateform.bind( "click", item, this.onSelectPlateform );
98
99                        if( "MOBILE" == item.type )
100                        {
101                            numberMobilePlateforms++;
102                            this.containerMobilePlateforms.append( divMainPlateform );
103                            divMainPlateform.append( divPlateform );
104
105                            var divPlateformDates = $( document.createElement( "div" ) );
106                            var dateString = interfaceTexts["app.measure.days"] + " :<BR/>";
107                            jQuery.each( this.mapPlateforms[item.id], function( j, itemDate )
108                            {
109                                dateString += "&nbsp;" + formatDate( new Date( itemDate.time ), "%Y-%m-%d" );
110                                if( 9 > j % 10 )
111                                    dateString += "&nbsp;&nbsp;&nbsp;";
112                                else
113                                    dateString += "&nbsp;<BR/>";
114                            } );
115                            divPlateformDates.html( dateString );
116                            divPlateformDates.addClass( "containerElement_plateform_dates" );
117                            divMainPlateform.append( divPlateformDates );
118
119                            divPlateform.mouseover( function( e )
120                            {
121                                divPlateformDates.toggle();
122                            } );
123
124                            divPlateform.mouseout( function( e )
125                            {
126                                divPlateformDates.toggle();
127                            } );
128
129//                            $( document ).mouseup( function( e )
130//                            {
131//                                divPlateformDates.hide();
132//                                divPlateform.removeClass( "containerElement_plateform_activated" );
133//                            } );
134                        }
135                        else
136                        {
137                            numberFixePlateforms++;
138                            this.containerFixePlateforms.append( divMainPlateform );
139                            divMainPlateform.append( divPlateform );
140                        }
141                    }, this ) );
142
143                    this.loadingMobilePlateforms.hide();
144                    if( 0 == numberMobilePlateforms )
145                    {
146                        var divNoPlateform = $( document.createElement( "div" ) );
147                        divNoPlateform.html( "&nbsp;&nbsp;" + interfaceTexts["visualization.noPlateform"] );
148                        this.containerMobilePlateforms.append( divNoPlateform );
149                    }
150
151                    this.loadingFixePlateforms.hide();
152                    if( 0 == numberFixePlateforms )
153                    {
154                        var divNoPlateform = $( document.createElement( "div" ) );
155                        divNoPlateform.html( "&nbsp;&nbsp;" + interfaceTexts["visualization.noPlateform"] );
156                        this.containerFixePlateforms.append( divNoPlateform );
157                    }
158                },
159
160                onSelectPlateform: function( event )
161                {
162                    document.location.href = "DescPlateforme.do?idPlat=" + event.data.id;
163                }
164            } );
165
166            new InterfacePlateform( ${nbPlateforms}, ${plateforms}, ${mapPlateforms} );
167        </script>
168
169    </tiles:put>
170</tiles:insert>
Note: See TracBrowser for help on using the repository browser.