mirror of
https://github.com/rmontanana/inventario2.git
synced 2025-08-18 00:45:58 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8ffd97b474 | ||
|
caae389c93 | ||
|
42eb01c27e |
@@ -118,14 +118,14 @@ class AportaContenido {
|
||||
public function __call($metodo, $parametros) {
|
||||
switch ($metodo) { // Dependiendo del método invocado
|
||||
case 'titulo': // devolvemos el título
|
||||
return PROGRAMA.VERSION;
|
||||
return APLICACION;
|
||||
case 'usuario':
|
||||
if ($this->registrado)
|
||||
return "Usuario=$this->usuario";
|
||||
else
|
||||
return '';
|
||||
case 'fecha': return $this->fechaActual();
|
||||
case 'aplicacion': return PROGRAMA.VERSION;
|
||||
case 'aplicacion': return APLICACION;
|
||||
case 'menu': // el menú
|
||||
if ($this->registrado) {
|
||||
return $this->miMenu->insertaMenu();
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Inventario
|
||||
* @copyright Copyright (c) 2008, Ricardo Montañana Gómez
|
||||
@@ -20,58 +19,127 @@
|
||||
*
|
||||
*/
|
||||
class Configuracion {
|
||||
private $nombreCentro;
|
||||
private $numFilas;
|
||||
private $estilo;
|
||||
private $servidor;
|
||||
private $baseDatos;
|
||||
private $usuario;
|
||||
private $clave;
|
||||
private $configuracion="inc/configuracion.inc";
|
||||
private $confNueva="inc/configuracion.new";
|
||||
private $confAnterior="inc/configuracion.ant";
|
||||
private $datosConf;
|
||||
//Campos del fichero de configuración que se van a editar.
|
||||
private $lista = array('SERVIDOR', 'BASEDATOS', 'BASEDATOSTEST', 'USUARIO', 'CLAVE', 'CENTRO', 'NUMFILAS', 'ESTILO', 'PLANTILLA', 'COLORLAT', 'COLORFON', 'MYSQLDUMP', 'GZIP');
|
||||
private $campos;
|
||||
private $plantilla;
|
||||
private $colorLateral;
|
||||
private $colorFondo;
|
||||
private $mysqldump; //comando mysqldump para la copia de seguridad
|
||||
private $gzip; //comando gzip para comprimir la copia de seguridad
|
||||
|
||||
public function __construct()
|
||||
public function ejecuta()
|
||||
{
|
||||
$this->campos = implode(",", $this->lista);
|
||||
}
|
||||
|
||||
//Hecho público para poder efectuar los tests correspondientes.
|
||||
public function obtieneFichero()
|
||||
{
|
||||
return file_get_contents($this->configuracion, FILE_TEXT);
|
||||
}
|
||||
|
||||
public function obtieneLista()
|
||||
{
|
||||
return $this->lista;
|
||||
}
|
||||
|
||||
public function obtieneDatos($linea, &$clave, &$valor)
|
||||
{
|
||||
$filtro = str_replace("'", "", $linea);
|
||||
list($clave, $valor) = explode(",", $filtro);
|
||||
list($resto, $campo) = explode("(", $clave);
|
||||
list($valor, $resto) = explode(")", $valor);
|
||||
list($resto, $clave) = explode("(", $clave);
|
||||
$valor = trim($valor);
|
||||
}
|
||||
|
||||
public function ejecuta() {
|
||||
$fichero = $this->obtieneFichero();
|
||||
$fichero=file_get_contents($this->configuracion,FILE_TEXT);
|
||||
$datos=explode("\n",$fichero);
|
||||
$grabar = isset($_POST['SERVIDOR']);
|
||||
$grabar=isset($_POST['servidor']);
|
||||
if ($grabar) {
|
||||
$fsalida=@fopen($this->confNueva,"wb");
|
||||
}
|
||||
foreach($datos as $linea) {
|
||||
if (stripos($linea,"DEFINE")!==false) {
|
||||
//Comprueba que tenga una definición correcta
|
||||
$this->obtieneDatos($linea, $clave, $valor);
|
||||
$this->datosConf[$clave] = $valor;
|
||||
if ($grabar && stripos($this->campos, $clave) !== false) {
|
||||
$linea = str_replace($valor, $_POST[$clave], $linea);
|
||||
$this->datosConf[$clave] = $_POST[$clave];
|
||||
$filtro=str_replace("'","",$linea);
|
||||
list($clave,$valor)=explode(",",$filtro);
|
||||
list($resto,$campo)=explode("(",$clave);
|
||||
list($valor,$resto)=explode(")",$valor);
|
||||
//$salida.="[$campo]=[$valor]<br>\n";
|
||||
switch ($campo) {
|
||||
case 'CENTRO':
|
||||
$this->nombreCentro=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['centro'],$linea);
|
||||
$this->nombreCentro=$_POST['centro'];
|
||||
}
|
||||
break;
|
||||
case 'NUMFILAS':
|
||||
$this->numFilas=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['filas'],$linea);
|
||||
$this->numFilas=$_POST['filas'];
|
||||
}
|
||||
break;
|
||||
case 'ESTILO':
|
||||
$this->estilo=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['estilo'],$linea);
|
||||
$this->estilo=$_POST['estilo'];
|
||||
}
|
||||
break;
|
||||
case 'PLANTILLA':
|
||||
$this->plantilla=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['plantilla'],$linea);
|
||||
$this->plantilla=$_POST['plantilla'];
|
||||
}
|
||||
break;
|
||||
case 'SERVIDOR':
|
||||
$this->servidor=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['servidor'],$linea);
|
||||
$this->servidor=$_POST['servidor'];
|
||||
}
|
||||
break;
|
||||
case 'BASEDATOS':
|
||||
$this->baseDatos=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['baseDatos'],$linea);
|
||||
$this->baseDatos=$_POST['baseDatos'];
|
||||
}
|
||||
break;
|
||||
case 'USUARIO':
|
||||
$this->usuario=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['usuario'],$linea);
|
||||
$this->usuario=$_POST['usuario'];
|
||||
}
|
||||
break;
|
||||
case 'CLAVE':
|
||||
$this->clave=$valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor, $_POST['clave'],$linea);
|
||||
$this->clave=$_POST['clave'];
|
||||
}
|
||||
break;
|
||||
case 'COLORLAT':
|
||||
$valor = trim($valor);
|
||||
$this->colorLateral = $valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor,$_POST['colorLat'],$linea);
|
||||
$this->colorLateral=$_POST['colorLat'];
|
||||
}
|
||||
break;
|
||||
case 'COLORFON':
|
||||
$valor = trim($valor);
|
||||
$this->colorFondo = $valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor,$_POST['colorFon'],$linea);
|
||||
$this->colorFondo=$_POST['colorFon'];
|
||||
}
|
||||
break;
|
||||
case 'MYSQLDUMP':
|
||||
$valor = trim($valor);
|
||||
$this->mysqldump = $valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor,$_POST['mysqldump'],$linea);
|
||||
$this->mysqldump=$_POST['mysqldump'];
|
||||
}
|
||||
break;
|
||||
case 'GZIP':
|
||||
$valor = trim($valor);
|
||||
$this->gzip = $valor;
|
||||
if ($grabar) {
|
||||
$linea=str_replace($valor,$_POST['gzip'],$linea);
|
||||
$this->gzip=$_POST['gzip'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
//$salida = "DatosConf=".var_export($this->datosConf, true) . "stripos = " . stripos($campos, "GZIP");
|
||||
//$salida .= "Post=" . var_export($_POST, true);
|
||||
}
|
||||
if ($grabar) {
|
||||
$registro=substr($linea,0,2)=="?>"?$linea:$linea."\n";
|
||||
@@ -80,6 +148,7 @@ class Configuracion {
|
||||
}
|
||||
$salida.=$this->formulario();
|
||||
if ($grabar) {
|
||||
//$salida.='<label class="warn">Configuración guardada correctamente</label>';
|
||||
$salida.='<p class="bg-primary">Configuración guardada correctamente</p>';
|
||||
fclose($fsalida);
|
||||
//unlink($this->confAnterior);
|
||||
@@ -89,76 +158,74 @@ class Configuracion {
|
||||
}
|
||||
return $salida;
|
||||
}
|
||||
|
||||
private function formulario() {
|
||||
private function formulario()
|
||||
{
|
||||
$coloresLateral = array( "Original" => "#C4FAEC", "Verde" => "#7bd148", "Azul marino" => "#5484ed", "Azul" => "#a4bdfc", "Turquesa" => "#46d6db",
|
||||
"Verde claro" => "#7ae7bf", "Verde oscuro" => "#51b749", "Amarillo" => "#fbd75b", "Naranja" => "#ffb878", "Morado" => "#6633FF",
|
||||
"Rojo oscuro" => "#dc2127", "Púrpura" => "#dbadff", "Gris" => "#e1e1e1");
|
||||
$coloresFondo = array( "Verde" => "#7bd148", "Azul marino" => "#5484ed", "Azul" => "#a4bdfc", "Turquesa" => "#46d6db",
|
||||
"Verde claro" => "#7ae7bf", "Verde oscuro" => "#51b749", "Amarillo" => "#fbd75b", "Naranja" => "#ffb878", "Rojo" => "#ff887c",
|
||||
"Rojo oscuro" => "#dc2127", "Púrpura" => "#dbadff", "Gris" => "#e1e1e1", "Original" => '#F3FEC8');
|
||||
$personal = $this->datosConf['ESTILO'] == "personal" ? 'selected' : ' ';
|
||||
$bluecurve = $this->datosConf['ESTILO'] == "bluecurve" ? 'selected' : ' ';
|
||||
$cristal = $this->datosConf['ESTILO'] == "cristal" ? 'selected' : ' ';
|
||||
$normal = $this->datosConf['PLANTILLA'] == "normal" ? 'selected' : ' ';
|
||||
$bootstrap = $this->datosConf['PLANTILLA'] == "bootstrap" ? 'selected' : ' ';
|
||||
$salida = '<center><div class="col-sm-4 col-md-6"><form name="configura" method="post">';
|
||||
$personal=$this->estilo=="personal"?'selected':' ';
|
||||
$bluecurve=$this->estilo=="bluecurve"?'selected':' ';
|
||||
$cristal=$this->estilo=="cristal"?'selected':' ';
|
||||
$normal=$this->plantilla=="normal"? 'selected':' ';
|
||||
$bootstrap=$this->plantilla=="bootstrap" ? 'selected':' ';
|
||||
$salida='<center><div class="col-sm-8 col-md-8"><form name="configura" method="post">';
|
||||
//$salida.='<p align="center"><table border=1 class="tablaDatos"><tbody>';
|
||||
$salida.='<p align="center"><table border=2 class="table table-hover"><tbody>';
|
||||
$salida.='<th colspan=2 class="info"><center><b>Preferencias</b></center></th>';
|
||||
$salida.='<tr><td>Nombre del Centro</td><td><input type="text" name="CENTRO" value="' . $this->datosConf['CENTRO'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Número de filas</td><td><input type="text" name="NUMFILAS" value="' . $this->datosConf['NUMFILAS'] . '" size="3" /></td></tr>';
|
||||
$salida.='<tr><td style="vertical-align:middle">Plantilla</td><td><select name="PLANTILLA" class="form-control">';
|
||||
$salida.='<tr><td>Nombre del Centro</td><td><input type="text" name="centro" value="'.$this->nombreCentro.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Número de filas</td><td><input type="text" name="filas" value="'.$this->numFilas.'" size="3" /></td></tr>';
|
||||
$salida.='<tr><td style="vertical-align:middle">Plantilla</td><td><select name="plantilla" class="form-control">';
|
||||
$salida.='<option value="normal" '.$normal.'>normal</option>';
|
||||
$salida.='<option '.$bootstrap.'>bootstrap</option></select></td></tr>';
|
||||
$salida.='<tr><td style="vertical-align:middle">Estilo</td><td><select name="ESTILO" class="form-control">';
|
||||
$salida.='<tr><td style="vertical-align:middle">Estilo</td><td><select name="estilo" class="form-control">';
|
||||
$salida.='<option value="personal" '.$personal.'>personal</option>';
|
||||
$salida.='<option '.$bluecurve.'>bluecurve</option>';
|
||||
$salida.='<option '.$cristal.'>cristal</option></select></td></tr>';
|
||||
$salida.='<tr><td style="vertical-align:middle">Color Lateral (bootstrap)</td><td style="vertical-align:middle"><select name="COLORLAT" id="COLORLAT" class="form-control">';
|
||||
$salida.='<tr><td style="vertical-align:middle">Color Lateral (bootstrap)</td><td style="vertical-align:middle"><select name="colorLat" id="colorLat" class="form-control">';
|
||||
foreach ($coloresLateral as $color => $codigo) {
|
||||
$selec = "";
|
||||
if (trim($this->datosConf['COLORLAT']) == $codigo) {
|
||||
if ($this->colorLateral == $codigo) {
|
||||
$selec = "selected";
|
||||
}
|
||||
$salida.='<option value="'.$codigo.'" '.$selec.' >'.$color.'</option>';
|
||||
}
|
||||
$salida.='</select></td></tr>';
|
||||
$salida.='<tr><td style="vertical-align:middle">Color Fondo (bootstrap)</td><td style="vertical-align:middle"><select name="COLORFON" id="COLORFON" class="form-control">';
|
||||
$salida.='<tr><td style="vertical-align:middle">Color Fondo (bootstrap)</td><td style="vertical-align:middle"><select name="colorFon" id="colorFon" class="form-control">';
|
||||
foreach ($coloresFondo as $color => $codigo) {
|
||||
$selec = "";
|
||||
if (trim($this->datosConf['COLORFON']) == $codigo) {
|
||||
if ($this->colorFondo == $codigo) {
|
||||
$selec = "selected";
|
||||
}
|
||||
$salida.='<option value="'.$codigo.'" '.$selec.' >'.$color.'</option>';
|
||||
}
|
||||
$salida.='</select></td></tr>';
|
||||
$salida.='<th colspan=2 class="danger"><center><b>Base de datos</b></center></th>';
|
||||
$salida.='<tr><td>Servidor</td><td><input type="text" name="SERVIDOR" value="' . $this->datosConf['SERVIDOR'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Base de datos</td><td><input type="text" name="BASEDATOS" value="' . $this->datosConf['BASEDATOS'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Base de datos Tests</td><td><input type="text" name="BASEDATOSTEST" value="' . $this->datosConf['BASEDATOSTEST'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Usuario</td><td><input type="text" name="USUARIO" value="' . $this->datosConf['USUARIO'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Clave</td><td><input type="text" name="CLAVE" value="' . $this->datosConf['CLAVE'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>mysqldump</td><td><input type="text" name="MYSQLDUMP" value="' . $this->datosConf['MYSQLDUMP'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>gzip</td><td><input type="text" name="GZIP" value="' . $this->datosConf['GZIP'] . '" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Servidor</td><td><input type="text" name="servidor" value="'.$this->servidor.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Base de datos</td><td><input type="text" name="baseDatos" value="'.$this->baseDatos.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Usuario</td><td><input type="text" name="usuario" value="'.$this->usuario.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Clave</td><td><input type="text" name="clave" value="'.$this->clave.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>mysqldump</td><td><input type="text" name="mysqldump" value="'.$this->mysqldump.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>gzip</td><td><input type="text" name="gzip" value="'.$this->gzip.'" size="30" /></td></tr>';
|
||||
$salida.='<tr align=center><td colspan=2><input type="submit" class="btn btn-primary" align="center" value="Aceptar" name="aceptar" /></td></tr></p>';
|
||||
$salida.='</form></div></center>';
|
||||
$salida.="<script>
|
||||
$(document).ready(function() {
|
||||
$('select[name=" . '"COLORFON"' . "]').on('change', function() {
|
||||
$(document.body).css('background-color', $('select[name=" . '"COLORFON"' . "]').val());
|
||||
$('.main').css('background-color', $('select[name=" . '"COLORFON"' . "]').val());
|
||||
$('select[name=" .'"colorFon"'. "]').on('change', function() {
|
||||
$(document.body).css('background-color', $('select[name=" .'"colorFon"'. "]').val());
|
||||
$('.main').css('background-color', $('select[name=" .'"colorFon"'. "]').val());
|
||||
});
|
||||
$('select[name=" . '"COLORLAT"' . "]').on('change', function() {
|
||||
$('.sidebar').css('background-color', $('select[name=" . '"COLORLAT"' . "]').val());
|
||||
$('select[name=" .'"colorLat"'. "]').on('change', function() {
|
||||
$('.sidebar').css('background-color', $('select[name=" .'"colorLat"'. "]').val());
|
||||
});
|
||||
$('select[name=" . '"COLORLAT"' . "]').simplecolorpicker({theme: 'glyphicons'});
|
||||
$('select[name=" . '"COLORFON"' . "]').simplecolorpicker({theme: 'glyphicons'});
|
||||
$('select[name=". '"colorLat"' ."]').simplecolorpicker({theme: 'glyphicons'});
|
||||
$('select[name=" .'"colorFon"' ."]').simplecolorpicker({theme: 'glyphicons'});
|
||||
});
|
||||
</script>";
|
||||
//$salida.="<br>fondo=[$this->colorFondo] lateral=[$this->colorLateral]<br>";
|
||||
return $salida;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
179
EtiquetasPDF.php
179
EtiquetasPDF.php
@@ -1,179 +0,0 @@
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* genera un documento PDF a partir de una descripción dada en un archivo XML
|
||||
* @author Ricardo Montañana <rmontanana@gmail.com>
|
||||
* @version 1.0
|
||||
* @package Inventario
|
||||
* @copyright Copyright (c) 2008, Ricardo Montañana
|
||||
* @package Inventario
|
||||
* @copyright Copyright (c) 2008, Ricardo Montañana Gómez
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* This file is part of Inventario.
|
||||
* Inventario is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Inventario is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Inventario. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
require_once 'phpqrcode.php';
|
||||
|
||||
class EtiquetasPDF {
|
||||
|
||||
/**
|
||||
*
|
||||
* @var basedatos Controlador de la base de datos
|
||||
*/
|
||||
private $bdd;
|
||||
private $docu;
|
||||
private $pdf;
|
||||
private $def;
|
||||
private $nombreFichero = "tmp/informeEtiquetas.pdf";
|
||||
|
||||
/**
|
||||
* El constructor recibe como argumento el nombre del archivo XML con la definición, encargándose de recuperarla y guardar toda la información localmente
|
||||
* @param basedatos $bdd manejador de la base de datos
|
||||
* @param string $definicion fichero con la definición del informe en XML
|
||||
* @param boolean $registrado usuario registrado si/no
|
||||
* @return ficheroPDF
|
||||
* todo: cambiar este comentario
|
||||
*/
|
||||
public function __construct($bdd, $definicion, $registrado)
|
||||
{
|
||||
if (!$registrado) {
|
||||
return 'Debe registrarse para acceder a este apartado';
|
||||
}
|
||||
// Recuperamos la definición del informe
|
||||
$this->def = simplexml_load_file($definicion);
|
||||
$this->bdd = $bdd;
|
||||
$this->pdf = new FPDF();
|
||||
$this->pdf->SetMargins(0.2, 0.2, 0.2);
|
||||
$this->pdf->SetFont('Arial', '', 11);
|
||||
$this->pdf->setAutoPageBreak(false);
|
||||
//echo $def->Titulo.$def->Cabecera;
|
||||
$this->pdf->setAuthor(AUTOR, true);
|
||||
$creador = CENTRO . " " . PROGRAMA . VERSION;
|
||||
$this->pdf->setCreator(html_entity_decode($creador), true);
|
||||
$this->pdf->setSubject($this->def->Titulo, true);
|
||||
//$this->pdf->setAutoPageBreak(true, 10);
|
||||
}
|
||||
|
||||
public function crea($definicion)
|
||||
{
|
||||
//print_r($def);echo $bdd;die();
|
||||
// Iniciamos la creación del documento
|
||||
$this->def = simplexml_load_file($definicion);
|
||||
//Ejecuta la consulta y prepara las variables de la base de datos.
|
||||
$this->bdd->ejecuta(trim($this->def->Datos->Consulta));
|
||||
//Inicializa las variables para el control de las etiquetas.
|
||||
$this->pdf->AddPage();
|
||||
$tamLinea = 5;
|
||||
$fila = -1;
|
||||
$primero = true; $i = 0;
|
||||
$url = explode("/", $_SERVER['SCRIPT_NAME']);
|
||||
$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;
|
||||
}
|
||||
$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++;
|
||||
}
|
||||
//$this->pdf->MultiCell(0,30,var_export($filas,true));
|
||||
}
|
||||
|
||||
public function cierraPDF()
|
||||
{
|
||||
$this->pdf->Close();
|
||||
$this->docu = $this->pdf->Output('', 'S');
|
||||
}
|
||||
|
||||
public function getContenido()
|
||||
{
|
||||
return $this->docu;
|
||||
}
|
||||
|
||||
public function getCabecera()
|
||||
{
|
||||
$cabecera = "Content-type: application/pdf";
|
||||
$cabecera = $cabecera . "Content-length: " . strlen($this->docu);
|
||||
$cabecera = $cabecera . "Content-Disposition: inline; filename=" . $this->nombreFichero;
|
||||
return $cabecera;
|
||||
}
|
||||
|
||||
public function guardaArchivo($nombre = "tmp/Informe.pdf")
|
||||
{
|
||||
$fichero = fopen($nombre, "w");
|
||||
fwrite($fichero, $this->getCabecera());
|
||||
fwrite($fichero, $this->getContenido(), strlen($this->getContenido()));
|
||||
$this->nombreFichero = $nombre;
|
||||
fclose($fichero);
|
||||
}
|
||||
|
||||
public function enviaCabecera()
|
||||
{
|
||||
header("Content-type: application/pdf");
|
||||
$longitud = strlen($this->docu);
|
||||
header("Content-length: $longitud");
|
||||
header("Content-Disposition: inline; filename=" . $this->nombreFichero);
|
||||
}
|
||||
|
||||
public function imprimeInforme()
|
||||
{
|
||||
$this->enviaCabecera();
|
||||
echo $this->docu;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -40,19 +40,12 @@ class InformeInventario {
|
||||
|
||||
private function listarUbicacion() {
|
||||
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
|
||||
switch ($salidaInforme) {
|
||||
case "pantalla":
|
||||
if ($salidaInforme == "pantalla") {
|
||||
$fichero = "xml/inventarioUbicacion.xml";
|
||||
$salida = "tmp/inventarioUbicacion.xml";
|
||||
break;
|
||||
case "csv":
|
||||
} else {
|
||||
$fichero = "xml/inventarioUbicacionCSV.xml";
|
||||
$salida = "tmp/inventarioUbicacionCSV.xml";
|
||||
break;
|
||||
case "etiquetas":
|
||||
$fichero = "xml/inventarioUbicacionEtiquetas.xml";
|
||||
$salida = "tmp/inventarioUbicacionEtiquetas.xml";
|
||||
break;
|
||||
}
|
||||
$plantilla = file_get_contents($fichero) or die('Fallo en la apertura de la plantilla ' . $fichero);
|
||||
$id = $_POST['id'] == NULL ? $_GET['id'] : $_POST['id'];
|
||||
@@ -65,47 +58,30 @@ class InformeInventario {
|
||||
$plantilla = str_replace("{id}", $id, $plantilla);
|
||||
$plantilla = str_replace("{Descripcion}", $fila['Descripcion'], $plantilla);
|
||||
file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida);
|
||||
switch ($salidaInforme) {
|
||||
case "pantalla":
|
||||
if ($salidaInforme == "pantalla") {
|
||||
$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;
|
||||
case "csv":
|
||||
} else {
|
||||
//Genera una hoja de cálculo en formato csv
|
||||
$nombre = "tmp/Ubicacion" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
|
||||
$hoja = new Csv($this->bdd);
|
||||
$hoja->crea($nombre);
|
||||
$hoja->ejecutaConsulta($salida);
|
||||
echo '<script type="text/javascript"> window.open( "' . $nombre . '" ) </script>';
|
||||
break;
|
||||
case "etiquetas":
|
||||
$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>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function listarArticulo() {
|
||||
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
|
||||
switch ($salidaInforme) {
|
||||
case "pantalla":
|
||||
if ($salidaInforme == "pantalla") {
|
||||
$fichero = "xml/inventarioArticulo.xml";
|
||||
$salida = "tmp/inventarioArticulo.xml";
|
||||
break;
|
||||
case "csv":
|
||||
} else {
|
||||
$fichero = "xml/inventarioArticuloCSV.xml";
|
||||
$salida = "tmp/inventarioArticuloCSV.xml";
|
||||
break;
|
||||
case "etiquetas":
|
||||
$fichero = "xml/inventarioArticuloEtiquetas.xml";
|
||||
$salida = "tmp/inventarioArticuloEtiquetas.xml";
|
||||
break;
|
||||
}
|
||||
$plantilla = file_get_contents($fichero) or die('Fallo en la apertura de la plantilla ' . $fichero);
|
||||
$id = $_POST['id'] == NULL ? $_GET['id'] : $_POST['id'];
|
||||
@@ -120,30 +96,21 @@ class InformeInventario {
|
||||
$plantilla = str_replace("{Marca}", $fila['marca'], $plantilla);
|
||||
$plantilla = str_replace("{Modelo}", $fila['modelo'], $plantilla);
|
||||
file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida);
|
||||
switch ($salidaInforme) {
|
||||
case "pantalla":
|
||||
if ($salidaInforme == "pantalla") {
|
||||
$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;
|
||||
case "csv":
|
||||
} else {
|
||||
//Genera una hoja de cálculo en formato csv
|
||||
$nombre = "tmp/Articulo" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
|
||||
$hoja = new Csv($this->bdd);
|
||||
$hoja->crea($nombre);
|
||||
$hoja->ejecutaConsulta($salida);
|
||||
echo '<script type="text/javascript"> window.open( "' . $nombre . '" ) </script>';
|
||||
break;
|
||||
case "etiquetas":
|
||||
$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;
|
||||
}
|
||||
//header('Location: index.php');
|
||||
}
|
||||
|
||||
private function listaUbicaciones() {
|
||||
@@ -182,7 +149,6 @@ class InformeInventario {
|
||||
$salida.="<br><br><label for='salida'>Salida del informe por:</label>";
|
||||
$salida.='<div class="radio"><label><input type="radio" name="salida" value="pantalla" checked>Pantalla</label></div>';
|
||||
$salida.='<div class="radio"><label><input type="radio" name="salida" value="csv">Archivo CSV</label></div>';
|
||||
$salida.='<div class="radio"><label><input type="radio" name="salida" value="etiquetas">Etiquetas</label></div>';
|
||||
$salida.="<br><br></fieldset><p>";
|
||||
$salida.='<p align="center"><button type=submit class="btn btn-primary">Aceptar</button></p><br></div>' . "\n";
|
||||
return $salida;
|
||||
@@ -226,6 +192,7 @@ class InformeInventario {
|
||||
$informe->cierraPDF();
|
||||
$informe->imprimeInforme();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -55,7 +55,7 @@ class InformePDF {
|
||||
//echo $def->Titulo.$def->Cabecera;
|
||||
$this->pdf->Open();
|
||||
$this->pdf->setAuthor(AUTOR,true);
|
||||
$creador = CENTRO . " " . PROGRAMA.VERSION;
|
||||
$creador = CENTRO . " " . APLICACION;
|
||||
$this->pdf->setCreator(html_entity_decode($creador),true);
|
||||
$this->pdf->setSubject($this->def->Titulo,true);
|
||||
$this->pdf->setAutoPageBreak(true, 10);
|
||||
|
@@ -104,7 +104,7 @@ class Inventario {
|
||||
$_SESSION['Usuario'] = $this->usuario;
|
||||
$_SESSION['Perfil'] = $this->perfil;
|
||||
// y enviamos la cookie para reconocerlo la próxima vez
|
||||
setcookie('InventarioId', $resultado, time() + 3600 * 24);
|
||||
setcookie('InventarioId', $resultado, time() + 3600 * 24 * 365);
|
||||
// Lo enviamos a la página de bienvenida
|
||||
header('Location: index.php?bienvenido');
|
||||
exit;
|
||||
|
@@ -276,7 +276,7 @@ class Mantenimiento {
|
||||
private function enlaceBusqueda($pagina)
|
||||
{
|
||||
$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">
|
||||
$salida = '<form name="busqueda" method="POST"><div class="col-sm-4 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></div></div></form>';
|
||||
|
@@ -61,7 +61,7 @@ class Pdf_mysql_table extends Fpdf
|
||||
//Titulo
|
||||
$fecha=strftime("%d-%b-%Y %H:%M");
|
||||
$this->SetFont('Arial','',8);
|
||||
$this->Cell(0,4,html_entity_decode(CENTRO . " " . PROGRAMA . VERSION,ENT_COMPAT | ENT_HTML401,'ISO-8859-1'),0,1,'L');
|
||||
$this->Cell(0,4,html_entity_decode(CENTRO . " " . APLICACION,ENT_COMPAT | ENT_HTML401,'ISO-8859-1'),0,1,'L');
|
||||
$this->SetFont('Arial','',18);
|
||||
$this->Cell(0,6,utf8_decode($this->titulo),0,1,'C');
|
||||
$this->SetFont('Arial','',8);
|
||||
|
825
css/bootstrap-datetimepicker.min.js
vendored
825
css/bootstrap-datetimepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -226,5 +226,4 @@
|
||||
<glyph unicode="" d="M100 200h400v-155l-75 -45h350l-75 45v155h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170z" />
|
||||
<glyph unicode="" d="M121 700q0 -53 28.5 -97t75.5 -65q-4 -16 -4 -38q0 -74 52.5 -126.5t126.5 -52.5q56 0 100 30v-306l-75 -45h350l-75 45v306q46 -30 100 -30q74 0 126.5 52.5t52.5 126.5q0 24 -9 55q50 32 79.5 83t29.5 112q0 90 -61.5 155.5t-150.5 71.5q-26 89 -99.5 145.5 t-167.5 56.5q-116 0 -197.5 -81.5t-81.5 -197.5q0 -4 1 -11.5t1 -11.5q-14 2 -23 2q-74 0 -126.5 -52.5t-52.5 -126.5z" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
</defs></svg>
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 62 KiB |
344
css/bootstrap/js/bootstrap.js
vendored
344
css/bootstrap/js/bootstrap.js
vendored
@@ -4,9 +4,7 @@
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
if (typeof jQuery === 'undefined') {
|
||||
throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
||||
}
|
||||
if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: transition.js v3.1.1
|
||||
@@ -45,13 +43,8 @@ if (typeof jQuery === 'undefined') {
|
||||
// http://blog.alexmaccaw.com/css-transitions
|
||||
$.fn.emulateTransitionEnd = function (duration) {
|
||||
var called = false, $el = this
|
||||
$(this).one($.support.transition.end, function() {
|
||||
called = true
|
||||
})
|
||||
var callback = function() {
|
||||
if (!called)
|
||||
$($el).trigger($.support.transition.end)
|
||||
}
|
||||
$(this).one($.support.transition.end, function () { called = true })
|
||||
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
||||
setTimeout(callback, duration)
|
||||
return this
|
||||
}
|
||||
@@ -93,8 +86,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
var $parent = $(selector)
|
||||
|
||||
if (e)
|
||||
e.preventDefault()
|
||||
if (e) e.preventDefault()
|
||||
|
||||
if (!$parent.length) {
|
||||
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
||||
@@ -102,8 +94,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
$parent.trigger(e = $.Event('close.bs.alert'))
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent.removeClass('in')
|
||||
|
||||
@@ -129,10 +120,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.alert')
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.alert', (data = new Alert(this)))
|
||||
if (typeof option == 'string')
|
||||
data[option].call($this)
|
||||
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -188,8 +177,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
state = state + 'Text'
|
||||
|
||||
if (!data.resetText)
|
||||
$el.data('resetText', $el[val]())
|
||||
if (!data.resetText) $el.data('resetText', $el[val]())
|
||||
|
||||
$el[val](data[state] || this.options[state])
|
||||
|
||||
@@ -212,17 +200,13 @@ if (typeof jQuery === 'undefined') {
|
||||
if ($parent.length) {
|
||||
var $input = this.$element.find('input')
|
||||
if ($input.prop('type') == 'radio') {
|
||||
if ($input.prop('checked') && this.$element.hasClass('active'))
|
||||
changed = false
|
||||
else
|
||||
$parent.find('.active').removeClass('active')
|
||||
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
||||
else $parent.find('.active').removeClass('active')
|
||||
}
|
||||
if (changed)
|
||||
$input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
||||
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
||||
}
|
||||
|
||||
if (changed)
|
||||
this.$element.toggleClass('active')
|
||||
if (changed) this.$element.toggleClass('active')
|
||||
}
|
||||
|
||||
|
||||
@@ -237,13 +221,10 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.button')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.button', (data = new Button(this, options)))
|
||||
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
||||
|
||||
if (option == 'toggle')
|
||||
data.toggle()
|
||||
else if (option)
|
||||
data.setState(option)
|
||||
if (option == 'toggle') data.toggle()
|
||||
else if (option) data.setState(option)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -264,8 +245,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
||||
var $btn = $(e.target)
|
||||
if (!$btn.hasClass('btn'))
|
||||
$btn = $btn.closest('.btn')
|
||||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||
$btn.button('toggle')
|
||||
e.preventDefault()
|
||||
})
|
||||
@@ -331,15 +311,10 @@ if (typeof jQuery === 'undefined') {
|
||||
var that = this
|
||||
var activeIndex = this.getActiveIndex()
|
||||
|
||||
if (pos > (this.$items.length - 1) || pos < 0)
|
||||
return
|
||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||
|
||||
if (this.sliding)
|
||||
return this.$element.one('slid.bs.carousel', function() {
|
||||
that.to(pos)
|
||||
})
|
||||
if (activeIndex == pos)
|
||||
return this.pause().cycle()
|
||||
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
||||
if (activeIndex == pos) return this.pause().cycle()
|
||||
|
||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||
}
|
||||
@@ -358,14 +333,12 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Carousel.prototype.next = function () {
|
||||
if (this.sliding)
|
||||
return
|
||||
if (this.sliding) return
|
||||
return this.slide('next')
|
||||
}
|
||||
|
||||
Carousel.prototype.prev = function () {
|
||||
if (this.sliding)
|
||||
return
|
||||
if (this.sliding) return
|
||||
return this.slide('prev')
|
||||
}
|
||||
|
||||
@@ -378,18 +351,15 @@ if (typeof jQuery === 'undefined') {
|
||||
var that = this
|
||||
|
||||
if (!$next.length) {
|
||||
if (!this.options.wrap)
|
||||
return
|
||||
if (!this.options.wrap) return
|
||||
$next = this.$element.find('.item')[fallback]()
|
||||
}
|
||||
|
||||
if ($next.hasClass('active'))
|
||||
return this.sliding = false
|
||||
if ($next.hasClass('active')) return this.sliding = false
|
||||
|
||||
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
this.sliding = true
|
||||
|
||||
@@ -413,9 +383,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||
$active.removeClass(['active', direction].join(' '))
|
||||
that.sliding = false
|
||||
setTimeout(function() {
|
||||
that.$element.trigger('slid.bs.carousel')
|
||||
}, 0)
|
||||
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
||||
})
|
||||
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
||||
} else {
|
||||
@@ -443,14 +411,10 @@ if (typeof jQuery === 'undefined') {
|
||||
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
var action = typeof option == 'string' ? option : options.slide
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.carousel', (data = new Carousel(this, options)))
|
||||
if (typeof option == 'number')
|
||||
data.to(option)
|
||||
else if (action)
|
||||
data[action]()
|
||||
else if (options.interval)
|
||||
data.pause().cycle()
|
||||
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
||||
if (typeof option == 'number') data.to(option)
|
||||
else if (action) data[action]()
|
||||
else if (options.interval) data.pause().cycle()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -474,8 +438,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
var options = $.extend({}, $target.data(), $this.data())
|
||||
var slideIndex = $this.attr('data-slide-to')
|
||||
if (slideIndex)
|
||||
options.interval = false
|
||||
if (slideIndex) options.interval = false
|
||||
|
||||
$target.carousel(options)
|
||||
|
||||
@@ -515,10 +478,8 @@ if (typeof jQuery === 'undefined') {
|
||||
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||
this.transitioning = null
|
||||
|
||||
if (this.options.parent)
|
||||
this.$parent = $(this.options.parent)
|
||||
if (this.options.toggle)
|
||||
this.toggle()
|
||||
if (this.options.parent) this.$parent = $(this.options.parent)
|
||||
if (this.options.toggle) this.toggle()
|
||||
}
|
||||
|
||||
Collapse.DEFAULTS = {
|
||||
@@ -531,20 +492,17 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Collapse.prototype.show = function () {
|
||||
if (this.transitioning || this.$element.hasClass('in'))
|
||||
return
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
var startEvent = $.Event('show.bs.collapse')
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented())
|
||||
return
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
var hasData = actives.data('bs.collapse')
|
||||
if (hasData && hasData.transitioning)
|
||||
return
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('bs.collapse', null)
|
||||
}
|
||||
@@ -567,8 +525,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.$element.trigger('shown.bs.collapse')
|
||||
}
|
||||
|
||||
if (!$.support.transition)
|
||||
return complete.call(this)
|
||||
if (!$.support.transition) return complete.call(this)
|
||||
|
||||
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
||||
|
||||
@@ -579,13 +536,11 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Collapse.prototype.hide = function () {
|
||||
if (this.transitioning || !this.$element.hasClass('in'))
|
||||
return
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
|
||||
var startEvent = $.Event('hide.bs.collapse')
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented())
|
||||
return
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
var dimension = this.dimension()
|
||||
|
||||
@@ -608,8 +563,7 @@ if (typeof jQuery === 'undefined') {
|
||||
.addClass('collapse')
|
||||
}
|
||||
|
||||
if (!$.support.transition)
|
||||
return complete.call(this)
|
||||
if (!$.support.transition) return complete.call(this)
|
||||
|
||||
this.$element
|
||||
[dimension](0)
|
||||
@@ -633,12 +587,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.collapse')
|
||||
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data && options.toggle && option == 'show')
|
||||
option = !option
|
||||
if (!data)
|
||||
$this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string')
|
||||
data[option]()
|
||||
if (!data && options.toggle && option == 'show') option = !option
|
||||
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -669,8 +620,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var $parent = parent && $(parent)
|
||||
|
||||
if (!data || !data.transitioning) {
|
||||
if ($parent)
|
||||
$parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
||||
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
||||
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
}
|
||||
|
||||
@@ -703,8 +653,7 @@ if (typeof jQuery === 'undefined') {
|
||||
Dropdown.prototype.toggle = function (e) {
|
||||
var $this = $(this)
|
||||
|
||||
if ($this.is('.disabled, :disabled'))
|
||||
return
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
var $parent = getParent($this)
|
||||
var isActive = $parent.hasClass('open')
|
||||
@@ -720,8 +669,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var relatedTarget = { relatedTarget: this }
|
||||
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent
|
||||
.toggleClass('open')
|
||||
@@ -734,40 +682,33 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Dropdown.prototype.keydown = function (e) {
|
||||
if (!/(38|40|27)/.test(e.keyCode))
|
||||
return
|
||||
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||
|
||||
var $this = $(this)
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if ($this.is('.disabled, :disabled'))
|
||||
return
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
var $parent = getParent($this)
|
||||
var isActive = $parent.hasClass('open')
|
||||
|
||||
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27)
|
||||
$parent.find(toggle).focus()
|
||||
if (e.which == 27) $parent.find(toggle).focus()
|
||||
return $this.click()
|
||||
}
|
||||
|
||||
var desc = ' li:not(.divider):visible a'
|
||||
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
|
||||
|
||||
if (!$items.length)
|
||||
return
|
||||
if (!$items.length) return
|
||||
|
||||
var index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0)
|
||||
index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1)
|
||||
index++ // down
|
||||
if (!~index)
|
||||
index = 0
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index = 0
|
||||
|
||||
$items.eq(index).focus()
|
||||
}
|
||||
@@ -777,11 +718,9 @@ if (typeof jQuery === 'undefined') {
|
||||
$(toggle).each(function () {
|
||||
var $parent = getParent($(this))
|
||||
var relatedTarget = { relatedTarget: this }
|
||||
if (!$parent.hasClass('open'))
|
||||
return
|
||||
if (!$parent.hasClass('open')) return
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
||||
})
|
||||
}
|
||||
@@ -810,10 +749,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.dropdown')
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string')
|
||||
data[option].call($this)
|
||||
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -834,9 +771,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
$(document)
|
||||
.on('click.bs.dropdown.data-api', clearMenus)
|
||||
.on('click.bs.dropdown.data-api', '.dropdown form', function(e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
|
||||
|
||||
@@ -888,8 +823,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented())
|
||||
return
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
@@ -931,15 +865,13 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Modal.prototype.hide = function (e) {
|
||||
if (e)
|
||||
e.preventDefault()
|
||||
if (e) e.preventDefault()
|
||||
|
||||
e = $.Event('hide.bs.modal')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented())
|
||||
return
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
@@ -1003,20 +935,17 @@ if (typeof jQuery === 'undefined') {
|
||||
.appendTo(document.body)
|
||||
|
||||
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||
if (e.target !== e.currentTarget)
|
||||
return
|
||||
if (e.target !== e.currentTarget) return
|
||||
this.options.backdrop == 'static'
|
||||
? this.$element[0].focus.call(this.$element[0])
|
||||
: this.hide.call(this)
|
||||
}, this))
|
||||
|
||||
if (doAnimate)
|
||||
this.$backdrop[0].offsetWidth // force reflow
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback)
|
||||
return
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop
|
||||
@@ -1050,12 +979,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.modal')
|
||||
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string')
|
||||
data[option](_relatedTarget)
|
||||
else if (options.show)
|
||||
data.show(_relatedTarget)
|
||||
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option](_relatedTarget)
|
||||
else if (options.show) data.show(_relatedTarget)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1080,8 +1006,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
if ($this.is('a'))
|
||||
e.preventDefault()
|
||||
if ($this.is('a')) e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option, this)
|
||||
@@ -1091,12 +1016,8 @@ if (typeof jQuery === 'undefined') {
|
||||
})
|
||||
|
||||
$(document)
|
||||
.on('show.bs.modal', '.modal', function() {
|
||||
$(document.body).addClass('modal-open')
|
||||
})
|
||||
.on('hidden.bs.modal', '.modal', function() {
|
||||
$(document.body).removeClass('modal-open')
|
||||
})
|
||||
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
||||
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
||||
|
||||
}(jQuery);
|
||||
|
||||
@@ -1188,8 +1109,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var defaults = this.getDefaults()
|
||||
|
||||
this._options && $.each(this._options, function (key, value) {
|
||||
if (defaults[key] != value)
|
||||
options[key] = value
|
||||
if (defaults[key] != value) options[key] = value
|
||||
})
|
||||
|
||||
return options
|
||||
@@ -1203,12 +1123,10 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
self.hoverState = 'in'
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show)
|
||||
return self.show()
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
self.timeout = setTimeout(function () {
|
||||
if (self.hoverState == 'in')
|
||||
self.show()
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
@@ -1220,12 +1138,10 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
self.hoverState = 'out'
|
||||
|
||||
if (!self.options.delay || !self.options.delay.hide)
|
||||
return self.hide()
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.timeout = setTimeout(function () {
|
||||
if (self.hoverState == 'out')
|
||||
self.hide()
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
@@ -1235,16 +1151,14 @@ if (typeof jQuery === 'undefined') {
|
||||
if (this.hasContent() && this.enabled) {
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
var that = this;
|
||||
|
||||
var $tip = this.tip()
|
||||
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation)
|
||||
$tip.addClass('fade')
|
||||
if (this.options.animation) $tip.addClass('fade')
|
||||
|
||||
var placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
@@ -1252,8 +1166,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
var autoToken = /\s?auto?\s?/i
|
||||
var autoPlace = autoToken.test(placement)
|
||||
if (autoPlace)
|
||||
placement = placement.replace(autoToken, '') || 'top'
|
||||
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
||||
|
||||
$tip
|
||||
.detach()
|
||||
@@ -1314,10 +1227,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
||||
|
||||
// we must check for NaN for ie 8/9
|
||||
if (isNaN(marginTop))
|
||||
marginTop = 0
|
||||
if (isNaN(marginLeft))
|
||||
marginLeft = 0
|
||||
if (isNaN(marginTop)) marginTop = 0
|
||||
if (isNaN(marginLeft)) marginLeft = 0
|
||||
|
||||
offset.top = offset.top + marginTop
|
||||
offset.left = offset.left + marginLeft
|
||||
@@ -1362,8 +1273,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||
}
|
||||
|
||||
if (replace)
|
||||
$tip.offset(offset)
|
||||
if (replace) $tip.offset(offset)
|
||||
}
|
||||
|
||||
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
||||
@@ -1384,15 +1294,13 @@ if (typeof jQuery === 'undefined') {
|
||||
var e = $.Event('hide.bs.' + this.type)
|
||||
|
||||
function complete() {
|
||||
if (that.hoverState != 'in')
|
||||
$tip.detach()
|
||||
if (that.hoverState != 'in') $tip.detach()
|
||||
that.$element.trigger('hidden.bs.' + that.type)
|
||||
}
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
@@ -1494,12 +1402,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.tooltip')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data && option == 'destroy')
|
||||
return
|
||||
if (!data)
|
||||
$this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string')
|
||||
data[option]()
|
||||
if (!data && option == 'destroy') return
|
||||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1535,8 +1440,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.init('popover', element, options)
|
||||
}
|
||||
|
||||
if (!$.fn.tooltip)
|
||||
throw new Error('Popover requires tooltip.js')
|
||||
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||
|
||||
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
||||
placement: 'right',
|
||||
@@ -1571,8 +1475,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||
// this manually by checking the contents.
|
||||
if (!$tip.find('.popover-title').html())
|
||||
$tip.find('.popover-title').hide()
|
||||
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
||||
}
|
||||
|
||||
Popover.prototype.hasContent = function () {
|
||||
@@ -1594,8 +1497,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Popover.prototype.tip = function () {
|
||||
if (!this.$tip)
|
||||
this.$tip = $(this.options.template)
|
||||
if (!this.$tip) this.$tip = $(this.options.template)
|
||||
return this.$tip
|
||||
}
|
||||
|
||||
@@ -1611,12 +1513,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.popover')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data && option == 'destroy')
|
||||
return
|
||||
if (!data)
|
||||
$this.data('bs.popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string')
|
||||
data[option]()
|
||||
if (!data && option == 'destroy') return
|
||||
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1690,9 +1589,7 @@ if (typeof jQuery === 'undefined') {
|
||||
&& $href.is(':visible')
|
||||
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
||||
})
|
||||
.sort(function(a, b) {
|
||||
return a[0] - b[0]
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
self.offsets.push(this[0])
|
||||
self.targets.push(this[1])
|
||||
@@ -1760,10 +1657,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.scrollspy')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
||||
if (typeof option == 'string')
|
||||
data[option]()
|
||||
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1820,8 +1715,7 @@ if (typeof jQuery === 'undefined') {
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
if ($this.parent('li').hasClass('active'))
|
||||
return
|
||||
if ($this.parent('li').hasClass('active')) return
|
||||
|
||||
var previous = $ul.find('.active:last a')[0]
|
||||
var e = $.Event('show.bs.tab', {
|
||||
@@ -1830,8 +1724,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
var $target = $(selector)
|
||||
|
||||
@@ -1892,10 +1785,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.tab')
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.tab', (data = new Tab(this)))
|
||||
if (typeof option == 'string')
|
||||
data[option]()
|
||||
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1957,8 +1848,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Affix.prototype.getPinnedOffset = function () {
|
||||
if (this.pinnedOffset)
|
||||
return this.pinnedOffset
|
||||
if (this.pinnedOffset) return this.pinnedOffset
|
||||
this.$element.removeClass(Affix.RESET).addClass('affix')
|
||||
var scrollTop = this.$window.scrollTop()
|
||||
var position = this.$element.offset()
|
||||
@@ -1970,8 +1860,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Affix.prototype.checkPosition = function () {
|
||||
if (!this.$element.is(':visible'))
|
||||
return
|
||||
if (!this.$element.is(':visible')) return
|
||||
|
||||
var scrollHeight = $(document).height()
|
||||
var scrollTop = this.$window.scrollTop()
|
||||
@@ -1980,32 +1869,25 @@ if (typeof jQuery === 'undefined') {
|
||||
var offsetTop = offset.top
|
||||
var offsetBottom = offset.bottom
|
||||
|
||||
if (this.affixed == 'top')
|
||||
position.top += scrollTop
|
||||
if (this.affixed == 'top') position.top += scrollTop
|
||||
|
||||
if (typeof offset != 'object')
|
||||
offsetBottom = offsetTop = offset
|
||||
if (typeof offsetTop == 'function')
|
||||
offsetTop = offset.top(this.$element)
|
||||
if (typeof offsetBottom == 'function')
|
||||
offsetBottom = offset.bottom(this.$element)
|
||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
||||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
||||
|
||||
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
||||
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
||||
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
||||
|
||||
if (this.affixed === affix)
|
||||
return
|
||||
if (this.unpin)
|
||||
this.$element.css('top', '')
|
||||
if (this.affixed === affix) return
|
||||
if (this.unpin) this.$element.css('top', '')
|
||||
|
||||
var affixType = 'affix' + (affix ? '-' + affix : '')
|
||||
var e = $.Event(affixType + '.bs.affix')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
this.affixed = affix
|
||||
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
||||
@@ -2032,10 +1914,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.affix')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data)
|
||||
$this.data('bs.affix', (data = new Affix(this, options)))
|
||||
if (typeof option == 'string')
|
||||
data[option]()
|
||||
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2061,10 +1941,8 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
data.offset = data.offset || {}
|
||||
|
||||
if (data.offsetBottom)
|
||||
data.offset.bottom = data.offsetBottom
|
||||
if (data.offsetTop)
|
||||
data.offset.top = data.offsetTop
|
||||
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
||||
if (data.offsetTop) data.offset.top = data.offsetTop
|
||||
|
||||
$spy.affix(data)
|
||||
})
|
||||
|
584
css/bootstrap/js/bootstrap.min.js
vendored
584
css/bootstrap/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -31,13 +31,6 @@ border-bottom: 1px solid #eee;
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.sidebar {
|
||||
top: 50px;
|
||||
bottom: 150px;
|
||||
background-color: <?php echo COLORLAT; ?>
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
@@ -78,11 +71,6 @@ background-color: #428bca;
|
||||
.main {
|
||||
padding: 10px;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.main{
|
||||
margin-top: 50px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.main {
|
||||
padding-right: 20px;
|
||||
|
2309
css/jquery.min.js
vendored
2309
css/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
SimpleColorPicker.prototype = {
|
||||
constructor: SimpleColorPicker,
|
||||
|
||||
init: function(type, select, options) {
|
||||
var self = this;
|
||||
|
||||
@@ -102,6 +103,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the selected color.
|
||||
*
|
||||
@@ -120,6 +122,7 @@
|
||||
console.error("The given color '" + color + "' could not be found");
|
||||
}
|
||||
},
|
||||
|
||||
showPicker: function() {
|
||||
var pos = this.$icon.offset();
|
||||
this.$picker.css({
|
||||
@@ -130,9 +133,11 @@
|
||||
|
||||
this.$picker.show(this.options.pickerDelay);
|
||||
},
|
||||
|
||||
hidePicker: function() {
|
||||
this.$picker.hide(this.options.pickerDelay);
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the given span inside $colorList.
|
||||
*
|
||||
@@ -156,6 +161,7 @@
|
||||
// Change HTML select value
|
||||
this.$select.val(color);
|
||||
},
|
||||
|
||||
/**
|
||||
* The user clicked on a color inside $colorList.
|
||||
*/
|
||||
@@ -166,6 +172,7 @@
|
||||
this.$select.trigger('change');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Prevents the mousedown event from "eating" the click event.
|
||||
*/
|
||||
@@ -173,6 +180,7 @@
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if (this.options.picker === true) {
|
||||
this.$icon.off('.' + this.type);
|
||||
@@ -216,8 +224,10 @@
|
||||
$.fn.simplecolorpicker.defaults = {
|
||||
// No theme by default
|
||||
theme: '',
|
||||
|
||||
// Show the picker or make it inline
|
||||
picker: false,
|
||||
|
||||
// Animation delay in milliseconds
|
||||
pickerDelay: 0
|
||||
};
|
||||
|
794
css/moment.min.js
vendored
794
css/moment.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Courier';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Courier-Bold';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Courier-BoldOblique';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Courier-Oblique';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Helvetica';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Helvetica-Bold';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Helvetica-BoldOblique';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Helvetica-Oblique';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************************
|
||||
* Utility to generate font definition files *
|
||||
* *
|
||||
@@ -16,15 +15,18 @@ function ReadMap($enc)
|
||||
if(empty($a))
|
||||
die('<b>Error:</b> encoding not found: '.$enc);
|
||||
$cc2gn=array();
|
||||
foreach ($a as $l) {
|
||||
if ($l[0] == '!') {
|
||||
foreach($a as $l)
|
||||
{
|
||||
if($l[0]=='!')
|
||||
{
|
||||
$e=preg_split('/[ \\t]+/',rtrim($l));
|
||||
$cc=hexdec(substr($e[0],1));
|
||||
$gn=$e[2];
|
||||
$cc2gn[$cc]=$gn;
|
||||
}
|
||||
}
|
||||
for ($i = 0; $i <= 255; $i++) {
|
||||
for($i=0;$i<=255;$i++)
|
||||
{
|
||||
if(!isset($cc2gn[$i]))
|
||||
$cc2gn[$i]='.notdef';
|
||||
}
|
||||
@@ -47,30 +49,37 @@ function ReadAFM($file, &$map)
|
||||
'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
|
||||
'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
|
||||
'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
|
||||
foreach ($a as $l) {
|
||||
foreach($a as $l)
|
||||
{
|
||||
$e=explode(' ',rtrim($l));
|
||||
if(count($e)<2)
|
||||
continue;
|
||||
$code=$e[0];
|
||||
$param=$e[1];
|
||||
if ($code == 'C') {
|
||||
if($code=='C')
|
||||
{
|
||||
//Character metrics
|
||||
$cc=(int)$e[1];
|
||||
$w=$e[4];
|
||||
$gn=$e[7];
|
||||
if(substr($gn,-4)=='20AC')
|
||||
$gn='Euro';
|
||||
if (isset($fix[$gn])) {
|
||||
if(isset($fix[$gn]))
|
||||
{
|
||||
//Fix incorrect glyph name
|
||||
foreach ($map as $c => $n) {
|
||||
foreach($map as $c=>$n)
|
||||
{
|
||||
if($n==$fix[$gn])
|
||||
$map[$c]=$gn;
|
||||
}
|
||||
}
|
||||
if (empty($map)) {
|
||||
if(empty($map))
|
||||
{
|
||||
//Symbolic font: use built-in encoding
|
||||
$widths[$cc]=$w;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$widths[$gn]=$w;
|
||||
if($gn=='X')
|
||||
$fm['CapXHeight']=$e[13];
|
||||
@@ -103,14 +112,17 @@ function ReadAFM($file, &$map)
|
||||
}
|
||||
if(!isset($fm['FontName']))
|
||||
die('FontName not found');
|
||||
if (!empty($map)) {
|
||||
if(!empty($map))
|
||||
{
|
||||
if(!isset($widths['.notdef']))
|
||||
$widths['.notdef']=600;
|
||||
if(!isset($widths['Delta']) && isset($widths['increment']))
|
||||
$widths['Delta']=$widths['increment'];
|
||||
//Order widths according to map
|
||||
for ($i = 0; $i <= 255; $i++) {
|
||||
if (!isset($widths[$map[$i]])) {
|
||||
for($i=0;$i<=255;$i++)
|
||||
{
|
||||
if(!isset($widths[$map[$i]]))
|
||||
{
|
||||
echo '<b>Warning:</b> character '.$map[$i].' is missing<br>';
|
||||
$widths[$i]=$widths['.notdef'];
|
||||
}
|
||||
@@ -178,7 +190,8 @@ function MakeWidthArray($fm)
|
||||
//Make character width array
|
||||
$s="array(\n\t";
|
||||
$cw=$fm['Widths'];
|
||||
for ($i = 0; $i <= 255; $i++) {
|
||||
for($i=0;$i<=255;$i++)
|
||||
{
|
||||
if(chr($i)=="'")
|
||||
$s.="'\\''";
|
||||
elseif(chr($i)=="\\")
|
||||
@@ -203,8 +216,10 @@ function MakeFontEncoding($map)
|
||||
$ref=ReadMap('cp1252');
|
||||
$s='';
|
||||
$last=0;
|
||||
for ($i = 32; $i <= 255; $i++) {
|
||||
if ($map[$i] != $ref[$i]) {
|
||||
for($i=32;$i<=255;$i++)
|
||||
{
|
||||
if($map[$i]!=$ref[$i])
|
||||
{
|
||||
if($i!=$last+1)
|
||||
$s.=$i.' ';
|
||||
$last=$i;
|
||||
@@ -247,14 +262,17 @@ function CheckTTF($file)
|
||||
fseek($f,6,SEEK_CUR);
|
||||
//Seek OS/2 table
|
||||
$found=false;
|
||||
for ($i = 0; $i < $nb; $i++) {
|
||||
if (fread($f, 4) == 'OS/2') {
|
||||
for($i=0;$i<$nb;$i++)
|
||||
{
|
||||
if(fread($f,4)=='OS/2')
|
||||
{
|
||||
$found=true;
|
||||
break;
|
||||
}
|
||||
fseek($f,12,SEEK_CUR);
|
||||
}
|
||||
if (!$found) {
|
||||
if(!$found)
|
||||
{
|
||||
fclose($f);
|
||||
return;
|
||||
}
|
||||
@@ -279,14 +297,14 @@ function CheckTTF($file)
|
||||
* patch: optional patch for encoding *
|
||||
* type: font type if fontfile is empty *
|
||||
*******************************************************************************/
|
||||
|
||||
function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType')
|
||||
{
|
||||
//Generate a font definition file
|
||||
if(get_magic_quotes_runtime())
|
||||
@set_magic_quotes_runtime(0);
|
||||
ini_set('auto_detect_line_endings','1');
|
||||
if ($enc) {
|
||||
if($enc)
|
||||
{
|
||||
$map=ReadMap($enc);
|
||||
foreach($patch as $cc=>$gn)
|
||||
$map[$cc]=$gn;
|
||||
@@ -302,7 +320,8 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
$diff='';
|
||||
$fd=MakeFontDescriptor($fm,empty($map));
|
||||
//Find font type
|
||||
if ($fontfile) {
|
||||
if($fontfile)
|
||||
{
|
||||
$ext=strtolower(substr($fontfile,-3));
|
||||
if($ext=='ttf')
|
||||
$type='TrueType';
|
||||
@@ -311,7 +330,8 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
else
|
||||
die('<b>Error:</b> unrecognized font file extension: '.$ext);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
if($type!='TrueType' && $type!='Type1')
|
||||
die('<b>Error:</b> incorrect font type: '.$type);
|
||||
}
|
||||
@@ -331,7 +351,8 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
$s.='$enc=\''.$enc."';\n";
|
||||
$s.='$diff=\''.$diff."';\n";
|
||||
$basename=substr(basename($afmfile),0,-4);
|
||||
if ($fontfile) {
|
||||
if($fontfile)
|
||||
{
|
||||
//Embedded font
|
||||
if(!file_exists($fontfile))
|
||||
die('<b>Error:</b> font file not found: '.$fontfile);
|
||||
@@ -342,10 +363,12 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
die('<b>Error:</b> Can\'t open '.$fontfile);
|
||||
$file=fread($f,filesize($fontfile));
|
||||
fclose($f);
|
||||
if ($type == 'Type1') {
|
||||
if($type=='Type1')
|
||||
{
|
||||
//Find first two sections and discard third one
|
||||
$header=(ord($file[0])==128);
|
||||
if ($header) {
|
||||
if($header)
|
||||
{
|
||||
//Strip first binary header
|
||||
$file=substr($file,6);
|
||||
}
|
||||
@@ -353,7 +376,8 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
if(!$pos)
|
||||
die('<b>Error:</b> font file does not seem to be valid Type1');
|
||||
$size1=$pos+6;
|
||||
if ($header && ord($file[$size1]) == 128) {
|
||||
if($header && ord($file[$size1])==128)
|
||||
{
|
||||
//Strip second binary header
|
||||
$file=substr($file,0,$size1).substr($file,$size1+6);
|
||||
}
|
||||
@@ -363,23 +387,28 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
$size2=$pos-$size1;
|
||||
$file=substr($file,0,$size1+$size2);
|
||||
}
|
||||
if (function_exists('gzcompress')) {
|
||||
if(function_exists('gzcompress'))
|
||||
{
|
||||
$cmp=$basename.'.z';
|
||||
SaveToFile($cmp,gzcompress($file),'b');
|
||||
$s.='$file=\''.$cmp."';\n";
|
||||
echo 'Font file compressed ('.$cmp.')<br>';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$s.='$file=\''.basename($fontfile)."';\n";
|
||||
echo '<b>Notice:</b> font file could not be compressed (zlib extension not available)<br>';
|
||||
}
|
||||
if ($type == 'Type1') {
|
||||
if($type=='Type1')
|
||||
{
|
||||
$s.='$size1='.$size1.";\n";
|
||||
$s.='$size2='.$size2.";\n";
|
||||
}
|
||||
else
|
||||
$s.='$originalsize='.filesize($fontfile).";\n";
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
//Not embedded font
|
||||
$s.='$file='."'';\n";
|
||||
}
|
||||
@@ -387,5 +416,4 @@ function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type
|
||||
SaveToFile($basename.'.php',$s,'t');
|
||||
echo 'Font definition file generated ('.$basename.'.php'.')<br>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Symbol';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Times-Roman';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Times-Bold';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Times-BoldItalic';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'Times-Italic';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$type = 'Core';
|
||||
$name = 'ZapfDingbats';
|
||||
$up = -100;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Fichero de configuración donde se introducirán los valores para
|
||||
* la conexión con el servidor MySQL y otros para personalizar la aplicación.
|
||||
@@ -21,20 +20,20 @@
|
||||
* along with Inventario. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
require_once 'version.inc';
|
||||
|
||||
define('AUTOR','Ricardo Montañana Gómez');
|
||||
define('SERVIDOR','localhost'); //Ubicación del servidor MySQL
|
||||
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.
|
||||
define('VERSION','1.03');
|
||||
define('PROGRAMA','Gestión de Inventario.');
|
||||
define('CENTRO','I.E.S.O. Pascual Serrano');
|
||||
define('NUMFILAS', '17'); // Número de registros a mostrar en las pantallas de consulta iniciales
|
||||
define('PAUSA', '2'); //Nº segundos de pausa para mostrar mensaje id insertado
|
||||
define('APLICACION',PROGRAMA.VERSION);
|
||||
define('NUMFILAS',17); // Número de registros a mostrar en las pantallas de consulta iniciales
|
||||
define('PAUSA',2);//Nº segundos de pausa para mostrar mensaje id insertado
|
||||
define('ESTILO','personal'); //Estilo de los iconos de edición (personal, personal, personal)
|
||||
define('PLANTILLA','bootstrap'); //Estilo de la plantilla y recursos a utilizar
|
||||
define('COLORLAT', '#46d6db'); //Color de la barra de menú lateral
|
||||
define('COLORLAT', '#7ae7bf'); //Color de la barra de menú lateral
|
||||
define('COLORFON', '#a4bdfc'); //Color del fondo de la pantalla
|
||||
define('MYSQLDUMP', '/usr/local/bin/mysqldump'); //camino a mysqldump
|
||||
define('GZIP', '/usr/bin/gzip'); //Camino a gzip
|
||||
|
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Fichero de configuración donde se introducirán los valores
|
||||
* de autor y de la versión
|
||||
* @package Inventario
|
||||
* @copyright Copyright (c) 2008, Ricardo Montañana Gómez
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* This file is part of Inventario.
|
||||
* Inventario is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Inventario is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Inventario. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
define('AUTOR', 'Ricardo Montañana Gómez');
|
||||
define('VERSION', '1.03b');
|
||||
?>
|
3312
phpqrcode.php
3312
phpqrcode.php
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<!--<li><a href="#">{usuario}</a></li>-->
|
||||
<li><a href="#">{usuario}</a></li>
|
||||
<li><a href="#">{fecha}</a></li>
|
||||
<li>{control}</li>
|
||||
</ul>
|
||||
|
@@ -22,8 +22,8 @@
|
||||
$host="localhost";
|
||||
$baseAnt="Inventario";
|
||||
$baseNueva="Inventario2";
|
||||
$usuario="root";
|
||||
$claveUsuario="galeote";
|
||||
$usuario="test";
|
||||
$claveUsuario="tset";
|
||||
$probar=false;
|
||||
|
||||
|
||||
|
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'Configuracion.php';
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-07 at 23:58:14.
|
||||
*/
|
||||
class ConfiguracionTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
/**
|
||||
* @var Configuracion
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->config = new Configuracion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Configuracion::ejecuta
|
||||
*/
|
||||
public function testEjecuta()
|
||||
{
|
||||
$this->assertFileExists('inc/Configuracion.inc', "El fichero de configuración no existe");
|
||||
$permisos = fileperms('inc/Configuracion.inc');
|
||||
//Comprueba que el propietario o el grupo tengan derecho de escritura
|
||||
$test = $permisos & 0x0080 || $permisos & 0x0010;
|
||||
$this->assertTrue($test, "El fichero de configuración no tiene los permisos adecuados");
|
||||
//Comprueba que existan todas las claves editables en el fichero de configuración.
|
||||
$fichero = $this->config->obtieneFichero();
|
||||
$this->assertNotNull($fichero, "El fichero de configuración no se ha leído o no tiene contenido");
|
||||
$lineas = explode("\n", $fichero);
|
||||
$campos = $this->config->obtieneLista();
|
||||
$numero = 0;
|
||||
$lista = implode(",", $campos);
|
||||
//var_dump($campos);
|
||||
//var_dump($lista);
|
||||
foreach ($lineas as $linea) {
|
||||
if (stripos($linea, "DEFINE") !== false) {
|
||||
$this->assertStringMatchesFormat("define('%s', '%s');%S", $linea, "La línea [" . $linea . "] del fichero de configuración no tiene el formato correcto");
|
||||
$this->config->obtieneDatos($linea, $clave, $valor);
|
||||
if (stripos($lista, $clave) !== false) {
|
||||
$this->assertContains($clave, $campos, "El fichero de configuración no tiene la clave [" . $clave . "]");
|
||||
$numero++;
|
||||
$verificados[] = $clave;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assertCount($numero, $campos, "No se han verificado todas las claves");
|
||||
if ($numero != count($campos)) {
|
||||
echo "Las claves verificadas han sido: \n";
|
||||
var_export($verificados);
|
||||
}
|
||||
// @todo comprobar que la salida incluye una tabla con todos los campos editables.
|
||||
// @todo comprobar que los valores seleccionados se corresponden co los del fichero
|
||||
$salida = $this->config->ejecuta();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once('Menu.php');
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-08 at 17:47:42.
|
||||
*/
|
||||
class MenuTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
/**
|
||||
* @var Menu
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new Menu('inc/inventario.menu');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Menu::insertaMenu
|
||||
* @todo Implement testInsertaMenu().
|
||||
*/
|
||||
public function testInsertaMenu()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,204 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once('inc/configuracion.inc');
|
||||
require_once('Sql.php');
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-08 at 01:19:34.
|
||||
*/
|
||||
class SqlTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
/**
|
||||
* @var Sql
|
||||
*/
|
||||
protected $bd;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
* @covers Sql::__construct
|
||||
* @uses Sql
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->bd = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOSTEST);
|
||||
$this->assertFalse($this->bd->error(), "No se ha conectado a la base de datos de pruebas [" . BASEDATOSTEST . "]");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::__destruct
|
||||
* @todo Implement test__destruct().
|
||||
*/
|
||||
public function test__destruct()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::filtra
|
||||
* @todo Implement testFiltra().
|
||||
*/
|
||||
public function testFiltra()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::ejecuta
|
||||
* @todo Implement testEjecuta().
|
||||
*/
|
||||
public function testEjecuta()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::procesaResultado
|
||||
* @todo Implement testProcesaResultado().
|
||||
*/
|
||||
public function testProcesaResultado()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::camposResultado
|
||||
* @todo Implement testCamposResultado().
|
||||
*/
|
||||
public function testCamposResultado()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::numeroTuplas
|
||||
* @todo Implement testNumeroTuplas().
|
||||
*/
|
||||
public function testNumeroTuplas()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::error
|
||||
* @todo Implement testError().
|
||||
*/
|
||||
public function testError()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::mensajeError
|
||||
* @todo Implement testMensajeError().
|
||||
*/
|
||||
public function testMensajeError()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::estructura
|
||||
* @todo Implement testEstructura().
|
||||
*/
|
||||
public function testEstructura()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::ultimoId
|
||||
* @todo Implement testUltimoId().
|
||||
*/
|
||||
public function testUltimoId()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::obtieneManejador
|
||||
* @todo Implement testObtieneManejador().
|
||||
*/
|
||||
public function testObtieneManejador()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::comienzaTransaccion
|
||||
* @todo Implement testComienzaTransaccion().
|
||||
*/
|
||||
public function testComienzaTransaccion()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::abortaTransaccion
|
||||
* @todo Implement testAbortaTransaccion().
|
||||
*/
|
||||
public function testAbortaTransaccion()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Sql::confirmaTransaccion
|
||||
* @todo Implement testConfirmaTransaccion().
|
||||
*/
|
||||
public function testConfirmaTransaccion()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Informe>
|
||||
<Titulo Texto="{Descripcion}" id="{id}"/>
|
||||
<Datos>
|
||||
<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,
|
||||
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
|
||||
and A.id='{id}' order by U.Descripcion,numserie;
|
||||
</Consulta>
|
||||
</Datos>
|
||||
<Pagina Orientacion="P" Formato="A4">
|
||||
<Cabecera>Articulo</Cabecera>
|
||||
<Cuerpo>
|
||||
<Col Nombre="Baja" Titulo="Baja"/>
|
||||
<Col Nombre="idEl" Titulo="idElem"/>
|
||||
<Col Nombre="idUbic" Titulo="idUbic"/>
|
||||
<Col Nombre="articulo" Titulo="Articulo"/>
|
||||
<Col Nombre="ubicacion" Titulo="Ubicación"/>
|
||||
<Col Nombre="numserie" Titulo="N Serie"/>
|
||||
<Col Nombre="fechaCompra" Titulo="Fecha C." />
|
||||
<Col Nombre="cantidad" Titulo="Cantidad"/>
|
||||
<Col Nombre="cantReal" Titulo="Cant. Real"/>
|
||||
</Cuerpo>
|
||||
</Pagina>
|
||||
</Informe>
|
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Informe>
|
||||
<Titulo Texto="{Descripcion}" id="{id}"/>
|
||||
<Datos>
|
||||
<Consulta>
|
||||
select A.id as idArt,E.id as idEl,U.id as idUbic,U.Descripcion as ubicacion,A.Marca as marca,A.Modelo as modelo,E.numSerie as numserie,
|
||||
E.fechaCompra as fechaCompra,A.Descripcion as articulo,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
|
||||
and U.id='{id}' order by A.descripcion;
|
||||
</Consulta>
|
||||
</Datos>
|
||||
<Pagina Horizontal="2" Vertical="7">
|
||||
<Cabecera>Ubicacion</Cabecera>
|
||||
<Cuerpo>
|
||||
<Col Nombre="Qr" Valor="{url}"/>
|
||||
<Col Nombre="idEl" Titulo="idElem"/>
|
||||
<Col Nombre="idArt" Titulo="idArt"/>
|
||||
<Col Nombre="idUbic" Titulo="idUbic"/>
|
||||
<Col Nombre="ubicacion" Titulo="Ubicacion"/>
|
||||
<Col Nombre="articulo" Titulo="Artículo"/>
|
||||
<Col Nombre="marca" Titulo="Marca"/>
|
||||
<Col Nombre="modelo" Titulo="Modelo"/>
|
||||
<Col Nombre="numserie" Titulo="N Serie"/>
|
||||
<Col Nombre="fechaCompra" Titulo="Fecha C." />
|
||||
<Col Nombre="cantidad" Titulo="Cantidad"/>
|
||||
<Col Nombre="cantReal" Titulo="Cant. Real"/>
|
||||
</Cuerpo>
|
||||
</Pagina>
|
||||
</Informe>
|
Reference in New Issue
Block a user