Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
securityRemake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Juan Guevara Mayta
securityRemake
Commits
79fe2d1a
Commit
79fe2d1a
authored
Aug 14, 2023
by
Mauro Paolo Josue Zuñiga Mallqui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EDIT] CAMBIOS PARA LA EDICION DE MENU Y PERMISOS POR VISTA
parent
72fb43bf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
391 additions
and
64 deletions
+391
-64
MenuDAO.java
src/main/java/com/mycompany/moduloseguridad/dao/MenuDAO.java
+50
-42
MenuMYSQLDAO.java
.../com/mycompany/moduloseguridad/mysqldao/MenuMYSQLDAO.java
+190
-6
MenuService.java
...a/com/mycompany/moduloseguridad/services/MenuService.java
+30
-0
MantenimientoMenuServlet.java
...ny/moduloseguridad/servlets/MantenimientoMenuServlet.java
+103
-5
general.css
src/main/webapp/css/general.css
+4
-0
MantenimientoMenu.js
src/main/webapp/js/pages/MantenimientoMenu.js
+0
-0
proyecto.js
src/main/webapp/js/pages/proyecto.js
+2
-2
tipoUsuario.js
src/main/webapp/js/pages/tipoUsuario.js
+2
-4
index.jsp
src/main/webapp/vistas/index.jsp
+7
-3
mantenimientoMenu.jsp
src/main/webapp/vistas/mantenimientoMenu.jsp
+3
-2
No files found.
src/main/java/com/mycompany/moduloseguridad/dao/MenuDAO.java
View file @
79fe2d1a
...
@@ -8,91 +8,98 @@ package com.mycompany.moduloseguridad.dao;
...
@@ -8,91 +8,98 @@ package com.mycompany.moduloseguridad.dao;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
java.sql.SQLException
;
/**
/**
*
* @author sistem17user
* @author sistem17user
*/
*/
public
interface
MenuDAO
{
public
interface
MenuDAO
{
public
JSONArray
listarProyecto
(
int
estado
)
throws
Exception
;
JSONArray
listarProyecto
(
int
estado
)
throws
Exception
;
JSONArray
listarTipoDeUsuario
(
int
proyecto
)
throws
Exception
;
JSONArray
listarTituloCompleto
(
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
JSONArray
listarModuloCompleto
(
int
titulo
,
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
public
JSONArray
listarTipoDeUsuario
(
int
proyect
o
)
throws
Exception
;
JSONArray
listarCategoriaCompleto
(
int
modulo
,
int
proyecto_detalle
,
int
proyecto
,
int
tip
o
)
throws
Exception
;
public
JSONArray
listarTituloCompleto
(
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
JSONArray
listarSubCategoriaCompleto
(
int
categoria
,
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
public
JSONArray
listarModuloCompleto
(
int
titulo
,
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
JSONObject
editarTitulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONArray
listarCategoriaCompleto
(
int
modulo
,
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
JSONObject
editarModulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONArray
listarSubCategoriaCompleto
(
int
categoria
,
int
proyecto_detalle
,
int
proyecto
,
int
tipo
)
throws
Exception
;
JSONObject
editarCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
editarTitulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
editarSubCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
editarMod
ulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoTit
ulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
editarCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoModulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
editarSub
Categoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevo
Categoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoTitulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoSubCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoMod
ulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
eliminarDetalleTit
ulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
eliminarDetalleModulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoSub
Categoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
eliminarDetalle
Categoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
eliminarDetalleTitulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
eliminarDetalleSubCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
eliminarDetalleMod
ulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
cambiarOrdenTit
ulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
eliminarDetalleCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
cambiarOrdenModulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
eliminarDetalleSub
Categoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
cambiarOrden
Categoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
cambiarOrdenTitulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
cambiarOrdenSubCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
cambiarOrdenModulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
reconocerNombreSimilar
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
cambiarOrdenCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoTituloExistente
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
cambiarOrdenSubCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoModuloExistente
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
reconocerNombreSimilar
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoCategoriaExistente
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoTitulo
Existente
(
JSONObject
datos
)
throws
Exception
;
JSONObject
nuevoSubCategoria
Existente
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoModuloExistente
(
JSONObject
datos
)
throws
Exception
;
JSONObject
validarEdicionTitulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoCategoriaExistente
(
JSONObject
datos
)
throws
Exception
;
JSONObject
validarEdicionModulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
nuevoSubCategoriaExistente
(
JSONObject
datos
)
throws
Exception
;
JSONObject
validarEdicionCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
validarEdicionTitulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
validarEdicionSubCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
validarEdicionModulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
listarTitulo
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
public
JSONObject
validarEdicionCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
listarModulo
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
public
JSONObject
validarEdicionSubCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
listarCategoria
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
public
JSONObject
listarTitulo
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
JSONObject
listarSubCategoria
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
public
JSONObject
listarModulo
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
JSONObject
validarElminarTitulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
listarCategoria
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
JSONObject
validarElminarModulo
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
listarSubCategoria
(
JSONObject
datos
,
String
draw
,
String
start
,
String
length
)
throws
Exception
;
JSONObject
validarElminarCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
validarElminarTitulo
(
JSONObject
datos
)
throws
Exception
;
JSONObject
validarElminarSubCategoria
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
validarElminarModul
o
(
JSONObject
datos
)
throws
Exception
;
JSONObject
eliminarMenusAninad
o
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
validarElminarCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONObject
eliminarMenusAninadoGeneral
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
validarElminarSubCategoria
(
JSONObject
datos
)
throws
Exception
;
JSONArray
obtenerAcciones
(
int
codigo
,
int
jerarquia
,
int
tipo_usuario
)
throws
Exception
;
public
JSONObject
eliminarMenusAninado
(
JSONObject
datos
)
throws
Exception
;
JSONObject
listarPermisosPorVista
(
JSONObject
datos
)
throws
Exception
;
public
JSONObject
eliminarMenusAninadoGeneral
(
JSONObject
datos
)
throws
Exception
;
JSONObject
asignarAccionesPorVista
(
JSONObject
json
)
throws
SQL
Exception
;
}
}
\ No newline at end of file
src/main/java/com/mycompany/moduloseguridad/mysqldao/MenuMYSQLDAO.java
View file @
79fe2d1a
This diff is collapsed.
Click to expand it.
src/main/java/com/mycompany/moduloseguridad/services/MenuService.java
View file @
79fe2d1a
...
@@ -429,4 +429,33 @@ public class MenuService {
...
@@ -429,4 +429,33 @@ public class MenuService {
return
obj
;
return
obj
;
}
}
public
JSONObject
listarPermisosPorVista
(
JSONObject
datos
)
{
JSONObject
obj
=
null
;
try
{
obj
=
dao
.
listarPermisosPorVista
(
datos
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
obj
;
}
public
JSONArray
obtenerAcciones
(
int
codigo
,
int
jerarquia
,
int
tipo_usuario
)
{
JSONArray
obj
=
null
;
try
{
obj
=
dao
.
obtenerAcciones
(
codigo
,
jerarquia
,
tipo_usuario
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
obj
;
}
public
JSONObject
asignarAccionesPorVista
(
JSONObject
json
)
{
JSONObject
obj
=
null
;
try
{
obj
=
dao
.
asignarAccionesPorVista
(
json
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
obj
;
}
}
}
\ No newline at end of file
src/main/java/com/mycompany/moduloseguridad/servlets/MantenimientoMenuServlet.java
View file @
79fe2d1a
...
@@ -7,6 +7,7 @@ package com.mycompany.moduloseguridad.servlets;
...
@@ -7,6 +7,7 @@ package com.mycompany.moduloseguridad.servlets;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.util.Objects
;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -65,10 +66,16 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -65,10 +66,16 @@ public class MantenimientoMenuServlet extends HttpServlet {
case
"eliminarMenusAninado"
:
case
"eliminarMenusAninado"
:
eliminarMenusAninado
(
request
,
response
);
eliminarMenusAninado
(
request
,
response
);
break
;
break
;
case
"listarPermisosPorVista"
:
listarPermisosPorVista
(
request
,
response
);
break
;
case
"asignarAccionesPorVista"
:
asignarAccionesPorVista
(
request
,
response
);
break
;
default
:
default
:
break
;
break
;
}
}
}
}
private
void
listarProyecto
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
listarProyecto
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
...
@@ -84,7 +91,7 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -84,7 +91,7 @@ public class MantenimientoMenuServlet extends HttpServlet {
response
.
setContentType
(
"application/json"
);
response
.
setContentType
(
"application/json"
);
PrintWriter
out
=
response
.
getWriter
();
PrintWriter
out
=
response
.
getWriter
();
MenuService
srv
=
new
MenuService
();
MenuService
srv
=
new
MenuService
();
int
codigo
=
Integer
.
parseInt
(
request
.
getParameter
(
"codigo"
));
int
codigo
=
Integer
.
parseInt
(
Objects
.
equals
(
request
.
getParameter
(
"codigo"
),
""
)
?
"0"
:
request
.
getParameter
(
"codigo"
));
JSONArray
rs
=
srv
.
listarTipoDeUsuario
(
codigo
);
JSONArray
rs
=
srv
.
listarTipoDeUsuario
(
codigo
);
out
.
println
(
rs
);
out
.
println
(
rs
);
}
}
...
@@ -129,8 +136,7 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -129,8 +136,7 @@ public class MantenimientoMenuServlet extends HttpServlet {
int
iCategoria
=
0
;
int
iCategoria
=
0
;
JSONObject
obj2
=
new
JSONObject
();
JSONObject
obj2
=
new
JSONObject
();
JSONObject
objModulo
=
(
JSONObject
)
listaModulo
.
get
(
j
);
JSONObject
objModulo
=
(
JSONObject
)
listaModulo
.
get
(
j
);
System
.
out
.
println
(
"objModulo "
+
i
+
" - "
+
j
+
" : "
+
objModulo
);
boolean
esVisible1
=
objModulo
.
getBoolean
(
"esVisible"
);
boolean
esVisible
=
objModulo
.
getBoolean
(
"esVisible"
);
String
nombreModulo
=
objModulo
.
getString
(
"nombreModulo"
);
String
nombreModulo
=
objModulo
.
getString
(
"nombreModulo"
);
int
codigoModulo
=
objModulo
.
getInt
(
"codigoModulo"
);
int
codigoModulo
=
objModulo
.
getInt
(
"codigoModulo"
);
int
configuracionModulo
=
objModulo
.
getInt
(
"configuracionModulo"
);
int
configuracionModulo
=
objModulo
.
getInt
(
"configuracionModulo"
);
...
@@ -150,14 +156,32 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -150,14 +156,32 @@ public class MantenimientoMenuServlet extends HttpServlet {
obj2
.
put
(
"configuracion"
,
configuracionModulo
);
obj2
.
put
(
"configuracion"
,
configuracionModulo
);
obj2
.
put
(
"padre"
,
padreModulo
);
obj2
.
put
(
"padre"
,
padreModulo
);
obj2
.
put
(
"orden"
,
ordenModulo
);
obj2
.
put
(
"orden"
,
ordenModulo
);
obj2
.
put
(
"esVisible"
,
esVisible
);
obj2
.
put
(
"esVisible"
,
esVisible1
);
lista
.
put
(
obj2
);
lista
.
put
(
obj2
);
JSONArray
listarModuloAcc
=
srv
.
obtenerAcciones
(
codigoModulo
,
2
,
proyecto_detalle
);
for
(
int
modacc
=
0
;
modacc
<
listarModuloAcc
.
length
();
modacc
++)
{
JSONObject
objModuloAcc
=
(
JSONObject
)
listarModuloAcc
.
get
(
modacc
);
JSONObject
objModuloAcc2
=
new
JSONObject
();
objModuloAcc2
.
put
(
"conta"
,
modacc
+
1
);
objModuloAcc2
.
put
(
"jerarquia"
,
5
);
objModuloAcc2
.
put
(
"nombre"
,
objModuloAcc
.
getString
(
"nom_accion"
));
objModuloAcc2
.
put
(
"codigo"
,
objModuloAcc
.
getInt
(
"cod_accion"
));
objModuloAcc2
.
put
(
"icono"
,
""
);
objModuloAcc2
.
put
(
"url"
,
""
);
objModuloAcc2
.
put
(
"tipo"
,
3
);
objModuloAcc2
.
put
(
"configuracion"
,
0
);
objModuloAcc2
.
put
(
"padre"
,
codigoModulo
);
objModuloAcc2
.
put
(
"orden"
,
0
);
// objModuloAcc2.put("esVisible", true);
lista
.
put
(
objModuloAcc2
);
}
JSONArray
listaCategoria
=
srv
.
listarCategoriaCompleto
(
codigoModulo
,
proyecto_detalle
,
proyecto
,
tipo
);
JSONArray
listaCategoria
=
srv
.
listarCategoriaCompleto
(
codigoModulo
,
proyecto_detalle
,
proyecto
,
tipo
);
for
(
int
k
=
0
;
k
<
listaCategoria
.
length
();
k
++)
{
for
(
int
k
=
0
;
k
<
listaCategoria
.
length
();
k
++)
{
int
iSubCategoria
=
0
;
int
iSubCategoria
=
0
;
JSONObject
obj3
=
new
JSONObject
();
JSONObject
obj3
=
new
JSONObject
();
JSONObject
objCategoria
=
(
JSONObject
)
listaCategoria
.
get
(
k
);
JSONObject
objCategoria
=
(
JSONObject
)
listaCategoria
.
get
(
k
);
String
nombreCategoria
=
objCategoria
.
getString
(
"nombreCategoria"
);
String
nombreCategoria
=
objCategoria
.
getString
(
"nombreCategoria"
);
boolean
esVisible2
=
objModulo
.
getBoolean
(
"esVisible"
);
int
codigoCategoria
=
objCategoria
.
getInt
(
"codigoCategoria"
);
int
codigoCategoria
=
objCategoria
.
getInt
(
"codigoCategoria"
);
int
configuracionCategoria
=
objCategoria
.
getInt
(
"configuracionCategoria"
);
int
configuracionCategoria
=
objCategoria
.
getInt
(
"configuracionCategoria"
);
String
urlCategoria
=
objCategoria
.
getString
(
"urlCategoria"
);
String
urlCategoria
=
objCategoria
.
getString
(
"urlCategoria"
);
...
@@ -175,12 +199,30 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -175,12 +199,30 @@ public class MantenimientoMenuServlet extends HttpServlet {
obj3
.
put
(
"configuracion"
,
configuracionCategoria
);
obj3
.
put
(
"configuracion"
,
configuracionCategoria
);
obj3
.
put
(
"padre"
,
padreCategoria
);
obj3
.
put
(
"padre"
,
padreCategoria
);
obj3
.
put
(
"orden"
,
ordenCategoria
);
obj3
.
put
(
"orden"
,
ordenCategoria
);
obj3
.
put
(
"esVisible"
,
esVisible2
);
lista
.
put
(
obj3
);
lista
.
put
(
obj3
);
JSONArray
listarCategoriaAcc
=
srv
.
obtenerAcciones
(
codigoCategoria
,
3
,
proyecto_detalle
);
for
(
int
catacc
=
0
;
catacc
<
listarCategoriaAcc
.
length
();
catacc
++)
{
JSONObject
objCategoriaAcc
=
(
JSONObject
)
listarCategoriaAcc
.
get
(
catacc
);
JSONObject
objCategoriaAcc2
=
new
JSONObject
();
objCategoriaAcc2
.
put
(
"conta"
,
catacc
+
1
);
objCategoriaAcc2
.
put
(
"jerarquia"
,
6
);
objCategoriaAcc2
.
put
(
"nombre"
,
objCategoriaAcc
.
getString
(
"nom_accion"
));
objCategoriaAcc2
.
put
(
"codigo"
,
objCategoriaAcc
.
getInt
(
"cod_accion"
));
objCategoriaAcc2
.
put
(
"icono"
,
""
);
objCategoriaAcc2
.
put
(
"url"
,
""
);
objCategoriaAcc2
.
put
(
"tipo"
,
3
);
objCategoriaAcc2
.
put
(
"configuracion"
,
0
);
objCategoriaAcc2
.
put
(
"padre"
,
codigoCategoria
);
objCategoriaAcc2
.
put
(
"orden"
,
0
);
lista
.
put
(
objCategoriaAcc2
);
}
JSONArray
listaSubCategoria
=
srv
.
listarSubCategoriaCompleto
(
codigoCategoria
,
proyecto_detalle
,
proyecto
,
tipo
);
JSONArray
listaSubCategoria
=
srv
.
listarSubCategoriaCompleto
(
codigoCategoria
,
proyecto_detalle
,
proyecto
,
tipo
);
for
(
int
l
=
0
;
l
<
listaSubCategoria
.
length
();
l
++)
{
for
(
int
l
=
0
;
l
<
listaSubCategoria
.
length
();
l
++)
{
JSONObject
obj4
=
new
JSONObject
();
JSONObject
obj4
=
new
JSONObject
();
JSONObject
objSubCategoria
=
(
JSONObject
)
listaSubCategoria
.
get
(
l
);
JSONObject
objSubCategoria
=
(
JSONObject
)
listaSubCategoria
.
get
(
l
);
String
nombreSubCategoria
=
objSubCategoria
.
getString
(
"nombreSubCategoria"
);
String
nombreSubCategoria
=
objSubCategoria
.
getString
(
"nombreSubCategoria"
);
boolean
esVisible3
=
objSubCategoria
.
getBoolean
(
"esVisible"
);
int
codigoSubCategoria
=
objSubCategoria
.
getInt
(
"codigoSubCategoria"
);
int
codigoSubCategoria
=
objSubCategoria
.
getInt
(
"codigoSubCategoria"
);
int
configuracionSubCategoria
=
objSubCategoria
.
getInt
(
"configuracionSubCategoria"
);
int
configuracionSubCategoria
=
objSubCategoria
.
getInt
(
"configuracionSubCategoria"
);
String
urlSubCategoria
=
objSubCategoria
.
getString
(
"urlSubCategoria"
);
String
urlSubCategoria
=
objSubCategoria
.
getString
(
"urlSubCategoria"
);
...
@@ -197,7 +239,24 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -197,7 +239,24 @@ public class MantenimientoMenuServlet extends HttpServlet {
obj4
.
put
(
"configuracion"
,
configuracionSubCategoria
);
obj4
.
put
(
"configuracion"
,
configuracionSubCategoria
);
obj4
.
put
(
"padre"
,
padreSubCategoria
);
obj4
.
put
(
"padre"
,
padreSubCategoria
);
obj4
.
put
(
"orden"
,
ordenSubCategoria
);
obj4
.
put
(
"orden"
,
ordenSubCategoria
);
obj4
.
put
(
"esVisible"
,
esVisible3
);
lista
.
put
(
obj4
);
lista
.
put
(
obj4
);
JSONArray
listarSubAcc
=
srv
.
obtenerAcciones
(
codigoSubCategoria
,
4
,
proyecto_detalle
);
for
(
int
subacc
=
0
;
subacc
<
listarSubAcc
.
length
();
subacc
++)
{
JSONObject
objSubAcc
=
(
JSONObject
)
listarSubAcc
.
get
(
subacc
);
JSONObject
objSubAcc2
=
new
JSONObject
();
objSubAcc2
.
put
(
"conta"
,
subacc
+
1
);
objSubAcc2
.
put
(
"jerarquia"
,
7
);
objSubAcc2
.
put
(
"nombre"
,
objSubAcc
.
getString
(
"nom_accion"
));
objSubAcc2
.
put
(
"codigo"
,
objSubAcc
.
getInt
(
"cod_accion"
));
objSubAcc2
.
put
(
"icono"
,
""
);
objSubAcc2
.
put
(
"url"
,
""
);
objSubAcc2
.
put
(
"tipo"
,
3
);
objSubAcc2
.
put
(
"configuracion"
,
0
);
objSubAcc2
.
put
(
"padre"
,
codigoSubCategoria
);
objSubAcc2
.
put
(
"orden"
,
0
);
lista
.
put
(
objSubAcc2
);
}
}
}
}
}
}
}
...
@@ -449,4 +508,42 @@ public class MantenimientoMenuServlet extends HttpServlet {
...
@@ -449,4 +508,42 @@ public class MantenimientoMenuServlet extends HttpServlet {
out
.
print
(
rs
);
out
.
print
(
rs
);
}
}
private
void
listarPermisosPorVista
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
response
.
setContentType
(
"application/json"
);
PrintWriter
out
=
response
.
getWriter
();
MenuService
srv
=
new
MenuService
();
JSONObject
rs
;
int
codigo
=
Integer
.
parseInt
(
request
.
getParameter
(
"codigo"
));
int
jerarquia
=
Integer
.
parseInt
(
request
.
getParameter
(
"jerarquia"
));
JSONObject
json
=
new
JSONObject
().
put
(
"codigo"
,
codigo
).
put
(
"jerarquia"
,
jerarquia
);
rs
=
srv
.
listarPermisosPorVista
(
json
);
out
.
print
(
rs
);
}
public
void
asignarAccionesPorVista
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
response
.
setContentType
(
"application/json"
);
PrintWriter
out
=
response
.
getWriter
();
MenuService
srv
=
new
MenuService
();
JSONObject
rs
;
int
tipo_accion
=
Integer
.
parseInt
(
request
.
getParameter
(
"tipo_accion"
));
int
v_cod_accion
=
Integer
.
parseInt
(
request
.
getParameter
(
"v_cod_accion"
));
String
v_nom_accion
=
request
.
getParameter
(
"v_nom_accion"
);
int
v_jerarquia
=
Integer
.
parseInt
(
request
.
getParameter
(
"v_jerarquia"
));
int
v_cod_proyecto
=
Integer
.
parseInt
(
request
.
getParameter
(
"v_cod_proyecto"
));
int
v_cod_vista
=
Integer
.
parseInt
(
request
.
getParameter
(
"v_cod_vista"
));
int
v_cod_vista_acc
=
Integer
.
parseInt
(
request
.
getParameter
(
"v_cod_vista_acc"
));
int
v_tipo_usuario
=
Integer
.
parseInt
(
request
.
getParameter
(
"v_tipo_usuario"
));
JSONObject
json
=
new
JSONObject
()
.
put
(
"tipo_accion"
,
tipo_accion
)
.
put
(
"v_cod_accion"
,
v_cod_accion
)
.
put
(
"v_nom_accion"
,
v_nom_accion
)
.
put
(
"v_jerarquia"
,
v_jerarquia
)
.
put
(
"v_cod_proyecto"
,
v_cod_proyecto
)
.
put
(
"v_cod_vista"
,
v_cod_vista
)
.
put
(
"v_cod_vista_acc"
,
v_cod_vista_acc
)
.
put
(
"v_tipo_usuario"
,
v_tipo_usuario
);
rs
=
srv
.
asignarAccionesPorVista
(
json
);
out
.
print
(
rs
);
}
}
}
\ No newline at end of file
src/main/webapp/css/general.css
View file @
79fe2d1a
...
@@ -312,6 +312,10 @@ table.display tbody tr:hover td {
...
@@ -312,6 +312,10 @@ table.display tbody tr:hover td {
padding-left
:
15vw
;
padding-left
:
15vw
;
}
}
.supercategoria
{
padding-left
:
20vw
;
}
.modal-header
[
class
*=
bg-
]
{
.modal-header
[
class
*=
bg-
]
{
padding
:
10px
15px
;
padding
:
10px
15px
;
}
}
...
...
src/main/webapp/js/pages/MantenimientoMenu.js
View file @
79fe2d1a
This diff is collapsed.
Click to expand it.
src/main/webapp/js/pages/proyecto.js
View file @
79fe2d1a
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"search"
:
"Filtrar:"
,
"search"
:
"Filtrar:"
,
"loadingRecords"
:
"Cargando..."
,
"loadingRecords"
:
"Cargando..."
,
"processing"
:
'<span style="width:100%;"><img src="http
://www.snacklocal.com/images/ajaxload.gif
"></span>'
,
"processing"
:
'<span style="width:100%;"><img src="http
s://upload.wikimedia.org/wikipedia/commons/7/7a/Ajax_loader_metal_512.gif?20180219130538
"></span>'
,
"scrollY"
:
false
,
"scrollY"
:
false
,
"paginate"
:
{
"paginate"
:
{
"first"
:
"First"
,
"first"
:
"First"
,
...
@@ -683,7 +683,7 @@
...
@@ -683,7 +683,7 @@
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"search"
:
"Filtrar:"
,
"search"
:
"Filtrar:"
,
"loadingRecords"
:
"Cargando..."
,
"loadingRecords"
:
"Cargando..."
,
"processing"
:
'<span style="width:100%;"><img src="http
://www.snacklocal.com/images/ajaxload.gif
"></span>'
,
"processing"
:
'<span style="width:100%;"><img src="http
s://upload.wikimedia.org/wikipedia/commons/7/7a/Ajax_loader_metal_512.gif?20180219130538
"></span>'
,
"scrollY"
:
false
,
"scrollY"
:
false
,
"paginate"
:
{
"paginate"
:
{
"first"
:
"First"
,
"first"
:
"First"
,
...
...
src/main/webapp/js/pages/tipoUsuario.js
View file @
79fe2d1a
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"search"
:
"Filtrar:"
,
"search"
:
"Filtrar:"
,
"loadingRecords"
:
"Cargando..."
,
"loadingRecords"
:
"Cargando..."
,
"processing"
:
'<span style="width:100%;"><img src="http
://www.snacklocal.com/images/ajaxload.gif
"></span>'
,
"processing"
:
'<span style="width:100%;"><img src="http
s://upload.wikimedia.org/wikipedia/commons/7/7a/Ajax_loader_metal_512.gif?20180219130538
"></span>'
,
"scrollY"
:
false
,
"scrollY"
:
false
,
"paginate"
:
{
"paginate"
:
{
"first"
:
"First"
,
"first"
:
"First"
,
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"infoEmpty"
:
" Mostrando 0 de 0 registros"
,
"search"
:
"Filtrar:"
,
"search"
:
"Filtrar:"
,
"loadingRecords"
:
"Cargando..."
,
"loadingRecords"
:
"Cargando..."
,
"processing"
:
'<span style="width:100%;"><img src="http
://www.snacklocal.com/images/ajaxload.gif
"></span>'
,
"processing"
:
'<span style="width:100%;"><img src="http
s://upload.wikimedia.org/wikipedia/commons/7/7a/Ajax_loader_metal_512.gif?20180219130538
"></span>'
,
"scrollY"
:
false
,
"scrollY"
:
false
,
"paginate"
:
{
"paginate"
:
{
"first"
:
"First"
,
"first"
:
"First"
,
...
@@ -980,9 +980,7 @@
...
@@ -980,9 +980,7 @@
}
}
}
}
});
});
listadoAcciones
.
init
(
function
()
{
listadoAcciones
.
init
(
function
()
{
//cargar el combo de acciones
listarCboAcciones
();
listarCboAcciones
();
});
});
}
}
...
...
src/main/webapp/vistas/index.jsp
View file @
79fe2d1a
...
@@ -45,8 +45,11 @@
...
@@ -45,8 +45,11 @@
<div
class=
"translucentMe card-3"
></div>
<div
class=
"translucentMe card-3"
></div>
<div
class=
"contentMe"
>
<div
class=
"contentMe"
>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<div
class=
"icon-object border-white text-white"
><img
src=
"../img/securityIconWhite.png"
alt=
""
style=
"width: 85px; height: 85px;"
></div>
<div
class=
"icon-object border-white text-white"
>
<h5
class=
"content-group text-white"
>
MÓDULO DE SEGURIDAD
<small
class=
"display-block"
style=
"color: white"
>
LOGIN
</small></h5>
<img
src=
"../img/securityIconBlack.png"
alt=
""
style=
"width: 85px; height: 85px;filter: brightness(1000)"
></div>
<h5
class=
"content-group text-white"
>
MÓDULO DE SEGURIDAD
<small
class=
"display-block"
style=
"color: white"
>
LOGIN
</small>
</h5>
</div>
</div>
<div
class=
"form-group has-feedback has-feedback-left"
>
<div
class=
"form-group has-feedback has-feedback-left"
>
...
@@ -125,4 +128,4 @@
...
@@ -125,4 +128,4 @@
})(
window
);
})(
window
);
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/vistas/mantenimientoMenu.jsp
View file @
79fe2d1a
...
@@ -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-->
...
@@ -122,7 +123,7 @@
...
@@ -122,7 +123,7 @@
<div>
<div>
No visibles :
No visibles :
</div>
</div>
<div
style=
"background: #
ffeaea; width: 1rem; height: 1
rem; border: 1px solid black; display: block"
></div>
<div
style=
"background: #
e0f8ff; width: 1.5rem; height: 1.5
rem; border: 1px solid black; display: block"
></div>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -170,7 +171,7 @@
...
@@ -170,7 +171,7 @@
</div>
</div>
<
%@
include
file=
"templates/footer-body.jsp"
%
>
<
%@
include
file=
"templates/footer-body.jsp"
%
>
<script
src=
"../js/lib/jquery-editable-select.min.js"
type=
"text/javascript"
></script>
<script
src=
"../js/pages/MantenimientoMenu.js"
type=
"text/javascript"
></script>
<script
src=
"../js/pages/MantenimientoMenu.js"
type=
"text/javascript"
></script>
<script>
<script>
let
switchery
=
new
Switchery
(
document
.
querySelector
(
'#cbkEstado'
),
{
color
:
'red'
,
secondaryColor
:
'green'
})
let
switchery
=
new
Switchery
(
document
.
querySelector
(
'#cbkEstado'
),
{
color
:
'red'
,
secondaryColor
:
'green'
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment