diff --git a/AportaContenido.php b/AportaContenido.php
index c538fef..e6d312b 100644
--- a/AportaContenido.php
+++ b/AportaContenido.php
@@ -237,8 +237,9 @@ class AportaContenido {
case 'principal': // contenido inicial
$creditos = "$('#creditos').modal({keyboard: false});";
+ $centro = '
' . CENTRO . '
';
return $mensaje . '
' .
- '
' . CREDITOS;
+ '
' . CREDITOS;
case 'articulos':
case 'ubicaciones':
case 'test':
diff --git a/CHANGELOG b/CHANGELOG
index e5f1b1c..d1219e1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,11 @@
+Versión 1.11 26-04-2014
+-Fix #34 Corregido que salga una etiqueta por cada elemento reflejado en cantidad.
+-Fix #33 Hay que hacer doble click para editar ajax
+-Fix #32 Añadido mensaje y enlace al tipo de etiquetas que utiliza y corregido mensaje de error de conexión a base de datos de SQL
+-Añadido diálogo antes de realizar el inventario total.
+-Añadido cuadro para resaltar el nombre del centro en la pantalla inicial.
+-Cambiada la alineación de los campos en Mantenimiento para utilizar el atributo Ajuste
+
Versión 1.10 21-04-2014
-Corregido error en el nombre del archivo de la clase ajax que estaba en minúsculas
-Añadidos botones de acción tipo bootstrap en Mantenimiento y añadido a configuración en estilo
diff --git a/EtiquetasPDF.php b/EtiquetasPDF.php
index ae00d1e..e4713fd 100644
--- a/EtiquetasPDF.php
+++ b/EtiquetasPDF.php
@@ -83,52 +83,55 @@ class EtiquetasPDF {
$aplicacion = $url[1];
$protocolo = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
$enlace = $protocolo . $_SERVER['SERVER_NAME'] . "/" . $aplicacion . "/index.php?elementos&opc=editar&id=";
- while($tupla = $this->bdd->procesaResultado()) {
- if ($i % 2) {
- //Columna 2
- $etiq1 = 136;
- $etiq2 = 105;
- } else {
- //Columna 1
- $etiq1 = 30;
- $etiq2 = 1;
- $fila++;
- }
- if ($i % 14 == 0) {
- if (!$primero) {
- $this->pdf->AddPage();
- $fila = 0;
+ while($tupla = $this->bdd->procesaResultado()) {
+ for ($j = 0; $j < $tupla['cantidad']; $j++) {
+ //Hay que generar tantas etiquetas como ponga la cantidad de cada elemento
+ if ($i % 2) {
+ //Columna 2
+ $etiq1 = 136;
+ $etiq2 = 105;
+ } else {
+ //Columna 1
+ $etiq1 = 30;
+ $etiq2 = 1;
+ $fila++;
}
- $primero = false;
+ if ($i % 14 == 0) {
+ if (!$primero) {
+ $this->pdf->AddPage();
+ $fila = 0;
+ }
+ $primero = false;
+ }
+ $py = 6 + 41 * $fila;
+ $enlace2=$enlace.$tupla['idEl'];
+ $fichero = "tmp/etiq".rand(1000,9999).".png";
+ QRcode::png($enlace2, $fichero);
+ $this->pdf->image($fichero, $etiq2, $py, 30, 30);
+ unlink($fichero);
+ $this->pdf->setxy($etiq1, $py);
+ $this->pdf->Cell(30, 10, utf8_decode($tupla['articulo']));
+ $py+=$tamLinea;
+ $this->pdf->setxy($etiq1, $py);
+ $this->pdf->Cell(30, 10, utf8_decode($tupla['marca']));
+ $py+=$tamLinea;
+ $this->pdf->setxy($etiq1, $py);
+ $this->pdf->Cell(30, 10, utf8_decode($tupla['modelo']));
+ $py+=$tamLinea;
+ $this->pdf->setxy($etiq1, $py);
+ $this->pdf->Cell(30, 10, utf8_decode($tupla['numserie']));
+ $py+=$tamLinea;
+ $this->pdf->setxy($etiq1, $py);
+ $this->pdf->Cell(30, 10, $tupla['fechaCompra']);
+ $py+=$tamLinea-1;
+ $this->pdf->setxy($etiq2, $py);
+ $this->pdf->Cell(30, 10, utf8_decode($tupla['ubicacion']));
+ $py+=$tamLinea-1;
+ $this->pdf->setxy($etiq2, $py);
+ $cadena = "idElemento=" . $tupla['idEl'] . " / idArticulo=" . $tupla['idArt'] . " / idUbicacion=" . $tupla['idUbic'];
+ $this->pdf->Cell(30, 10, $cadena);
+ $i++;
}
- $py = 6 + 41 * $fila;
- $enlace2=$enlace.$tupla['idEl'];
- $fichero = "tmp/etiq".rand(1000,9999).".png";
- QRcode::png($enlace2, $fichero);
- $this->pdf->image($fichero, $etiq2, $py, 30, 30);
- unlink($fichero);
- $this->pdf->setxy($etiq1, $py);
- $this->pdf->Cell(30, 10, utf8_decode($tupla['articulo']));
- $py+=$tamLinea;
- $this->pdf->setxy($etiq1, $py);
- $this->pdf->Cell(30, 10, utf8_decode($tupla['marca']));
- $py+=$tamLinea;
- $this->pdf->setxy($etiq1, $py);
- $this->pdf->Cell(30, 10, utf8_decode($tupla['modelo']));
- $py+=$tamLinea;
- $this->pdf->setxy($etiq1, $py);
- $this->pdf->Cell(30, 10, utf8_decode($tupla['numserie']));
- $py+=$tamLinea;
- $this->pdf->setxy($etiq1, $py);
- $this->pdf->Cell(30, 10, $tupla['fechaCompra']);
- $py+=$tamLinea-1;
- $this->pdf->setxy($etiq2, $py);
- $this->pdf->Cell(30, 10, utf8_decode($tupla['ubicacion']));
- $py+=$tamLinea-1;
- $this->pdf->setxy($etiq2, $py);
- $cadena = "idElemento=" . $tupla['idEl'] . " / idArticulo=" . $tupla['idArt'] . " / idUbicacion=" . $tupla['idUbic'];
- $this->pdf->Cell(30, 10, $cadena);
- $i++;
}
//$this->pdf->MultiCell(0,30,var_export($filas,true));
}
diff --git a/Importacion.php b/Importacion.php
index ad2cfff..334314c 100644
--- a/Importacion.php
+++ b/Importacion.php
@@ -55,10 +55,10 @@ class Importacion {
private function formulario() {
$accion = "index.php?importacion&opc=importar";
- $salida .= '';
+ //$salida .= '';
$salida .='
- ';
+ ';
$salida .= '
' . "\n";
$salida .= '';
$mensaje = 'Sólo se permiten archivos con extensión CSV';
- $salida .= "";
@@ -223,8 +224,25 @@ class InformeInventario {
$accion = "index.php?informeInventario&opc=listarArticulo";
return $this->formulario($accion, 'Artículo', $this->listaArticulos());
}
-
+
private function inventarioTotal()
+ {
+ return $this->dialogo();
+ }
+
+ private function dialogo()
+ {
+ $dialogo = '
+
Inventario Total
+
¿Desea obtener el inventario de todo el centro?
+
Volver
+
+ Continuar
+
';
+ return $dialogo;
+ }
+
+ private function listarTotal()
{
$fichero = "xml/inventarioUbicacion.xml";
$salida = "tmp/inventarioUbicacion.xml";
diff --git a/Instalar.php b/Instalar.php
index 609b2a3..8b48bdc 100644
--- a/Instalar.php
+++ b/Instalar.php
@@ -332,8 +332,8 @@ class Instalar {
$borra_database = "DROP DATABASE " . BASEDATOS . " ;";
$database = "CREATE DATABASE " . BASEDATOS . " DEFAULT CHARACTER SET utf8;";
$articulos = "CREATE TABLE `Articulos` (
- `id` smallint(6) NOT NULL auto_increment COMMENT 'ordenable',
- `descripcion` varchar(60) NOT NULL COMMENT 'ordenable,link/Articulo',
+ `id` smallint(6) NOT NULL auto_increment COMMENT 'ordenable,link/Articulo',
+ `descripcion` varchar(60) NOT NULL COMMENT 'ordenable,ajax/text',
`marca` varchar(20) default NULL COMMENT 'ordenable,ajax/text',
`modelo` varchar(20) default NULL COMMENT 'ordenable,ajax/text',
`cantidad` int(11) default NULL COMMENT 'ordenable,ajax/number',
@@ -342,8 +342,8 @@ class Instalar {
) ENGINE=InnoDB AUTO_INCREMENT=769 DEFAULT CHARSET=utf8;
";
$ubicaciones = "CREATE TABLE `Ubicaciones` (
- `id` smallint(5) unsigned NOT NULL auto_increment COMMENT 'ordenable',
- `Descripcion` varchar(50) NOT NULL COMMENT 'ordenable,link/Ubicacion',
+ `id` smallint(5) unsigned NOT NULL auto_increment COMMENT 'ordenable,link/Ubicacion',
+ `Descripcion` varchar(50) NOT NULL COMMENT 'ordenable,ajax/text',
`imagen` varchar(45) DEFAULT NULL COMMENT 'imagen',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=utf8;
diff --git a/Mantenimiento.php b/Mantenimiento.php
index 6f7d423..57889ee 100644
--- a/Mantenimiento.php
+++ b/Mantenimiento.php
@@ -189,8 +189,9 @@ class Mantenimiento {
}
}
//$salida.=$comando;
+ //$salida.=var_export($this->campos,true);
while ($fila = $this->bdd->procesaResultado()) {
- $salida.='';
+ $salida.='
';
foreach ($fila as $clave => $valor) {
if ($clave == "id") {
$id = $valor;
@@ -230,10 +231,19 @@ class Mantenimiento {
$cant++;
$valor = $this->campoAjax($id, $clave, $tipo, $valor, $cant, $fila);
}
- $salida.="$valor | \n";
+ $alineacion = '';
+ if (isset($this->campos[$clave]['Ajuste'])) {
+ switch ($this->campos[$clave]['Ajuste']) {
+ case 'D': $alineacion = 'align="right"'; break;
+ case 'L': $alineacion = 'align="left"'; break;
+ case 'C': $alineacion = 'align="center"'; break;
+ }
+ }
+ $salida.="$valor | \n";
}
+ //Añade los botones de acciones
+ $salida .= '';
//Añade el icono de editar
- $salida .= " | ";
if ($this->perfil['Modificacion']) {
//$salida.='backupURL(); $this->datosURL['opc'] = "editar"; $this->datosURL['id'] = $id;
@@ -570,7 +580,8 @@ class Mantenimiento {
$def = simplexml_load_file($nombre);
foreach ($def->Campos->Col as $columna) {
$this->campos[(string) $columna['Nombre']] = array("Field" => (string) $columna['Titulo'], "Comment" => (string) $columna['Varios'],
- "Type" => (string) $columna['Tipo'] . "(" . $columna['Ancho'] . ")", "Editable" => (string) $columna['Editable'], "Campo" => (string) $columna['Campo'], "Visible" => (string) $columna['Visible']);
+ "Type" => (string) $columna['Tipo'] . "(" . $columna['Ancho'] . ")", "Editable" => (string) $columna['Editable'],
+ "Campo" => (string) $columna['Campo'], "Visible" => (string) $columna['Visible'], "Ajuste" => (string) $columna['Ajuste']);
}
$this->comandoConsulta = $def->Consulta;
} else {
@@ -581,6 +592,15 @@ class Mantenimiento {
$this->campos[$datos[$i]["Field"]] = $this->campos[$datos[$i]["Field"]][0];
$this->campos[$datos[$i]["Field"]]["Campo"] = $datos[$i]["Field"];
$this->campos[$datos[$i]["Field"]]["Editable"] = "si";
+ if (strstr($datos[$i]["Type"],"int")) {
+ $ajuste = "D";
+ } else if (strstr($datos[$i]["Type"],"char")) {
+ $ajuste = "L";
+ }
+ if (strstr($datos[$i]["Comment"],"imagen")) {
+ $ajuste = "C";
+ }
+ $this->campos[$datos[$i]["Field"]]["Ajuste"] = $ajuste;
}
$this->comandoConsulta = "select SQL_CALC_FOUND_ROWS * from " . $this->tabla . " {buscar} {orden} limit {inferior},{superior}";
}
@@ -843,13 +863,16 @@ class Mantenimiento {
$valorSelect = 'data-value="'.$valorDato.'" ';
$remoto = $valorSelect . ' data-sourceCache="true" data-sourceError="Error cargando datos" data-source="Ajax.php?opc=get&tabla='.$tabla2.'"';
}
- $mensaje = '' . $valor . '
+ $mensaje = ''.
+ ' ' . $valor . '
|