Vista de lista del catálogo mejorada, corregidos errores en traducciones, corregidos errores tpv

This commit is contained in:
Juan Ferrer Toribio 2016-01-08 22:00:02 +01:00
parent c1992af214
commit df1fe12980
18 changed files with 350 additions and 255 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.319-deb8) stable; urgency=low hedera-web (1.321-deb8) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -29,6 +29,7 @@ class Tpv
,$conf['db']['user'] ,$conf['db']['user']
,base64_decode ($conf['db']['pass']) ,base64_decode ($conf['db']['pass'])
,$conf['db']['schema'] ,$conf['db']['schema']
,$conf['db']['port']
); );
} }
@ -185,8 +186,7 @@ class Tpv
&& isset ($params['Ds_Order']) && isset ($params['Ds_Order'])
&& isset ($params['Ds_MerchantCode']) && isset ($params['Ds_MerchantCode'])
&& isset ($params['Ds_Currency']) && isset ($params['Ds_Currency'])
&& isset ($params['Ds_Response']) && isset ($params['Ds_Response']))
&& isset ($params['Ds_Signature']))
{ {
if (isset ($params['Ds_ErrorCode'])) if (isset ($params['Ds_ErrorCode']))
$error = $params['Ds_ErrorCode']; $error = $params['Ds_ErrorCode'];

3
php-test Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
php -d auto_prepend_file=configure.php "$@"

View File

@ -6,12 +6,7 @@
{ {
max-width: 30em; max-width: 30em;
margin: 0 auto; margin: 0 auto;
} padding: 0 2em;
.basket .form
{
padding: 1em;
margin: 0;
background-color: #009688;
} }
.basket .form > p .basket .form > p
{ {
@ -20,12 +15,55 @@
color: white; color: white;
text-align: right; text-align: right;
} }
.basket .config .basket .head
{
padding: 1.8em 0;
margin: 0;
border-bottom: 1px solid #DDD;
}
.basket .head p
{ {
margin: 0; margin: 0;
padding: 0;
font-size: 1.4em;
text-align: right;
} }
/* Rows */ /* Lines */
.basket .lines
{
padding: .8em 0;
}
.basket .line
{
padding: 1em 0;
}
.basket .line > .delete
{
margin: -0.5em;
margin-top: .3em;
margin-right: .5em;
float: left;
}
.basket .line > .photo
{
margin-right: 1em;
float: left;
border-radius: 50%;
height: 3.2em;
}
.basket .line > p
{
margin: .1em 0;
margin-left: 7.5em;
}
.basket .line .subtotal
{
float: right;
}
/* Fields */
.basket td.available-exceeded input .basket td.available-exceeded input
{ {
@ -36,33 +74,3 @@
border-radius: 50%; border-radius: 50%;
} }
/* Lines */
.basket-line
{
padding: 1em;
border-bottom: 1px solid #DDD;
}
.basket-line > .delete
{
margin-top: .3em;
margin-right: .5em;
float: left;
}
.basket-line > .photo
{
margin-right: 1em;
float: left;
border-radius: 50%;
height: 3.2em;
}
.basket-line > p
{
margin: .1em 0;
margin-left: 7.5em;
}
.basket-line .subtotal
{
float: right;
}

View File

@ -21,7 +21,15 @@
</div> </div>
<div id="form" class="basket"> <div id="form" class="basket">
<div class="box"> <div class="box">
<div> <div class="head">
<p>
<t>Total</t>
<htk-text format="%.2d€">
<db-calc-sum property="param" func="subtotal" model="items"/>
</htk-text>
</p>
</div>
<div class="lines">
<htk-repeater form-id="iter" renderer="repeaterFunc"> <htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model id="items" property="model" updatable="true"> <db-model id="items" property="model" updatable="true">
<custom> <custom>
@ -33,7 +41,7 @@
</custom> </custom>
</db-model> </db-model>
<custom> <custom>
<div class="basket-line"> <div class="line">
<htk-button <htk-button
form="iter" form="iter"
column="ticket_id" column="ticket_id"
@ -65,14 +73,6 @@
</div> </div>
</custom> </custom>
</htk-repeater> </htk-repeater>
<div class="form">
<p>
<t>OrderTotal</t>
<htk-text format="%.2d€">
<db-calc-sum property="param" func="subtotal" model="items"/>
</htk-text>
</p>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -55,11 +55,8 @@ Vn.Catalog = new Class
,setView: function (view) ,setView: function (view)
{ {
if (this.viewNode) var grid = this.$('grid-view');
{ var node = grid.getNode ();
Vn.Node.remove (this.viewNode);
this.viewHolder.model = null;
}
if (view === Vn.Catalog.View.GRID) if (view === Vn.Catalog.View.GRID)
{ {
@ -68,8 +65,7 @@ Vn.Catalog = new Class
tip: _('List view') tip: _('List view')
}); });
this.view = Vn.Catalog.View.GRID; this.view = Vn.Catalog.View.GRID;
this.viewNode = this.$('grid-view').getNode (); var className = 'grid-view';
this.viewHolder = this.$('grid-view');
} }
else else
{ {
@ -78,13 +74,11 @@ Vn.Catalog = new Class
tip: _('Grid view') tip: _('Grid view')
}); });
this.view = Vn.Catalog.View.LIST; this.view = Vn.Catalog.View.LIST;
this.viewNode = this.$('list-view'); var className = 'list-view';
this.viewHolder = this.$('items-grid');
} }
this.$('main').appendChild (this.viewNode); node.className = className;
this.viewHolder.model = this.$('items-model'); Vn.Cookie.set ('hedera_view', this.view);
Vn.Cookie.set ('hedera_view', this.view)
} }
,onBasketReady: function (form) ,onBasketReady: function (form)

