mirror of
https://github.com/rmontanana/inventario2.git
synced 2025-08-15 23:45:58 +00:00
-Los informes aparecen ahora en la pantalla de la aplicación embebidos.
-Añadido un calendario al pulsar sobre la fecha en la cabecera de la aplicación. -Corregido pequeño problema de margen en resoluciones pequeñas donde se solapaba parte del menú. -Quitados los logos de GPLv3, MySQL y Apache -Inventario.php llama al instalador si la aplicación no está instalada
This commit is contained in:
@@ -149,7 +149,19 @@ class AportaContenido {
|
||||
return "Usuario=$this->usuario";
|
||||
else
|
||||
return '';
|
||||
case 'fecha': return $this->fechaActual();
|
||||
case 'fecha':
|
||||
$script = '<script type="text/javascript">
|
||||
$(function () {
|
||||
$(' . "'#fechaCabecera'" . ").datetimepicker({
|
||||
pick12HourFormat: false,
|
||||
language: 'es',
|
||||
pickTime: false
|
||||
});
|
||||
});
|
||||
</script>";
|
||||
$campo = '<input type="hidden" name="fechaCabecera" id="fechaCabecera" value="'.$this->fechaActual("%d/%m/%Y").'">';
|
||||
$etiqueta = '<label for="fechaCabecera" onClick="$(' . "'#fechaCabecera'" . ").data('DateTimePicker').show();" . '">' . $this->fechaActual() . '</label>';
|
||||
return $etiqueta . $campo . $script;
|
||||
case 'aplicacion': return PROGRAMA." v".VERSION;
|
||||
case 'menu': // el menú
|
||||
if ($this->registrado) {
|
||||
@@ -199,10 +211,14 @@ class AportaContenido {
|
||||
// }
|
||||
list($opcion, $parametro) = explode("&", $this->opcionActual);
|
||||
switch ($opcion) {
|
||||
case 'bienvenido':
|
||||
$mensaje = '<div class="alert alert-success">';
|
||||
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div>';
|
||||
case 'principal': // contenido inicial
|
||||
|
||||
$creditos = "$('#creditos').modal({keyboard: false});";
|
||||
return '<br><br><center><img src="img/logo.png" alt="' . PROGRAMA . '" onClick="' . $creditos . '" >' .
|
||||
'<br><label>' . CENTRO . '</label></center><br><br>' . PIE . CREDITOS;
|
||||
return $mensaje . '<br><br><center><img src="img/logo.png" alt="' . PROGRAMA . '" onClick="' . $creditos . '" >' .
|
||||
'<br><br><label onClick="'.$creditos.'">' . CENTRO . '</label></center><br><br>' . CREDITOS;
|
||||
case 'articulos':
|
||||
case 'ubicaciones':
|
||||
case 'test':
|
||||
@@ -266,12 +282,6 @@ class AportaContenido {
|
||||
} else {
|
||||
return $this->mensajePermisos('Usuarios');
|
||||
}
|
||||
|
||||
case 'bienvenido': // El usuario quiere iniciar sesión
|
||||
$mensaje = '<div class="alert alert-success">';
|
||||
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div><br><br><center><img src="img/codigoBarras.png" alt="' . PROGRAMA . '">' .
|
||||
'<br><label>' . CENTRO . '</label></center><br><br>' . PIE;;
|
||||
return $mensaje;
|
||||
case 'configuracion':
|
||||
if ($this->perfil['Config']) {
|
||||
$conf = new Configuracion();
|
||||
@@ -286,17 +296,17 @@ class AportaContenido {
|
||||
} else {
|
||||
return $this->mensajePermisos('Informes');
|
||||
}
|
||||
case 'descuadres':
|
||||
if ($this->perfil['Informe']) {
|
||||
$enlace = 'xml/informe' . ucfirst($opcion) . '.xml';
|
||||
$informe = new InformePDF($this->bdd, $enlace, $this->registrado);
|
||||
$informe->crea($enlace);
|
||||
$informe->cierraPDF();
|
||||
$informe->imprimeInforme();
|
||||
return;
|
||||
} else {
|
||||
return $this->mensajePermisos('Informes');
|
||||
}
|
||||
// case 'descuadres':
|
||||
// if ($this->perfil['Informe']) {
|
||||
// $enlace = 'xml/informe' . ucfirst($opcion) . '.xml';
|
||||
// $informe = new InformePDF($this->bdd, $enlace, $this->registrado);
|
||||
// $informe->crea($enlace);
|
||||
// $informe->cierraPDF();
|
||||
// $informe->imprimeInforme();
|
||||
// return;
|
||||
// } else {
|
||||
// return $this->mensajePermisos('Informes');
|
||||
// }
|
||||
case 'importacion':
|
||||
if ($this->perfil['Modificacion'] && $this->perfil['Borrado']) {
|
||||
$import = new Importacion($this->bdd, $this->registrado);
|
||||
|
@@ -1,5 +1,10 @@
|
||||
Versión 1.08 07-04-2014
|
||||
-Los informes aparecen ahora en la pantalla de la aplicación embebidos.
|
||||
-Añadido un calendario al pulsar sobre la fecha en la cabecera de la aplicación.
|
||||
-Corregido pequeño problema de margen en resoluciones pequeñas donde se solapaba parte del menú.
|
||||
-Quitados los logos de GPLv3, MySQL y Apache
|
||||
-Inventario.php llama al instalador si la aplicación no está instalada
|
||||
-Añadido dialogo modal de Créditos cuando se pulsa sobre el gráfico de código de barras de la aplicación
|
||||
-Añadido dialogo modal de Créditos cuando se pulsa sobre el gráfico de código de barras de la aplicación o sobre el nombre del centro
|
||||
-Quitados los usuarios de ejemplo en el archivo setup.sql
|
||||
-Creado el programa instalar.php que permitirá configurar el acceso a la base de datos, comprobar la configuración del servidor y la creación del usuario administrador
|
||||
-Añadido un parámetro en el archivo configuracion.inc que permite o no ejecutar el programa instalar.php
|
||||
|
@@ -23,11 +23,13 @@ class InformeInventario {
|
||||
|
||||
private $bdd;
|
||||
|
||||
public function __construct($baseDatos) {
|
||||
public function __construct($baseDatos)
|
||||
{
|
||||
$this->bdd = $baseDatos;
|
||||
}
|
||||
|
||||
public function ejecuta() {
|
||||
public function ejecuta()
|
||||
{
|
||||
$opc = $_GET['opc'];
|
||||
switch ($opc) {
|
||||
case 'Ubicacion':return $this->formularioUbicacion();
|
||||
@@ -35,10 +37,33 @@ class InformeInventario {
|
||||
case 'listarArticulo':return $this->listarArticulo();
|
||||
case 'Articulo':return $this->formularioArticulo();
|
||||
case 'Total':return $this->inventarioTotal();
|
||||
case 'descuadres': return $this->inventarioDescuadres();
|
||||
}
|
||||
}
|
||||
|
||||
private function listarUbicacion() {
|
||||
private function inventarioDescuadres()
|
||||
{
|
||||
$enlace = 'xml/informeDescuadres.xml';
|
||||
$informe = new InformePDF($this->bdd, $enlace, true);
|
||||
$informe->crea($enlace);
|
||||
$informe->cierraPDF();
|
||||
return $this->devuelveInforme($informe);
|
||||
}
|
||||
|
||||
private function devuelveInforme($informe)
|
||||
{
|
||||
$letras = "abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
||||
$nombre = "tmp/informe" . substr(str_shuffle($letras), 0, 10) . ".pdf";
|
||||
$informe->guardaArchivo($nombre);
|
||||
return '<div class="container">
|
||||
<!--<a href="' . $nombre . '" target="_blank"><span class="glyphicon glyphicon-cloud-download" style="font-size:1.5em;"></span>Descargar Informe</a>-->
|
||||
<object data="' . $nombre . '" type="application/pdf" width="100%" height="700" style="float:left;">
|
||||
</object>
|
||||
</div>';
|
||||
}
|
||||
|
||||
private function listarUbicacion()
|
||||
{
|
||||
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
|
||||
switch ($salidaInforme) {
|
||||
case "pantalla":
|
||||
@@ -70,8 +95,9 @@ class InformeInventario {
|
||||
$informe = new InformePDF($this->bdd, $salida, true);
|
||||
$informe->crea($salida);
|
||||
$informe->cierraPDF();
|
||||
$informe->guardaArchivo("tmp/Informe.pdf");
|
||||
echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
|
||||
return $this->devuelveInforme($informe);
|
||||
// $informe->guardaArchivo("tmp/Informe.pdf");
|
||||
// echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
|
||||
break;
|
||||
case "csv":
|
||||
//Genera una hoja de cálculo en formato csv
|
||||
@@ -85,13 +111,15 @@ class InformeInventario {
|
||||
$etiquetas = new EtiquetasPDF($this->bdd, $salida, true);
|
||||
$etiquetas->crea($salida);
|
||||
$etiquetas->cierraPDF();
|
||||
$etiquetas->guardaArchivo("tmp/EtiquetasUbicacion.pdf");
|
||||
echo '<script type="text/javascript"> window.open( "tmp/EtiquetasUbicacion.pdf" ) </script>';
|
||||
return $this->devuelveInforme($etiquetas);
|
||||
// $etiquetas->guardaArchivo("tmp/EtiquetasUbicacion.pdf");
|
||||
// echo '<script type="text/javascript"> window.open( "tmp/EtiquetasUbicacion.pdf" ) </script>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function listarArticulo() {
|
||||
private function listarArticulo()
|
||||
{
|
||||
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
|
||||
switch ($salidaInforme) {
|
||||
case "pantalla":
|
||||
@@ -125,9 +153,9 @@ class InformeInventario {
|
||||
$informe = new InformePDF($this->bdd, $salida, true);
|
||||
$informe->crea($salida);
|
||||
$informe->cierraPDF();
|
||||
$informe->guardaArchivo("tmp/Informe.pdf");
|
||||
echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
|
||||
break;
|
||||
return $this->devuelveInforme($informe);
|
||||
// $informe->guardaArchivo("tmp/Informe.pdf");
|
||||
// echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
|
||||
case "csv":
|
||||
//Genera una hoja de cálculo en formato csv
|
||||
$nombre = "tmp/Articulo" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
|
||||
@@ -140,13 +168,14 @@ class InformeInventario {
|
||||
$etiquetas = new EtiquetasPDF($this->bdd, $salida, true);
|
||||
$etiquetas->crea($salida);
|
||||
$etiquetas->cierraPDF();
|
||||
$etiquetas->guardaArchivo("tmp/EtiquetasArticulo.pdf");
|
||||
echo '<script type="text/javascript"> window.open( "tmp/EtiquetasArticulo.pdf" ) </script>';
|
||||
break;
|
||||
return $this->devuelveInforme($etiquetas);
|
||||
// $etiquetas->guardaArchivo("tmp/EtiquetasArticulo.pdf");
|
||||
// echo '<script type="text/javascript"> window.open( "tmp/EtiquetasArticulo.pdf" ) </script>';
|
||||
}
|
||||
}
|
||||
|
||||
private function listaUbicaciones() {
|
||||
private function listaUbicaciones()
|
||||
{
|
||||
$salida = "<select class=\"selectpicker show-tick\" name=\"id\" data-live-search=\"true\" data-width=\"auto\">\n";
|
||||
$comando = "select * from Ubicaciones order by Descripcion";
|
||||
$resultado = $this->bdd->ejecuta($comando);
|
||||
@@ -160,7 +189,8 @@ class InformeInventario {
|
||||
return $salida;
|
||||
}
|
||||
|
||||
private function listaArticulos() {
|
||||
private function listaArticulos()
|
||||
{
|
||||
$salida = "<select class=\"selectpicker show-tick\" name=\"id\" data-live-search=\"true\" data-width=\"auto\">\n";
|
||||
$comando = "select * from Articulos order by descripcion, marca, modelo";
|
||||
$resultado = $this->bdd->ejecuta($comando);
|
||||
@@ -174,8 +204,9 @@ class InformeInventario {
|
||||
return $salida;
|
||||
}
|
||||
|
||||
private function formulario($accion, $etiqueta, $lista) {
|
||||
$salida ='<div class="col-sm-6 col-md-6"><form name="informeInventario.form" method="post" action="' . $accion . '">' . "\n";
|
||||
private function formulario($accion, $etiqueta, $lista)
|
||||
{
|
||||
$salida = '<div class="col-sm-6 col-md-6"><form name="informeInventario.form" method="post" action="' . $accion . '">' . "\n";
|
||||
$salida.="<fieldset style=\"width: 96%;\"><p><legend style=\"color: red;\"><b>Elige $etiqueta</b></legend>\n";
|
||||
$salida.="<br><br><label>$etiqueta </label>";
|
||||
$salida.=$lista;
|
||||
@@ -190,18 +221,21 @@ class InformeInventario {
|
||||
return $salida;
|
||||
}
|
||||
|
||||
private function formularioUbicacion() {
|
||||
private function formularioUbicacion()
|
||||
{
|
||||
//Genera un formulario con las ubicaciones disponibles.
|
||||
$accion = "index.php?informeInventario&opc=listarUbicacion";
|
||||
return $this->formulario($accion, 'Ubicación', $this->listaUbicaciones());
|
||||
}
|
||||
|
||||
private function formularioArticulo() {
|
||||
private function formularioArticulo()
|
||||
{
|
||||
$accion = "index.php?informeInventario&opc=listarArticulo";
|
||||
return $this->formulario($accion, 'Artículo', $this->listaArticulos());
|
||||
}
|
||||
|
||||
private function inventarioTotal() {
|
||||
private function inventarioTotal()
|
||||
{
|
||||
$fichero = "xml/inventarioUbicacion.xml";
|
||||
$salida = "tmp/inventarioUbicacion.xml";
|
||||
$comando = "select * from Ubicaciones ;";
|
||||
@@ -226,8 +260,10 @@ class InformeInventario {
|
||||
}
|
||||
$nombre = "tmp/total.pdf";
|
||||
$informe->cierraPDF();
|
||||
$informe->imprimeInforme();
|
||||
return $this->devuelveInforme($informe);
|
||||
//$informe->imprimeInforme();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
31
Instalar.php
31
Instalar.php
@@ -284,37 +284,6 @@ class Instalar {
|
||||
//Pasa al paso siguiente
|
||||
return $this->paso2();
|
||||
}
|
||||
/*$conf = new Configuracion();
|
||||
$fichero = $conf->obtieneFichero();
|
||||
$datos = explode("\n", $fichero);
|
||||
if ($grabar) {
|
||||
$fsalida = @fopen(CONFIGTMP, "wb");
|
||||
}
|
||||
foreach ($datos as $linea) {
|
||||
if (stripos($linea, "DEFINE") !== false) {
|
||||
$conf->obtieneDatos($linea, $clave, $valor);
|
||||
if (stripos($campos, $clave) !== false) {
|
||||
if ($grabar) {
|
||||
$linea = str_replace($valor, $_POST[$clave], $linea);
|
||||
$valor = $_POST[$clave];
|
||||
}
|
||||
}
|
||||
$datos[$clave] = $valor;
|
||||
}
|
||||
$registro = substr($linea, 0, 2) == "?>" ? $linea : $linea . "\n";
|
||||
if ($grabar) {
|
||||
fwrite($fsalida, $registro);
|
||||
}
|
||||
}
|
||||
if ($grabar) {
|
||||
fclose($fsalida);
|
||||
unlink(CONFIGURACION);
|
||||
rename(CONFIGTMP, CONFIGURACION);
|
||||
if ($this->validaPaso1()) {
|
||||
//Pasa al paso siguiente
|
||||
return $this->paso2();
|
||||
}
|
||||
}*/
|
||||
|
||||
$info = '<form method="post" name="conf" action="instalar.php?paso=1">';
|
||||
$info .= '<ul class="list-group">';
|
||||
|
@@ -50,9 +50,9 @@ class Inventario {
|
||||
//Conexión con la base de datos.
|
||||
$this->bdd = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS);
|
||||
if ($this->bdd->error()) {
|
||||
|
||||
echo '<h1>Fallo al conectar con el servidor MySQL.</h1>';
|
||||
echo SERVIDOR;
|
||||
echo "Servidor [ " . SERVIDOR . " ] usuario [" . USUARIO . "] clave [" . CLAVE . "] base [" . BASEDATOS . "]";
|
||||
echo "Servidor [ " . SERVIDOR . " ] base de datos [" . BASEDATOS . "]";
|
||||
$this->estado = false;
|
||||
return;
|
||||
} else {
|
||||
@@ -203,7 +203,6 @@ class Inventario {
|
||||
$_SESSION['Perfil'] = $this->perfil;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -33,7 +33,7 @@ display: none;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.sidebar {
|
||||
top: 50px;
|
||||
top: 60px;
|
||||
bottom: 150px;
|
||||
background-color: <?php echo COLORLAT; ?>
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ require_once 'version.inc';
|
||||
|
||||
define('SERVIDOR', 'localhost'); //Ubicación del servidor MySQL
|
||||
define('PUERTO', '3306'); //Puerto donde se conecta a MySQL
|
||||
define('BASEDATOS', 'Inventario'); //Nombre de la base de datos.
|
||||
define('BASEDATOS', 'Inventario2'); //Nombre de la base de datos.
|
||||
define('BASEDATOSTEST', 'Inventario_test'); //Base de datos para los tests.
|
||||
define('USUARIO', 'test'); //Usuario con permisos de lectura/escritura en la base de datos
|
||||
define('CLAVE', 'tset'); //contraseña del usuario.
|
||||
|
@@ -6,8 +6,8 @@
|
||||
1|Inventario|||
|
||||
2|Ubicación|index.php?informeInventario&opc=Ubicacion|_self|Inventario de una ubicación
|
||||
2|Artículo|index.php?informeInventario&opc=Articulo|_self|Inventario de un Artículo
|
||||
2|Total|index.php?informeInventario&opc=Total|_blank|Inventario de todas las ubicaciones
|
||||
2|Descuadres|index.php?descuadres|_blank|Diferencias entre artículos y elementos
|
||||
2|Total|index.php?informeInventario&opc=Total|_self|Inventario de todas las ubicaciones
|
||||
2|Descuadres|index.php?informeInventario&opc=descuadres|_self|Diferencias entre artículos y elementos
|
||||
1|Varios|||
|
||||
2|Configuración|index.php?configuracion|_self|Opciones configurables de la aplicación
|
||||
2|Importación|index.php?importacion&opc=form|_self|Importa datos de una hoja de cálculo
|
||||
|
Reference in New Issue
Block a user