<%@ page import="br.com.centralit.citcorpore.util.WebUtil" %>
<%@ page import="br.com.centralit.citcorpore.bean.BarraFerramentasIncidentesDTO" %>
<%@page import="br.com.citframework.util.UtilI18N"%>

<%@include file="/novoLayout/common/include/iframe.jsp" %>

<%
	String id = request.getParameter("id");
%>
<!doctype html public "">
<html <%=(iframe != null) ? "data-iframe=\"" + iframe + "\"" : "" %>>
<head>
	<%@include file="/include/header.jsp"%>
	<title><fmt:message key="citcorpore.comum.title" /></title>

	<%@ include file="/include/javaScriptsComuns/javaScriptsComuns.jsp" %>

	<link rel="stylesheet" type="text/css" href="${ctx}/pages/barraFerramentasIncidentes/css/barraFerramentasIncidentes.css">
</head>
<body>
	<input type="hidden" id="idsolicitacaoservico" value="1" />
	<div align="center" id="barraFerramentasIncidentes">
		<ul class="menu_horizontal">
			<li style="cursor: pointer;" class="li_menu tooltip_bottom" id="btAnexos" title='<fmt:message key="citcorpore.comum.anexardocumentoimagens" />'>
				<img src="${ctx}/template_new/images/icons/small/grey/paperclip.png" />
				<div class="name"><fmt:message key="citcorpore.comum.anexos" /></div>
			</li>
			<li style="cursor: pointer;" class="li_menu tooltip_bottom" id="btOcorrencias" title='<fmt:message key="gerenciaservico.visualizarregistarocorrencia" />'>
				<img src="${ctx}/template_new/images/icons/small/grey/note_book.png" >
				<div class="name"><fmt:message key="citcorpore.comum.ocorrencia" /></div>
			</li>
			<li style="cursor: pointer;" class="li_menu tooltip_bottom" id="btIncidentesRelacionados" title='<fmt:message key="gerenciaservico.vincularincidentesrelacionados" />'>
				<img src="${ctx}/template_new/images/icons/small/grey/strategy.png" >
				<div class="name"><fmt:message key="gerenciaservico.incidentesrelacionados" /></div>
			</li>
			<% if (id == null ) { %>
			<li style="cursor: pointer;" class="li_menu tooltip_bottom" id="btBaseConhecimentoView" title='<fmt:message key="gerenciaservico.acessarbaseconhecimentos" />'>
				<img  src="${ctx}/template_new/images/icons/small/grey/user_comment.png" >
				<div class="name"><fmt:message key="baseConhecimento.baseConhecimento" /></div>
			</li>
			<% } %>
		</ul>
	</div>
	<div class="POPUP_barraFerramentasIncidentes" id="POPUP_menuAnexos" style="display:none">
		<form name="formUpload" method="post" enctype="multipart/form-data">
			<cit:uploadControl id="uploadAnexos" title="Anexos" style="height: 100px; width: 50%; border: 1px solid black;"
				form="document.formUpload" action="/pages/upload/upload.load" disabled="false" />
			<font id="msgGravarDados" style="display:none" color="red"><fmt:message key="barraferramenta.validacao.solicitacao" /></font><br />
			<button id="btnGravarTelaAnexos" name="btnGravarTelaAnexos" onclick="gravarAnexo();" type="button" style="display:none">
				<fmt:message key="citcorpore.comum.gravar" />
			</button>
			<button id="btnFecharTelaAnexos" name="btnFecharTelaAnexos" type="button">
				<fmt:message key="citcorpore.comum.fechar" />
			</button>
		</form>
	</div>
	<div class="POPUP_barraFerramentasIncidentes" id="POPUP_menuOcorrencias">
		<!-- Conteudo -->
		<!-- Não usar este CSS possuido: main_container -->
		<div id="main_container" class="container_16 clearfix">
			<div class="flat_area grid_16">
				<h2><fmt:message key="citcorpore.comum.ocorrencia" /></h2>
			</div>
			<div class="box grid_16 tabs">
				<ul class="tab_header clearfix">
					<li>
						<a href="#tabs-1"><fmt:message key="gerenciaservico.relacaoocorrenciaregistradas" /></a>
					</li>
					<li>
						<a href="#tabs-2" class="round_top">
							<fmt:message key="gerenciaservico.cadastroocorrencia" />
						</a>
					</li>
				</ul>
				<a href="#" class="toggle">&nbsp;</a>
				<div class="toggle_container">
					<form name="formOcorrenciaSolicitacao" method="post"
						action="${ctx}/pages/ocorrenciaSolicitacao/ocorrenciaSolicitacao">
						<input type="hidden" id="idSolicitacaoOcorrencia" name="idSolicitacaoOcorrencia" />
						<input type="hidden" id="descricao" name="descricao" />
						<input type="hidden" id="idCategoriaOcorrencia" name="idCategoriaOcorrencia" />
						<input type="hidden" id="idOrigemOcorrencia" name="idOrigemOcorrencia" />

						<!-- Primeira aba -->
						<div id="tabs-1" class="block">
							<div id="divRelacaoOcorrencias" style="width: 100%; height: 100%; overflow: auto"></div>
						</div>
						<!-- Segunda aba -->
						<div id="tabs-2" class="block">
							<div class="section">
								<div class="columns clearfix">
									<input type="hidden" name="idOcorrencia" />
									<div class="col_50">
										<fieldset style="height: 70px;">
											<div>
												<label class="campoObrigatorio" style="cursor: pointer; float: left; width: 100px">
													<fmt:message key="citcorpore.comum.categoria" />
													<img id="btnCategoriaOcorrencia" src="${ctx}/imagens/add.png" onclick="abrirPopupCadastroCategoriaOcorrencia();" />
												</label>
												<div>
													<input id="nomeCategoriaOcorrencia" name="nomeCategoriaOcorrencia" type="text" readonly="readonly" maxlength="80" class="Valid[Required] 
													Description[citcorpore.comum.categoria]" />
												</div>
											</div>
										</fieldset>
									</div>
									<div class="col_50">
										<fieldset>
											<label class="campoObrigatorio" style="cursor: pointer; float: left; width: 100px">
												<fmt:message key="citcorpore.comum.origem" />
												<img id="btnOrigemOcorrencia" src="${ctx}/imagens/add.png" onclick="abrirPopupCadastroOrigemOcorrencia();" />
											</label>
											<div>
												<input id="nomeOrigemOcorrencia" name="nomeOrigemOcorrencia" type="text" readonly="readonly" maxlength="80" class="Valid[Required] 
												Description[citcorpore.comum.origem]" />
											</div>
										</fieldset>
									</div>
								</div>
								<div class="columns clearfix">
									<div class="col_20">
										<fieldset>
											<label class="campoObrigatorio"><fmt:message key="ocorrenciaSolicitacao.tempoGasto" /></label>
											<div>
												<input type="text" name="tempoGasto" maxlength="4" size="4" class="Format[Numero] Valid[Required] Description[ocorrenciaSolicitacao.tempoGasto]" />
											</div>
										</fieldset>
									</div>
									<div class="col_50">
										<fieldset>
											<label class="campoObrigatorio"><fmt:message key="ocorrenciaSolicitacao.registradopor" /></label>
											<div>
												<input type="text" name="registradopor" id="registradopor" maxlength="30" size="30" readonly="readonly" class="Valid[Required] Description[ocorrenciaSolicitacao.registradopor]" />
											</div>
										</fieldset>
									</div>
								</div>
								<div class="columns clearfix">
									<div class="col_100">
										<fieldset>
											<label class="campoObrigatorio">
												<fmt:message key="citcorpore.comum.descricao" />
											</label>
											<div>
												<textarea cols="70" rows="5" name="descricao1" class="Valid[Required] Description[citcorpore.comum.descricao]" maxlength="200"></textarea>
											</div>
										</fieldset>
									</div>
								</div>
								<div class="columns clearfix">
									<div class="col_100">
										<fieldset>
											<label class="campoObrigatorio"><fmt:message key="citcorpore.comum.ocorrencia" /></label>
											<div>
												<textarea cols="70" rows="5" name="ocorrencia" class="Valid[Required] Description[citcorpore.comum.ocorrencia]" maxlength="5000"></textarea>
											</div>
										</fieldset>
									</div>
								</div>
								<div class="columns clearfix">
									<div class="col_100">
										<fieldset>
											<label class="campoObrigatorio"><fmt:message key="solicitacaoServico.informacaoContato" /></label>
											<div>
												<textarea cols="70" rows="2" name="informacoesContato" class="Valid[Required] Description[solicitacaoServico.informacaoContato]" maxlength="5000"></textarea>
											</div>
										</fieldset>
									</div>
								</div>
								<br>
								<br>
								<button type="button" name="btnGravar" class="light" onclick="salvar();">
									<img src="${ctx}/template_new/images/icons/small/grey/pencil.png">
									<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:message key="citcorpore.comum.gravar" /></span>
								</button>
								<button type="button" name="btnLimpar" class="light" onclick="document.formOcorrenciaSolicitacao.clear();">
									<img src="${ctx}/template_new/images/icons/small/grey/trashcan.png">
									<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:message key="citcorpore.comum.limpar" /></span>
								</button>
							</div>
						</div>
						<!-- ## FIM - AREA DA APLICACAO ## -->
					</form>
				</div>
			</div>
		</div>
	</div>
	<div class="POPUP_barraFerramentasIncidentes" id="POPUP_menuIncidentesRelacionados">
		<div id="tabelaIncidentesRelacionados"></div>
		<div id="menuIncidentesRelacionados" class="col_50">
			<button type="button" name="btRelacionarSolicitacao" id="btRelacionarSolicitacao" class="light" onclick="">
				<img src="${ctx}/template_new/images/icons/small/grey/pencil.png">
				<span>
					<fmt:message key="barraferramenta.relacionaroutroincidente" />
				</span>
			</button>
		</div>
		<div id="menuIncidentesRelacionados" class="col_50">
			<button type="button" name="btRelacionarSolicitacaoFechar" id="btRelacionarSolicitacaoFechar" class="light" onclick="">
				<span>
					<fmt:message key="citcorpore.comum.fechar" />
				</span>
			</button>
		</div>
		<div class="POPUP_barraFerramentasIncidentes" id="divSolicitacoesFilhas">
			<form name="formIncidentesRelacionados" method="post" action="${ctx}/pages/incidentesRelacionados/incidentesRelacionados">
				<input type="hidden" name="idSolicitacaoIncRel" value="" />
				<div id="divConteudoIncRel"></div>
			</form>
		</div>
	</div>
	<div class="POPUP_barraFerramentasIncidentes" id="POPUP_menuHistorico">
		<div id="divResultHistorico"></div>
	</div>
	<div id="popupCadastroRapido">
		<iframe id="frameCadastroRapido" name="frameCadastroRapido" width="100%" height="99%"></iframe>
	</div>
	<div id="POPUP_PESQUISA_CATEGORIA_OCORRENCIA" class="POPUP_PESQUISA_CATEGORIA_OCORRENCIA" title="<fmt:message key="citcorpore.comum.pesquisaCategoriaOcorrencia" />" style="padding: 5px !important;">
		<form id="formPesquisaCategoriaOcorrencia" name="formPesquisaCategoriaOcorrencia" method="post" action="${ctx}/pages/categoriaOcorrencia/categoriaOcorrencia">
			<cit:findField id="LOOKUP_CATEGORIA_OCORRENCIA" formName="formPesquisaCategoriaOcorrencia" lockupName="LOOKUP_CATEGORIA_OCORRENCIA"
				top="0" left="0" len="550" heigth="400" javascriptCode="true" htmlCode="true" />
		</form>
	</div>
	<div id="POPUP_PESQUISA_ORIGEM_OCORRENCIA" class="POPUP_PESQUISA_ORIGEM_OCORRENCIA" title="<fmt:message key="citcorpore.comum.pesquisaOrigemOcorrencia" />" style="padding: 5px !important;">
		<form id="formPesquisaOrigemOcorrencia" name="formPesquisaOrigemOcorrencia" method="post" action="${ctx}/pages/origemOcorrencia/origemOcorrencia">
			<cit:findField id="LOOKUP_ORIGEM_OCORRENCIA" formName="formPesquisaOrigemOcorrencia" lockupName="LOOKUP_ORIGEM_OCORRENCIA"
				top="0" left="0" len="550" heigth="400" javascriptCode="true" htmlCode="true" />
		</form>
	</div>

	<script type="text/javascript" src="${ctx}/pages/barraFerramentasIncidentes/js/barraFerramentasIncidentes.js"></script>
</body>
</html>
