tabellaAccessi.jsp 7.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
<%@ include file="/project/include.jsp" %>

<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>

<%@page import="it.cedaf.icare.interventi.view.dto.TableDto"%>
<%@page import="it.cedaf.icare.interventi.view.dto.RowDto"%>
<%@page import="it.cedaf.icare.interventi.view.dto.CellDto"%>
<%@page import="it.cedaf.icare.interventi.view.dto.HeaderObjectDto"%>
<%@page import="it.cedaf.icare.interventi.view.dto.TabellaAccessiConfDto"%>
<%@page import="it.cedaf.icare.business.entities.tabelle.Colore"%>

<%@page import="it.cedaf.juice.mvc.modules.bui.model.BuiContext"%>


<link rel="stylesheet" href="${j:getResourceUrlOfModule('interventi', 'css/tabellaAccessi.css')}">

<script type="text/javascript" src="${j:getResourceUrlOfModule('interventi', 'js/arrayutils.js')}"></script>
<script type="text/javascript" src="${j:getResourceUrlOfModule('interventi', 'js/observer.js')}"></script>
<script type="text/javascript" src="${j:getResourceUrlOfModule('interventi', 'js/tabellaAccessi.js')}"></script>

<% TableDto tableDto = (TableDto) BuiContext.getInstance().getCurrentDataManagement().getContext().getAttribute("tableDto"); %>

<% TabellaAccessiConfDto[] confDtos = (TabellaAccessiConfDto[])request.getAttribute("dto_config");  %>

<% 
if (confDtos != null) {
	for (int c = 0; c<confDtos.length; c++) {
		TabellaAccessiConfDto confDto = confDtos[c];
		Iterator iterServizi = confDto.getIdServizi().iterator(); 
		while (iterServizi.hasNext()) { %>
			<script type="text/javascript">registerConfigurator(<%=iterServizi.next()%>,'<%=confDto.getIdentifier()%>');</script>
	<% }
	}
} 
%>

<% 
List colors = (List)request.getAttribute("dto_colors"); 
for (Iterator iterator = colors.iterator(); iterator.hasNext();) {
	Colore colore = (Colore) iterator.next();
	String colore_codice = colore.getCodice();
	String colore_rgb = colore.getRgb();
	String colore_rgb_hover = colore.getRgbHover();
	if (colore_rgb_hover == null) {
		colore_rgb_hover = colore_rgb;
	}
%>	
<style>.acc_color_<%=colore_codice%> {background-color: #<%=colore_rgb%>;} .acc_color_<%=colore_codice%>:hover.selected {background-color: #<%=colore_rgb_hover%>;}</style>
<% } %>


<icare:customControl identifier="tabella_accessi_ext1" /> 
					
<div id="div_errorContainer" style="display:none">
<table border="0" cellpadding="0" cellspacing="0" width="99%" align="center">
 	<tr>
 		<td><img src="${j:getResourceUrlOfModule('shell', 'img/messages/error-small.gif')}" border="0" align="absmiddle" width="16" height="16"></td>
 		<td id="tdErrMsg" class="tabacc-msg_error" style="width:99%"></td>
 	</tr>
</table><br />
</div>


<div id="idWarningMessageOnBinding" class="modalElement">
	<table width="100%" style="padding: 4px 20px 4px 20px;">
		<tr> <td style="vertical-align: top; padding: 20px 2px 2px 2px;">
			<img src="${j:getResourceUrlOfModule('shell', 'img/messages/warning-small.gif')}" border="0" align="absmiddle" width="16" height="16">					
		</td> <td class="generic-label" style="width:100%; padding: 20px 2px 2px 10px;">
 			<div id="divWarningMsg">${warningMessage}</div>
		</td> </tr>
	</table>
</div>

<div id="main_container">
	<div id="table_container"><div class="generic-title" style="display:block;padding-bottom:5px;width:100%;text-align:center">${dto_descPeriodo}</div>
		<table id="datagrid" width="100%" cellspacing="1" cellpadding="0" border="0">
			<thead>
			<% 
				int numCells = 0;
				List festivi = new ArrayList();
				
				int indexRow = 0;
				Iterator iterHRows = tableDto.getHRows().iterator();
				
				while (iterHRows.hasNext()) {
					RowDto hRow = (RowDto)iterHRows.next();
					numCells = hRow.getCells().size();
					String rowId = "";
					if (indexRow == 0 ) {
						rowId = "header_firstrow";
					} else if (indexRow == 1 ) {
						rowId = "header_secondrow";
					} else {
						rowId = "header_" + indexRow;
					}
					%>
					<tr id = "<%=rowId%>">
						<%
						Iterator iterHCells = hRow.getCells().iterator();
						int indexCell = 0;
						while (iterHCells.hasNext()) {
							CellDto hCell = (CellDto)iterHCells.next();
							HeaderObjectDto hDto = (HeaderObjectDto)hCell.getOggetti().get(0);
							
							String td_class = "giorno";
							if (indexCell > 0 ) {
								if (hDto.isFestivo()) {
									festivi.add(indexCell);
									td_class += "_festivo";
								} 
							} else {
								td_class = "prima_cella";
							}
							%><td class="<%=td_class%>"><%=hDto.getValue()%></td>
							<%
							indexCell++;
						}
						%>
					</tr>
					<%
					indexRow++;
				} %>
				</thead>
				<tbody>
				<%	for (int r = 0; r < tableDto.getRowsPerPage(); r++) { %>
						<tr id="row_<%=r%>">
							<% for (int c = 0; c < numCells; c++) { %>
								<% 
								String td_class = "cella";  
								if (festivi.contains(c)) {
									td_class += "_festivo";
								}
								%><td id="row_<%=r%>_d_<%=c%>"  class="<%=td_class%>">
								  <% if (c==0) { %>
								  <div id="row_<%=r%>_d_<%=c%>_info" style="float:left;"></div>
								  <div id="row_<%=r%>_d_<%=c%>_sosp" class="markerSospensioni" style="display:none;" title="presenti sospensioni">S</div> 								
								  <%} else { %>
									 <div id="row_<%=r%>_d_<%=c%>_info"></div>
									 <div id="row_<%=r%>_d_<%=c%>_sosp" class="markerCellaSospensioni" style="float:right;padding:0px;margin:0px;height:1px;display:none;width:100%"  />							 								  
								  <%}%></td><% } %>
						</tr>
				<%	} %>
				</tbody>
		</table>
		<table cellspacing="0" cellpadding="0" style="padding: 0px 0px 4px 0px;" align="right">
			<tr>
				<td class="grid-bottom">
					<shell:button id="tabAccFirst" img="shell.firstPage" href="javascript:firstPage();" title="${shell:msg('shell_grid_first_page')}" />
					&nbsp;&nbsp;
					<shell:button id="tabAccPrev" img="shell.prevPage" href="javascript:prevPage();" title="${shell:msg('shell_grid_prev_page')}" />
					&nbsp;&nbsp;
					<span id="tabAccPageInfos" style="position:relative;left:0;top:0;text-align:center"></span>
					&nbsp;&nbsp;
					<shell:button id="tabAccNext" img="shell.nextPage" href="javascript:nextPage();" title="${shell:msg('shell_grid_next_page')}" />
					&nbsp;&nbsp;
					<shell:button id="tabAccLast" img="shell.lastPage" href="javascript:lastPage();" title="${shell:msg('shell_grid_last_page')}" />	
				</td>
			</tr>	 
		</table>		
	</div>
	<div id="detail_container">
		<div id="detail_main_container">
			<div id="prest_container">
				<div class="div_decorator_1"></div>
				<div class="div_decorator_2"></div>
				<div id="div_prestazione" class="div_prestazione">
					<j:tile name="tileTabellaAccessiPrestazione" />
				</div>
				<div class="div_decorator_2"></div>
				<div class="div_decorator_1"></div>
			</div>
			<div id="detail_table_container">
				<table cellspacing="1" cellpadding="0" border="0" bgcolor="#cccccc" width="100%" id="detail_table">
					<tbody>
						<tr>
							<td style="padding-right: 12px; padding-left: 12px; text-align: center; width: 1px;" class="grid-title"><b>#</b></td>
							<td width="0" class="grid-title"><b>Gruppo Prestazioni</b></td>
							<td width="0" class="grid-title"><b>Tipo Prestazione</b></td>
							<td width="0" class="grid-title" style="text-align:right"><b>Quantit</b></td>
							<td width="0" class="grid-title"><b>Ora Inizio</b></td>
							<td width="0" class="grid-title"><b>Ora Fine</b></td>
							<td width="0" class="grid-title" style="text-align:center"><b>Erogata</b></td>
							<td width="0" class="grid-title" style="text-align:center"><b>&nbsp;</b></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>

<div id="divGestioneSospensioni" class="modalElement"><j:tile name="tileTabellaAccessiSospensione" /></div>