#3894 Display minimal grouping, php8.1 compatibility fixes
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-04-13 13:31:52 +02:00
parent 2fe78cfc0e
commit 188181b114
16 changed files with 83 additions and 52 deletions

View File

@ -31,7 +31,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
php-image-text \ php-image-text \
php-text-captcha \ php-text-captcha \
php-apcu-bc \ php-apcu \
php-zip \ php-zip \
hedera-web \ hedera-web \
cron cron

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.407.60) stable; urgency=low hedera-web (1.407.61) stable; urgency=low
* Initial Release. * Initial Release.

4
debian/control vendored
View File

@ -9,8 +9,8 @@ Vcs-Git: https://git.verdnatura.es/hedera-web
Package: hedera-web Package: hedera-web
Architecture: all Architecture: all
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-ldap, php-ssh2, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
Suggests: php-text-captcha, cron Suggests: php-text-captcha, php-zip, cron
Section: misc Section: misc
Priority: optional Priority: optional
Description: Verdnatura's web page Description: Verdnatura's web page

1
debian/postinst vendored
View File

@ -10,7 +10,6 @@ then
. /usr/share/apache2/apache2-maintscript-helper . /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enmod rewrite apache2_invoke enmod rewrite
apache2_invoke enmod headers apache2_invoke enmod headers
apache2_invoke enmod authnz_ldap
apache2_invoke enconf hedera-web.conf apache2_invoke enconf hedera-web.conf
fi fi

View File

