mirror of
https://github.com/rmontanana/inventario2.git
synced 2025-08-16 16:05:58 +00:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
6829495ca9 | |||
12ff042c1d | |||
37f7e1a6cf | |||
c42fae0514 | |||
0e38e97ff5 | |||
9105f92c26 | |||
1b64dba9b2 | |||
52ddeee4ba | |||
c6bc31a275 | |||
|
f5577a4119 | ||
|
5676f75b97 | ||
c0b0878a74 | |||
9a8ba799c4 | |||
2452d2a9e6 | |||
|
b48b206950 | ||
|
a72ef244cd | ||
cc2129e7d9 | |||
14e5767eb1 |
@@ -210,7 +210,11 @@ class AportaContenido {
|
|||||||
return $salida;
|
return $salida;
|
||||||
}
|
}
|
||||||
case 'opcion':
|
case 'opcion':
|
||||||
list($opcion, $parametro) = explode("&", $this->opcionActual);
|
if (strstr($this->opcionActual, "&")) {
|
||||||
|
list($opcion, $parametro) = explode("&", $this->opcionActual);
|
||||||
|
} else {
|
||||||
|
$opcion = $this->opcionActual; $parametro = "";
|
||||||
|
}
|
||||||
switch ($opcion) {
|
switch ($opcion) {
|
||||||
case 'bienvenido':
|
case 'bienvenido':
|
||||||
return "Menú Principal";
|
return "Menú Principal";
|
||||||
@@ -244,13 +248,19 @@ class AportaContenido {
|
|||||||
// if (!$this->registrado) {
|
// if (!$this->registrado) {
|
||||||
// return $this->mensajeRegistro();
|
// return $this->mensajeRegistro();
|
||||||
// }
|
// }
|
||||||
list($opcion, $parametro) = explode("&", $this->opcionActual);
|
if (strstr($this->opcionActual, "&")) {
|
||||||
|
list($opcion, $parametro) = explode("&", $this->opcionActual);
|
||||||
|
} else {
|
||||||
|
$opcion = $this->opcionActual; $parametro = "";
|
||||||
|
}
|
||||||
switch ($opcion) {
|
switch ($opcion) {
|
||||||
case 'bienvenido':
|
case 'bienvenido':
|
||||||
$mensaje = '<div class="alert alert-success">';
|
$mensaje = '<div class="alert alert-success">';
|
||||||
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div>';
|
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div>';
|
||||||
case 'principal': // contenido inicial
|
case 'principal': // contenido inicial
|
||||||
|
if (!isset($mensaje)) {
|
||||||
|
$mensaje = "";
|
||||||
|
}
|
||||||
$creditos = "$('#creditos').modal({keyboard: false});";
|
$creditos = "$('#creditos').modal({keyboard: false});";
|
||||||
$centro = '<div class="well well-sm">' . CENTRO . '</div>';
|
$centro = '<div class="well well-sm">' . CENTRO . '</div>';
|
||||||
$tabla = $this->creaTablaAcercaDe();
|
$tabla = $this->creaTablaAcercaDe();
|
||||||
@@ -264,7 +274,7 @@ class AportaContenido {
|
|||||||
case 'elementos':
|
case 'elementos':
|
||||||
$this->cargaDatosURL();
|
$this->cargaDatosURL();
|
||||||
if ($this->datosURL['opc'] == "informe") {
|
if ($this->datosURL['opc'] == "informe") {
|
||||||
if (!$this->pefil['Informe']) {
|
if ($this->perfil['Informe']) {
|
||||||
$this->procesaURL();
|
$this->procesaURL();
|
||||||
$fichero = 'xml/informe' . ucfirst($opcion) . '.xml';
|
$fichero = 'xml/informe' . ucfirst($opcion) . '.xml';
|
||||||
$salida = TMP.'/informe' . ucfirst($opcion) . '.xml';
|
$salida = TMP.'/informe' . ucfirst($opcion) . '.xml';
|
||||||
@@ -343,7 +353,7 @@ class AportaContenido {
|
|||||||
case 'copiaseg':
|
case 'copiaseg':
|
||||||
if ($this->perfil['Config']) {
|
if ($this->perfil['Config']) {
|
||||||
$copia = new CopiaSeguridad();
|
$copia = new CopiaSeguridad();
|
||||||
if ($_GET['confirmado'] == "1") {
|
if (isset($_GET['confirmado']) && $_GET['confirmado'] == "1") {
|
||||||
if (!$copia->creaCopia()) {
|
if (!$copia->creaCopia()) {
|
||||||
$tipo = "danger";
|
$tipo = "danger";
|
||||||
$cabecera = "ERROR";
|
$cabecera = "ERROR";
|
||||||
|
12
CHANGELOG
12
CHANGELOG
@@ -1,3 +1,15 @@
|
|||||||
|
Version 1.17 29-07-2014
|
||||||
|
-Eliminados los mensajes de aviso de php en todos los archivos php
|
||||||
|
|
||||||
|
Versión 1.16 28-07-2014
|
||||||
|
-Fix #41. Arregla las llamadas a Instalar.php que se hacían desde Inventario.php y desde Instalar.php
|
||||||
|
|
||||||
|
Versión 1.15 29-06-2014
|
||||||
|
-Crear la opción de clonar registro en Mantenimiento.
|
||||||
|
-Crear iconos de clonado en todos los estilos.
|
||||||
|
-Corregido determinaAccion en Imagen para aceptar el clonado
|
||||||
|
-Corregido codificación/decodificación de la cadena de búsqueda en la URL
|
||||||
|
|
||||||
Versión 1.14.1 02-06-2014
|
Versión 1.14.1 02-06-2014
|
||||||
-Añadidos enlaces a manual y a aplicación de ejemplo en readme.md
|
-Añadidos enlaces a manual y a aplicación de ejemplo en readme.md
|
||||||
-Arreglado que los créditos salgan centrados en lugar de alineados a la derecha
|
-Arreglado que los créditos salgan centrados en lugar de alineados a la derecha
|
||||||
|
@@ -82,7 +82,7 @@ class Configuracion {
|
|||||||
fwrite($fsalida, $registro);
|
fwrite($fsalida, $registro);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$salida.=$this->formulario();
|
$salida = $this->formulario();
|
||||||
if ($grabar) {
|
if ($grabar) {
|
||||||
$salida.='<div class="alert alert-success">Configuración guardada correctamente</div>';
|
$salida.='<div class="alert alert-success">Configuración guardada correctamente</div>';
|
||||||
fclose($fsalida);
|
fclose($fsalida);
|
||||||
|
@@ -23,10 +23,6 @@ class CopiaSeguridad {
|
|||||||
private $baseDatos;
|
private $baseDatos;
|
||||||
private $imagenes;
|
private $imagenes;
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$opcion = $_GET['opc'];
|
|
||||||
}
|
|
||||||
public function creaCopia()
|
public function creaCopia()
|
||||||
{
|
{
|
||||||
if (!$this->copiaBaseDatos()) {
|
if (!$this->copiaBaseDatos()) {
|
||||||
|
69
Csv.php
69
Csv.php
@@ -76,7 +76,8 @@ class Csv {
|
|||||||
* Constructor de la clase.
|
* Constructor de la clase.
|
||||||
* @param BaseDatos $baseDatos Manejador de la base de datos
|
* @param BaseDatos $baseDatos Manejador de la base de datos
|
||||||
*/
|
*/
|
||||||
public function __construct($baseDatos) {
|
public function __construct($baseDatos)
|
||||||
|
{
|
||||||
$this->bdd = $baseDatos;
|
$this->bdd = $baseDatos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +85,8 @@ class Csv {
|
|||||||
* Crea un fichero csv con el nombre especificado
|
* Crea un fichero csv con el nombre especificado
|
||||||
* @param String $fichero Nombre del fichero
|
* @param String $fichero Nombre del fichero
|
||||||
*/
|
*/
|
||||||
public function crea($fichero) {
|
public function crea($fichero)
|
||||||
|
{
|
||||||
$this->nombre = $fichero;
|
$this->nombre = $fichero;
|
||||||
$this->fichero = fopen($this->nombre, "w") or die("No puedo abrir " . $this->nombre . " para escritura.");
|
$this->fichero = fopen($this->nombre, "w") or die("No puedo abrir " . $this->nombre . " para escritura.");
|
||||||
}
|
}
|
||||||
@@ -93,15 +95,18 @@ class Csv {
|
|||||||
*
|
*
|
||||||
* @param array $datos escribe la línea en el archivo
|
* @param array $datos escribe la línea en el archivo
|
||||||
*/
|
*/
|
||||||
public function escribeLinea($datos) {
|
public function escribeLinea($datos)
|
||||||
|
{
|
||||||
fputcsv($this->fichero, $datos, ',', '"') or die("No puedo escribir en el fichero csv");
|
fputcsv($this->fichero, $datos, ',', '"') or die("No puedo escribir en el fichero csv");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct()
|
||||||
|
{
|
||||||
$this->cierra();
|
$this->cierra();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cierra() {
|
public function cierra()
|
||||||
|
{
|
||||||
fclose($this->fichero) or die("No puedo cerrar el archivo csv");
|
fclose($this->fichero) or die("No puedo cerrar el archivo csv");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +114,8 @@ class Csv {
|
|||||||
*
|
*
|
||||||
* @param String $fichero Archivo xml que contiene la definición de la consulta
|
* @param String $fichero Archivo xml que contiene la definición de la consulta
|
||||||
*/
|
*/
|
||||||
public function ejecutaConsulta($fichero) {
|
public function ejecutaConsulta($fichero)
|
||||||
|
{
|
||||||
$consulta = simplexml_load_file($fichero) or die("No puedo cargar el fichero xml " . $fichero . " al csv");
|
$consulta = simplexml_load_file($fichero) or die("No puedo cargar el fichero xml " . $fichero . " al csv");
|
||||||
// Escribe la cabecera del fichero
|
// Escribe la cabecera del fichero
|
||||||
$this->escribeLinea(array($consulta->Pagina->Cabecera, $consulta->Titulo['id'], $consulta->Titulo['Texto']));
|
$this->escribeLinea(array($consulta->Pagina->Cabecera, $consulta->Titulo['id'], $consulta->Titulo['Texto']));
|
||||||
@@ -132,7 +138,8 @@ class Csv {
|
|||||||
*
|
*
|
||||||
* @param String $ficheroCSV Nombre del archivo csv
|
* @param String $ficheroCSV Nombre del archivo csv
|
||||||
*/
|
*/
|
||||||
public function cargaCSV($ficheroCSV) {
|
public function cargaCSV($ficheroCSV)
|
||||||
|
{
|
||||||
$this->nombre = $ficheroCSV;
|
$this->nombre = $ficheroCSV;
|
||||||
$this->fichero = fopen($this->nombre, "r") or die('No puedo abrir el archivo ' . $this->nombre . " para lectura.");
|
$this->fichero = fopen($this->nombre, "r") or die('No puedo abrir el archivo ' . $this->nombre . " para lectura.");
|
||||||
list($archivo, $idCabecera, $cabecera) = fgetcsv($this->fichero);
|
list($archivo, $idCabecera, $cabecera) = fgetcsv($this->fichero);
|
||||||
@@ -149,7 +156,8 @@ class Csv {
|
|||||||
* Muestra un resumen de los datos del fichero csv cargado por pantalla
|
* Muestra un resumen de los datos del fichero csv cargado por pantalla
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function resumen() {
|
public function resumen()
|
||||||
|
{
|
||||||
//$mensaje .=
|
//$mensaje .=
|
||||||
$mensaje = "<center><h1>Archivo [inventario" . $this->cabecera[0] . "]</h1>";
|
$mensaje = "<center><h1>Archivo [inventario" . $this->cabecera[0] . "]</h1>";
|
||||||
$mensaje .= "<h2>id=[" . $this->cabecera[1] . "] Descripción=[" . $this->cabecera[2] . "]</h2><br>";
|
$mensaje .= "<h2>id=[" . $this->cabecera[1] . "] Descripción=[" . $this->cabecera[2] . "]</h2><br>";
|
||||||
@@ -211,12 +219,14 @@ class Csv {
|
|||||||
* @param $array línea de datos del fichero csv para comprobar las cantidades si se han modificado o no
|
* @param $array línea de datos del fichero csv para comprobar las cantidades si se han modificado o no
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function compruebaCantidades($i) {
|
private function compruebaCantidades($i)
|
||||||
$ultimo = count($datos);
|
{
|
||||||
|
//$ultimo = count($datos);
|
||||||
return $this->datosFichero[$i][$this->cantidadReal] - $this->datosFichero[$i][$this->cantidad];
|
return $this->datosFichero[$i][$this->cantidadReal] - $this->datosFichero[$i][$this->cantidad];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function panelMensaje($info, $tipo = "danger", $cabecera = "¡Atención!") {
|
private function panelMensaje($info, $tipo = "danger", $cabecera = "¡Atención!")
|
||||||
|
{
|
||||||
$mensaje = '<div class="panel panel-' . $tipo . '"><div class="panel-heading">';
|
$mensaje = '<div class="panel panel-' . $tipo . '"><div class="panel-heading">';
|
||||||
$mensaje .= '<h3 class="panel-title">' . $cabecera . '</h3></div>';
|
$mensaje .= '<h3 class="panel-title">' . $cabecera . '</h3></div>';
|
||||||
$mensaje .= '<div class="panel-body">';
|
$mensaje .= '<div class="panel-body">';
|
||||||
@@ -226,36 +236,40 @@ class Csv {
|
|||||||
return $mensaje;
|
return $mensaje;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function escribeLog($comando) {
|
private function escribeLog($comando)
|
||||||
$fp = fopen($this->nombre.".log", "a");
|
{
|
||||||
$linea = strftime("%Y/%m/%d")."|".$this->nombre."|".$comando;
|
$fp = fopen($this->nombre . ".log", "a");
|
||||||
|
$linea = strftime("%Y/%m/%d") . "|" . $this->nombre . "|" . $comando;
|
||||||
fputs($fp, $linea . "\n");
|
fputs($fp, $linea . "\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function bajaElemento($i) {
|
private function bajaElemento($i)
|
||||||
|
{
|
||||||
$id = $this->datosFichero[$i][$this->idElemento];
|
$id = $this->datosFichero[$i][$this->idElemento];
|
||||||
$comando = 'delete from Elementos where id="' . $id . '";';
|
$comando = 'delete from Elementos where id="' . $id . '";';
|
||||||
$this->escribeLog($comando);
|
$this->escribeLog($comando);
|
||||||
if (!$this->bdd->ejecuta($comando)) {
|
if (!$this->bdd->ejecuta($comando)) {
|
||||||
throw new Exception("Baja-".$this->bdd->mensajeError, $this->bdd->error);
|
throw new Exception("Baja-" . $this->bdd->mensajeError, $this->bdd->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function modificaElemento($i) {
|
private function modificaElemento($i)
|
||||||
|
{
|
||||||
$id = $this->datosFichero[$i][$this->idElemento];
|
$id = $this->datosFichero[$i][$this->idElemento];
|
||||||
$comando = 'update Elementos set Cantidad=' . $this->datosFichero[$i][$this->cantidadReal] . ' where id="' . $id . '";';
|
$comando = 'update Elementos set Cantidad=' . $this->datosFichero[$i][$this->cantidadReal] . ' where id="' . $id . '";';
|
||||||
$this->escribeLog($comando);
|
$this->escribeLog($comando);
|
||||||
if (!$this->bdd->ejecuta($comando)) {
|
if (!$this->bdd->ejecuta($comando)) {
|
||||||
throw new Exception("Modifica-".$this->bdd->mensajeError, $this->bdd->error);
|
throw new Exception("Modifica-" . $this->bdd->mensajeError, $this->bdd->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function altaElemento($i) {
|
private function altaElemento($i)
|
||||||
|
{
|
||||||
if ($this->cabecera[0] == "Articulo") {
|
if ($this->cabecera[0] == "Articulo") {
|
||||||
$idUbicacion = $this->datosFichero[$i][$this->idUbicacion];
|
$idUbicacion = $this->datosFichero[$i][$this->idUbicacion];
|
||||||
$idArticulo = $this->cabecera[1];
|
$idArticulo = $this->cabecera[1];
|
||||||
$comando = 'select id from Ubicaciones where Descripcion="'.$this->datosFichero[$i][$this->desUbicacion].'";';
|
$comando = 'select id from Ubicaciones where Descripcion="' . $this->datosFichero[$i][$this->desUbicacion] . '";';
|
||||||
} else {
|
} else {
|
||||||
$idUbicacion = $this->cabecera[1];
|
$idUbicacion = $this->cabecera[1];
|
||||||
$idArticulo = $this->datosFichero[$i][$this->idArticulo];
|
$idArticulo = $this->datosFichero[$i][$this->idArticulo];
|
||||||
@@ -265,11 +279,12 @@ class Csv {
|
|||||||
$comando .= '",' . $this->datosFichero[$i][$this->cantidadReal] . ',"' . $this->datosFichero[$i][$this->fechaCompra] . '");';
|
$comando .= '",' . $this->datosFichero[$i][$this->cantidadReal] . ',"' . $this->datosFichero[$i][$this->fechaCompra] . '");';
|
||||||
$this->escribeLog($comando);
|
$this->escribeLog($comando);
|
||||||
if (!$this->bdd->ejecuta($comando)) {
|
if (!$this->bdd->ejecuta($comando)) {
|
||||||
throw new Exception("Alta-".$this->bdd->mensajeError, $this->bdd->error);
|
throw new Exception("Alta-" . $this->bdd->mensajeError, $this->bdd->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function cargaIndices($campos) {
|
private function cargaIndices($campos)
|
||||||
|
{
|
||||||
for ($i = 0; $i < count($campos); $i++) {
|
for ($i = 0; $i < count($campos); $i++) {
|
||||||
switch ($campos[$i]) {
|
switch ($campos[$i]) {
|
||||||
case "Cant. Real": $this->cantidadReal = $i;
|
case "Cant. Real": $this->cantidadReal = $i;
|
||||||
@@ -295,7 +310,8 @@ class Csv {
|
|||||||
/**
|
/**
|
||||||
* Procesa contra la base de datos todas las acciones del archivo
|
* Procesa contra la base de datos todas las acciones del archivo
|
||||||
*/
|
*/
|
||||||
public function ejecutaFichero() {
|
public function ejecutaFichero()
|
||||||
|
{
|
||||||
$this->cargaIndices($this->datosFichero[0]);
|
$this->cargaIndices($this->datosFichero[0]);
|
||||||
//Realiza una transacción para que no se ejecute parcialmente una actualización
|
//Realiza una transacción para que no se ejecute parcialmente una actualización
|
||||||
try {
|
try {
|
||||||
@@ -322,7 +338,7 @@ class Csv {
|
|||||||
}
|
}
|
||||||
$mensaje = "Se han procesado correctamente $acciones acciones en la Base de Datos.";
|
$mensaje = "Se han procesado correctamente $acciones acciones en la Base de Datos.";
|
||||||
$this->bdd->confirmaTransaccion();
|
$this->bdd->confirmaTransaccion();
|
||||||
return $this->panelMensaje($mensaje,"success", "Información");
|
return $this->panelMensaje($mensaje, "success", "Información");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->bdd->abortaTransaccion();
|
$this->bdd->abortaTransaccion();
|
||||||
$mensaje = "Se ha producido el error [" . $e->getMessage() . "]<br>NO se ha realizado ningún cambio en la Base de Datos.";
|
$mensaje = "Se ha producido el error [" . $e->getMessage() . "]<br>NO se ha realizado ningún cambio en la Base de Datos.";
|
||||||
@@ -330,7 +346,8 @@ class Csv {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function ejecutaFichero2() {
|
private function ejecutaFichero2()
|
||||||
|
{
|
||||||
echo '<script>visualizaProgreso();</script>';
|
echo '<script>visualizaProgreso();</script>';
|
||||||
for ($i = 1; $i < 80; $i++) {
|
for ($i = 1; $i < 80; $i++) {
|
||||||
//sleep(1);
|
//sleep(1);
|
||||||
|
15
Imagen.php
15
Imagen.php
@@ -29,6 +29,7 @@ class Imagen {
|
|||||||
public $archivoComprimido;
|
public $archivoComprimido;
|
||||||
private $extension;
|
private $extension;
|
||||||
private $dirData;
|
private $dirData;
|
||||||
|
public $archivoCopiado;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -39,7 +40,7 @@ class Imagen {
|
|||||||
{
|
{
|
||||||
if (isset($_POST[$campo]) && $_POST[$campo] == "") {
|
if (isset($_POST[$campo]) && $_POST[$campo] == "") {
|
||||||
return HAYQUEBORRAR; //Hay que borrar el archivo de imagen
|
return HAYQUEBORRAR; //Hay que borrar el archivo de imagen
|
||||||
} elseif ($_FILES[$campo]['error'] == 0) {
|
} elseif (isset($_FILES[$campo]['error']) && $_FILES[$campo]['error'] == 0) {
|
||||||
return HAYQUEGRABAR; //Hay que guardar el archivo de imagen enviado
|
return HAYQUEGRABAR; //Hay que guardar el archivo de imagen enviado
|
||||||
} else {
|
} else {
|
||||||
return NOHACERNADA; //No hay que hacer nada
|
return NOHACERNADA; //No hay que hacer nada
|
||||||
@@ -111,6 +112,18 @@ class Imagen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public function copiaImagenId($valorImagen, $tabla, $id, &$mensaje)
|
||||||
|
{
|
||||||
|
$extension = strrchr($valorImagen, ".");
|
||||||
|
$nombre = $this->dirData . "/" . $tabla . "_" . $id . $extension;
|
||||||
|
if (!@copy($valorImagen, $nombre)) {
|
||||||
|
$errors= error_get_last();
|
||||||
|
$mensaje = "No pudo copiar el archivo " . $valorImagen . " en " . $nombre . " Error = [" . $errors['message'] . "]";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$this->archivoCopiado = $nombre;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function mueveImagenId($tabla, $id, &$mensaje)
|
public function mueveImagenId($tabla, $id, &$mensaje)
|
||||||
{
|
{
|
||||||
|
@@ -55,6 +55,7 @@ class Importacion {
|
|||||||
|
|
||||||
private function formulario() {
|
private function formulario() {
|
||||||
$accion = "index.php?importacion&opc=importar";
|
$accion = "index.php?importacion&opc=importar";
|
||||||
|
$salida = "";
|
||||||
//$salida .= '<script type="text/javascript" src="css/bootstrap-filestyle.min.js"> </script>';
|
//$salida .= '<script type="text/javascript" src="css/bootstrap-filestyle.min.js"> </script>';
|
||||||
$salida .='<div class="col-sm-6 col-md-6">';
|
$salida .='<div class="col-sm-6 col-md-6">';
|
||||||
$salida .= '<form enctype="multipart/form-data" name="importacion.form" method="post" action="' . $accion . '">' . "\n";
|
$salida .= '<form enctype="multipart/form-data" name="importacion.form" method="post" action="' . $accion . '">' . "\n";
|
||||||
|
12
Instalar.php
12
Instalar.php
@@ -149,7 +149,7 @@ class Instalar {
|
|||||||
|
|
||||||
// Final del paso
|
// Final del paso
|
||||||
$info .='</ul>';
|
$info .='</ul>';
|
||||||
$info .= $this->validaPaso0() ? $this->retornaBoton(false, "instalar.php?paso=1") : $this->retornaBoton(true, "instalar.php");
|
$info .= $this->validaPaso0() ? $this->retornaBoton(false, "Instalar.php?paso=1") : $this->retornaBoton(true, "Instalar.php");
|
||||||
$panel = $this->panelMensaje($info, 'primary', 'PASO 1: Configuración del servidor y la aplicación');
|
$panel = $this->panelMensaje($info, 'primary', 'PASO 1: Configuración del servidor y la aplicación');
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ class Instalar {
|
|||||||
return $this->paso2();
|
return $this->paso2();
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = '<form method="post" name="conf" action="instalar.php?paso=1">';
|
$info = '<form method="post" name="conf" action="Instalar.php?paso=1">';
|
||||||
$info .= '<ul class="list-group">';
|
$info .= '<ul class="list-group">';
|
||||||
$info .= '<li class="list-group-item list-group-item-info">Datos de configuración</li>';
|
$info .= '<li class="list-group-item list-group-item-info">Datos de configuración</li>';
|
||||||
$info .= '<li class="list-group-item">Servidor <input type="text" name="SERVIDOR" class="form-control" placeholder="Nombre del servidor o dirección IP" value="'. $datos['SERVIDOR'] .'"></li>';
|
$info .= '<li class="list-group-item">Servidor <input type="text" name="SERVIDOR" class="form-control" placeholder="Nombre del servidor o dirección IP" value="'. $datos['SERVIDOR'] .'"></li>';
|
||||||
@@ -293,8 +293,8 @@ class Instalar {
|
|||||||
$info .= '<li class="list-group-item">Usuario <input type="text" name="USUARIO" class="form-control" placeholder="Usuario" value="'. $datos['USUARIO'] .'"></li>';
|
$info .= '<li class="list-group-item">Usuario <input type="text" name="USUARIO" class="form-control" placeholder="Usuario" value="'. $datos['USUARIO'] .'"></li>';
|
||||||
$info .= '<li class="list-group-item">Contraseña <input type="text" name="CLAVE" class="form-control" placeholder="Contraseña" value="'. $datos['CLAVE'] .'"></li>';
|
$info .= '<li class="list-group-item">Contraseña <input type="text" name="CLAVE" class="form-control" placeholder="Contraseña" value="'. $datos['CLAVE'] .'"></li>';
|
||||||
$info .= '</ul>';
|
$info .= '</ul>';
|
||||||
$info .= $this->botonVolver("instalar.php");
|
$info .= $this->botonVolver("Instalar.php");
|
||||||
$info .= $this->validaPaso1() ? $this->retornaBoton(false, "instalar.php?paso=1", false) : $this->retornaBoton(true, "instalar.php?paso=1", false);
|
$info .= $this->validaPaso1() ? $this->retornaBoton(false, "Instalar.php?paso=1", false) : $this->retornaBoton(true, "Instalar.php?paso=1", false);
|
||||||
$info .= '</form>';
|
$info .= '</form>';
|
||||||
$panel = $this->panelMensaje($info, 'primary', 'PASO 2: Configuración de la Base de Datos.');
|
$panel = $this->panelMensaje($info, 'primary', 'PASO 2: Configuración de la Base de Datos.');
|
||||||
return $panel;
|
return $panel;
|
||||||
@@ -415,7 +415,7 @@ class Instalar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$info = '
|
$info = '
|
||||||
<form data-toggle="validator" role="form" class="form-horizontal" method="post" action="instalar.php?paso=2">
|
<form data-toggle="validator" role="form" class="form-horizontal" method="post" action="Instalar.php?paso=2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="usuario" class="control-label col-sm-2">Usuario</label>
|
<label for="usuario" class="control-label col-sm-2">Usuario</label>
|
||||||
<div class="form-group col-sm-10">
|
<div class="form-group col-sm-10">
|
||||||
@@ -435,7 +435,7 @@ class Instalar {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-12">
|
<div class="form-group col-sm-12">
|
||||||
' . $this->botonVolver("instalar.php?paso=1") . '
|
' . $this->botonVolver("Instalar.php?paso=1") . '
|
||||||
<button type="submit" class="btn btn-primary pull-right btn-lg" disabled="disabled">Crear base de datos y usuario <span class="glyphicon glyphicon-arrow-right"></button>
|
<button type="submit" class="btn btn-primary pull-right btn-lg" disabled="disabled">Crear base de datos y usuario <span class="glyphicon glyphicon-arrow-right"></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -42,7 +42,7 @@ class Inventario {
|
|||||||
$this->opcActual = $_SERVER['QUERY_STRING'] == '' ? 'principal' : $_SERVER['QUERY_STRING'];
|
$this->opcActual = $_SERVER['QUERY_STRING'] == '' ? 'principal' : $_SERVER['QUERY_STRING'];
|
||||||
//Si el programa no está instalado, llama al instalador.
|
//Si el programa no está instalado, llama al instalador.
|
||||||
if (INSTALADO == "no") {
|
if (INSTALADO == "no") {
|
||||||
header('location: instalar.php');
|
header('location: Instalar.php');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Iniciamos una sesión
|
// Iniciamos una sesión
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
define('EDICION', 'Edición');
|
define('EDICION', 'Edición');
|
||||||
define('BORRADO', '<i>Borrado</i>');
|
define('BORRADO', '<i>Borrado</i>');
|
||||||
define('ANADIR', 'Inserción');
|
define('ANADIR', 'Inserción');
|
||||||
|
define('CLONAR', 'Clonar');
|
||||||
|
|
||||||
class Mantenimiento {
|
class Mantenimiento {
|
||||||
|
|
||||||
@@ -91,7 +92,10 @@ class Mantenimiento {
|
|||||||
$sentido = "&sentido=" . $this->datosURL['sentido'];
|
$sentido = "&sentido=" . $this->datosURL['sentido'];
|
||||||
$pag = "&pag=" . $this->datosURL['pag'];
|
$pag = "&pag=" . $this->datosURL['pag'];
|
||||||
//Ahora los datos opcionales
|
//Ahora los datos opcionales
|
||||||
$buscar = isset($this->cadenaBusqueda) ? "&buscar=$this->cadenaBusqueda" : null;
|
//$buscar = isset($this->cadenaBusqueda) ? '&buscar="'.$this->cadenaBusqueda.'"' : null;
|
||||||
|
//$buscar = isset($this->cadenaBusqueda) ? "&buscar='$this->cadenaBusqueda'" : null;
|
||||||
|
//$buscar = isset($this->cadenaBusqueda) ? "&buscar=$this->cadenaBusqueda" : null;
|
||||||
|
$buscar = isset($this->cadenaBusqueda) ? "&buscar=" . urlencode($this->cadenaBusqueda) : null;
|
||||||
$id = isset($this->datosURL['id']) ? "&id=" . $this->datosURL['id'] : null;
|
$id = isset($this->datosURL['id']) ? "&id=" . $this->datosURL['id'] : null;
|
||||||
$enlace = $this->url . $opc . $orden . $sentido . $pag . $buscar . $id;
|
$enlace = $this->url . $opc . $orden . $sentido . $pag . $buscar . $id;
|
||||||
return $enlace;
|
return $enlace;
|
||||||
@@ -109,10 +113,15 @@ class Mantenimiento {
|
|||||||
case 'insertar':return $this->insertar();
|
case 'insertar':return $this->insertar();
|
||||||
case 'modificar':return $this->modificar();
|
case 'modificar':return $this->modificar();
|
||||||
case 'borrar':return $this->borrar();
|
case 'borrar':return $this->borrar();
|
||||||
|
case 'clonar': return $this->muestra(CLONAR);
|
||||||
default: return "La clase Mantenimiento No entiende lo solicitado [" . $this->datosURL['opc'] . "]";
|
default: return "La clase Mantenimiento No entiende lo solicitado [" . $this->datosURL['opc'] . "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function clonar()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
protected function obtieneClavesForaneas()
|
protected function obtieneClavesForaneas()
|
||||||
{
|
{
|
||||||
$salida = null;
|
$salida = null;
|
||||||
@@ -146,7 +155,7 @@ class Mantenimiento {
|
|||||||
$cabecera = $this->cabeceraTabla();
|
$cabecera = $this->cabeceraTabla();
|
||||||
//Trata con la cadena de búsqueda si viene del post debe quedarse con ella sino con la del get y si no está definida => vacía
|
//Trata con la cadena de búsqueda si viene del post debe quedarse con ella sino con la del get y si no está definida => vacía
|
||||||
if (isset($this->cadenaBusqueda) && strlen($this->cadenaBusqueda)) {
|
if (isset($this->cadenaBusqueda) && strlen($this->cadenaBusqueda)) {
|
||||||
$sufijo = " where $this->campoBusca like '%" . $this->bdd->filtra($this->cadenaBusqueda) . "%'";
|
$sufijo = " where $this->campoBusca like '%" . $this->bdd->filtra(urldecode($this->cadenaBusqueda)) . "%'";
|
||||||
$comando = str_replace('{buscar}', $sufijo, $this->comandoConsulta);
|
$comando = str_replace('{buscar}', $sufijo, $this->comandoConsulta);
|
||||||
} else {
|
} else {
|
||||||
$comando = str_replace('{buscar}', '', $this->comandoConsulta);
|
$comando = str_replace('{buscar}', '', $this->comandoConsulta);
|
||||||
@@ -191,6 +200,7 @@ class Mantenimiento {
|
|||||||
}
|
}
|
||||||
//$salida.=$comando;
|
//$salida.=$comando;
|
||||||
//$salida.=var_export($this->campos,true);
|
//$salida.=var_export($this->campos,true);
|
||||||
|
$cant = 0;
|
||||||
while ($fila = $this->bdd->procesaResultado()) {
|
while ($fila = $this->bdd->procesaResultado()) {
|
||||||
$salida.='<tr bottom="middle">';
|
$salida.='<tr bottom="middle">';
|
||||||
foreach ($fila as $clave => $valor) {
|
foreach ($fila as $clave => $valor) {
|
||||||
@@ -209,7 +219,7 @@ class Mantenimiento {
|
|||||||
$datoEnlace = $tmpco[1];
|
$datoEnlace = $tmpco[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->campoBusca = $dato[1];
|
$this->campoBusca = isset($dato[1]) ? $dato[1] : "";
|
||||||
$valor = '<a title="Inventario de ' . $valor . '" $target="_blank" href="index.php?informeInventario&opc=listar' . $datoEnlace . '&id=' . $id . '">' . $valor;
|
$valor = '<a title="Inventario de ' . $valor . '" $target="_blank" href="index.php?informeInventario&opc=listar' . $datoEnlace . '&id=' . $id . '">' . $valor;
|
||||||
}
|
}
|
||||||
if (strstr($this->campos[$clave]['Comment'], "imagen") && isset($valor)) {
|
if (strstr($this->campos[$clave]['Comment'], "imagen") && isset($valor)) {
|
||||||
@@ -244,6 +254,18 @@ class Mantenimiento {
|
|||||||
}
|
}
|
||||||
//Añade los botones de acciones
|
//Añade los botones de acciones
|
||||||
$salida .= '<td align="center">';
|
$salida .= '<td align="center">';
|
||||||
|
//Añade el icono de clonar
|
||||||
|
if ($this->perfil['Alta']) {
|
||||||
|
//$salida.='<a href="index.php?' . $tabla . '&opc=editar&id=' . $id . "&pag=" . $pagina . $sufijoOrden . $sufijoEnlace .
|
||||||
|
$this->backupURL(); $this->datosURL['opc'] = "clonar"; $this->datosURL['id'] = $id;
|
||||||
|
if (ESTILO == 'bootstrap') {
|
||||||
|
$salida.='<a href="'.$this->montaURL() . '" title="Clonar"><span class="glyphicon glyphicon-copyright-mark"></span></a> ';
|
||||||
|
} else {
|
||||||
|
$salida.='<a href="' . $this->montaURL() .
|
||||||
|
'"><img title="Clonar" src="img/' . ESTILO . '/clonar.png" alt="clonar"></a> ';
|
||||||
|
}
|
||||||
|
$this->restoreURL();
|
||||||
|
}
|
||||||
//Añade el icono de editar
|
//Añade el icono de editar
|
||||||
if ($this->perfil['Modificacion']) {
|
if ($this->perfil['Modificacion']) {
|
||||||
//$salida.='<a href="index.php?' . $tabla . '&opc=editar&id=' . $id . "&pag=" . $pagina . $sufijoOrden . $sufijoEnlace .
|
//$salida.='<a href="index.php?' . $tabla . '&opc=editar&id=' . $id . "&pag=" . $pagina . $sufijoOrden . $sufijoEnlace .
|
||||||
@@ -323,11 +345,13 @@ class Mantenimiento {
|
|||||||
$informe = "";
|
$informe = "";
|
||||||
}
|
}
|
||||||
$this->restoreURL();
|
$this->restoreURL();
|
||||||
|
} else {
|
||||||
|
$anterior = $rew = $az = $informe = $za = $siguiente = $fwd = "";
|
||||||
}
|
}
|
||||||
if ($this->perfil['Alta']) {
|
if ($this->perfil['Alta']) {
|
||||||
$this->datosURL['opc'] = 'nuevo';
|
$this->datosURL['opc'] = 'nuevo';
|
||||||
if (ESTILO == 'bootstrap') {
|
if (ESTILO == 'bootstrap') {
|
||||||
$anadir = '<button type="button" class="btn btn-default btn-lg" title="Añade '.$this->tabla.'" onClick="location.href='."'".$this->montaURL()."'".'"><span class="glyphicon glyphicon-plus-sign"></span></button>';
|
$anadir = '<button type="button" class="btn btn-default btn-lg" title="Añade '.$this->tabla.'" onClick="location.href='."'".$this->montaURL()."'".'"><span class="glyphicon glyphicon-plus-sign"></span></button>';
|
||||||
} else {
|
} else {
|
||||||
$anadir = '<a href="' . $this->montaURL() . '">' .
|
$anadir = '<a href="' . $this->montaURL() . '">' .
|
||||||
'<img title="Añadir registro" alt="nuevo" src="img/' . ESTILO . '/nuevo.png"></a>';
|
'<img title="Añadir registro" alt="nuevo" src="img/' . ESTILO . '/nuevo.png"></a>';
|
||||||
@@ -336,8 +360,8 @@ class Mantenimiento {
|
|||||||
} else {
|
} else {
|
||||||
$anadir = "";
|
$anadir = "";
|
||||||
}
|
}
|
||||||
$salida.='<p align="center">' .
|
$salida .= '<p align="center">' .
|
||||||
"$rew  $anterior  $az  $anadir  $informe  $za  $siguiente  $fwd</p>";
|
"$rew  $anterior  $az  $anadir  $informe  $za  $siguiente  $fwd</p>";
|
||||||
return $salida;
|
return $salida;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,18 +425,18 @@ class Mantenimiento {
|
|||||||
} else {
|
} else {
|
||||||
$coma = ",";
|
$coma = ",";
|
||||||
}
|
}
|
||||||
if ($this->campos[$campo]['Type'] == 'Boolean(1)') {
|
if (isset($this->campos[$campo]['Type']) && $this->campos[$campo]['Type'] == 'Boolean(1)') {
|
||||||
$valor = "";
|
$valor = "";
|
||||||
if (empty($_POST[$campo])) {
|
if (empty($_POST[$campo])) {
|
||||||
$valor = "0";
|
$valor = "0";
|
||||||
}
|
}
|
||||||
$valor = $_POST[$campo] == "on" ? '1' : $valor;
|
$valor = $_POST[$campo] == "on" ? '1' : $valor;
|
||||||
} else {
|
} else {
|
||||||
if (stristr($this->campos[$campo]['Comment'], "imagen")) {
|
if (isset($this->campos[$campo]['Comment']) && stristr($this->campos[$campo]['Comment'], "imagen")) {
|
||||||
//procesa el envío de la imagen
|
//procesa el envío de la imagen
|
||||||
$imagen = new Imagen();
|
$imagen = new Imagen();
|
||||||
$accion = $imagen->determinaAccion($campo);
|
$accion = $imagen->determinaAccion($campo);
|
||||||
if ($accion != NOHACERNADA) {
|
if ($accion != NOHACERNADA) { // && $_POST['tipoOperacion'] != CLONAR) {
|
||||||
$mensaje = "";
|
$mensaje = "";
|
||||||
if (!$imagen->procesaEnvio($campo, $mensaje)) {
|
if (!$imagen->procesaEnvio($campo, $mensaje)) {
|
||||||
return $this->panelMensaje($mensaje, "danger", "ERROR PROCESANDO IMAGEN");
|
return $this->panelMensaje($mensaje, "danger", "ERROR PROCESANDO IMAGEN");
|
||||||
@@ -420,7 +444,20 @@ class Mantenimiento {
|
|||||||
$hayImagen = true;
|
$hayImagen = true;
|
||||||
$campoImagen = $campo;
|
$campoImagen = $campo;
|
||||||
} else {
|
} else {
|
||||||
$valor = "null";
|
//Comprobamos si hay clonación y hay imagen a clonar.
|
||||||
|
if (isset($_POST[$campo])) {
|
||||||
|
$valor = $_POST[$campo];
|
||||||
|
} else {
|
||||||
|
$valor = "";
|
||||||
|
}
|
||||||
|
if ($_POST['tipoOperacion'] == CLONAR && file_exists($valor)) {
|
||||||
|
$hayImagen = true;
|
||||||
|
$campoImagen = $campo;
|
||||||
|
$valorImagen = $valor;
|
||||||
|
$valor = "null";
|
||||||
|
} else {
|
||||||
|
$valor = "null";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$valor = $_POST[$campo] == "" ? "null" : '"' . $this->bdd->filtra($_POST[$campo]) . '"';
|
$valor = $_POST[$campo] == "" ? "null" : '"' . $this->bdd->filtra($_POST[$campo]) . '"';
|
||||||
@@ -434,11 +471,22 @@ class Mantenimiento {
|
|||||||
}
|
}
|
||||||
$id = $this->bdd->ultimoId();
|
$id = $this->bdd->ultimoId();
|
||||||
if ($hayImagen) {
|
if ($hayImagen) {
|
||||||
|
$mensaje = " ";
|
||||||
//Tiene que recuperar el id del registro insertado y actualizar el archivo de imagen
|
//Tiene que recuperar el id del registro insertado y actualizar el archivo de imagen
|
||||||
if (!$imagen->mueveImagenId($this->tabla, $id, $mensaje)) {
|
if ($_POST['tipoOperacion'] == CLONAR) {
|
||||||
return $this->panelMensaje($mensaje, "danger", "ERROR COMPRIMIENDO IMAGEN");
|
//Tiene que copiar el archivo original.
|
||||||
|
if (!$imagen->copiaImagenId($valorImagen, $this->tabla, $id, $mensaje)) {
|
||||||
|
return $this->panelMensaje($mensaje, "danger", "ERROR COPIANDO IMAGEN");
|
||||||
|
}
|
||||||
|
$archivoImagen = $imagen->archivoCopiado;
|
||||||
|
} else {
|
||||||
|
//Crea el archivo de imagen
|
||||||
|
if (!$imagen->mueveImagenId($this->tabla, $id, $mensaje)) {
|
||||||
|
return $this->panelMensaje($mensaje, "danger", "ERROR COMPRIMIENDO IMAGEN");
|
||||||
|
}
|
||||||
|
$archivoImagen = $imagen->archivoComprimido;
|
||||||
}
|
}
|
||||||
$comando = "update " . $this->tabla . " set " . $campoImagen . "='" . $imagen->archivoComprimido . "' where id='" . $id ."';";
|
$comando = "update " . $this->tabla . " set " . $campoImagen . "='" . $archivoImagen . "' where id='" . $id ."';";
|
||||||
if (!$this->bdd->ejecuta($comando)) {
|
if (!$this->bdd->ejecuta($comando)) {
|
||||||
return $this->errorBD($comando);
|
return $this->errorBD($comando);
|
||||||
}
|
}
|
||||||
@@ -657,7 +705,7 @@ class Mantenimiento {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $tipo ANADIR,EDICION,BORRADO
|
* @param string $tipo ANADIR,EDICION,BORRADO,CLONAR
|
||||||
* @param array $datos Vector con los datos del registro
|
* @param array $datos Vector con los datos del registro
|
||||||
* @return array lista de campos y formulario de entrada
|
* @return array lista de campos y formulario de entrada
|
||||||
*/
|
*/
|
||||||
@@ -666,6 +714,7 @@ class Mantenimiento {
|
|||||||
$modo = $tipo == BORRADO ? "readonly" : "";
|
$modo = $tipo == BORRADO ? "readonly" : "";
|
||||||
$nfechas = 0;
|
$nfechas = 0;
|
||||||
switch ($tipo) {
|
switch ($tipo) {
|
||||||
|
case CLONAR:
|
||||||
case ANADIR:
|
case ANADIR:
|
||||||
$this->datosURL['opc'] = "insertar"; $this->datosURL['id'] = null;
|
$this->datosURL['opc'] = "insertar"; $this->datosURL['id'] = null;
|
||||||
break;
|
break;
|
||||||
@@ -677,9 +726,10 @@ class Mantenimiento {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$accion = $this->montaURL();
|
$accion = $this->montaURL();
|
||||||
$salida.='<div class="col-sm-8"><form name="mantenimiento.form" enctype="multipart/form-data" class="form-horizontal" role="form" method="post" action="' . $accion . '">' . "\n";
|
$salida = '<div class="col-sm-8"><form name="mantenimiento.form" enctype="multipart/form-data" class="form-horizontal" role="form" method="post" action="' . $accion . '">' . "\n";
|
||||||
$salida.="<fieldset style=\"width: 96%;\"><p><legend style=\"color: red;\"><b>$tipo</b></legend>\n";
|
$salida .= "<fieldset style=\"width: 96%;\"><p><legend style=\"color: red;\"><b>$tipo</b></legend>\n";
|
||||||
//$salida.= var_export($datos,true);
|
//$salida.= var_export($datos,true);
|
||||||
|
$campos = "";
|
||||||
foreach ($this->campos as $clave => $valor) {
|
foreach ($this->campos as $clave => $valor) {
|
||||||
if ($valor["Editable"] == "no") {
|
if ($valor["Editable"] == "no") {
|
||||||
//Se salta los campos que no deben aparecer
|
//Se salta los campos que no deben aparecer
|
||||||
@@ -695,7 +745,7 @@ class Mantenimiento {
|
|||||||
//Se asegura que el id no se pueda modificar.
|
//Se asegura que el id no se pueda modificar.
|
||||||
$modoEfectivo = $clave == 'id' ? "readonly" : $modo;
|
$modoEfectivo = $clave == 'id' ? "readonly" : $modo;
|
||||||
$valorDato = $datos == null ? "" : $datos[$campo];
|
$valorDato = $datos == null ? "" : $datos[$campo];
|
||||||
if ($clave == 'id' && $tipo == ANADIR) {
|
if ($clave == 'id' && ($tipo == ANADIR || $tipo == CLONAR)) {
|
||||||
$valorDato = null;
|
$valorDato = null;
|
||||||
}
|
}
|
||||||
if (!isset($this->foraneas[$valor['Campo']])) {
|
if (!isset($this->foraneas[$valor['Campo']])) {
|
||||||
@@ -744,6 +794,10 @@ class Mantenimiento {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stristr($this->campos[$campo]['Comment'], "imagen")) {
|
if (stristr($this->campos[$campo]['Comment'], "imagen")) {
|
||||||
|
/*if ($tipo == CLONAR) {
|
||||||
|
// De momento no deja clonar las imágenes
|
||||||
|
$valorDato = null;
|
||||||
|
}*/
|
||||||
$salida .= $this->creaCampoImagen($campo, $valorDato, $tipo);
|
$salida .= $this->creaCampoImagen($campo, $valorDato, $tipo);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -762,6 +816,8 @@ class Mantenimiento {
|
|||||||
}
|
}
|
||||||
//genera un campo oculto con la lista de campos a modificar.
|
//genera un campo oculto con la lista de campos a modificar.
|
||||||
$salida .= '<input name="listacampos" type="hidden" value="' . $campos . "\">\n";
|
$salida .= '<input name="listacampos" type="hidden" value="' . $campos . "\">\n";
|
||||||
|
//genera un campo oculto con el tipo de operación asociado al formulario
|
||||||
|
$salida .= '<input name="tipoOperacion" type="hidden" value="' . $tipo . "\">\n";
|
||||||
$salida .= "</fieldset><p>";
|
$salida .= "</fieldset><p>";
|
||||||
$salida .= '<center>';
|
$salida .= '<center>';
|
||||||
$this->datosURL['opc'] = 'inicial';
|
$this->datosURL['opc'] = 'inicial';
|
||||||
@@ -812,7 +868,7 @@ class Mantenimiento {
|
|||||||
|
|
||||||
private function creaModal($valor, $id)
|
private function creaModal($valor, $id)
|
||||||
{
|
{
|
||||||
$mensaje .= '
|
$mensaje = '
|
||||||
<div id="mensajeModal'.$id.'" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
<div id="mensajeModal'.$id.'" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog text-center">
|
<div class="modal-dialog text-center">
|
||||||
<div class="modal-content text-center">
|
<div class="modal-content text-center">
|
||||||
|
@@ -111,7 +111,8 @@ class Pdf_mysql_table extends FPDF
|
|||||||
if ($this->procesandoTotales) {
|
if ($this->procesandoTotales) {
|
||||||
$this->SetFont('Arial','B',12);
|
$this->SetFont('Arial','B',12);
|
||||||
}
|
}
|
||||||
$this->Cell($col['w'],5,utf8_decode($data[$col['f']]),1,0,$alin,$fill);
|
$dato = isset($data[$col['f']]) ? $data[$col['f']] : "";
|
||||||
|
$this->Cell($col['w'],5,utf8_decode($dato),1,0,$alin,$fill);
|
||||||
//$this->Cell($col['w'],5,utf8_decode($data[$col['f']]),1,0,$alin,$fill);
|
//$this->Cell($col['w'],5,utf8_decode($data[$col['f']]),1,0,$alin,$fill);
|
||||||
//$this->Cell($col['w'],5,utf8_decode($data['proveedor']),1,0,$alin,$fill);
|
//$this->Cell($col['w'],5,utf8_decode($data['proveedor']),1,0,$alin,$fill);
|
||||||
//$this->Write(5,"nombre=".$col['f'].",titulo=".$col['c'].",ancho=".$col['w'].",alin=".$col['a']);
|
//$this->Write(5,"nombre=".$col['f'].",titulo=".$col['c'].",ancho=".$col['w'].",alin=".$col['a']);
|
||||||
@@ -119,7 +120,10 @@ class Pdf_mysql_table extends FPDF
|
|||||||
//print_r($data);
|
//print_r($data);
|
||||||
//print_r($this->aCols);
|
//print_r($this->aCols);
|
||||||
if ($col['t']=='S' && !$this->procesandoTotales) {
|
if ($col['t']=='S' && !$this->procesandoTotales) {
|
||||||
$this->totales[$col['f']]+=$data[$col['f']];
|
if (isset($this->totales[$col['f']]))
|
||||||
|
$this->totales[$col['f']] += $data[$col['f']];
|
||||||
|
else
|
||||||
|
$this->totales[$col['f']] = $data[$col['f']];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Inventario de Centro Educativo
|
# Inventario de Centro Educativo [](https://www.ohloh.net/p/inventario2)
|
||||||
Copyright (c) 2008-2014, Ricardo Montañana Gómez
|
Copyright (c) 2008-2014, Ricardo Montañana Gómez
|
||||||
|
|
||||||
Inventario2 is free software: you can redistribute it and/or modify
|
Inventario2 is free software: you can redistribute it and/or modify
|
||||||
@@ -17,6 +17,8 @@ Utiliza:
|
|||||||
|
|
||||||
[Instalación de ejemplo](http://inventario2.rmontanana.es)
|
[Instalación de ejemplo](http://inventario2.rmontanana.es)
|
||||||
|
|
||||||
|
[Estadísticas del proyecto](https://www.ohloh.net/p/inventario2)
|
||||||
|
|
||||||
##Instalación
|
##Instalación
|
||||||
Para instalar la aplicación basta con seguir estos pasos:
|
Para instalar la aplicación basta con seguir estos pasos:
|
||||||
###1. Copiar los archivos en una ubicación a la que tenga acceso el usuario con el que se ejecuta el servidor Apache (apache, _www, etc.).
|
###1. Copiar los archivos en una ubicación a la que tenga acceso el usuario con el que se ejecuta el servidor Apache (apache, _www, etc.).
|
||||||
@@ -30,7 +32,8 @@ Para instalar la aplicación basta con seguir estos pasos:
|
|||||||
###2. Crear un directorio temporal y dar derechos de escritura a los ficheros de configuración.
|
###2. Crear un directorio temporal y dar derechos de escritura a los ficheros de configuración.
|
||||||
|
|
||||||
mkdir tmp
|
mkdir tmp
|
||||||
chown apache tmp
|
mkdir img.data
|
||||||
|
chown apache tmp img.data
|
||||||
chown apache inc/configuracion.inc
|
chown apache inc/configuracion.inc
|
||||||
chown apache inc
|
chown apache inc
|
||||||
|
|
||||||
|
BIN
img/bluecurve/clonar.png
Normal file
BIN
img/bluecurve/clonar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 560 B |
BIN
img/clonar.png
Normal file
BIN
img/clonar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
BIN
img/cristal/clonar.png
Normal file
BIN
img/cristal/clonar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 635 B |
BIN
img/personal/clonar.png
Normal file
BIN
img/personal/clonar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 642 B |
@@ -23,5 +23,5 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
define('AUTOR', 'Ricardo Montañana Gómez');
|
define('AUTOR', 'Ricardo Montañana Gómez');
|
||||||
define('VERSION', '1.14.1');
|
define('VERSION', '1.17');
|
||||||
?>
|
?>
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<Titulo Texto="{Descripcion}" id="{id}"/>
|
<Titulo Texto="{Descripcion}" id="{id}"/>
|
||||||
<Datos>
|
<Datos>
|
||||||
<Consulta>
|
<Consulta>
|
||||||
select A.id as id, A.Descripcion as articulo, A.Marca as marca, A.Modelo as modelo, E.id as idEl, U.id as idUbic,U.Descripcion as ubicacion,E.numserie as numserie,
|
select A.id as idArt, A.Descripcion as articulo, A.Marca as marca, A.Modelo as modelo, E.id as idEl, U.id as idUbic,U.Descripcion as ubicacion,E.numserie as numserie,
|
||||||
E.fechaCompra as fechaCompra,E.Cantidad as cantidad, E.Cantidad as cantReal, 'N' as Baja
|
E.fechaCompra as fechaCompra,E.Cantidad as cantidad, E.Cantidad as cantReal, 'N' as Baja
|
||||||
from Elementos E, Articulos A, Ubicaciones U where A.id=E.id_Articulo and U.id=E.id_Ubicacion
|
from Elementos E, Articulos A, Ubicaciones U where A.id=E.id_Articulo and U.id=E.id_Ubicacion
|
||||||
and A.id='{id}' order by U.Descripcion,numserie;
|
and A.id='{id}' order by U.Descripcion,numserie;
|
||||||
|
Reference in New Issue
Block a user