<%@page import="br.com.centralit.citcorpore.util.CitCorporeConstantes"%>
<%@page import="br.com.centralit.citcorpore.util.WebUtil"%>
<%@page import="br.com.centralit.citcorpore.bean.UsuarioDTO"%>
<%@page import="br.com.citframework.dto.Usuario"%>

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

<%
	String URL_SISTEMA = CitCorporeConstantes.CAMINHO_SERVIDOR + request.getContextPath()+'/';
%>

<!doctype html public "">
<html <%=(iframe != null) ? "data-iframe=\"" + iframe + "\"" : "" %>>
	<head>
		<%@include file="/novoLayout/common/include/libCabecalho.jsp" %>
		<%@include file="/novoLayout/common/include/titulo.jsp" %>
		<link type="text/css" rel="stylesheet" href="../../novoLayout/common/include/css/jqueryautocomplete.css"/>
		<link type="text/css" rel="stylesheet" href="../../novoLayout/common/include/css/template.css"/>
		<link rel="stylesheet" type="text/css" href="css/cadastroTemplateIncidenteRequisicao.css">
	</head>
	<cit:janelaAguarde id="JANELA_AGUARDE_MENU"  title="" style="display:none;top:325px;width:300px;left:500px;height:50px;position:absolute;"></cit:janelaAguarde>
	<body>
		<%@include file="/novoLayout/common/include/hint.jsp"%>
		<div class="container-fluid fixed">
			<div class="navbar main hidden-print">
				<%@include file="/novoLayout/common/include/cabecalho.jsp" %>
				<%@include file="/novoLayout/common/include/menuPadrao.jsp" %>
			</div>
			<div id="wrapper">
				<!-- Inicio conteudo -->
				<div id="content">
					<div class="row-fluid">
						<div class="widget">
							<div class="widget-head">
								<h4 class="heading"><fmt:message key="templateIncidenteRequisicao.titulo"/></h4>
							</div>
							<div class="widget-body collapse in">
								<div class="tabsbar">
									<ul>
										<li class="active"><a href="#tab1-2" data-toggle="tab"><fmt:message key="citcorpore.comum.cadastro"/></a></li>
										<li><a href="#tab2-2" data-toggle="tab"><fmt:message key="citcorpore.comum.pesquisa"/></a></li>
									</ul>
								</div>
								<div class="tab-content">
									<div class="tab-pane active" id="tab1-2">
										<form name='form' action='${ctx}/pages/cadastroTemplateIncidenteRequisicao/cadastroTemplateIncidenteRequisicao'>
											<input type="hidden" id="idTemplateIncidenteRequisicao" name="idTemplateIncidenteRequisicao" />
											<input type="hidden" id="tipoServico" name="tipoServico" />
											<input type="hidden" id="reclassicarSolicitacao" name="reclassicarSolicitacao" />
											<input type="hidden" id="idSolicitacaoServico" name="idSolicitacaoServico" />
											<input type="hidden" id="idServicoNegocioTecBusc" name="idServicoNegocioTecBusc" />
											<input type="hidden" id="idTipoCatalogoServicoSoli" name="idTipoCatalogoServicoSoli" />
											<input type="hidden" id="dataInicio" name="dataInicio" />
											<input type="hidden" id="dataFim" name="dataFim" />
											<input type="hidden" id="idsItemConfiguracao" name="idsItemConfiguracao" />
											
											<div class='row-fluid'>
												<div class='span12'>
													<label class="campoObrigatorio"><fmt:message key="citcorpore.comum.nome" /></label>
													<input id="nomeTemplate" name="nomeTemplate" required="required" type='text' maxlength="200" class="span12 Valid[Required] Description[citcorpore.comum.nome]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.nome')" onMouseout="hideddrivetip()"/>
												</div>
											</div>
											
											<div class="row-fluid" >
												<div class='span4'>
													<label class="pull-left"><fmt:message key="solicitacaoServico.solicitante" /></label>
													<label id="lblLimparSolicitante" class="pull-right label" onclick="limparSolicitante()"><i class="material-icons md-14">cancel</i></label>
													<input type="text" name="solicitante" id="solicitante" onfocus="montaParametrosAutocompleteSolicitante();" class="span12 Description[solicitacaoServico.solicitante]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.solicitante')" onMouseout="hideddrivetip()">
													<input type='hidden' name='idSolicitante' id='idSolicitante'/>
												</div>
												<div class="span4">
													<label><fmt:message key="requisicaoMudanca.email" /></label>
													<input id="emailSolicitante" name="emailSolicitante" type='text' maxlength="120" class="span12 Description[requisicaoMudanca.email]"  onMouseover="ddrivetip('evm.acao.mudanca.hint.emailContato')" onMouseout="hideddrivetip()" />
												</div>
												<div class='span4'>
													<label class="campoObrigatorio"><fmt:message key="citcorpore.comum.origemNovoLayout" /></label>
													<select id="idOrigem" required="required" name="idOrigem" class="span12 Valid[Required] Description[citcorpore.comum.origemNovoLayout]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.origemContrato')" onMouseout="hideddrivetip()"></select>
												</div>
											</div>
											
											<div class="separator bottom"></div>
											
											<div class="widget">
												<div class="widget-head">
													<h4 class="heading"><fmt:message key="solicitacaoServico.filtros.titulo" /></h4>
													<div class="sla">
														<span id="tdResultadoSLAPrevisto" class="label">N/A</span>
														<span id="divMini_loading" style="display: none" ><img src='<%=URL_SISTEMA%>novoLayout/common/include/imagens/mini_loading.gif'></span>
													</div>
												</div>
												<div class="widget-body">
													<div class="row-fluid">	
														<div class="span4">
															<label><fmt:message key="solicitacaoServico.filtros.catalogo" /></label>
															<select class="span12" name="idTipoCatalogoServicoSol" id="idTipoCatalogoServicoSol" onchange="changeCatalogoServicoSolicitacao();"></select>
														</div>
														<div class="span8 pesquisaServicoNegocioTecnico">
															<label class="pull-left"><fmt:message key="solicitacaoServico.filtros.servico" /></label>
															<label id="lblLimparServicoNegocioTecnicoBusca" class="pull-right label" onclick="limparServicoNegocioTecnico()"><i class="material-icons md-14">cancel</i></label>
															<label id="lblPesquisarServicoNegocioTecnicoBusca" class="pull-right label label-success mr1" onclick="buscarTodosServicosNegocioTecnico()"><i class="material-icons md-14">search</i></label>
															<input class="span12" type="text" name="servicoNegocioTecnicoBusca" id="servicoNegocioTecnicoBusca">
														</div>
													</div>
													<div class="row-fluid">
														<div class="uniformjs span4"  id="checkUtilizaCategoriaServico">
															<label></br></label>
															<label class="checkbox" id="checkUtilizaCategoriaServico" >
																<input type="checkbox" name="utilizaCategoriaServico" id="utilizaCategoriaServico" value="S" onclick="carregaCategoriaServico();" style="opacity: 0;" >
																<fmt:message key="solicitacaoServico.utilizaCategoriaServico" />
															</label>
														</div>
														<div class="divCategoriaServico span8">
															<div>
																<label><fmt:message key="servico.categoria" /></label>
																<select disabled="disabled" class="span12 disabled" id="idCategoriaServico" name="idCategoriaServico" onchange="changeCategoria(); montaParametrosAutocompleteServico();"></select>
															</div>
														</div>
													</div>
													<div class="row-fluid">
														<div class="span4">
															<label class="campoObrigatorio"><fmt:message key="solicitacaoServico.tipoSolicitacao" /></label>
															<select name="idTipoDemandaServico" id="idTipoDemandaServico" required="required" onchange="limparCampoServico();" class="span12 Valid[Required] Description[solicitacaoServico.tipoSolicitacao]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.tipoSolicitacao')" onMouseout="hideddrivetip()"></select>
														</div>
														<div class='span8'>
															<label class="campoObrigatorio"><fmt:message key="evm.cadAcaoAutoIncReq.incidenteRequisicaoProcedimento" /></label>
															<input type="text" name="servico" id="servico" onfocus="montaParametrosAutocompleteServico();" required="required"  placeholder="" value="" class="span12 Valid[Required] Description[citcorpore.comum.servico]"  onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.servico')" onMouseout="hideddrivetip()">
															<input type='hidden' name='idServico' id='idServico'/>
														</div>
													</div>
												</div>
											</div>
											
											<div class="row-fluid">
												<div class='span6'>
													<label class="campoObrigatorio"><fmt:message key="contrato.contrato" /></label>
													<select id="idContrato" name="idContrato" required="required" onchange="onChangeContrato();" class="span12 Valid[Required] Description[contrato.contrato]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.contrato')" onMouseout="hideddrivetip()"></select>
												</div>
												<div class='span6' id='divUnidade'>
													<label class="campoObrigatorio"><fmt:message key="unidade.unidade" /></label>
													<select name='idUnidade' id='idUnidade' required="required" class='span12 Valid[Required] Description[unidade.unidade]' onMouseover="ddrivetip('evm.acao.mudanca.hint.unidadeContato')" onMouseout="hideddrivetip()"></select>
												</div>
											</div>
											
											<div class='row-fluid'>
												<div class="span6">
													<label  class="campoObrigatorio"><fmt:message key="solicitacaoServico.urgencia" /></label>
													<select id="urgencia" name="urgencia" required="required" onchange="calcularSLA();" class="span12 Valid[Required] Description[solicitacaoServico.urgencia]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.urgencia')" onMouseout="hideddrivetip()"></select>
												</div>
												<div class="span6">
													<label  class="campoObrigatorio"><fmt:message key="solicitacaoServico.impacto" /></label>
													<select id="impacto" name="impacto" required="required" onchange="calcularSLA();" class="span12 Valid[Required] Description[solicitacaoServico.impacto]" onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.impacto')" onMouseout="hideddrivetip()"></select>
												</div>
											</div>
											
											<div class='row-fluid'>
												<div class='span12'>
													<label class="campoObrigatorio"><fmt:message key="citcorpore.comum.descricao" /></label>
													<textarea id="descricao" name="descricao" rows="5" class="span12 Valid[Required] Description[citcorpore.comum.descricao]"   onMouseover="ddrivetip('evm.cadAcaoAutoIncReq.hint.descricao')" onMouseout="hideddrivetip()"></textarea>
												</div>
											</div>
											
											<div class="row-fluid">
												<div class="span12">
													<h5>
														<fmt:message key="itemConfiguracao.itemConfiguracao" />
														<label id="lblPesquisarItemConfiguracao" class="pull-right label label-success" onclick="abrirModalPesquisaItemConfiguracao()"><i class="material-icons md-14">search</i></label>
													</h5>
													<div id="itensConfiguracaoSelecionados">
														<div class='nenhum-selecionado'><fmt:message key="citcorpore.comum.nenhumaSelecao" /></div><div class='clearfix'></div>
													</div>
												</div>
											</div>
											
											<div class="separator bottom"></div>

											<div class='row-fluid'>
												<div class='span12'>
													<button type='button' name='btnGravar' class="lFloat btn btn-icon btn-primary" onclick='gravar();'>
														<i></i><fmt:message key="citcorpore.comum.gravar" />
													</button>
													<button type="button" name='btnLimpar' class="lFloat btn btn-icon btn-primary" onclick='limpar();'>
														<i></i><fmt:message key="citcorpore.comum.limpar" />
													</button>
													<button type='button' name='btnExcluir' class="lFloat btn btn-icon btn-primary" onclick='excluir();'>
														<i></i><fmt:message key="citcorpore.comum.excluir" />
													</button>
												</div>
											</div>
										</form>
									</div>
									<div class="tab-pane" id="tab2-2">
										<div class="section"><fmt:message key="citcorpore.comum.pesquisa" />
											<form name='formPesquisa'>
												<cit:findField formName='formPesquisa' lockupName='LOOKUP_TEMPLATE_INCIDENTE_REQUISICAO' id='LOOKUP_TEMPLATE_INCIDENTE_REQUISICAO' top='0' left='0' len='550' heigth='400' javascriptCode='true' htmlCode='true' />
											</form>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
				</div>
				<!--  Fim conteudo-->
				
				<div class="modal hide fade" id="modal_infoServicosNegocioTecnico" aria-hidden="false">
					<div class="modal-header">
						 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h3><fmt:message key="portal.carrinho.listagem" /></h3>
					</div>
					<div class="modal-body">
						<div class='slimScrollDiv'>
							<div class='slim-scroll'>
								<div id="divInfoServicosNegocioTecnico">
									<div class="filter-bar">
										<div class='row-fluid'>
											<input type='text' class='span12' id='filtroTableServicosNegocioTecnico' placeholder="<fmt:message key="portal.carrinho.filtroBusca" />" onkeyup="filtroTableJs(this, 'tblListaServicosNegocioTecnico')">
										</div>
									</div>
									<table id='tblListaServicosNegocioTecnico' class='dynamicTable table  table-bordered table-condensed dataTable'>
										<tr>
											<th></th>
											<th ><fmt:message key="citcorpore.comum.servico" /></th>
										</tr>
									</table>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<a href="#" class="btn btn-primary" data-dismiss="modal"><fmt:message key="citcorpore.comum.fechar" /></a>
					</div>
				</div>
				
				<div class="modal hide fade width-80" id="modal_pesquisaItemConfiguracao" aria-hidden="false">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h3><fmt:message key="solicitacaoServico.pesquisarItemConfiguracao" /></h3>
					</div>
					<div class="modal-body">
						<div id="conteudoPesquisaItemConfiguracao">
							<iframe id="framePesquisaItemConfiguracao" src="about:blank" width="99%" height="530"></iframe>
						</div>
					</div>
					<div class="modal-footer">
						<a href="#" class="btn " data-dismiss="modal"><fmt:message key="citcorpore.comum.fechar" /></a>
					</div>
				</div>
				
				<%@include file="/novoLayout/common/include/rodape.jsp" %>
  		
			</div>
		</div>
		<script type="text/javascript" src="js/cadastroTemplateIncidenteRequisicao.js"></script>
	</body>
</html>