Commit 1aa253ee by wrosado

[edit] tipo de usuario

parent 332fecdd
/dist/ /dist/
/build/
/nbproject/private/
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link href="../css/lib/jquery-editable-select.min.css" rel="stylesheet" type="text/css"/>
<%@include file="templates/header.jsp" %> <%@include file="templates/header.jsp" %>
<!--template-core--> <!--template-core-->
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
<%@include file="templates/header-body.jsp" %> <%@include file="templates/header-body.jsp" %>
<!-- content --> <!-- content -->
<div class="row animated fadeIn"> <div class="row animated fadeIn">
<div class="col-sm-12 col-md-12 col-lg-3 col-centered"> <div class="col-sm-12 col-md-12 col-lg-5 col-centered">
<div class="panel panel-primary card-3" style="margin-top: 30px"> <div class="panel panel-primary card-3" style="margin-top: 30px">
<div class="panel-heading" style="padding: 8px 15px"> <div class="panel-heading" style="padding: 8px 15px">
<h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="icon icon-search4"></i>&nbsp; Búsqueda de Tipos de Usuario</h6> <h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="icon icon-search4"></i>&nbsp; Búsqueda de Tipos de Usuario</h6>
...@@ -32,13 +33,27 @@ ...@@ -32,13 +33,27 @@
<div class="panel-body" id="panelSearch"> <div class="panel-body" id="panelSearch">
<form id="formTipoUsuario" onsubmit="return false" autocomplete="off"> <form id="formTipoUsuario" onsubmit="return false" autocomplete="off">
<div class="row"> <div class="row">
<div class='col-md-12' id="div-busq-tipo"> <div class='col-md-6'>
<div class="form-group"> <div class="form-group">
<label> <label>
Tipo de Usuario: Proyecto
</label> </label>
<span class="asterisk">(*)</span> <span class="asterisk">(*)</span>
<input type="text" id="txtTipoDeUsuario" name="txtBusqueda" class="form-control" value="" placeholder="INGRESE NOMBRE DEL TIPO DE USUARIO" style="text-transform:uppercase;"> <select class="form-control" id="cboProyectos">
</select>
</div>
</div>
<div class='col-md-6' id="div-busq-tipo">
<div class="form-group">
<label>
Tipo de Usuario:
</label>
<select class="form-control" id="cboTipoUsuarios">
</select>
<!--<span class="asterisk">(*)</span>-->
<!--<input type="text" id="txtTipoDeUsuario" name="txtBusqueda" class="form-control" value="" placeholder="INGRESE NOMBRE DEL TIPO DE USUARIO" style="text-transform:uppercase;">-->
</div> </div>
</div> </div>
</div> </div>
...@@ -64,12 +79,12 @@ ...@@ -64,12 +79,12 @@
</div> </div>
</div> </div>
<div class="col-sm-12 col-md-12 col-lg-9 col-centered"> <div class="col-sm-12 col-md-12 col-lg-10 col-centered">
<div class="panel panel-primary card-3" style="margin-top: 30px"> <div class="panel panel-primary card-3" style="margin-top: 30px">
<div class="panel-heading" style="padding: 8px 15px"> <div class="panel-heading" style="padding: 8px 15px">
<h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="fa fa-list"></i>&nbsp; Listado de Tipos de Usuario</h6> <h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="fa fa-list"></i>&nbsp; Listado de Tipos de Usuario</h6>
<div class="heading-elements"> <div class="heading-elements">
<button type="button" id="btnNuevoTipoUsuario" class="btn bg-slate border-slate-600 btn-xs"><i class="glyphicon glyphicon-plus"></i>&nbsp;Nuevo Tipo de Usuario</button>
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
...@@ -77,7 +92,8 @@ ...@@ -77,7 +92,8 @@
<thead> <thead>
<tr> <tr>
<th class="text-center"></th> <th class="text-center"></th>
<th class="text-center">NOMBRE</th> <th class="text-center">PROYECTO</th>
<th class="text-center">TIPO DE USUARIO</th>
<th class="text-center">ESTADO</th> <th class="text-center">ESTADO</th>
<th class="text-center">ACCIONES</th> <th class="text-center">ACCIONES</th>
</tr> </tr>
...@@ -86,10 +102,12 @@ ...@@ -86,10 +102,12 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- / content --> <!-- / content -->
<%@include file="templates/footer-body.jsp" %> <%@include file="templates/footer-body.jsp" %>
<!--js--> <!--js-->
<script src="../js/lib/jquery-editable-select.min.js" type="text/javascript"></script>
<script src="../js/pages/tipoUsuario.js" type="text/javascript"></script> <script src="../js/pages/tipoUsuario.js" type="text/javascript"></script>
<!--js--> <!--js-->
</body> </body>
......
No preview for this file type
...@@ -998,6 +998,7 @@ exists or setup the property manually. For example like this: ...@@ -998,6 +998,7 @@ exists or setup the property manually. For example like this:
</target> </target>
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/> <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
<copyfiles files="${file.reference.json-20171018.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.sqljdbc42.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.sqljdbc42.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.commons-codec-1.10.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.commons-codec-1.10.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.json-20160212.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.json-20160212.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
...@@ -1005,6 +1006,7 @@ exists or setup the property manually. For example like this: ...@@ -1005,6 +1006,7 @@ exists or setup the property manually. For example like this:
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
</target> </target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
<copyfiles files="${file.reference.json-20171018.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.sqljdbc42.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.sqljdbc42.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.commons-codec-1.10.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.commons-codec-1.10.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.json-20160212.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.json-20160212.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
......
deploy.ant.properties.file=C:\\Users\\sistem02user\\AppData\\Roaming\\NetBeans\\8.2\\config\\GlassFishEE6\\Properties\\gfv3258829979.properties deploy.ant.properties.file=C:\\Users\\sistem02user\\AppData\\Roaming\\NetBeans\\8.2\\config\\GlassFishEE6\\Properties\\gfv3258829979.properties
file.reference.commons-codec-1.10.jar=D:\\LIBRERIAS\\commons-codec-1.10.jar
file.reference.json-20171018.jar=D:\\LIBRERIAS\\json-20160810.jar
file.reference.sqljdbc42.jar=D:\\LIBRERIAS\\sqljdbc42.jar
j2ee.platform.is.jsr109=true j2ee.platform.is.jsr109=true
j2ee.server.domain=C:/Users/sistem02user/AppData/Roaming/NetBeans/8.2/config/GF_4.1.1/domain1 j2ee.server.domain=C:/Users/sistem02user/AppData/Roaming/NetBeans/8.2/config/GF_4.1.1/domain1
j2ee.server.home=C:/Program Files/glassfish-4.1.1/glassfish j2ee.server.home=C:/Program Files/glassfish-4.1.1/glassfish
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/> <group>
<file>file:/E:/maven/securityRemake/web/js/pages/tipoUsuario.js</file>
<file>file:/E:/maven/securityRemake/src/java/moduloSeguridad/sqlserverdao/TipoUsuarioSqlServerDAO.java</file>
<file>file:/E:/maven/securityRemake/web/vistas/mantenimientoTipoUsuario.jsp</file>
</group>
</open-files> </open-files>
</project-private> </project-private>
...@@ -28,7 +28,10 @@ dist.war=${dist.dir}/${war.name} ...@@ -28,7 +28,10 @@ dist.war=${dist.dir}/${war.name}
endorsed.classpath=\ endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath} ${libs.javaee-endorsed-api-7.0.classpath}
excludes= excludes=
file.reference.json-20160212.jar=D:\\LIBRERIAS\\json-20160212.jar file.reference.commons-codec-1.10.jar=E:\\LIBRERIAS\\commons-codec-1.10.jar
file.reference.json-20160212.jar=E:\\LIBRERIAS\\json-20160212.jar
file.reference.json-20171018.jar=E:\\LIBRERIAS\\json-20171018.jar
file.reference.sqljdbc42.jar=E:\\LIBRERIAS\\sqljdbc42.jar
includes=** includes=**
j2ee.compile.on.save=true j2ee.compile.on.save=true
j2ee.copy.static.files.on.save=true j2ee.copy.static.files.on.save=true
......
...@@ -13,7 +13,21 @@ import org.json.JSONObject; ...@@ -13,7 +13,21 @@ import org.json.JSONObject;
*/ */
public interface TipoUsuarioDAO { public interface TipoUsuarioDAO {
public JSONObject listarTipoUsuario(String filtro, int vstart, int vlength, String draw) throws Exception; public JSONObject listarProyectos() throws Exception;
public JSONObject listarTiposUsuarios(int codigoProyecto) throws Exception;
public JSONObject asignarAcciones(JSONObject datos) throws Exception;
public JSONObject activarDesactivarAccion(JSONObject datos) throws Exception;
public JSONObject activarDesactivarTipoUsuario(JSONObject datos) throws Exception;
public JSONObject listarAcciones(JSONObject datos) throws Exception;
public JSONObject listarCboAcciones() throws Exception;
public JSONObject listadoPrincipal(String filtro, int filtrado, int proyecto, int vstart, int vlength, String draw) throws Exception;
public int activarTipoUsuario(int codigo) throws Exception; public int activarTipoUsuario(int codigo) throws Exception;
......
...@@ -18,10 +18,80 @@ public class TipoUsuarioService { ...@@ -18,10 +18,80 @@ public class TipoUsuarioService {
DAOFactory fabrica = DAOFactory.getDAOFactory(DAOFactory.SQLSERVER); DAOFactory fabrica = DAOFactory.getDAOFactory(DAOFactory.SQLSERVER);
TipoUsuarioDAO dao = fabrica.getTipoUsuario(); TipoUsuarioDAO dao = fabrica.getTipoUsuario();
public JSONObject listarTipoUsuario(String filtro, int vstart, int vlength, String draw) { public JSONObject listarProyectos() {
JSONObject obj = null; JSONObject obj = null;
try { try {
obj = dao.listarTipoUsuario(filtro, vstart, vlength, draw); obj = dao.listarProyectos();
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject listarTiposUsuarios(int codigoProyecto) {
JSONObject obj = null;
try {
obj = dao.listarTiposUsuarios(codigoProyecto);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject asignarAcciones(JSONObject datos) {
JSONObject obj = null;
try {
obj = dao.asignarAcciones(datos);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject listarAcciones(JSONObject datos) {
JSONObject obj = null;
try {
obj = dao.listarAcciones(datos);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject listarCboAcciones() {
JSONObject obj = null;
try {
obj = dao.listarCboAcciones();
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject activarDesactivarAccion(JSONObject datos) {
JSONObject obj = null;
try {
obj = dao.activarDesactivarAccion(datos);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject activarDesactivarTipoUsuario(JSONObject datos) {
JSONObject obj = null;
try {
obj = dao.activarDesactivarTipoUsuario(datos);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public JSONObject listadoPrincipal(String filtro,int filtrado, int proyecto, int vstart, int vlength, String draw) {
JSONObject obj = null;
try {
obj = dao.listadoPrincipal(filtro,filtrado, proyecto, vstart, vlength, draw);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -25,11 +25,29 @@ public class TipoUsuarioServlet extends HttpServlet { ...@@ -25,11 +25,29 @@ public class TipoUsuarioServlet extends HttpServlet {
response.setContentType("text/html"); response.setContentType("text/html");
String accion = request.getParameter("accion"); String accion = request.getParameter("accion");
switch (accion) { switch (accion) {
case "listarTipoUsuario": case "listarProyectos":
listarTipoUsuario(request, response); listarProyectos(request, response);
break; break;
case "activarTipoUsuario": case "listarTiposUsuarios":
activarTipoUsuario(request, response); listarTiposUsuarios(request, response);
break;
case "asignarAcciones":
asignarAcciones(request, response);
break;
case "listarAcciones":
listarAcciones(request, response);
break;
case "listarCboAcciones":
listarCboAcciones(request, response);
break;
case "listadoPrincipal":
listadoPrincipal(request, response);
break;
case "activarDesactivarAccion":
activarDesactivarAccion(request, response);
break;
case "activarDesactivarTipoUsuario":
activarDesactivarTipoUsuario(request, response);
break; break;
case "desactivarTipoUsuario": case "desactivarTipoUsuario":
desactivarTipoUsuario(request, response); desactivarTipoUsuario(request, response);
...@@ -51,15 +69,102 @@ public class TipoUsuarioServlet extends HttpServlet { ...@@ -51,15 +69,102 @@ public class TipoUsuarioServlet extends HttpServlet {
} }
} }
private void listarTipoUsuario(HttpServletRequest request, HttpServletResponse response) throws IOException { private void listarProyectos(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.listarProyectos();
out.println(json);
}
private void listarTiposUsuarios(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
int codigoProyecto = Integer.parseInt(request.getParameter("codigoProy"));
TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.listarTiposUsuarios(codigoProyecto);
out.println(json);
}
private void asignarAcciones(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
JSONObject obj = new JSONObject()
.put("codProyectoDetalle", Integer.parseInt(request.getParameter("codigoProyDetalle")))
.put("nomAccion", request.getParameter("nomAccion"));
TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.asignarAcciones(obj);
out.println(json);
}
private void activarDesactivarAccion(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
JSONObject obj = new JSONObject().put("codigoAccionDetalle", Integer.parseInt(request.getParameter("codAccionDetalle")));
TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.activarDesactivarAccion(obj);
out.println(json);
}
private void activarDesactivarTipoUsuario(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
JSONObject obj = new JSONObject().put("codigoProyectoDetalle", Integer.parseInt(request.getParameter("codProyectoDetalle")));
TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.activarDesactivarTipoUsuario(obj);
out.println(json);
}
private void listarCboAcciones(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json"); response.setContentType("application/json");
PrintWriter out = response.getWriter(); PrintWriter out = response.getWriter();
TipoUsuarioService service = new TipoUsuarioService(); TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.listarCboAcciones();
out.println(json);
}
private void listarAcciones(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
String draw = request.getParameter("draw");
int vstart = Integer.parseInt(request.getParameter("start"));
int vlength = Integer.parseInt(request.getParameter("length"));
JSONObject obj = new JSONObject()
.put("draw",draw)
.put("start",vstart)
.put("length",vlength)
.put("proyectoDetalle", Integer.parseInt(request.getParameter("codProyDetalle")));
TipoUsuarioService service = new TipoUsuarioService();
JSONObject json = service.listarAcciones(obj);
out.println(json);
}
private void listadoPrincipal(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("application/json");
PrintWriter out = response.getWriter();
TipoUsuarioService service = new TipoUsuarioService();
String filtro = request.getParameter("filtro"); String filtro = request.getParameter("filtro");
int filtrado = Integer.parseInt(request.getParameter("filtrado"));
int cboProyecto = Integer.parseInt(request.getParameter("valorCboProyecto"));
String draw = request.getParameter("draw"); String draw = request.getParameter("draw");
int vstart = Integer.parseInt(request.getParameter("start")); int vstart = Integer.parseInt(request.getParameter("start"));
int vlength = Integer.parseInt(request.getParameter("length")); int vlength = Integer.parseInt(request.getParameter("length"));
JSONObject json = service.listarTipoUsuario(filtro, vstart, vlength, draw);
JSONObject json = service.listadoPrincipal(filtro, filtrado, cboProyecto, vstart, vlength, draw);
out.println(json); out.println(json);
} }
......
/*! jQuery Editable Select - v2.2.5 - https://github.com/indrimuska/jquery-editable-select - (c) 2016 Indri Muska - MIT */
input.es-input{padding-right:20px!important;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAYAAADJEc7MAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAG2YAABzjgAA4DIAAIM2AAB5CAAAxgwAADT6AAAgbL5TJ5gAAABGSURBVHjaYvz//z8DOYCJgUzA0tnZidPK8vJyRpw24pLEpwnuVHRFhDQxMDAwMPz//x+OOzo6/iPz8WFGuocqAAAA//8DAD/sORHYg7kaAAAAAElFTkSuQmCC) right center no-repeat}input.es-input.open{-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-moz-border-radius-bottomright:0;border-bottom-right-radius:0}.es-list{position:absolute;padding:0;margin:0;border:1px solid #d1d1d1;display:none;z-index:1000;background:#fff;max-height:160px;overflow-y:auto;-moz-box-shadow:0 2px 3px #ccc;-webkit-box-shadow:0 2px 3px #ccc;box-shadow:0 2px 3px #ccc}.es-list li{display:block;padding:5px 10px;margin:0}.es-list li.selected{background:#f3f3f3}.es-list li[disabled]{opacity:.5}
\ No newline at end of file
!function(t){EditableSelect=function(e,i){this.options=i,this.$select=t(e),this.$input=t('<input type="text" autocomplete="off">'),this.$list=t('<ul class="es-list">'),this.utility=new EditableSelectUtility(this),["focus","manual"].indexOf(this.options.trigger)<0&&(this.options.trigger="focus"),["default","fade","slide"].indexOf(this.options.effects)<0&&(this.options.effects="default"),isNaN(this.options.duration)&&["fast","slow"].indexOf(this.options.duration)<0&&(this.options.duration="fast");var s=t._data(e,"events");s&&Object.keys(s).forEach(t=>{var e=s[t][0];this.$input.bind(e.type+"."+e.namespace,e.handler)}),this.$select.replaceWith(this.$input),this.$list.appendTo(this.options.appendTo||this.$input.parent()),this.utility.initialize(),this.utility.initializeList(),this.utility.initializeInput(),this.utility.trigger("created")},EditableSelect.DEFAULTS={filter:!0,effects:"default",duration:"fast",trigger:"focus"},EditableSelect.prototype.filter=function(){var e=0,i=this.$input.val().toLowerCase().trim();this.$list.find("li").addClass("es-visible").show(),this.options.filter&&(e=this.$list.find("li").filter(function(e,s){return t(s).text().toLowerCase().indexOf(i)<0}).hide().removeClass("es-visible").length,this.$list.find("li").length==e&&this.hide())},EditableSelect.prototype.show=function(){if(this.$list.css({top:this.$input.position().top+this.$input.outerHeight()-1,left:this.$input.position().left,width:this.$input.outerWidth()}),!this.$list.is(":visible")&&this.$list.find("li.es-visible").length>0){var e={default:"show",fade:"fadeIn",slide:"slideDown"}[this.options.effects];this.utility.trigger("show"),this.$input.addClass("open"),this.$list[e](this.options.duration,t.proxy(this.utility.trigger,this.utility,"shown"))}},EditableSelect.prototype.hide=function(){var e={default:"hide",fade:"fadeOut",slide:"slideUp"}[this.options.effects];this.utility.trigger("hide"),this.$input.removeClass("open"),this.$list[e](this.options.duration,t.proxy(this.utility.trigger,this.utility,"hidden"))},EditableSelect.prototype.select=function(t){this.$list.has(t)&&t.is("li.es-visible:not([disabled])")&&(this.$input.val(t.text()),this.options.filter&&this.hide(),this.filter(),this.utility.trigger("select",t))},EditableSelect.prototype.add=function(e,i,s,l){var o=t("<li>").html(e),n=t("<option>").text(e),a=this.$list.find("li").length;0==(i=isNaN(i)?a:Math.min(Math.max(0,i),a))?(this.$list.prepend(o),this.$select.prepend(n)):(this.$list.find("li").eq(i-1).after(o),this.$select.find("option").eq(i-1).after(n)),this.utility.setAttributes(o,s,l),this.utility.setAttributes(n,s,l),this.filter()},EditableSelect.prototype.remove=function(t){var e=this.$list.find("li").length;t=isNaN(t)?e:Math.min(Math.max(0,t),e-1),this.$list.find("li").eq(t).remove(),this.$select.find("option").eq(t).remove(),this.filter()},EditableSelect.prototype.clear=function(){this.$list.find("li").remove(),this.$select.find("option").remove(),this.filter()},EditableSelect.prototype.destroy=function(){this.$list.off("mousemove mousedown mouseup"),this.$input.off("focus blur input keydown"),this.$input.replaceWith(this.$select),this.$list.remove(),this.$select.removeData("editable-select")},EditableSelectUtility=function(t){this.es=t},EditableSelectUtility.prototype.initialize=function(){var e=this;e.setAttributes(e.es.$input,e.es.$select[0].attributes,e.es.$select.data()),e.es.$input.addClass("es-input").data("editable-select",e.es),e.es.$select.find("option").each(function(i,s){var l=t(s).remove();e.es.add(l.text(),i,s.attributes,l.data()),l.attr("selected")&&e.es.$input.val(l.text())}),e.es.filter()},EditableSelectUtility.prototype.initializeList=function(){var e=this;e.es.$list.on("mousemove","li:not([disabled])",function(){e.es.$list.find(".selected").removeClass("selected"),t(this).addClass("selected")}).on("mousedown","li",function(i){t(this).is("[disabled]")?i.preventDefault():e.es.select(t(this))}).on("mouseup",function(){e.es.$list.find("li.selected").removeClass("selected")})},EditableSelectUtility.prototype.initializeInput=function(){var e=this;switch(this.es.options.trigger){default:case"focus":e.es.$input.on("focus",t.proxy(e.es.show,e.es)).on("blur",t.proxy(function(){0===t(".es-list:hover").length?e.es.hide():this.$input.focus()},e.es));break;case"manual":}e.es.$input.on("input keydown",function(t){switch(t.keyCode){case 38:var i=(s=e.es.$list.find("li.es-visible:not([disabled])")).index(s.filter("li.selected"));e.highlight(i-1),t.preventDefault();break;case 40:var s;i=(s=e.es.$list.find("li.es-visible:not([disabled])")).index(s.filter("li.selected"));e.highlight(i+1),t.preventDefault();break;case 13:e.es.$list.is(":visible")&&(e.es.select(e.es.$list.find("li.selected")),t.preventDefault());break;case 9:case 27:e.es.hide();break;default:e.es.filter(),e.highlight(0)}})},EditableSelectUtility.prototype.highlight=function(t){var e=this;e.es.show(),setTimeout(function(){var i=e.es.$list.find("li.es-visible"),s=e.es.$list.find("li.selected").removeClass("selected"),l=i.index(s);if(i.length>0){var o=(i.length+t)%i.length,n=i.eq(o),a=n.position().top;n.addClass("selected"),o<l&&a<0&&e.es.$list.scrollTop(e.es.$list.scrollTop()+a),o>l&&a+n.outerHeight()>e.es.$list.outerHeight()&&e.es.$list.scrollTop(e.es.$list.scrollTop()+n.outerHeight()+2*(a-e.es.$list.outerHeight()))}})},EditableSelectUtility.prototype.setAttributes=function(e,i,s){t.each(i||{},function(t,i){e.attr(i.name,i.value)}),e.data(s)},EditableSelectUtility.prototype.trigger=function(t){var e=Array.prototype.slice.call(arguments,1),i=[t+".editable-select"];i.push(e),this.es.$select.trigger.apply(this.es.$select,i),this.es.$input.trigger.apply(this.es.$input,i)},Plugin=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var s=t(this),l=s.data("editable-select"),o=t.extend({},EditableSelect.DEFAULTS,s.data(),"object"==typeof e&&e);l||(l=new EditableSelect(this,o)),"string"==typeof e&&l[e].apply(l,i)})},t.fn.editableSelect=Plugin,t.fn.editableSelect.Constructor=EditableSelect}(jQuery);
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link href="../css/lib/jquery-editable-select.min.css" rel="stylesheet" type="text/css"/>
<%@include file="templates/header.jsp" %> <%@include file="templates/header.jsp" %>
<!--template-core--> <!--template-core-->
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
<%@include file="templates/header-body.jsp" %> <%@include file="templates/header-body.jsp" %>
<!-- content --> <!-- content -->
<div class="row animated fadeIn"> <div class="row animated fadeIn">
<div class="col-sm-12 col-md-12 col-lg-3 col-centered"> <div class="col-sm-12 col-md-12 col-lg-5 col-centered">
<div class="panel panel-primary card-3" style="margin-top: 30px"> <div class="panel panel-primary card-3" style="margin-top: 30px">
<div class="panel-heading" style="padding: 8px 15px"> <div class="panel-heading" style="padding: 8px 15px">
<h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="icon icon-search4"></i>&nbsp; Búsqueda de Tipos de Usuario</h6> <h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="icon icon-search4"></i>&nbsp; Búsqueda de Tipos de Usuario</h6>
...@@ -32,13 +33,27 @@ ...@@ -32,13 +33,27 @@
<div class="panel-body" id="panelSearch"> <div class="panel-body" id="panelSearch">
<form id="formTipoUsuario" onsubmit="return false" autocomplete="off"> <form id="formTipoUsuario" onsubmit="return false" autocomplete="off">
<div class="row"> <div class="row">
<div class='col-md-12' id="div-busq-tipo"> <div class='col-md-6'>
<div class="form-group"> <div class="form-group">
<label> <label>
Tipo de Usuario: Proyecto
</label> </label>
<span class="asterisk">(*)</span> <span class="asterisk">(*)</span>
<input type="text" id="txtTipoDeUsuario" name="txtBusqueda" class="form-control" value="" placeholder="INGRESE NOMBRE DEL TIPO DE USUARIO" style="text-transform:uppercase;"> <select class="form-control" id="cboProyectos">
</select>
</div>
</div>
<div class='col-md-6' id="div-busq-tipo">
<div class="form-group">
<label>
Tipo de Usuario:
</label>
<select class="form-control" id="cboTipoUsuarios">
</select>
<!--<span class="asterisk">(*)</span>-->
<!--<input type="text" id="txtTipoDeUsuario" name="txtBusqueda" class="form-control" value="" placeholder="INGRESE NOMBRE DEL TIPO DE USUARIO" style="text-transform:uppercase;">-->
</div> </div>
</div> </div>
</div> </div>
...@@ -64,12 +79,12 @@ ...@@ -64,12 +79,12 @@
</div> </div>
</div> </div>
<div class="col-sm-12 col-md-12 col-lg-9 col-centered"> <div class="col-sm-12 col-md-12 col-lg-10 col-centered">
<div class="panel panel-primary card-3" style="margin-top: 30px"> <div class="panel panel-primary card-3" style="margin-top: 30px">
<div class="panel-heading" style="padding: 8px 15px"> <div class="panel-heading" style="padding: 8px 15px">
<h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="fa fa-list"></i>&nbsp; Listado de Tipos de Usuario</h6> <h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="fa fa-list"></i>&nbsp; Listado de Tipos de Usuario</h6>
<div class="heading-elements"> <div class="heading-elements">
<button type="button" id="btnNuevoTipoUsuario" class="btn bg-slate border-slate-600 btn-xs"><i class="glyphicon glyphicon-plus"></i>&nbsp;Nuevo Tipo de Usuario</button>
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
...@@ -77,7 +92,8 @@ ...@@ -77,7 +92,8 @@
<thead> <thead>
<tr> <tr>
<th class="text-center"></th> <th class="text-center"></th>
<th class="text-center">NOMBRE</th> <th class="text-center">PROYECTO</th>
<th class="text-center">TIPO DE USUARIO</th>
<th class="text-center">ESTADO</th> <th class="text-center">ESTADO</th>
<th class="text-center">ACCIONES</th> <th class="text-center">ACCIONES</th>
</tr> </tr>
...@@ -86,10 +102,12 @@ ...@@ -86,10 +102,12 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- / content --> <!-- / content -->
<%@include file="templates/footer-body.jsp" %> <%@include file="templates/footer-body.jsp" %>
<!--js--> <!--js-->
<script src="../js/lib/jquery-editable-select.min.js" type="text/javascript"></script>
<script src="../js/pages/tipoUsuario.js" type="text/javascript"></script> <script src="../js/pages/tipoUsuario.js" type="text/javascript"></script>
<!--js--> <!--js-->
</body> </body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment