diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/_resumenItems.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/_resumenItems.php
index b70b5fc2..f3d1ea6b 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/_resumenItems.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/_resumenItems.php
@@ -12,7 +12,8 @@
+
@@ -50,6 +78,6 @@
= $this->section("additionalInlineJs") ?>
window.routes_resumen = {
- guardarPresupuesto: "= route_to('guardarPresupuesto') ?>",
+guardarPresupuesto: "= route_to('guardarPresupuesto') ?>",
}
= $this->endSection() ?>
\ No newline at end of file
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js
index 8931667f..ace8796f 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js
@@ -279,7 +279,7 @@
item.addEventListener('click', event => {
// When click the Next button, we will validate the current step
switch (validationStepper._currentIndex) {
- case 0:
+ /*case 0:
FormValidation2.validate();
break;
@@ -293,9 +293,10 @@
case 3:
FormValidation5.validate();
- break;
+ break;*/
default:
+ validationStepper.next();
break;
}
});
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js
index 0a0d202c..aa59fb4f 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js
@@ -1,18 +1,26 @@
// Global parameters
var pvObj;
-$('#toReview').on( "click", function() {
+$('#toReview').on("click", function () {
console.log('ec draw');
- portadaTapaDura();
+ portadaTapaDura(true);
//previewEsquemaCubierta('ec', '','');
-} );
+});
+
+$(document).on('shown.bs.modal', function (e) {
+ // do cool stuff here all day… no need to change bootstrap
+ console.log('eooo');
+
+ portadaTapaDura(false);
+})
-function previewEsquemaCubierta() {
+
+function previewEsquemaCubierta(isThumbnail) {
/*let tipoImpresion;
@@ -44,7 +52,7 @@ function previewEsquemaCubierta() {
}
-function portadaTapaDura() {
+function portadaTapaDura(isThumbnail = false) {
// Variables locales
let altoLibro, anchoLibro, lomoLibro, anchoCubierta, altoSangrado, anchoSangrado;
@@ -55,22 +63,32 @@ function portadaTapaDura() {
let altoPliegue = parseFloat(7); // mm
let anchoCarton = parseFloat(7); // mm
+ let divIdName = (isThumbnail) ? 'thumbnail_ec_shape' : 'pv_ec_shape';
+
// Get the preview Object parameters
getObjetoToPreview();
- // Definicion de los parametros del Esquema de Cubierta (EC) -
- anchoSangrado = 400; // px
- altoSangrado = (anchoSangrado * 0.647 > 350) ? anchoSangrado * 0.647 : 350; // px
+ // Definicion de los parametros del Esquema de Cubierta (EC)
+ if (isThumbnail) {
+ anchoSangrado = 350; // px
+ altoSangrado = (anchoSangrado * 0.647 > 300) ? 300 : anchoSangrado * 0.647; // px
+ } else {
+ anchoSangrado = 700; // px
+ altoSangrado = (anchoSangrado * 0.647 > 650) ? 650 : anchoSangrado * 0.647; // px
+ }
altoLibro = altoSangrado * 0.88;
anchoLibro = anchoSangrado * 0.39;
lomoLibro = anchoSangrado * 0.133;
anchoCubierta = (2 * anchoLibro) + lomoLibro;
// Clear the canvas element
- $('#pv_ec_shape').empty();
+ $(`#${divIdName}`).empty();
// Get the element for placing the graphical elements
- var divEC = document.getElementById('pv_ec_shape');
+ var divEC = document.getElementById(divIdName);
var previewEC = new Two({fitted: true}).appendTo(divEC);
+ //previewEC.width = 700;
+ //previewEC.height = 650;
+
// Calculate the center of the canvas element
var origenEC = new Two.Vector(previewEC.width / 2, previewEC.height / 2);
@@ -102,73 +120,77 @@ function portadaTapaDura() {
lomo.fill = '#F4F8F2';
lomo.linewidth = 1;
- // Cotas
- var cotaAnchoCubierta = previewEC.makeDobleArrow(
- origenEC.x - (anchoSangrado / 2),
- origenEC.y + (altoLibro / 2) + 35,
- origenEC.x + (anchoSangrado / 2),
- origenEC.y + (altoLibro / 2) + 35,
- 10);
- cotaAnchoCubierta.linewidth = 2;
- var cotaAltoCubierta = previewEC.makeDobleArrow(
- origenEC.x + (anchoCubierta / 2) + 35,
- origenEC.y + (altoSangrado / 2),
- origenEC.x + (anchoCubierta / 2) + 35,
- origenEC.y - (altoSangrado / 2),
- 10);
- cotaAltoCubierta.linewidth = 2;
- var cotaAltoLibro = previewEC.makeDobleArrow(
- origenEC.x + (lomoLibro / 2) + 35,
- origenEC.y + (altoLibro / 2),
- origenEC.x + (lomoLibro / 2) + 35,
- origenEC.y - (altoLibro / 2),
- 10);
- cotaAltoLibro.linewidth = 2;
- var cotaLomo = previewEC.makeDobleArrow(
- origenEC.x - (lomoLibro / 2),
- origenEC.y + (altoLibro / 3),
- origenEC.x + (lomoLibro / 2),
- origenEC.y + (altoLibro / 3),
- 10);
- cotaLomo.linewidth = 2;
- var cotaContraportada = previewEC.makeDobleArrow(
- origenEC.x - (lomoLibro / 2 + anchoLibro),
- origenEC.y - (altoLibro / 3),
- origenEC.x - (lomoLibro / 2),
- origenEC.y - (altoLibro / 3),
- 10);
- cotaContraportada.linewidth = 2;
- var cotaPortada = previewEC.makeDobleArrow(
- origenEC.x + (lomoLibro / 2),
- origenEC.y - (altoLibro / 3),
- origenEC.x + (lomoLibro / 2 + anchoLibro),
- origenEC.y - (altoLibro / 3),
- 10);
- cotaPortada.linewidth = 2;
+ // Cotas y textos
+ if (!isThumbnail) {
+ // Cotas:
+ var cotaAnchoCubierta = previewEC.makeDobleArrow(
+ origenEC.x - (anchoSangrado / 2),
+ origenEC.y + (altoLibro / 2) + 35,
+ origenEC.x + (anchoSangrado / 2),
+ origenEC.y + (altoLibro / 2) + 35,
+ 10);
+ cotaAnchoCubierta.linewidth = 2;
+ var cotaAltoCubierta = previewEC.makeDobleArrow(
+ origenEC.x + (anchoCubierta / 2) + 35,
+ origenEC.y + (altoSangrado / 2),
+ origenEC.x + (anchoCubierta / 2) + 35,
+ origenEC.y - (altoSangrado / 2),
+ 10);
+ cotaAltoCubierta.linewidth = 2;
+ var cotaAltoLibro = previewEC.makeDobleArrow(
+ origenEC.x + (lomoLibro / 2) + 35,
+ origenEC.y + (altoLibro / 2),
+ origenEC.x + (lomoLibro / 2) + 35,
+ origenEC.y - (altoLibro / 2),
+ 10);
+ cotaAltoLibro.linewidth = 2;
+ var cotaLomo = previewEC.makeDobleArrow(
+ origenEC.x - (lomoLibro / 2),
+ origenEC.y + (altoLibro / 3),
+ origenEC.x + (lomoLibro / 2),
+ origenEC.y + (altoLibro / 3),
+ 10);
+ cotaLomo.linewidth = 2;
+ var cotaContraportada = previewEC.makeDobleArrow(
+ origenEC.x - (lomoLibro / 2 + anchoLibro),
+ origenEC.y - (altoLibro / 3),
+ origenEC.x - (lomoLibro / 2),
+ origenEC.y - (altoLibro / 3),
+ 10);
+ cotaContraportada.linewidth = 2;
+ var cotaPortada = previewEC.makeDobleArrow(
+ origenEC.x + (lomoLibro / 2),
+ origenEC.y - (altoLibro / 3),
+ origenEC.x + (lomoLibro / 2 + anchoLibro),
+ origenEC.y - (altoLibro / 3),
+ 10);
+ cotaPortada.linewidth = 2;
- // Textos:
- // Titulos generales
- let stylesEC = {size: 22, weight: 'bold', family: 'Public Sans'};
- previewEC.makeText("Portada", origenEC.x + (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
- previewEC.makeText("Contraportada", origenEC.x - (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
- previewEC.makeText("Lomo", origenEC.x, origenEC.y, stylesEC).rotation = -Math.PI / 2;
- // Sangrados
- let styleSangrado = {size: 10, family: 'Public Sans', style: 'italic', fill: 'red'};
- previewEC.makeText(sangradoTexto, origenEC.x, origenEC.y + (altoLibro / 2 + 13), styleSangrado);
- previewEC.makeText(sangradoTexto, origenEC.x, origenEC.y - (altoLibro / 2 + 13), styleSangrado);
- previewEC.makeText(sangradoTexto, origenEC.x + (lomoLibro / 2 + anchoLibro + 13), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
- previewEC.makeText(sangradoTexto, origenEC.x - (lomoLibro / 2 + anchoLibro + 13), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
- // Cotas
- previewEC.makeText(pvObj.lomoLibro + anchoCarton + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas);
- previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
- previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
- previewEC.makeText(pvObj.altoLibro + altoPliegue + " mm", origenEC.x + (lomoLibro / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
- previewEC.makeText(pvObj.altoLibro + (2 * sangradoValor) + altoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
- previewEC.makeText((2 * pvObj.anchoLibro) + pvObj.lomoLibro + (2 * sangradoValor) + +(2 * anchoPliegue) + anchoCarton + " mm",
- origenEC.x,
- origenEC.y + (altoLibro / 2) + 50,
- styleCotas);
+ // Textos:
+ // Titulos generales
+ let stylesEC = {size: 22, weight: 'bold', family: 'Public Sans'};
+ previewEC.makeText("Portada", origenEC.x + (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
+ previewEC.makeText("Contraportada", origenEC.x - (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
+ previewEC.makeText("Lomo", origenEC.x, origenEC.y, stylesEC).rotation = -Math.PI / 2;
+ // Sangrados
+ let styleSangrado = {size: 10, family: 'Public Sans', style: 'italic', fill: 'red'};
+ previewEC.makeText(sangradoTexto, origenEC.x, origenEC.y + (altoLibro / 2 + 13), styleSangrado);
+ previewEC.makeText(sangradoTexto, origenEC.x, origenEC.y - (altoLibro / 2 + 13), styleSangrado);
+ previewEC.makeText(sangradoTexto, origenEC.x + (lomoLibro / 2 + anchoLibro + 13), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
+ previewEC.makeText(sangradoTexto, origenEC.x - (lomoLibro / 2 + anchoLibro + 13), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
+ // Cotas
+ previewEC.makeText(pvObj.lomoLibro + anchoCarton + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas);
+ previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
+ previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
+ previewEC.makeText(pvObj.altoLibro + altoPliegue + " mm", origenEC.x + (lomoLibro / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
+ previewEC.makeText(pvObj.altoLibro + (2 * sangradoValor) + altoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
+ previewEC.makeText((2 * pvObj.anchoLibro) + pvObj.lomoLibro + (2 * sangradoValor) + +(2 * anchoPliegue) + anchoCarton + " mm",
+ origenEC.x,
+ origenEC.y + (altoLibro / 2) + 50,
+ styleCotas);
+
+ }
previewEC.update();
@@ -363,24 +385,23 @@ function portadaEspiral() {
// Definicion de los parametros del Esquema de Cubierta (EC)
anchoSangrado = 600; // px
- if((pvObj.anchoSolapa !== 0) && (isTapaDura === 0)){
+ if ((pvObj.anchoSolapa !== 0) && (isTapaDura === 0)) {
altoSangrado = (anchoSangrado * 0.418 > 350) ? anchoSangrado * 0.418 : 350; // px
altoLibro = altoSangrado * 0.95;
anchoLibro = anchoSangrado * 0.28;
anchoCalle = anchoSangrado * 0.02;
anchoSolapa = anchoSangrado * 0.163;
sangrado = anchoSangrado * 0.03;
- anchoCubierta = 2 * (anchoLibro + anchoSolapa+ sangrado) + anchoCalle;
- offsetCubierta = anchoLibro/2 + anchoCalle/2 + anchoSolapa/2 + sangrado;
- }
- else {
+ anchoCubierta = 2 * (anchoLibro + anchoSolapa + sangrado) + anchoCalle;
+ offsetCubierta = anchoLibro / 2 + anchoCalle / 2 + anchoSolapa / 2 + sangrado;
+ } else {
altoSangrado = (anchoSangrado * 0.647 > 350) ? anchoSangrado * 0.647 : 350; // px
altoLibro = (isTapaDura) ? altoSangrado * 0.88 : altoSangrado * 0.97;
anchoLibro = (isTapaDura) ? anchoSangrado * 0.39 : anchoSangrado * 0.419;
anchoCalle = anchoSangrado * 0.02;
anchoSolapa = 0;
anchoCubierta = (2 * anchoLibro) + (2 * anchoSolapa) + anchoCalle;
- offsetCubierta = anchoLibro/2 + anchoCalle/2 + anchoSolapa + sangradoValor;
+ offsetCubierta = anchoLibro / 2 + anchoCalle / 2 + anchoSolapa + sangradoValor;
}
// Clear the canvas element
@@ -404,7 +425,7 @@ function portadaEspiral() {
if (pvObj.anchoSolapa != 0) {
var solapa1 = previewEC.makeRectangle(
- origenEC.x + (anchoLibro + anchoCalle/2 + anchoSolapa/2 + sangradoValor),
+ origenEC.x + (anchoLibro + anchoCalle / 2 + anchoSolapa / 2 + sangradoValor),
origenEC.y,
anchoSolapa,
altoLibro);
@@ -412,7 +433,7 @@ function portadaEspiral() {
solapa1.linewidth = 1;
var solapa2 = previewEC.makeRectangle(
- origenEC.x - (anchoLibro + anchoCalle/2 + anchoSolapa/2 + sangradoValor),
+ origenEC.x - (anchoLibro + anchoCalle / 2 + anchoSolapa / 2 + sangradoValor),
origenEC.y,
anchoSolapa,
altoLibro);
@@ -421,14 +442,14 @@ function portadaEspiral() {
// Cotas Solapas
var cotaSolapa2 = previewEC.makeDobleArrow(
- origenEC.x - (anchoCalle/2 + sangradoValor + anchoLibro + anchoSolapa),
+ origenEC.x - (anchoCalle / 2 + sangradoValor + anchoLibro + anchoSolapa),
origenEC.y - (altoLibro / 3),
origenEC.x - (anchoLibro + sangradoValor + anchoCalle / 2),
origenEC.y - (altoLibro / 3),
10);
cotaSolapa2.linewidth = 2;
var cotaSolapa1 = previewEC.makeDobleArrow(
- origenEC.x + (anchoCalle/2 + sangradoValor + anchoLibro + anchoSolapa),
+ origenEC.x + (anchoCalle / 2 + sangradoValor + anchoLibro + anchoSolapa),
origenEC.y - (altoLibro / 3),
origenEC.x + (anchoLibro + sangradoValor + anchoCalle / 2),
origenEC.y - (altoLibro / 3),
@@ -446,7 +467,7 @@ function portadaEspiral() {
}
var portada = previewEC.makeRectangle(
- origenEC.x + (anchoLibro/2 + anchoCalle/2 + sangradoValor),
+ origenEC.x + (anchoLibro / 2 + anchoCalle / 2 + sangradoValor),
origenEC.y,
anchoLibro,
altoLibro);
@@ -454,7 +475,7 @@ function portadaEspiral() {
portada.linewidth = 1;
var contraportada = previewEC.makeRectangle(
- origenEC.x - (anchoLibro/2 + anchoCalle/2 + sangradoValor),
+ origenEC.x - (anchoLibro / 2 + anchoCalle / 2 + sangradoValor),
origenEC.y,
anchoLibro,
altoLibro);
@@ -513,12 +534,12 @@ function portadaEspiral() {
// Titulos generales
let stylesEC = {size: 22, weight: 'bold', family: 'Public Sans'};
previewEC.makeText("Portada",
- origenEC.x + anchoLibro/2 + anchoCalle/2 + sangradoValor + 15,
+ origenEC.x + anchoLibro / 2 + anchoCalle / 2 + sangradoValor + 15,
origenEC.y,
stylesEC
);
previewEC.makeText("Contraportada",
- origenEC.x - (anchoLibro/2 + anchoCalle/2 + sangradoValor),
+ origenEC.x - (anchoLibro / 2 + anchoCalle / 2 + sangradoValor),
origenEC.y,
stylesEC
);
@@ -531,8 +552,8 @@ function portadaEspiral() {
previewEC.makeText(sangradoTexto, origenEC.x + (anchoSangrado / 2) - 20, origenEC.y, styleSangrado).rotation = -Math.PI / 2;
previewEC.makeText(sangradoTexto, origenEC.x - (anchoSangrado / 2) + 20, origenEC.y, styleSangrado).rotation = -Math.PI / 2;
// Cotas
- previewEC.makeText(pvObj.anchoLibro + " mm", origenEC.x - (offsetCubierta - anchoSolapa/2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
- previewEC.makeText(pvObj.anchoLibro + " mm", origenEC.x + (offsetCubierta - anchoSolapa/2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
+ previewEC.makeText(pvObj.anchoLibro + " mm", origenEC.x - (offsetCubierta - anchoSolapa / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
+ previewEC.makeText(pvObj.anchoLibro + " mm", origenEC.x + (offsetCubierta - anchoSolapa / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(pvObj.altoLibro + " mm", origenEC.x + (anchoCalle / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(pvObj.altoLibro + (2 * sangradoValor) + " mm",
origenEC.x + (anchoSangrado / 2) + 30,
@@ -725,10 +746,10 @@ function getLomoLibro() {
function getObjetoToPreview() {
pvObj = {
- lomoLibro: parseFloat('30.0'),
- anchoSolapa: $('#solapasCubierta').is(':checked') ? parseFloat($('#anchoSolapasCubierta').val()) : parseFloat(0),
- altoLibro: getDimensionLibro().alto,
- anchoLibro: getDimensionLibro().ancho
+ lomoLibro: 30,//parseFloat($('#lomo_cubierta').val()),
+ anchoSolapa: 0, //$('#solapasCubierta').is(':checked') ? parseFloat($('#anchoSolapasCubierta').val()) : parseFloat(0),
+ altoLibro: 148, //getDimensionLibro().alto,
+ anchoLibro: 190, //getDimensionLibro().ancho
};
//console.log(pvObj);