mirror of
https://github.com/rmontanana/inventario2.git
synced 2025-08-16 07:56:00 +00:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
a25e8a6c1a | |||
|
a34058f1c5 | ||
|
91c55fd3f6 | ||
25e0264b27 | |||
f0e76f92b5 | |||
f6fec3bdf3 | |||
336cab29ef | |||
4cf4354dbc | |||
17c907795f | |||
|
a8cad22add | ||
1bfeb891e6 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,2 @@
|
||||
nbproject
|
||||
tmp/*
|
||||
.DS_Store
|
||||
/img.data/
|
@@ -39,9 +39,24 @@ define('CREDITOS', '<div class="modal fade" tabindex="-1" id="creditos" role="di
|
||||
<div class="jumbotron">
|
||||
<img src="img/logo.png" class="img-responsive img-rounded" style="float:left">
|
||||
<h1>Inventario2</h1>
|
||||
<p> Aplicación para controlar el inventario de un centro educativo.</p><br><br><br><br><br><br>
|
||||
<p><small>Copyright (C) 2008-2014 Ricardo Montañana Gómez<br>
|
||||
Esta aplicación se distribuye con licencia <a target="_blank" href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3 </a></small></p>
|
||||
<p> Aplicación para controlar el inventario de un centro educativo.</p>
|
||||
<p>En la aplicación se hace uso de los siguientes módulos y/o bibliotecas</p>
|
||||
<table class="table table-condensed">
|
||||
<thead><tr><th>Biblioteca/Módulo</th><th>Licencia</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><a href="http://getbootstrap.com/" target="_blank">Twitter Bootstrap</a></td><td><a target="_blank" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">MIT</a></td>
|
||||
<tr><td><a href="http://www.fpdf.org/" target="_blank">FPDF</a></td><td>Libre</td>
|
||||
<tr><td><a href="http://phpqrcode.sourceforge.net/" target="_blank">PHP QR Code Enconder</a></td><td><a target="_blank" href="http://www.gnu.org/licenses/lgpl-3.0.txt">LGPL</a></td>
|
||||
<tr><td><a href="http://stefangabos.ro/php-libraries/zebra-image/" target="_blank">Zebra_Image</a></td><td><a target="_blank" href="http://www.gnu.org/licenses/lgpl-3.0.txt">LGPL</a></td>
|
||||
<tr><td><a href="http://jasny.github.io/bootstrap/" target="_blank">Jasny Bootstrap</a></td><td><a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a></td>
|
||||
<tr><td><a href="http://1000hz.github.io/bootstrap-validator/" target="_blank">Bootstrap Validator</a></td><td><a target="_blank" href="https://github.com/1000hz/bootstrap-validator/blob/master/LICENSE">MIT</a></td>
|
||||
<tr><td><a href="https://github.com/tkrotoff/jquery-simplecolorpicker" target="_blank">jquery-simplecolorpicker</a></td><td><a target="_blank" href="https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/LICENSE.txt">MIT</a></td>
|
||||
<tr><td><a href="http://eonasdan.github.io/bootstrap-datetimepicker/" target="_blank">Bootstrap datetimepicker</a></td><td><a target="_blank" href="https://github.com/Eonasdan/bootstrap-datetimepicker/blob/master/src/js/bootstrap-datetimepicker.js">MIT</a></td>
|
||||
<tr><td><a href="http://silviomoreto.github.io/bootstrap-select/" target="_blank">Bootstrap-select</a></td><td><a target="_blank" href="https://github.com/silviomoreto/bootstrap-select">MIT</a></td>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><h5>Copyright © 2008-2014 Ricardo Montañana Gómez</h4>
|
||||
<h5><small>Esta aplicación se distribuye con licencia <a target="_blank" href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3 </a></small></h5></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,7 +101,7 @@ class AportaContenido {
|
||||
* @var array Permisos del usuario
|
||||
*/
|
||||
private $perfil;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array Datos pasados en la URL
|
||||
@@ -102,7 +117,8 @@ class AportaContenido {
|
||||
* @param array $perfil Permisos de acceso del usuario
|
||||
* @param String $opcion Opción elegida por el usuario
|
||||
*/
|
||||
public function __construct($baseDatos, $registrado, $usuario, $perfil, $opcion) {
|
||||
public function __construct($baseDatos, $registrado, $usuario, $perfil, $opcion)
|
||||
{
|
||||
$this->bdd = $baseDatos;
|
||||
$this->miMenu = new Menu('inc/inventario.menu');
|
||||
$this->registrado = $registrado;
|
||||
@@ -117,7 +133,8 @@ class AportaContenido {
|
||||
* @param string $idioma idioma para formatear la fecha, p.ej. es_ES
|
||||
* @return string
|
||||
*/
|
||||
public function fechaActual($formato = '', $idioma = 'es_ES') {
|
||||
public function fechaActual($formato = '', $idioma = 'es_ES')
|
||||
{
|
||||
if ($formato == '')
|
||||
$formato = "%d-%b-%y";
|
||||
setlocale(LC_TIME, $idioma);
|
||||
@@ -128,7 +145,8 @@ class AportaContenido {
|
||||
*
|
||||
* @return string Mensaje el usuario debe registrarse.
|
||||
*/
|
||||
private function mensajeRegistro() {
|
||||
private function mensajeRegistro()
|
||||
{
|
||||
return 'Debe registrarse para acceder a este apartado';
|
||||
}
|
||||
|
||||
@@ -140,16 +158,17 @@ class AportaContenido {
|
||||
* @param string $parametros Parámetros del método
|
||||
* @return string Contenido devuelto por el método
|
||||
*/
|
||||
public function __call($metodo, $parametros) {
|
||||
public function __call($metodo, $parametros)
|
||||
{
|
||||
switch ($metodo) { // Dependiendo del método invocado
|
||||
case 'titulo': // devolvemos el título
|
||||
return PROGRAMA." v".VERSION;
|
||||
return PROGRAMA . " v" . VERSION;
|
||||
case 'usuario':
|
||||
if ($this->registrado)
|
||||
return "Usuario=$this->usuario";
|
||||
else
|
||||
return '';
|
||||
case 'fecha':
|
||||
case 'fecha':
|
||||
$script = '<script type="text/javascript">
|
||||
$(function () {
|
||||
$(' . "'#fechaCabecera'" . ").datetimepicker({
|
||||
@@ -159,10 +178,10 @@ class AportaContenido {
|
||||
});
|
||||
});
|
||||
</script>";
|
||||
$campo = '<input type="hidden" name="fechaCabecera" id="fechaCabecera" value="'.$this->fechaActual("%d/%m/%Y").'">';
|
||||
$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 'aplicacion': return PROGRAMA . " v" . VERSION;
|
||||
case 'menu': // el menú
|
||||
if ($this->registrado) {
|
||||
return $this->miMenu->insertaMenu();
|
||||
@@ -215,15 +234,15 @@ class AportaContenido {
|
||||
$mensaje = '<div class="alert alert-success">';
|
||||
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div>';
|
||||
case 'principal': // contenido inicial
|
||||
|
||||
|
||||
$creditos = "$('#creditos').modal({keyboard: false});";
|
||||
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;
|
||||
'<br><br><label onClick="' . $creditos . '">' . CENTRO . '</label></center><br><br>' . CREDITOS;
|
||||
case 'articulos':
|
||||
case 'ubicaciones':
|
||||
case 'test':
|
||||
case 'elementos':
|
||||
$this->DatosURL();
|
||||
$this->cargaDatosURL();
|
||||
if ($this->datosURL['opc'] == "informe") {
|
||||
if (!$this->pefil['Informe']) {
|
||||
$this->procesaURL();
|
||||
@@ -240,8 +259,7 @@ class AportaContenido {
|
||||
$informe = new InformePDF($this->bdd, $salida, $this->registrado);
|
||||
$informe->crea($salida);
|
||||
$informe->cierraPDF();
|
||||
$informe->imprimeInforme();
|
||||
return;
|
||||
return $this->devuelveInforme($informe);
|
||||
} else {
|
||||
return $this->mensajePermisos("Informes");
|
||||
}
|
||||
@@ -271,8 +289,7 @@ class AportaContenido {
|
||||
$informe = new InformePDF($this->bdd, $salida, $this->registrado);
|
||||
$informe->crea($salida);
|
||||
$informe->cierraPDF();
|
||||
$informe->imprimeInforme();
|
||||
return;
|
||||
return $this->devuelveInforme($informe);
|
||||
} else {
|
||||
return $this->mensajePermisos("Informes");
|
||||
}
|
||||
@@ -296,17 +313,6 @@ 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 'importacion':
|
||||
if ($this->perfil['Modificacion'] && $this->perfil['Borrado']) {
|
||||
$import = new Importacion($this->bdd, $this->registrado);
|
||||
@@ -348,6 +354,7 @@ class AportaContenido {
|
||||
return "Marca {$metodo} queda sin procesar";
|
||||
}
|
||||
}
|
||||
|
||||
public function cargaDatosURL()
|
||||
{
|
||||
$this->datosURL['opc'] = isset($_GET['opc']) ? $_GET['opc'] : 'inicial';
|
||||
@@ -357,16 +364,31 @@ class AportaContenido {
|
||||
$this->datosURL['buscar'] = isset($_GET['buscar']) ? $_GET['buscar'] : null;
|
||||
$this->datosURL['id'] = isset($_GET['id']) ? $_GET['id'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $tipo
|
||||
* @return string
|
||||
*/
|
||||
public function mensajePermisos($tipo) {
|
||||
public function mensajePermisos($tipo)
|
||||
{
|
||||
return $this->panel("ERROR", "No tiene permiso para acceder a $tipo", "danger");
|
||||
}
|
||||
|
||||
public function panel($cabecera, $mensaje, $tipo) {
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
public function panel($cabecera, $mensaje, $tipo)
|
||||
{
|
||||
$panel = '<div class="panel panel-' . $tipo . '"><div class="panel-heading">';
|
||||
$panel .= '<h3 class="panel-title">' . $cabecera . '</h3></div>';
|
||||
$panel .= '<div class="panel-body">';
|
||||
@@ -374,7 +396,6 @@ class AportaContenido {
|
||||
$panel .= '</div>';
|
||||
return $panel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -1,3 +1,12 @@
|
||||
Versión 1.082 09-04-2014
|
||||
-Ahora git tiene en cuenta los directorios tmp e img.data y no tiene en cuenta su contenido
|
||||
-Fix #30. Arreglado el botón de buscar que no enviaba los datos. Cambiado el texto por la lupa.
|
||||
|
||||
Versión 1.081 08-04-2014
|
||||
-Fix #29. Añade el programa instalar.php en el proceso de instalación en README.md
|
||||
-Fix #29. Añadida la tabla de módulos/bibliotecas utilizados en los créditos.
|
||||
-Fix #28. Corrige que el informe pedido desde matenimiento salga en una ventana nueva.
|
||||
|
||||
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.
|
||||
|
@@ -262,7 +262,7 @@ class Mantenimiento {
|
||||
if ($this->perfil['Informe']) {
|
||||
$this->datosURL['opc'] = "informe";
|
||||
$inf = $this->montaURL();
|
||||
$informe = '<a href="' . $inf . '" target="_blank"><img src="img/' . ESTILO . '/informe.png" alt="informe" title="Informe pdf"></a>';
|
||||
$informe = '<a href="' . $inf . '"><img src="img/' . ESTILO . '/informe.png" alt="informe" title="Informe pdf"></a>';
|
||||
} else {
|
||||
$informe = "";
|
||||
}
|
||||
@@ -285,7 +285,7 @@ class Mantenimiento {
|
||||
$valor = isset($this->cadenaBusqueda) ? 'value="' . $this->cadenaBusqueda . '"' : '';
|
||||
$salida = '<form name="busqueda" method="POST"><div class="col-xs-6 col-sm-4 col-md-6 col-lg-6"><div class="input-group">
|
||||
<input type="text" name="buscar" placeholder="Descripción" class="form-control" ' . $valor . '>
|
||||
<span class="input-group-btn"><button class="btn btn-primary" type="button">Buscar</button>
|
||||
<span class="input-group-btn"><button class="btn btn-primary" type="submit"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</span></div></div></form>';
|
||||
$salida .= '<button class="btn btn-info pull-right" type="button">Página <span class="badge">'
|
||||
. $pagina . '</span></button>';
|
||||
|
@@ -38,14 +38,12 @@ Para instalar la aplicación basta con seguir estos pasos:
|
||||
|
||||
grant all on Inventario.* to usuario identified by "contraseña";
|
||||
|
||||
###5. Crear la estructura de la base de datos para poder comenzar a trabajar:
|
||||
###5. Conectarse a la aplicación en la url donde se ha instalado:
|
||||
|
||||
mysql -u usuario --password=contraseña <sql/setup.sql
|
||||
http://<url>
|
||||
|
||||
Con esto queda instalado el programa. Se crean en este proceso dos usuarios:
|
||||
Al hacer esto se arrancará automáticamente el programa de instalación con el que terminaremos de configurar la aplicación.
|
||||
|
||||
Usuario: admin Usuario: demo
|
||||
Contraseña: pruebas Contraseña: pruebas
|
||||
|
||||
##Modelo de datos
|
||||
El modelo de datos que se ha utilizado ha sido:
|
||||
|
5
img.data/.gitignore
vendored
Normal file
5
img.data/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 210 KiB |
@@ -23,5 +23,5 @@
|
||||
*/
|
||||
|
||||
define('AUTOR', 'Ricardo Montañana Gómez');
|
||||
define('VERSION', '1.08');
|
||||
define('VERSION', '1.082');
|
||||
?>
|
||||
|
5
tmp/.gitignore
vendored
Normal file
5
tmp/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
|
Reference in New Issue
Block a user