@ -227,14 +227,20 @@ Hedera.Catalog = new Class({
this.hash.set({'form': 'ecomerce/checkout'}); this.hash.set({'form': 'ecomerce/checkout'});
} }
,onAddItemClick: function(button, form) { ,repeaterFunc: function(res, form) {
if (this.isGuest()) res.$('item-box').addEventListener('click',
return; this.onAddItemClick.bind(this, form));
}
,onAddItemClick: function(form, event) {
if (event.defaultPrevented) return;
event.preventDefault();
if (this.isGuest()) return;
this.onEraseClick(); this.onEraseClick();
this.$('card').row = form.row; this.$('card').row = form.row;
this.$('card-item').value = form.get('id'); this.$('card-item').value = form.get('id');
this.$('card-popup').show(button.node); this.$('card-popup').show(event.currentTarget);
} }
,onAddLotClick: function(column, value, row) { ,onAddLotClick: function(column, value, row) {

View File

@ -43,3 +43,6 @@ Confirm: Confirmar
IndicativePhotos: '* Les fotos són orientatives' IndicativePhotos: '* Les fotos són orientatives'
Added%dOf%s: Afegits %d de %s Added%dOf%s: Afegits %d de %s
NoMoreAmountAvailable: No hi ha més quantitat disponible NoMoreAmountAvailable: No hi ha més quantitat disponible
MinimalGrouping: Empaquetat mínim
Available: Disponible
GroupingPrice: Preu per grup

View File

@ -43,3 +43,6 @@ Confirm: Confirm
IndicativePhotos: '* Photos are indicative' IndicativePhotos: '* Photos are indicative'
Added%dOf%s: Added %d of %s Added%dOf%s: Added %d of %s
NoMoreAmountAvailable: No more amount available NoMoreAmountAvailable: No more amount available
MinimalGrouping: Minimal packing
Available: Available
GroupingPrice: Price per group

View File

@ -43,3 +43,6 @@ Confirm: Confirmar
IndicativePhotos: '* Las fotos son orientativas' IndicativePhotos: '* Las fotos son orientativas'
Added%dOf%s: Añadidos %d de %s Added%dOf%s: Añadidos %d de %s
NoMoreAmountAvailable: No hay más cantidad disponible NoMoreAmountAvailable: No hay más cantidad disponible
MinimalGrouping: Empaquetado mínimo
Available: Disponible
GroupingPrice: Precio per grupo

View File

@ -43,3 +43,6 @@ Confirm: Confirmer
IndicativePhotos: '* Photos sont indicatifs' IndicativePhotos: '* Photos sont indicatifs'
Added%dOf%s: Ajouté %d %s Added%dOf%s: Ajouté %d %s
NoMoreAmountAvailable: Pas plus disponible NoMoreAmountAvailable: Pas plus disponible
MinimalGrouping: Emballage minimal
Available: Disponible
GroupingPrice: Prix par groupe

View File

@ -43,3 +43,6 @@ Confirm: Confirmar
IndicativePhotos: '* As Fotos São Orientativas' IndicativePhotos: '* As Fotos São Orientativas'
Added%dOf%s: Adicionados %d de %s Added%dOf%s: Adicionados %d de %s
NoMoreAmountAvailable: Não há mais quantidade disponível NoMoreAmountAvailable: Não há mais quantidade disponível
MinimalGrouping: Embalagem mínima
Available: Disponível
GroupingPrice: Preço por grupo

View File

@ -140,6 +140,15 @@
/* Items */ /* Items */
.item-box
{
transition: background-color 200ms ease-in;
}
.item-box:hover
{
cursor: pointer;
background-color: #eee;
}
.item-info .item-info
{ {
position: relative; position: relative;
@ -193,16 +202,34 @@
.item-info .available-price .item-info .available-price
{ {
white-space: nowrap; white-space: nowrap;
font-size: .95em;
text-align: right;
align-items: middle;
column-gap: .2em;
display: flex;
} }
.item-info .price-label .item-info .available-price > *
{ {
font-size: .8em; border-radius: .2em;
font-style: italic; padding: .3em;
border: .1em transparent solid;
}
.item-info .grouping
{
width: 2em;
background-color: #ddd;
}
.item-info .available
{
width: 3.3em;
border-color: #bbb;
color: #777;
} }
.item-info .price .item-info .price
{ {
color: green; width: 4em;
font-size: 1.1em; border-color: #9cbc28;
color: #748c1e;
} }
.tags .tags
{ {
@ -275,7 +302,7 @@
{ {
clear: both; clear: both;
float: right; float: right;
padding-top: 1.2em; padding-top: 2.2em;
} }
.list-view .item-info .tags .list-view .item-info .tags
{ {
@ -334,26 +361,11 @@
bottom: 0; bottom: 0;
margin: .6em; margin: .6em;
} }
.grid-view .item-info .add-button
{
position: absolute;
bottom: 0;
right: 0;
}
.grid-view .item-info .available-price .grid-view .item-info .available-price
{ {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 2em; right: 0;
}
.grid-view .item-info .available
{
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: 4em;
vertical-align: bottom;
} }
.grid-view .item-info .tags td { .grid-view .item-info .tags td {
overflow: hidden; overflow: hidden;

View File

@ -64,7 +64,8 @@
i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
i.relevancy, i.size, i.category, i.relevancy, i.size, i.category,
k.name ink, p.name producer, o.name origin, k.name ink, p.name producer, o.name origin,
b.available, b.price, i.image, im.updated b.available, b.price, b.`grouping`,
i.image, im.updated
FROM tmp.ticketCalculateItem b FROM tmp.ticketCalculateItem b
JOIN vn.item i ON i.id = b.itemFk JOIN vn.item i ON i.id = b.itemFk
LEFT JOIN vn.ink k ON k.id = i.inkFk LEFT JOIN vn.ink k ON k.id = i.inkFk
@ -113,9 +114,13 @@
id="grid-view" id="grid-view"
empty-message="_Choose filter from right menu" empty-message="_Choose filter from right menu"
form-id="item" form-id="item"
model="items-model"> model="items-model"
renderer="repeaterFunc">
<custom> <custom>
<div class="box item-box"> <div
id="item-box"
class="box item-box"
title="_AddToBasket">
<htk-image <htk-image
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
@ -124,21 +129,14 @@
stamp-column="updated" stamp-column="updated"
full-dir="1600x900"/> full-dir="1600x900"/>
<div class="item-info"> <div class="item-info">
<htk-button
form="item"
column="id"
tip="_AddToBasket"
icon="add"
on-click="onAddItemClick"
class="add-button"/>
<div class="available-price"> <div class="available-price">
<span class="available"> <span class="grouping" title="_MinimalGrouping">
<htk-text form="item" column="grouping" format="x%.0d"/>
</span>
<span class="available" title="Available">
<htk-text form="item" column="available"/> <htk-text form="item" column="available"/>
</span> </span>
<span class="price-label"> <span class="price" title="_GroupingPrice">
<t>por</t>
</span>
<span class="price">
<htk-text form="item" column="price" format="%.2d€"/> <htk-text form="item" column="price" format="%.2d€"/>
</span> </span>
</div> </div>

View File

@ -161,10 +161,11 @@ module.exports = new Class({
this._error = true; this._error = true;
} }
,_onClick: function() { ,_onClick: function(event) {
if (!this._fullDir || !this._value || this._error) if (!this._fullDir || !this._value || this._error)
return; return;
event.preventDefault();
(new Htk.FullImage()).show(this._makeSrc(this._fullDir)); (new Htk.FullImage()).show(this._makeSrc(this._fullDir));
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.407.60", "version": "1.407.61",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

View File

@ -32,7 +32,7 @@ class JsonService extends RestService {
echo json_encode($reply); echo json_encode($reply);
} }
function errorHandler($errno, $message, $file, $line, $context) { function errorHandler($errno, $message, $file, $line, $context = null) {
$eUserWarn = $eUserWarn =
E_USER_NOTICE E_USER_NOTICE
| E_USER_WARNING | E_USER_WARNING

View File

@ -279,7 +279,7 @@ abstract class Service {
*/ */
function getVersion() { function getVersion() {
$appName = $this->app->getName(); $appName = $this->app->getName();
$version = apc_fetch("$appName.version", $success); $version = apcu_fetch("$appName.version", $success);
if (!$success) { if (!$success) {
if (file_exists('package.json')) { if (file_exists('package.json')) {
@ -288,7 +288,7 @@ abstract class Service {
} else } else
$version = '0.0.0'; $version = '0.0.0';
apc_store("$appName.version", $version); apcu_store("$appName.version", $version);
} }
return $version; return $version;