View File

@ -181,8 +181,8 @@ button.confirm > img
height: 1em; height: 1em;
} }
/* List view */ /* Items */
/*
.catalog .list-view .catalog .list-view
{ {
margin: 0 auto; margin: 0 auto;
@ -214,7 +214,7 @@ button.confirm > img
max-height: 2.5em; max-height: 2.5em;
max-width: 2.5em; max-width: 2.5em;
border-radius: 50%; border-radius: 50%;
} }*/
td.second-category td.second-category
{ {
font-weight: bold; font-weight: bold;
@ -236,16 +236,112 @@ td.third-category
text-align: center; text-align: center;
} }
/* List view */
.list-view
{
max-width: 30em;
margin: 0 auto;
padding: 1em;
}
.list-view .item-box
{
display: block;
position: relative;
width: 100%;
margin: 0;
height: 5.5em;
overflow: visible;
border-bottom: 1px solid #DDD;
}
.list-view .item-box > .image
{
margin: 1em;
width: 3.5em;
height: 3.5em;
float: left;
border-radius: 50%;
overflow: hidden;
}
.list-view .item-box > .image > img
{
max-width: 100%;
height: 100%;
display: block;
margin: 0 auto;
}
.list-view .item-info
{
position: absolute;
left: 4.6em;
right: 0;
top: 0;
bottom: 0;
margin: .9em;
}
.list-view .item-info > h2
{
font-size: 1em;
font-weight: normal;
padding: 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.list-view .item-info > p
{
margin: 0;
padding: 0;
color: #777;
font-size: .8em;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.list-view .item-info > .producer
{
text-transform: uppercase;
}
.list-view .item-info > .color
{
display: none;
}
.list-view .item-info > .aval-price
{
position: absolute;
bottom: 0;
right: .3em;
}
.list-view .item-info .from
{
font-size: .8em;
font-style: italic;
}
.list-view .item-info > .htk-button
{
float: right;
margin: -.3em;
padding: .3em;
}
.list-view .item-info > .htk-button > img
{
vertical-align: middle;
}
.list-view .item-info > .info-button
{
margin-right: 0;
}
/* Grid view */ /* Grid view */
.catalog .grid-view .grid-view
{ {
padding: 1em; padding: 1em;
padding-right: .2em; padding-right: .2em;
padding-bottom: .4em; padding-bottom: .4em;
text-align: center; text-align: center;
} }
.item-box .grid-view .item-box
{ {
text-align: left; text-align: left;
position: relative; position: relative;
@ -257,20 +353,20 @@ td.third-category
height: 10em; height: 10em;
overflow: hidden; overflow: hidden;
} }
.item-box > .image .grid-view .item-box > .image
{ {
width: 10em; width: 10em;
height: 100%; height: 100%;
float: left; float: left;
} }
.item-box > .image > img .grid-view .item-box > .image > img
{ {
max-width: 100%; max-width: 100%;
height: 100%; height: 100%;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
.item-info .grid-view .item-info
{ {
position: absolute; position: absolute;
left: 10.4em; left: 10.4em;
@ -279,13 +375,13 @@ td.third-category
bottom: 0; bottom: 0;
margin: .6em; margin: .6em;
} }
.item-info > h2 .grid-view .item-info > h2
{ {
font-size: 1.2em; font-size: 1.2em;
font-weight: normal; font-weight: normal;
padding-top: 0; padding-top: 0;
} }
.item-info > p .grid-view .item-info > p
{ {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -295,33 +391,33 @@ td.third-category
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
.item-info > .producer .grid-view .item-info > .producer
{ {
text-transform: uppercase; text-transform: uppercase;
} }
.item-info > .aval-price .grid-view .item-info > .aval-price
{ {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 2.8em; right: 2.8em;
} }
.item-info .from .grid-view .item-info .from
{ {
font-size: .8em; font-size: .8em;
font-style: italic; font-style: italic;
} }
.item-info .add-button .grid-view .item-info .add-button
{ {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 0; right: 0;
padding: .3em; padding: .3em;
} }
.item-info .add-button > img .grid-view .item-info .add-button > img
{ {
vertical-align: middle; vertical-align: middle;
} }
.item-info > .info-button .grid-view .item-info > .info-button
{ {
float: right; float: right;
} }

View File

@ -117,8 +117,72 @@
param="search"/> param="search"/>
</div> </div>
<div id="form" class="catalog"> <div id="form" class="catalog">
<div id="main" class="main"/> <div id="main" class="main">
<htk-repeater
id="grid-view"
class="grid-view"
empty-message="_Choose filter from right menu"
form-id="item"
renderer="gridRenderer"
model="items-model">
<custom>
<div class="box item-box">
<div class="image">
<htk-image
directory="catalog"
subdir="200x200"
form="item"
column="Foto"
show-full="true"
full-dir="900x900"
editable="true"/>
</div>
<div class="item-info">
<htk-button
form="item"
column="id"
tip="_AddToBasket"
image="image/add.svg"
on-click="onGridAddItemClick"
class="add-button"/>
<htk-button
form="item"
column="id"
tip="_More info"
image="image/info.svg"
on-click="onInfoClick"
id="info-button"
class="info-button"/>
<div class="aval-price">
<htk-text form="item" column="available"/>
<span class="from">
<t>from</t>
</span>
<span class="price">
<htk-text form="item" column="price" format="%.2d€"/>
</span>
</div>
<h2>
<htk-text form="item" column="Article"/>
</h2>
<p class="producer">
<htk-text form="item" column="producer"/>
</p>
<p>
<t>Size</t> <htk-text form="item" column="Medida"/>,
<t>Category</t> <htk-text form="item" column="Categoria"/>
</p>
<p class="color">
<t>Color</t> <htk-text form="item" column="color"/>
<htk-text form="item" column="Tallos" format="_, %.0d Units"/>
</p>
</div>
</div>
</custom>
</htk-repeater>
</div>
</div> </div>
<!--
<div id="list-view" class="list-view"> <div id="list-view" class="list-view">
<div class="box"> <div class="box">
<htk-grid <htk-grid
@ -164,67 +228,7 @@
</p> </p>
</div> </div>
</div> </div>
<htk-repeater -->
id="grid-view"
class="grid-view"
empty-message="_Choose filter from right menu"
form-id="item"
renderer="gridRenderer">
<custom>
<div class="box item-box">
<div class="image">
<htk-image
directory="catalog"
subdir="200x200"
form="item"
column="Foto"
show-full="true"
full-dir="900x900"
editable="true"/>
</div>
<div class="item-info">
<htk-button
form="item"
column="id"
tip="_More info"
image="image/info.svg"
on-click="onInfoClick"
id="info-button"
class="info-button"/>
<h2>
<htk-text form="item" column="Article"/>
</h2>
<p class="producer">
<htk-text form="item" column="producer"/>
</p>
<p>
<t>Size</t> <htk-text form="item" column="Medida"/>,
<t>Category</t> <htk-text form="item" column="Categoria"/>
</p>
<p>
<t>Color</t> <htk-text form="item" column="color"/>
<htk-text form="item" column="Tallos" format="_, %.0d Units"/>
</p>
<div class="aval-price">
<htk-text form="item" column="available"/>
<span class="from">
<t>from</t>
</span>
<span class="price">
<htk-text form="item" column="price" format="%.2d€"/>
</span>
</div>
<htk-button
form="item"
column="id"
tip="_AddToBasket"
image="image/add.svg"
on-click="onGridAddItemClick"
class="add-button"/>
</div>
</div>
</custom>
</htk-repeater>
<div id="right-panel" class="right-panel" on-click="onRightPanelClick"> <div id="right-panel" class="right-panel" on-click="onRightPanelClick">
<div class="basket-info"> <div class="basket-info">
<p> <p>

View File

@ -60,7 +60,7 @@
</div> </div>
<div> <div>
<p class="important total"> <p class="important total">
Total <t>Total</t>
<htk-text format="%.2d€"> <htk-text format="%.2d€">
<db-calc-sum property="param" func="subtotal" model="movements"/> <db-calc-sum property="param" func="subtotal" model="movements"/>
</htk-text> </htk-text>

View File

@ -62,7 +62,7 @@ body
right: 0; right: 0;
} }
@media (max-height: 700px) @media (max-height: 630px)
{ {
.vn-login .vn-login
{ {

View File

@ -10,7 +10,7 @@
/* Desktop - Laptop 1360x768 */ /* Desktop - Laptop 1360x768 */
@media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) @media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px)
{ {
body { font-size: 12pt; } body { font-size: 11pt; }
} }
/* Desktop - FHD 1920x1080 */ /* Desktop - FHD 1920x1080 */

View File

@ -11,7 +11,7 @@
,"LastOrders": "Últimes comandes" ,"LastOrders": "Últimes comandes"
,"Balance:": "Saldo:" ,"Balance:": "Saldo:"
,"PaymentInfo": "La quantitat que mostrada és el teu saldo pendent (negatiu) o favorable a dia d'avui, no té en compte comandes del futur. Perquè la teva comanda sigui enviat, aquesta quantitat ha de ser igual o més gran que 0. Si vols fer un lliurament a compte, esborra la quantitat suggerida i introdueix la quantitat que vulguis." ,"PaymentInfo": "La quantitat mostrada és el teu saldo pendent (negatiu) o favorable a dia d'avui, no té en compte comandes del futur. Perquè la teva comanda sigui enviat, aquesta quantitat ha de ser igual o més gran que 0. Si vols fer un lliurament a compte, prem el botó de pagament, esborra la quantitat suggerida e introdueix la quantitat que vulguis."
,"MakePayment": "Realitzar pagament" ,"MakePayment": "Realitzar pagament"
,"Company": "Empresa" ,"Company": "Empresa"
,"Pending": "Pendent" ,"Pending": "Pendent"

View File

@ -11,7 +11,7 @@
,"LastOrders": "Last orders" ,"LastOrders": "Last orders"
,"Balance:": "Balance:" ,"Balance:": "Balance:"
,"PaymentInfo": "The amount shown is your slope (negative) or favorable balance today, it disregards future orders. For get your order shipped, this amount must be equal to or greater than 0. If you want to make a down payment, delete the suggested amount and enter the amount you want." ,"PaymentInfo": "The amount shown is your slope (negative) or favorable balance today, it disregards future orders. For get your order shipped, this amount must be equal to or greater than 0. If you want to make a down payment, click the payment button, delete the suggested amount and enter the amount you want."
,"MakePayment": "Make payment" ,"MakePayment": "Make payment"
,"Company": "Company" ,"Company": "Company"
,"Pending": "Pending" ,"Pending": "Pending"

View File

@ -11,7 +11,7 @@
,"LastOrders": "Últimos pedidos" ,"LastOrders": "Últimos pedidos"
,"Balance:": "Saldo:" ,"Balance:": "Saldo:"
,"PaymentInfo": "La cantidad que mostrada es tu saldo pendiente (negativa) o favorable a día de hoy, no tiene en cuenta pedidos del futuro. Para que tu pedido sea enviado, esta cantidad debe ser igual o mayor que 0. Si quieres realizar una entrega a cuenta, borra la cantidad sugerida e introduce la cantidad que desees." ,"PaymentInfo": "La cantidad mostrada es tu saldo pendiente (negativa) o favorable a día de hoy, no tiene en cuenta pedidos del futuro. Para que tu pedido sea enviado, esta cantidad debe ser igual o mayor que 0. Si quieres realizar una entrega a cuenta, pulsa el botón de pago, borra la cantidad sugerida e introduce la cantidad que desees."
,"MakePayment": "Realizar pago" ,"MakePayment": "Realizar pago"
,"Company": "Empresa" ,"Company": "Empresa"
,"Pending": "Pendiente" ,"Pending": "Pendiente"

View File

@ -11,7 +11,7 @@
,"LastOrders": "Últimos pedidos" ,"LastOrders": "Últimos pedidos"
,"Balance:": "Saldo:" ,"Balance:": "Saldo:"
,"PaymentInfo": "A quantidade mostrada é seu saldo pendente (negativo) ou favorável a dia de hoje, não se vincula a pedidos futuros. Para que seu pedido seja enviado, esta quantidade deve ser igual ou superior a 0. Se queres realizar um depósito à conta, apague a quantidade sugerida e introduza a quantidade que deseje." ,"PaymentInfo": "A quantidade mostrada é seu saldo pendente (negativo) ou favorável a dia de hoje, não se vincula a pedidos futuros. Para que seu pedido seja enviado, esta quantidade deve ser igual ou superior a 0. Se queres realizar um depósito à conta, clique no botão de pagamento, apague a quantidade sugerida e introduza a quantidade que deseje."
,"MakePayment": "Realizar pagamento" ,"MakePayment": "Realizar pagamento"
,"Company": "Empresa" ,"Company": "Empresa"
,"Pending": "Pendente" ,"Pending": "Pendente"

View File

@ -28,7 +28,6 @@ class RestMod extends Rest\Module
,'params' => $params ,'params' => $params
,'signature' => $signature ,'signature' => $signature
]; ];
trigger_error (print_r ($result, TRUE));
return $result; return $result;
} }

57
web/rest/visits-sync.php Normal file
View File

@ -0,0 +1,57 @@
<?php
use Vn\Rest;
class RestMod extends Rest\Module
{
function run ()
{
$conn = $this->conn;
$result = $conn->query ("SELECT id, agent FROM visit_agent "
."WHERE version = '0.0' OR platform = 'unknown' OR cookies IS NULL ORDER BY id DESC");
$stmt = $conn->prepare (
'UPDATE visit_agent SET platform = ?, browser = ?, version = ?, javascript = ?, cookies = ? WHERE id = ?');
if ($result && $stmt)
{
set_time_limit (0);
$stmt->bind_param('sssiii'
,$platform
,$browser
,$version
,$javascript
,$cookies
,$id
);
// Update the visit info using browscap
while ($row = $result->fetch_assoc ())
{
$info = get_browser ($row['agent']);
$platform = $info->platform;
$browser = $info->browser;
$version = $info->version;
$javascript = $info->javascript;
$cookies = $info->cookies;
$id = $row['id'];
$stmt->execute ();
}
$result = TRUE;
}
else
$result = FALSE;
if ($stmt)
$stmt->close ();
if ($result)
$result->free ();
return $result;
}
}
?>

View File

@ -1,66 +0,0 @@
<?php
require_once ('vn/web/auth.php');
require_once ('vn/hedera/init.php');
use Vn\Web\Auth;
// Update the visit info using browscap
Auth::getCredentials ();
$conn = new mysqli
(
$conf['db']['host']
,Auth::getUser ()
,Auth::getPassword ()
,$conf['db']['schema']
);
if ($conn->connect_error)
exit ($conn->connect_error);
$result = $conn->query ("SELECT id, agent FROM visit_agent "
."WHERE version = '0.0' OR platform = 'unknown' OR cookies IS NULL ORDER BY id DESC");
$stmt = $conn->prepare (
'UPDATE visit_agent SET platform = ?, browser = ?, version = ?, javascript = ?, cookies = ? WHERE id = ?');
if ($result && $stmt)
{
set_time_limit (0);
$stmt->bind_param('sssiii'
,$platform
,$browser
,$version
,$javascript
,$cookies
,$id
);
while ($row = $result->fetch_assoc ())
{
echo sprintf ("Processing row: %d\n", $row['id']);
$info = get_browser ($row['agent']);
$platform = $info->platform;
$browser = $info->browser;
$version = $info->version;
$javascript = $info->javascript;
$cookies = $info->cookies;
$id = $row['id'];
$stmt->execute ();
}
}
if ($stmt)
$stmt->close ();
if ($result)
$result->free ();
if ($conn->errno)
exit ($conn->error);
$conn->close ();
?>