maia/.svn/pristine/c7/c7b158a0933bc77dee841267c4e...

260 lines
18 KiB
Plaintext
Executable File

<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{centroControlArmasController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:datosTramite :formTable:datosTramite"
focusContainer=":formTable:filters" saveUpdate=":formTable:datosTramite"/>
<p:panelGrid id="filters" columns="2" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="institucionF" value="#{msg_armas.lbl_institucion}:*" />
<p:selectOneMenu id="institucionF" value="#{centroControlArmasController.mfilters['institucion']}"
var="p" style="width:340px" panelStyle="width:340px" >
<f:selectItem itemLabel="TODOS" itemValue="%" />
<p:ajax update="filters" event="change" listener="#{centroControlArmasController.executeInstitucion()}" process="filters"/>
<f:selectItems value="#{centroControlArmasController.linstitucion}" var="vmod"
itemLabel="#{vmod.description}" itemValue="#{vmod.pk.catalog}" />
</p:selectOneMenu>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{centroControlArmasController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters :formTable:datosTramite"
createUpdate=":formBtype:pEdit"
dialogWidgetVar="dialog" saveUpdate=":formTable:datosTramite"/>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content" >
<p:dataTable id="datosTramite" var="row" value="#{centroControlArmasController.lrecord}"
style="min-width: 500px;" rowKey="#{row.rowkey()}" selectionMode="single"
>
<p:column headerText="#{msg_armas.lbl_institucion}" sortBy="#{row.modifiedData['desinstitucion']}">
<h:outputText value="#{row.modifiedData['desinstitucion']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_nombre}" sortBy="#{row.modifiedData['desnombreinstitucion']}" >
<h:outputText value="#{row.modifiedData['desnombreinstitucion']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_province}" sortBy="#{row.modifiedData['desprovincia']}">
<h:outputText value="#{row.modifiedData['desprovincia']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_canton}" sortBy="#{row.modifiedData['descanton']}" >
<h:outputText value="#{row.modifiedData['descanton']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_parroquia}" sortBy="#{row.modifiedData['desparroquia']}">
<h:outputText value="#{row.modifiedData['desparroquia']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_address}" sortBy="#{row.direccion}" >
<h:outputText value="#{row.direccion}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_jefecentro}" sortBy="#{row.modifiedData['nombre']}" style="width:100px">
<h:outputText value="#{row.modifiedData['nombre']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_grado}" sortBy="#{row.modifiedData['desgrado']}">
<h:outputText value="#{row.modifiedData['desgrado']}" />
</p:column>
<p:column styleClass="m-action-column" style="width:40px;text-align:center">
<p:commandButton value="#{msg_general.btn_edit}" update=":formBtype:pEdit"
oncomplete="PF('dialog').show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this datosTramite"
action="#{centroControlArmasController.loadEdit()}">
<f:setPropertyActionListener target="#{centroControlArmasController.record}" value="#{row}" />
<f:setPropertyActionListener target="#{centroControlArmasController.showRow}" value="#{false}" />
<f:setPropertyActionListener target="#{centroControlArmasController.newRow}" value="#{false}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column" style="width:40px;text-align:center">
<p:commandButton value="#{msg_general.btn_delete}" update=":formTable:datosTramite" styleClass="m-action-button"
icon="ui-icon-trash" action="#{centroControlArmasController.remove()}" process="@this, datosTramite">
<f:setPropertyActionListener target="#{centroControlArmasController.record}" value="#{row}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column" style="width:40px;text-align:center">
<p:commandButton id="jurisdiccion" title="#{msg_armas.btn_jurisdiccion}"
update=":formBtypeJurisdiccion:pEditJurisdiccion :formBtypeJurisdiccion:arbolJurisdiccion"
process="@this datosTramite"
style="background-image: url('../../resources/images/jurisdiccion.jpg');width:20px;height:20px"
action="#{tarmCentroControlJurController.loadEdit()}"
oncomplete="if(args.validationFailed){return false;}PF('dialogJurisdiccion').show()"
rendered="#{not empty row.pk}" value="">
<f:setPropertyActionListener target="#{centroControlArmasController.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialog" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formBtype">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEdit" columns="1" bodyrows="1" >
<h:panelGrid id="pCabecera" columns="3" bodyrows="1" >
<p:outputLabel for="institucion" value="#{msg_armas.lbl_institucion}:" />
<p:inputText id="institucion" value="#{centroControlArmasController.record.modifiedData['desinstitucion']}" disabled="true"></p:inputText>
<p:outputLabel></p:outputLabel>
<p:outputLabel for="nombreInstitucion" value="#{msg_armas.lbl_nombre}:" />
<p:selectOneMenu id="nombreInstitucion" value="#{centroControlArmasController.record.nombreinstitucion}"
var="p" style="width:340px" panelStyle="width:340px" required="true" disabled="#{ingresoDatosTipoTramite.editarReg=='SI'}">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{centroControlArmasController.lnombreInstitucion}" var="vmod" itemLabel="#{vmod.description}" itemValue="#{vmod.pk.catalog}" />
</p:selectOneMenu>
<p:message for="nombreInstitucion" />
</h:panelGrid>
<p:fieldset legend="#{msg_armas.field_ubicacion}" style="margin-bottom:20px">
<h:panelGrid id="pDireccion" columns="3" bodyrows="1" >
<p:outputLabel for="provincecode" value="#{msg_general.lbl_province}:"/>
<p:selectOneMenu id="provincecode" value="#{centroControlArmasController.record.provincecode}" var="p"
required="true" style="width:250px">
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax update="cantoncode, parroquiacode" event="change" listener="#{centroControlArmasController.executeProvince()}"/>
<f:selectItems value="#{centroControlArmasController.lprovinces}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.provincecode}" />
</p:selectOneMenu>
<p:message for="provincecode" />
<p:outputLabel for="cantoncode" value="#{msg_general.lbl_canton}:" />
<p:selectOneMenu id="cantoncode" value="#{centroControlArmasController.record.cantoncode}" var="p"
panelStyle="width:135px" required="true" style="width:250px">
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax update="parroquiacode" event="change" listener="#{centroControlArmasController.executeCanton()}"/>
<f:selectItems value="#{centroControlArmasController.lcantones}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.cantoncode}" />
</p:selectOneMenu>
<p:message for="cantoncode"/>
<p:outputLabel for="parroquiacode" value="#{msg_general.lbl_parroquia}:" />
<p:selectOneMenu id="parroquiacode" value="#{centroControlArmasController.record.parroquiacode}" var="p"
panelStyle="width:135px" required="true" style="width:250px">
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{centroControlArmasController.lparroquias}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.parroquiacode}" />
</p:selectOneMenu>
<p:message for="parroquiacode"/>
<p:outputLabel for="ldireccion" value="#{msg_armas.lbl_direccion}:" />
<p:inputText id="ldireccion" value="#{centroControlArmasController.record.direccion}"
required="true" style="width:260px" onkeyup="Maia.forceupper(event, this);" maxlength="100"></p:inputText>
<p:message for="ldireccion"/>
<p:outputLabel for="jefecentro" value="#{msg_armas.lbl_jefecentro}:" />
<h:panelGrid columns="2">
<p:inputText id="jefecentro" value="#{centroControlArmasController.record.modifiedData['nombre']}"
required="true" style="width:230px" title="#{centroControlArmasController.record.modifiedData['nombre']}">
<p:ajax listener="#{centroControlArmasController.validarJefe(centroControlArmasController.record)}"
event="change" update="jefecentro"></p:ajax>
</p:inputText>
<p:commandButton icon="ui-icon-link" actionListener="#{centroControlArmasController.openPersonLov()}"
process="@this" styleClass="m-lov-button" oncomplete="Maia.focus('formTable\\:idQuery');">
<p:ajax event="dialogReturn" listener="#{centroControlArmasController.onReturnPersonLov}" update="jefecentro" />
</p:commandButton>
</h:panelGrid>
<p:message for="jefecentro"/>
<p:outputLabel for="grado" value="#{msg_armas.lbl_grado}:" />
<p:selectOneMenu id="grado" value="#{centroControlArmasController.record.grado}" var="p"
panelStyle="width:135px" required="true" style="width:250px">
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{centroControlArmasController.lgrados}" var="vmod" itemLabel="#{vmod.description}"
itemValue="#{vmod.pk.catalog}" />
</p:selectOneMenu>
<p:message for="grado"/>
<p:outputLabel for="estador" value="#{msg_armas.lbl_estado}:" />
<p:selectOneMenu id="estador" value="#{centroControlArmasController.record.estado}" var="p"
panelStyle="width:135px" required="true" style="width:250px">
<f:selectItem itemLabel="ACTIVO" itemValue="Y" />
<f:selectItem itemLabel="INACTIVO" itemValue="N" />
</p:selectOneMenu>
<p:message for="estador"/>
</h:panelGrid>
</p:fieldset>
</h:panelGrid>
<h:panelGrid columns="2" >
<maia:dialogControls controller="#{centroControlArmasController}"
process=":formBtype:pEdit"
update=":formBtype:pEdit :formTable:datosTramite"
dialogWidgetVar="dialog" />
</h:panelGrid>
</h:form>
</p:dialog>
<p:dialog widgetVar="dialogJurisdiccion" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_datosdejurisdicciones}" />
</f:facet>
<h:form id="formBtypeJurisdiccion">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEditJurisdiccion" columns="1" bodyrows="1" >
<h:panelGrid columns="2" styleClass="m-filters" style="width:100%">
<p:outputLabel for="institucionDes" value="#{msg_armas.lbl_institucion}:" />
<p:inputText id="institucionDes" value="#{centroControlArmasController.record.modifiedData['desinstitucion']}"
style="width:250px" disabled="true" title="#{centroControlArmasController.record.modifiedData['desinstitucion']}"></p:inputText>
<p:outputLabel for="nombInstitucion" value="#{msg_armas.lbl_nombre}:" />
<p:inputText id="nombInstitucion" value="#{centroControlArmasController.record.modifiedData['desnombreinstitucion']}"
style="width:250px" disabled="true" title="#{centroControlArmasController.record.modifiedData['desnombreinstitucion']}"></p:inputText>
</h:panelGrid>
<h:panelGrid styleClass="m-controls">
<p:commandButton id="saveControl" value="#{msg_general.btn_save}" icon="ui-icon-disk"
update="arbolJurisdiccion" process="@this" action="#{tarmCentroControlJurController.save()}" />
</h:panelGrid>
<p:panel id="arbolJurisdiccion" style="vertical-align:top !important;" >
<p:tree id="docs" value="#{tarmCentroControlJurController.root}" var="doc" selectionMode="single"
selection="#{tarmCentroControlJurController.selectedNode}" style="color:000 !important;vertical-align:top;height:180px; overflow:auto;" >
<p:treeNode expandedIcon="ui-icon-folder-open" collapsedIcon="ui-icon-folder-collapsed">
<h:outputText value="#{doc.provincianombre}"/>
</p:treeNode>
</p:tree>
<p:contextMenu for="docs" style="width:50px">
<p:menuitem value="#{msg_armas.btn_crear}" update="messages :formDialogProvin:person"
actionListener="#{tarmCentroControlJurController.displaySelectedSingle}"
oncomplete="if(args.validationFailed){return false;} PF('dialogProvincia').show()"
style="color:000;width:30px"/>
<p:menuitem value="#{msg_armas.btn_eliminar}" update="docs" actionListener="#{tarmCentroControlJurController.deleteNode}"
style="color:000;width:30px"/>
</p:contextMenu>
</p:panel>
</h:panelGrid>
</h:form>
</p:dialog>
<p:dialog widgetVar="dialogProvincia" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog" style="width:100px !important" width="200" minWidth="200">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_nueva_jurisdiccion}:" style="font-weight:bold;"/>
</f:facet>
<h:form id="formDialogProvin">
<h:outputText value="#{msg_armas.lbl_jurisdicciones}:" style="font-weight: bold;"/>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content" style="margin-left:40px;">
<p:dataTable id="person" var="row" value="#{tarmCentroControlJurController.lprovinces}"
style="height:300px !important;overflow:auto;">
<p:column resizable="true">
<h:outputText value="#{row.description}" />
</p:column>
<p:column resizable="true" style="width:20px">
<p:commandButton icon="ui-icon-copy" actionListener="#{tarmCentroControlJurController.setProvincia(row)}"
process="@this person" oncomplete="PF('dialogProvincia').hide()" update=":formBtypeJurisdiccion:arbolJurisdiccion"/>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>