forked from verdnatura/hedera-web
Tags beta, local config.php, removed MySQL cleartext plugin due to php7 lack of support
This commit is contained in:
parent
fadc5505ad
commit
73b2750b8a
|
@ -1,2 +1,3 @@
|
|||
node_modules
|
||||
build/
|
||||
config.php
|
||||
|
|
1
env.php
1
env.php
|
@ -8,6 +8,5 @@ $vnAutoloadMap['vn/web'] = __DIR__.'/web';
|
|||
|
||||
const _ENABLE_DEBUG = TRUE;
|
||||
const _DEV_MODE = TRUE;
|
||||
const _CONFIG_DIR = __DIR__.'/../../.config';
|
||||
const _LOG_DIR = '/tmp';
|
||||
const _DATA_DIR = '/tmp';
|
||||
|
|
|
@ -32,7 +32,7 @@ Hedera.Catalog = new Class
|
|||
{
|
||||
document.body.appendChild (this.$('right-panel'));
|
||||
|
||||
this.$('items-model').setInfo ('a', 'Articles', 'vn2008', ['item_id']);
|
||||
this.$('items-model').setInfo ('i', 'item', 'vn', ['itemFk']);
|
||||
|
||||
if (localStorage.getItem ('hederaView'))
|
||||
this.setView (parseInt (localStorage.getItem ('hederaView')));
|
||||
|
@ -200,7 +200,7 @@ Hedera.Catalog = new Class
|
|||
|
||||
if (type)
|
||||
{
|
||||
var row = types.search ('tipo_id', type);
|
||||
var row = types.search ('id', type);
|
||||
|
||||
if (row != -1)
|
||||
title = types.get (row, 'name');
|
||||
|
@ -269,15 +269,15 @@ Hedera.Catalog = new Class
|
|||
|
||||
this.onEraseClick ();
|
||||
this.$('card').row = form.row;
|
||||
this.$('card-item').value = form.get ('item_id');
|
||||
this.$('card-item').value = form.get ('itemFk');
|
||||
this.$('card-popup').show (button.node);
|
||||
}
|
||||
|
||||
,onAddLotClick: function (column, value, row, button)
|
||||
,onAddLotClick: function (column, value, row)
|
||||
{
|
||||
var model = this.$('item-lots');
|
||||
var grouping = model.get (row, 'grouping');
|
||||
var warehouse = model.get (row, 'warehouse_id');
|
||||
var warehouse = model.get (row, 'warehouseFk');
|
||||
var available = model.get (row, 'available');
|
||||
|
||||
var lotAmount = this.items[warehouse];
|
||||
|
@ -321,7 +321,7 @@ Hedera.Catalog = new Class
|
|||
{
|
||||
this.conn.execQuery (sql);
|
||||
|
||||
var itemName = this.$('card').get ('Article');
|
||||
var itemName = this.$('card').get ('item');
|
||||
Htk.Toast.showMessage (
|
||||
sprintf (_('Added%dOf%s'), amountSum, itemName));
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ Hedera.Catalog = new Class
|
|||
this.$('card-item').value = undefined;
|
||||
}
|
||||
|
||||
,onStatusChange: function (model)
|
||||
,onCardLoad: function ()
|
||||
{
|
||||
this.$('card-popup').reset ();
|
||||
}
|
||||
|
@ -426,13 +426,13 @@ Vn.Filter = new Class
|
|||
this.parent (props);
|
||||
}
|
||||
|
||||
,_onMouseDown: function (e)
|
||||
,_onMouseDown: function ()
|
||||
{
|
||||
if (this._model && this._model.status === Db.Model.Status.CLEAN)
|
||||
this._model.refresh ();
|
||||
}
|
||||
|
||||
,_onCloseClick: function (li)
|
||||
,_onCloseClick: function ()
|
||||
{
|
||||
this._removeSelectionNode ();
|
||||
this._changeValue (undefined);
|
||||
|
|
|
@ -175,6 +175,8 @@
|
|||
padding-bottom: .1em;
|
||||
font-weight: normal;
|
||||
font-size: 1.1em;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.item-info > p
|
||||
{
|
||||
|
@ -224,7 +226,6 @@
|
|||
.item-card .top
|
||||
{
|
||||
padding: 1em;
|
||||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
.item-card .item-info
|
||||
{
|
||||
|
@ -245,6 +246,10 @@
|
|||
margin-top: 1em;
|
||||
font-size: .9em;
|
||||
}
|
||||
.item-card .lots-grid
|
||||
{
|
||||
border-top: 1px solid #DDD;
|
||||
}
|
||||
.item-card .lots-grid tr
|
||||
{
|
||||
height: 3em;
|
||||
|
@ -319,9 +324,7 @@
|
|||
.list-view .item-info > h2
|
||||
{
|
||||
font-size: 1em;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.list-view .item-info > .color
|
||||
{
|
||||
|
|
|
@ -12,75 +12,67 @@
|
|||
<vn-hash-param key="type" param="type"/>
|
||||
<sql-filter type="AND" id="filter">
|
||||
<sql-filter-item type="EQUAL" primary="false" id="op-realm">
|
||||
<sql-field name="reino_id" target="t"/>
|
||||
<sql-field target="t" name="categoryFk"/>
|
||||
<sql-value id="realm-value"/>
|
||||
</sql-filter-item>
|
||||
<sql-filter-item type="EQUAL" id="op-type">
|
||||
<sql-field name="tipo_id" target="a"/>
|
||||
<sql-field target="i" name="typeFk"/>
|
||||
<sql-value id="type-value"/>
|
||||
</sql-filter-item>
|
||||
<sql-filter-item type="LIKE" id="op-name">
|
||||
<sql-field name="Article"/>
|
||||
<sql-field target="i" name="name"/>
|
||||
<sql-search-tags param="search"/>
|
||||
</sql-filter-item>
|
||||
<sql-filter-item type="EQUAL" id="op-color">
|
||||
<sql-field name="Color"/>
|
||||
<sql-field target="i" name="inkFk"/>
|
||||
<sql-value param="color"/>
|
||||
</sql-filter-item>
|
||||
<sql-filter-item type="EQUAL" id="op-origin">
|
||||
<sql-field name="id_origen"/>
|
||||
<sql-field target="i" name="originFk"/>
|
||||
<sql-value param="origin"/>
|
||||
</sql-filter-item>
|
||||
<sql-filter-item type="EQUAL" id="op-category">
|
||||
<sql-field name="Categoria"/>
|
||||
<sql-field target="i" name="category"/>
|
||||
<sql-value param="category"/>
|
||||
</sql-filter-item>
|
||||
<sql-filter-item type="EQUAL" id="op-producer">
|
||||
<sql-field name="producer_id"/>
|
||||
<sql-field target="i" name="producerFk"/>
|
||||
<sql-value param="producer"/>
|
||||
</sql-filter-item>
|
||||
</sql-filter>
|
||||
<db-form id="basket" on-ready="onBasketReady">
|
||||
<db-model property="model">
|
||||
<custom>
|
||||
SELECT o.id, o.date_send, ag.description agency, v.code method
|
||||
FROM basket o
|
||||
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
|
||||
JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id
|
||||
</custom>
|
||||
SELECT b.id, b.sent, a.description agency, m.code method
|
||||
FROM myBasket b
|
||||
JOIN vn.agencyMode a ON a.id = b.agencyModeFk
|
||||
JOIN vn.deliveryMethod m ON m.id = b.deliveryMethodFk
|
||||
</db-model>
|
||||
</db-form>
|
||||
<db-query id="basket-lines">
|
||||
<custom>
|
||||
SELECT item_id, warehouse_id, SUM(amount) amount
|
||||
FROM basket_item
|
||||
GROUP BY warehouse_id
|
||||
</custom>
|
||||
</db-query>
|
||||
<db-model
|
||||
id="items-model"
|
||||
result-index="2"
|
||||
on-status-changed="onItemsChange">
|
||||
<custom>
|
||||
CREATE TEMPORARY TABLE tmp.bionic_calc
|
||||
(INDEX (item_id))
|
||||
ENGINE=MEMORY
|
||||
SELECT a.Id_Article item_id FROM vn2008.Articles a
|
||||
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
||||
WHERE #filter;
|
||||
CALL bionic_calc ();
|
||||
SELECT a.Id_Article item_id, a.description, b.available, b.price,
|
||||
b.producer, a.Foto, a.Article, a.Categoria, a.Medida,
|
||||
IF(a.Tallos > 1, a.Tallos, NULL) Tallos, c.name color
|
||||
FROM tmp.bionic_item b
|
||||
JOIN vn2008.Articles a ON a.Id_Article = b.item_id
|
||||
LEFT JOIN vn2008.producer p ON p.producer_id = a.producer_id
|
||||
LEFT JOIN vn.inkL10n c ON c.id = a.Color
|
||||
LEFT JOIN vn.originL10n o ON o.id = a.id_origen
|
||||
WHERE b.available > 0
|
||||
ORDER BY a.relevancy DESC, a.Article, a.Medida
|
||||
LIMIT 400;
|
||||
</custom>
|
||||
CREATE TEMPORARY TABLE tmp.bionic_calc
|
||||
(INDEX (item_id))
|
||||
ENGINE=MEMORY
|
||||
SELECT i.id item_id
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType t ON t.id = i.typeFk
|
||||
WHERE #filter;
|
||||
CALL bionic_calc ();
|
||||
SELECT i.id itemFk, i.description, b.available, b.price,
|
||||
b.producer, i.image, i.name item, i.category, i.size,
|
||||
IF(i.stems > 1, i.stems, NULL) stems, c.name color,
|
||||
t.tag1, t.val1, t.tag2, t.val2, t.tag3, t.val3
|
||||
FROM tmp.bionic_item b
|
||||
JOIN vn.item i ON i.id = b.item_id
|
||||
LEFT JOIN vn.itemTagArranged t ON t.itemFk = i.id
|
||||
LEFT JOIN vn.producer p ON p.id = i.producerFk
|
||||
LEFT JOIN vn.inkL10n c ON c.id = i.inkFk
|
||||
LEFT JOIN vn.originL10n o ON o.id = i.originFk
|
||||
WHERE b.available > 0
|
||||
ORDER BY i.relevancy DESC, i.name, i.size
|
||||
LIMIT 400;
|
||||
<sql-batch property="batch" id="filter-batch">
|
||||
<custom>
|
||||
<item name="filter" object="filter"/>
|
||||
|
@ -93,33 +85,6 @@
|
|||
<item name="item" param="card-item"/>
|
||||
</custom>
|
||||
</sql-batch>
|
||||
<db-form id="card-extend">
|
||||
<db-model
|
||||
property="model"
|
||||
batch="card-batch"
|
||||
on-status-changed-after="onStatusChange">
|
||||
<custom>
|
||||
SELECT a.description, o.name origin
|
||||
FROM vn2008.Articles a
|
||||
LEFT JOIN vn.originL10n o ON o.id = a.id_origen
|
||||
WHERE a.Id_Article = #item
|
||||
</custom>
|
||||
</db-model>
|
||||
</db-form>
|
||||
<db-model
|
||||
id="item-lots"
|
||||
result-index="1"
|
||||
on-status-changed-after="onStatusChange"
|
||||
batch="card-batch">
|
||||
<custom>
|
||||
CALL bionic_from_item (#item);
|
||||
SELECT p.warehouse_id, w.name warehouse, p.grouping, p.price, p.rate, l.available
|
||||
FROM tmp.bionic_lot l
|
||||
JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id
|
||||
JOIN vn2008.warehouse w ON w.id = p.warehouse_id
|
||||
ORDER BY warehouse_id, grouping;
|
||||
</custom>
|
||||
</db-model>
|
||||
</vn-group>
|
||||
<div id="title">
|
||||
<h1 id="title-text"><t>Catalog</t></h1>
|
||||
|
@ -152,7 +117,7 @@
|
|||
directory="catalog"
|
||||
subdir="200x200"
|
||||
form="item"
|
||||
column="Foto"
|
||||
column="image"
|
||||
full-dir="900x900"/>
|
||||
<div class="item-info">
|
||||
<htk-button
|
||||
|
@ -163,18 +128,18 @@
|
|||
on-click="onAddItemClick"
|
||||
class="add-button"/>
|
||||
<h2>
|
||||
<htk-text form="item" column="Article"/>
|
||||
<htk-text form="item" column="item"/>
|
||||
</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"/>
|
||||
<htk-text form="item" column="tag1"/> <htk-text form="item" column="val1"/>,
|
||||
<htk-text form="item" column="tag2"/> <htk-text form="item" column="val2"/>
|
||||
</p>
|
||||
<p class="color">
|
||||
<t>Color</t> <htk-text form="item" column="color"/>
|
||||
<htk-text form="item" column="Tallos" format="_, %.0d Units"/>
|
||||
<htk-text form="item" column="tag3"/> <htk-text form="item" column="val3"/>
|
||||
<htk-text form="item" column="stems" format="_, %.0d Units"/>
|
||||
</p>
|
||||
<div class="aval-price">
|
||||
<htk-text form="item" column="available"/>
|
||||
|
@ -194,7 +159,7 @@
|
|||
<div id="right-panel" class="right-panel" on-click="onRightPanelClick">
|
||||
<div class="basket-info">
|
||||
<p>
|
||||
<htk-text form="basket" column="date_send" format="%D"/>
|
||||
<htk-text form="basket" column="sent" format="%D"/>
|
||||
</p>
|
||||
<p>
|
||||
<span id="method"/>
|
||||
|
@ -216,13 +181,11 @@
|
|||
id="realms-model"
|
||||
property="model"
|
||||
on-status-changed="refreshTitleColor">
|
||||
<custom>
|
||||
SELECT r.id, l.name, r.color
|
||||
FROM vn2008.reinos r
|
||||
JOIN vn.itemCategoryL10n l ON l.id = r.id
|
||||
WHERE r.display != FALSE
|
||||
ORDER BY name
|
||||
</custom>
|
||||
SELECT c.id, l.name, c.color
|
||||
FROM vn.itemCategory c
|
||||
JOIN vn.itemCategoryL10n l ON l.id = c.id
|
||||
WHERE c.display
|
||||
ORDER BY name
|
||||
</db-model>
|
||||
<custom>
|
||||
<a id="link">
|
||||
|
@ -247,20 +210,18 @@
|
|||
conn="conn"
|
||||
result-index="1"
|
||||
on-status-changed="refreshTitle">
|
||||
<custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT t.tipo_id, l.name
|
||||
FROM vn2008.Tipos t
|
||||
JOIN vn2008.Articles a ON a.tipo_id = t.tipo_id
|
||||
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
||||
JOIN vn.itemTypeL10n l ON l.id = t.tipo_id
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT t.id, l.name
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType t ON t.id = i.typeFk
|
||||
JOIN tmp.item_available a ON a.item_id = i.id
|
||||
JOIN vn.itemTypeL10n l ON l.id = t.id
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</db-model>
|
||||
<sql-filter property="filter" type="AND">
|
||||
<sql-filter-item type="EQUAL">
|
||||
<sql-field name="reino_id" target="t"/>
|
||||
<sql-field name="categoryFk" target="t"/>
|
||||
<sql-value param="realm"/>
|
||||
</sql-filter-item>
|
||||
</sql-filter>
|
||||
|
@ -269,17 +230,15 @@
|
|||
placeholder="_Color"
|
||||
param="color">
|
||||
<db-model property="model" auto-load="false" result-index="1">
|
||||
<custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT c.Id_Tinta, l.name
|
||||
FROM vn2008.Tintas c
|
||||
JOIN vn2008.Articles a ON a.Color = c.Id_Tinta
|
||||
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
||||
JOIN vn.inkL10n l ON l.id = c.Id_Tinta
|
||||
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT k.id, l.name
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType t ON t.id = i.typeFk
|
||||
JOIN tmp.item_available a ON a.item_id = i.id
|
||||
JOIN vn.ink k ON k.id = i.inkFk
|
||||
JOIN vn.inkL10n l ON l.id = i.id
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</db-model>
|
||||
<sql-filter property="filter" always-ready="true" type="AND">
|
||||
<pointer object="op-realm"/>
|
||||
|
@ -294,16 +253,14 @@
|
|||
placeholder="_Producer"
|
||||
param="producer">
|
||||
<db-model property="model" auto-load="false" result-index="1">
|
||||
<custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT p.producer_id, p.name
|
||||
FROM vn2008.producer p
|
||||
JOIN vn2008.Articles a ON a.producer_id = p.producer_id
|
||||
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
||||
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT p.id, p.name
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType t ON t.id = i.typeFk
|
||||
JOIN tmp.item_available a ON a.item_id = i.id
|
||||
JOIN vn.producer p ON p.id = i.producerFk
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</db-model>
|
||||
<sql-filter property="filter" always-ready="true" type="AND">
|
||||
<pointer object="op-realm"/>
|
||||
|
@ -318,17 +275,15 @@
|
|||
placeholder="_Origin"
|
||||
param="origin">
|
||||
<db-model property="model" auto-load="false" result-index="1">
|
||||
<custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT o.id, l.name, o.Abreviatura
|
||||
FROM vn2008.Origen o
|
||||
JOIN vn2008.Articles a ON a.id_origen = o.id
|
||||
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
||||
JOIN vn.originL10n l ON l.id = o.id
|
||||
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT o.id, l.name, o.code
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType t ON t.id = i.typeFk
|
||||
JOIN tmp.item_available a ON a.item_id = i.id
|
||||
JOIN vn.origin o ON o.id = i.originFk
|
||||
JOIN vn.originL10n l ON l.id = o.id
|
||||
WHERE #filter
|
||||
ORDER BY name
|
||||
</db-model>
|
||||
<sql-filter property="filter" always-ready="true" type="AND">
|
||||
<pointer object="op-realm"/>
|
||||
|
@ -343,15 +298,13 @@
|
|||
placeholder="_Category"
|
||||
param="category">
|
||||
<db-model property="model" auto-load="false" result-index="1">
|
||||
<custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT a.Categoria, a.Categoria category
|
||||
FROM vn2008.Articles a
|
||||
JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id
|
||||
JOIN tmp.item_available i ON i.item_id = a.Id_Article
|
||||
WHERE #filter
|
||||
ORDER BY a.Categoria
|
||||
</custom>
|
||||
CALL item_available ();
|
||||
SELECT DISTINCT i.category, i.category
|
||||
FROM vn.item i
|
||||
JOIN vn.itemType t ON t.id = i.typeFk
|
||||
JOIN tmp.item_available a ON a.item_id = i.id
|
||||
WHERE #filter
|
||||
ORDER BY category
|
||||
</db-model>
|
||||
<sql-filter property="filter" always-ready="true" type="AND">
|
||||
<pointer object="op-realm"/>
|
||||
|
@ -369,7 +322,7 @@
|
|||
<option value="D|relevancy" selected="true">
|
||||
<t>Relevancy</t>
|
||||
</option>
|
||||
<option value="A|Article">
|
||||
<option value="A|item">
|
||||
<t>Name</t>
|
||||
</option>
|
||||
<option value="A|price">
|
||||
|
@ -381,10 +334,10 @@
|
|||
<option value="A|available">
|
||||
<t>Available</t>
|
||||
</option>
|
||||
<option value="A|Medida">
|
||||
<option value="A|size">
|
||||
<t>Lower size</t>
|
||||
</option>
|
||||
<option value="D|Medida">
|
||||
<option value="D|size">
|
||||
<t>Higher size</t>
|
||||
</option>
|
||||
<option value="A|color">
|
||||
|
@ -393,10 +346,10 @@
|
|||
<option value="A|producer">
|
||||
<t>Producer</t>
|
||||
</option>
|
||||
<option value="A|Abreviatura">
|
||||
<option value="A|origin">
|
||||
<t>Origin</t>
|
||||
</option>
|
||||
<option value="A|Categoria">
|
||||
<option value="A|category">
|
||||
<t>Category</t>
|
||||
</option>
|
||||
</select>
|
||||
|
@ -415,32 +368,43 @@
|
|||
modal="true"
|
||||
on-closed="onPopupClose">
|
||||
<div property="child-node" class="item-card">
|
||||
<db-form id="card-extend">
|
||||
<db-model
|
||||
property="model"
|
||||
batch="card-batch"
|
||||
on-status-changed-after="onCardLoad">
|
||||
SELECT i.description, o.name origin
|
||||
FROM vn.item i
|
||||
LEFT JOIN vn.originL10n o ON o.id = i.originFk
|
||||
WHERE i.id = #item
|
||||
</db-model>
|
||||
</db-form>
|
||||
<div class="top">
|
||||
<htk-image
|
||||
directory="catalog"
|
||||
subdir="200x200"
|
||||
form="card"
|
||||
column="Foto"
|
||||
column="image"
|
||||
full-dir="900x900"
|
||||
conn="conn"
|
||||
editable="true"/>
|
||||
<div class="item-info">
|
||||
<h2>
|
||||
<htk-text form="card" column="Article"/>
|
||||
<htk-text form="card" column="item"/>
|
||||
</h2>
|
||||
<p class="producer">
|
||||
<htk-text form="card" column="producer"/>
|
||||
</p>
|
||||
<p>
|
||||
@<htk-text form="card" column="item_id"/>
|
||||
@<htk-text form="card" column="itemFk"/>
|
||||
</p>
|
||||
<p>
|
||||
<t>Size</t> <htk-text form="card" column="Medida"/>,
|
||||
<t>Category</t> <htk-text form="card" column="Categoria"/>
|
||||
<t>Size</t> <htk-text form="card" column="size"/>,
|
||||
<t>Category</t> <htk-text form="card" column="category"/>
|
||||
</p>
|
||||
<p class="color">
|
||||
<p>
|
||||
<t>Color</t> <htk-text form="card" column="color"/>
|
||||
<htk-text form="card" column="Tallos" format="_, %.0d Units"/>
|
||||
<htk-text form="card" column="stems" format="_, %.0d Units"/>
|
||||
</p>
|
||||
<p>
|
||||
<t>Origin</t> <htk-text form="card-extend" column="origin"/>
|
||||
|
@ -450,7 +414,37 @@
|
|||
<htk-text form="card-extend" column="description" id="desc"/>
|
||||
</p>
|
||||
</div>
|
||||
<htk-grid class="lots-grid" model="item-lots" show-header="false">
|
||||
<htk-repeater show-status="false">
|
||||
<db-model
|
||||
property="model"
|
||||
batch="card-batch"
|
||||
on-status-changed-after="onCardLoad">
|
||||
SELECT l.name, it.value
|
||||
FROM vn.itemTag it
|
||||
JOIN vn.tag t ON t.id = it.tagFk
|
||||
JOIN vn.tagL10n l ON l.id = t.id
|
||||
WHERE it.itemFk = #item
|
||||
</db-model>
|
||||
<custom>
|
||||
<p>
|
||||
<htk-text form="form" column="name"/> <htk-text form="form" column="value"/>
|
||||
</p>
|
||||
</custom>
|
||||
</htk-repeater>
|
||||
<htk-grid class="lots-grid" show-header="false">
|
||||
<db-model
|
||||
id="item-lots"
|
||||
property="model"
|
||||
result-index="1"
|
||||
on-status-changed-after="onCardLoad"
|
||||
batch="card-batch">
|
||||
CALL bionic_from_item (#item);
|
||||
SELECT w.id warehouseFk, w.name warehouse, p.grouping, p.price, p.rate, l.available
|
||||
FROM tmp.bionic_lot l
|
||||
JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id
|
||||
JOIN vn.warehouse w ON w.id = p.warehouse_id
|
||||
ORDER BY warehouseFk, grouping;
|
||||
</db-model>
|
||||
<htk-column-text title="_Store" column="warehouse"/>
|
||||
<htk-column-spin title="_Price" column="price" unit="€" digits="2"/>
|
||||
<htk-column-text title="_Pack" column="grouping" format="x%.0d"/>
|
||||
|
|
|
@ -255,6 +255,12 @@ Model.implement
|
|||
this._setStatus (Status.CLEAN);
|
||||
}
|
||||
|
||||
,appendChild: function (child)
|
||||
{
|
||||
if (child.nodeType === Node.TEXT_NODE)
|
||||
this.query = child.textContent;
|
||||
}
|
||||
|
||||
,loadXml: function (builder, node)
|
||||
{
|
||||
this.parent (builder, node);
|
||||
|
@ -377,7 +383,7 @@ Model.implement
|
|||
}
|
||||
}
|
||||
|
||||
,_cleanData: function (error)
|
||||
,_cleanData: function ()
|
||||
{
|
||||
this.data = null;
|
||||
this.tables = null;
|
||||
|
|
|
@ -62,6 +62,22 @@ module.exports = new Class
|
|||
this._renderer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Wether to show the model status.
|
||||
**/
|
||||
,showStatus:
|
||||
{
|
||||
type: Boolean
|
||||
,set: function (x)
|
||||
{
|
||||
this._showStatus = x;
|
||||
this._onModelChange();
|
||||
}
|
||||
,get: function ()
|
||||
{
|
||||
this._showStatus;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Message that should be displayed when source model is not ready.
|
||||
**/
|
||||
|
@ -74,6 +90,7 @@ module.exports = new Class
|
|||
|
||||
,_builder: null
|
||||
,_formId: 'form'
|
||||
,_showStatus: true
|
||||
|
||||
,render: function ()
|
||||
{
|
||||
|
@ -172,14 +189,17 @@ module.exports = new Class
|
|||
this.signalEmit ('change');
|
||||
}
|
||||
|
||||
,_showNoRecordsFound: function (count)
|
||||
,_showNoRecordsFound: function ()
|
||||
{
|
||||
if (this._model.numRows === 0)
|
||||
this._showMessage (_('EmptyList'), 'clean');
|
||||
}
|
||||
|
||||
,_showMessage: function (message, src)
|
||||
{
|
||||
{
|
||||
if (!this._showStatus)
|
||||
return;
|
||||
|
||||
var div = this.createElement ('div');
|
||||
div.className = 'message';
|
||||
this._container.appendChild (div);
|
||||
|
@ -213,7 +233,7 @@ module.exports = new Class
|
|||
this._showNoRecordsFound ();
|
||||
}
|
||||
|
||||
,_onRowUpdate: function (model, row, columns)
|
||||
,_onRowUpdate: function (model, row)
|
||||
{
|
||||
this._childsData[row].set.iterChanged ();
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ module.exports = new Class
|
|||
{
|
||||
var parser = new DOMParser ();
|
||||
var xmlDoc = parser.parseFromString (xmlString, 'text/xml');
|
||||
return this.loadFromXmlDoc (xmlDoc);
|
||||
return this.loadFromXmlDoc (xmlDoc, dstDocument);
|
||||
}
|
||||
|
||||
,loadFromXmlDoc: function (xmlDoc, dstDocument)
|
||||
|
@ -193,7 +193,7 @@ module.exports = new Class
|
|||
this._doc = dstDocument ? dstDocument : document;
|
||||
}
|
||||
|
||||
,_compileEnd: function (node)
|
||||
,_compileEnd: function ()
|
||||
{
|
||||
for (var i = this._links.length - 1; i >= 0; i--)
|
||||
{
|
||||
|
@ -333,12 +333,9 @@ module.exports = new Class
|
|||
for (var i = 0; i < childNodes.length; i++)
|
||||
{
|
||||
var child = childNodes[i];
|
||||
|
||||
if (child.nodeType !== Node.ELEMENT_NODE)
|
||||
continue;
|
||||
|
||||
var isElement = child.nodeType === Node.ELEMENT_NODE;
|
||||
var childTagName = isElement ? child.tagName.toLowerCase () : null;
|
||||
var childContext;
|
||||
var childTagName = child.tagName.toLowerCase ();
|
||||
|
||||
if (childTagName === 'pointer')
|
||||
{
|
||||
|
@ -350,7 +347,7 @@ module.exports = new Class
|
|||
}
|
||||
else if (childContext = this._compileNode (child))
|
||||
{
|
||||
var prop = child.getAttribute ('property');
|
||||
var prop = isElement ? child.getAttribute ('property') : null;
|
||||
|
||||
if (prop)
|
||||
{
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<link rel="icon" type="image/png" href="image/favicon/favicon.png"/>
|
||||
<link rel="icon" type="image/svg+xml" href="image/icon.svg" sizes="any"/>
|
||||
<link rel="manifest" href="<?=$dir?>/manifest.json"/>
|
||||
<?=js("$dir/main.js")?>
|
||||
<?=css("$dir/style.css")?>
|
||||
<?=js("$dir/main")?>
|
||||
<?=css("$dir/style")?>
|
||||
<title>Production</title>
|
||||
</head>
|
||||
<body onload="onBodyLoad()">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="viewport" content="user-scalable=no"/>
|
||||
<meta name="content-language" content="<?=$lang?>"/>
|
||||
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"/>
|
||||
<?=css("$dir/style.css")?>
|
||||
<?=css("$dir/style")?>
|
||||
<title>Verdnatura</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="viewport" content="user-scalable=no"/>
|
||||
<meta name="content-language" content="<?=$lang?>"/>
|
||||
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"/>
|
||||
<?=css("$dir/style.css")?>
|
||||
<?=css("$dir/style")?>
|
||||
<title>Verdnatura</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -103,8 +103,9 @@ class HtmlService extends Service
|
|||
//header ("Content-Security-Policy: default-src *; img-src *;");
|
||||
}
|
||||
|
||||
function errorHandler ()
|
||||
function errorHandler ($err)
|
||||
{
|
||||
error_log("{$err->getMessage()} {$err->getTraceAsString()}");
|
||||
$this->printHeader ();
|
||||
include (__DIR__.'/unavailable.html');
|
||||
exit (0);
|
||||
|
|
|
@ -15,12 +15,12 @@ function getUrl ($fileName)
|
|||
|
||||
function js ($fileName)
|
||||
{
|
||||
return '<script type="text/javascript" src="'. getUrl ($fileName) .'"></script>'."\n";
|
||||
return '<script type="text/javascript" src="'. getUrl ($fileName) .'.js"></script>'."\n";
|
||||
}
|
||||
|
||||
function css ($fileName)
|
||||
{
|
||||
return '<link rel="stylesheet" type="text/css" href="'. getUrl ($fileName) .'"/>'."\n";
|
||||
return '<link rel="stylesheet" type="text/css" href="'. getUrl ($fileName) .'.css"/>'."\n";
|
||||
}
|
||||
|
||||
function getWebpackAssets ()
|
||||
|
|
|
@ -63,6 +63,9 @@ class RestService extends Service
|
|||
throw new UserException (s($e->getMessage ()));
|
||||
}
|
||||
|
||||
if ($method::SECURITY == Security::DEFINER)
|
||||
$methodDb->query ('CALL account.userLogout ()');
|
||||
|
||||
$db->query ('CALL account.userLogout ()');
|
||||
|
||||
return $res;
|
||||
|
|
|
@ -227,7 +227,7 @@ abstract class Service
|
|||
|
||||
/**
|
||||
* Creates or returns a database connection where the authenticated user
|
||||
* is the current logged user.
|
||||
* is the role of the current logged user.
|
||||
*
|
||||
* @return {Db\Conn} The database connection
|
||||
*/
|
||||
|
@ -235,10 +235,23 @@ abstract class Service
|
|||
{
|
||||
if ($this->userDb)
|
||||
return $this->userDb;
|
||||
|
||||
$password = $this->db->getValue (
|
||||
'SELECT password FROM account.user WHERE name = #', [$user]);
|
||||
return $this->userDb = $this->app->createConnection ($user, $password);
|
||||
|
||||
$row = $this->db->getObject (
|
||||
'SELECT r.name, rc.mysqlPassword, uc.loginKey
|
||||
FROM account.user u
|
||||
JOIN account.role r ON r.id = u.role
|
||||
JOIN account.roleConfig rc ON TRUE
|
||||
JOIN account.userConfig uc ON TRUE
|
||||
WHERE u.name = #',
|
||||
[$user]
|
||||
);
|
||||
|
||||
$userName = "z-{$row->name}";
|
||||
$password = base64_decode ($row->mysqlPassword);
|
||||
$userDb = $this->app->createConnection ($userName, $password, TRUE);
|
||||
|
||||
$userDb->query ('CALL account.userLoginWithKey (#, #)', [$user, $row->loginKey]);
|
||||
return $userDb;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue