<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" xmlns:bnu="http://bootsfaces.net/ui">


<ui:composition template="/tampletes/modeloGeral.xhtml">

	<ui:define name="conteudo">
			<f:metadata>
			<f:viewParam name="acao" value="#{funcionarioBean.acao}" />
			<f:viewParam name="codigo" value="#{funcionarioBean.codigo}" />
			<f:event listener="#{funcionarioBean.loadCadastro()}"
				type="preRenderView"></f:event>
		</f:metadata>
		
		
		<h:form id="frmuser">
			<h:inputHidden value="#{funcionarioBean.funcionarioEntity.id}" />
		
			<bnu:panel title="Dados do Funcionario">
				<bnu:inputText id="frm_fun_nome"
					value="#{funcionarioBean.funcionarioEntity.nome}" label="Nome Do Funcionário"
					required="true" required-message="Campo obrigatório" readonly="#{funcionarioBean.acao == 'DELETE'}"/>
			
			</bnu:panel>

			<bnu:panel title="Dados do Usuário">
				
				<h:inputHidden value="#{funcionarioBean.usuarioEntity.id}" />

				<h:message for="frm_user_nome" />
				<bnu:inputText id="frm_user_nome"
					value="#{funcionarioBean.usuarioEntity.username}" label="Nome Usuário"
					required="true" required-message="Campo obrigatório" readonly="#{funcionarioBean.acao == 'DELETE'}"/>


				<h:message for="frm_mail" />
				<bnu:inputText id="frm_mail"
					value="#{funcionarioBean.usuarioEntity.email}" label="E-mail"
					required="true" required-message="Campo obrigatório" readonly="#{funcionarioBean.acao == 'DELETE'}" />


				<h:message for="frm_senha" />
				<bnu:inputText id="frm_senha"
					value="#{funcionarioBean.usuarioEntity.password}" label="Password"
					size="20" required="true" required-message="Campo obrigatório" readonly="#{funcionarioBean.acao == 'DELETE'}" />

				<!--Rendereriza se for adicionar -->
				<h:selectManyCheckbox value="#{funcionarioBean.permissaoSelecionadas}"
					layout="pageDirection"  converter="omnifaces.SelectItemsConverter" readonly="#{funcionarioBean.acao == 'DELETE'}">
					<f:selectItems value="#{funcionarioBean.loadPermissoes()}"
						var="permissao" itemValue="#{permissao}" itemLabel="#{permissao.role}" itemDisabled="#{funcionarioBean.acao == 'DELETE'}"/>
				</h:selectManyCheckbox>

<!-- 				Rendereriza se for editar ou excluir -->
<!-- 				<h:selectManyCheckbox value="#{funcionarioBean.permissaoSelecionadas}" rendered="#{funcionarioBean.acao == 'EDIT'}" -->
<!-- 					layout="pageDirection"  converter="omnifaces.SelectItemsConverter" readonly="#{funcionarioBean.acao == 'DELETE'}"> -->
<!-- 					<f:selectItems value="#{funcionarioBean.loadPermissoes()}" -->
<!-- 						var="permissao" itemValue="#{permissao}" itemLabel="#{permissao.role}" itemDisabled="#{funcionarioBean.acao == 'DELETE'}"/> -->
<!-- 				</h:selectManyCheckbox> -->
				
							<p:commandButton value="salvar" styleClass="but but-success"  rendered="#{funcionarioBean.acao == 'ADICIONAR'}"
								action="#{funcionarioBean.salvarOuDeletar()}"/>
							

							<p:commandButton value="Excluir" styleClass="but but-danger"
								action="#{funcionarioBean.deletar()}" rendered="#{funcionarioBean.acao == 'DELETE'}"/>

							<p:commandButton value="Editar" styleClass="but but-warning"
								action="#{funcionarioBean.salvarOuDeletar()}" rendered="#{funcionarioBean.acao == 'EDIT'}"/>

							<p:button value="Voltar" styleClass="but but-primary" 
								 outcome="/pages/funcionario/funcionarioList.xhtml"  />
			</bnu:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html><commit_msg>EDIT CORRIGIDO, [EXCLUI COM CONFIRMAÇÃO]<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" xmlns:bnu="http://bootsfaces.net/ui">


<ui:composition template="/tampletes/modeloGeral.xhtml">

	<ui:define name="conteudo">
		<f:metadata>
			<f:viewParam name="acao" value="#{funcionarioBean.acao}" />
			<f:viewParam name="codigo" value="#{funcionarioBean.codigo}" />
			<f:event listener="#{funcionarioBean.loadCadastro()}"
				type="preRenderView"></f:event>
		</f:metadata>


		<h:form id="frmuser">
			<h:inputHidden value="#{funcionarioBean.funcionarioEntity.id}" />

			<bnu:panel title="Dados do Funcionario">
				<bnu:inputText id="frm_fun_nome"
					value="#{funcionarioBean.funcionarioEntity.nome}"
					label="Nome Do Funcionário" required="true"
					required-message="Campo obrigatório"
					readonly="#{funcionarioBean.acao == 'DELETE'}" />

			</bnu:panel>

			<bnu:panel title="Dados do Usuário">

				<h:inputHidden value="#{funcionarioBean.usuarioEntity.id}" />

				<h:message for="frm_user_nome" />
				<bnu:inputText id="frm_user_nome"
					value="#{funcionarioBean.usuarioEntity.username}"
					label="<NAME>" required="true"
					required-message="Campo obrigatório"
					readonly="#{funcionarioBean.acao == 'DELETE'}" />


				<h:message for="frm_mail" />
				<bnu:inputText id="frm_mail"
					value="#{funcionarioBean.usuarioEntity.email}" label="E-mail"
					required="true" required-message="Campo obrigatório"
					readonly="#{funcionarioBean.acao == 'DELETE'}" />


				<h:message for="frm_senha" />
				<bnu:inputText id="frm_senha"
					value="#{funcionarioBean.usuarioEntity.password}" label="Password"
					size="20" required="true" required-message="Campo obrigatório"
					readonly="#{funcionarioBean.acao == 'DELETE'}" />

				<!--Rendereriza se for adicionar -->
				<h:selectManyCheckbox
					value="#{funcionarioBean.permissaoSelecionadas}"
					layout="pageDirection" converter="omnifaces.SelectItemsConverter"
					readonly="#{funcionarioBean.acao == 'DELETE'}">
					<f:selectItems value="#{funcionarioBean.loadPermissoes()}"
						var="permissao" itemValue="#{permissao}"
						itemLabel="#{permissao.role}"
						itemDisabled="#{funcionarioBean.acao == 'DELETE'}" />
				</h:selectManyCheckbox>

				<!-- 				Rendereriza se for editar ou excluir -->
				<!-- 				<h:selectManyCheckbox value="#{funcionarioBean.permissaoSelecionadas}" rendered="#{funcionarioBean.acao == 'EDIT'}" -->
				<!-- 					layout="pageDirection"  converter="omnifaces.SelectItemsConverter" readonly="#{funcionarioBean.acao == 'DELETE'}"> -->
				<!-- 					<f:selectItems value="#{funcionarioBean.loadPermissoes()}" -->
				<!-- 						var="permissao" itemValue="#{permissao}" itemLabel="#{permissao.role}" itemDisabled="#{funcionarioBean.acao == 'DELETE'}"/> -->
				<!-- 				</h:selectManyCheckbox> -->

				<p:commandButton value="salvar" styleClass="but but-success"
					rendered="#{funcionarioBean.acao == 'ADICIONAR'}"
					action="#{funcionarioBean.salvarOuDeletar()}" />


				<p:commandButton value="Excluir" styleClass="but but-danger"
					action="#{funcionarioBean.deletar()}"
					rendered="#{funcionarioBean.acao == 'DELETE'}" >
					 <p:confirm header="Confirmar" message="Todos Dados relacionados a funcionário serão perdidos. Deseja confirmar ?" 
					 icon="ui-icon-alert" />
					</p:commandButton>

				<p:commandButton value="Editar" styleClass="but but-warning"
					action="#{funcionarioBean.salvarOuDeletar()}"
					rendered="#{funcionarioBean.acao == 'EDIT'}" />

				<p:button value="Voltar" styleClass="but but-primary"
					outcome="/pages/funcionario/funcionarioList.xhtml" />

				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
					<p:commandButton value="Sim" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />

					<p:commandButton value="Não" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
			</bnu:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>
{'fraction_non_alphanumeric': 0.18377922390937576, 'fraction_numerical': 0.003856350927934442, 'mean_word_length': 4.14188351920694, 'pattern_counts': {'":': 0, '<': 102, '<?xml version=': 2, '>': 102, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 18}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2273483', 'n_tokens_mistral': 3497, 'n_tokens_neox': 2903, 'n_words': 360}