Master merged with rest branch

This commit is contained in:
Juan Ferrer Toribio 2016-10-14 13:03:36 +02:00
commit 8ed2b115ad
750 changed files with 7975 additions and 7348 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

51
app.js Normal file
View File

@ -0,0 +1,51 @@
var Hedera = require ('hedera/hedera');
window.onload = function ()
{
Vn.Locale.init ();
var lang = Vn.Locale.language;
loadLocale (lang, main);
}
function main (req)
{
var keys = req.keys ();
for (var i = 0; i < keys.length; i++)
Vn.Locale.add (req (keys[i]));
hederaWeb = new Hedera.App ();
hederaWeb.run ();
}
function loadLocale (lang, cb)
{
switch (lang)
{
case 'ca':
require ([], function () {
cb (require.context ('locale/ca/js')); });
break;
case 'es':
require ([], function () {
cb (require.context ('locale/es/js')); });
break;
case 'fr':
require ([], function () {
cb (require.context ('locale/fr/js')); });
break;
case 'mn':
require ([], function () {
cb (require.context ('locale/mn/js')); });
break;
case 'pt':
require ([], function () {
cb (require.context ('locale/pt/js')); });
break;
default:
require ([], function () {
cb (require.context ('locale/en/js')); });
}
}

9
cli.php Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/php -q
<?php
@include_once __DIR__.'/environ.php';
require_once 'vn-autoload.php';
$cliApp = new Vn\Lib\CliApp ('hedera-web', __DIR__.'/rest');
$cliApp->run ();

View File

@ -1,4 +1,5 @@
# Alias /hedera-web /usr/share/hedera-web/ # Alias /hedera-web /usr/share/hedera-web/
# Alias /image-db /var/lib/hedera-web/image-db/
<Directory /usr/share/hedera-web/> <Directory /usr/share/hedera-web/>
@ -20,3 +21,14 @@
</Directory> </Directory>
<Directory /var/lib/hedera-web/image-db/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo Options
Order Allow,Deny
Allow From All
Require all granted
</Directory>

View File

@ -19,11 +19,11 @@ return [
* Database parameters. * Database parameters.
**/ **/
'db' => [ 'db' => [
'host' => 'db.verdnatura.es' 'host' => 'localhost'
,'port' => 3306 ,'port' => 3306
,'schema' => 'hedera-web' ,'schema' => 'hedera-web'
,'user' => 'hedera-web' ,'user' => 'hedera-web'
,'pass' => 'base64pass' ,'pass' => ''
] ]
]; ];

View File

@ -1,18 +0,0 @@
<?php
namespace Vn\Hedera;
require_once (__DIR__.'/../php-vn-web/configure.php');
require_once (__DIR__.'/../vn-image/configure.php');
set_include_path
(
get_include_path ()
.PATH_SEPARATOR.__DIR__
);
const _DEVELOPER_MODE = TRUE;
const _CONFIG_DIR = '/home/juan/.config';
const _LOG_DIR = '/tmp';
?>

View File

@ -1,4 +1,4 @@
Copyright (C) 2015 - Juan Ferrer Toribio Copyright (C) 2016 - Juan Ferrer Toribio
This package is free software; you can redistribute it and/or modify This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

2
debian/changelog vendored
View File

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

4
debian/control vendored
View File

@ -1,7 +1,7 @@
Source: hedera-web Source: hedera-web
Priority: optional Priority: optional
Maintainer: Juan Ferrer Toribio <juan@verdnatura.es> Maintainer: Juan Ferrer Toribio <juan@verdnatura.es>
Build-Depends: build-essential, debhelper Build-Depends: build-essential, debhelper, nodejs, npm
Standards-Version: 3.9.3 Standards-Version: 3.9.3
Section: misc Section: misc
Homepage: http://www.verdnatura.es Homepage: http://www.verdnatura.es
@ -9,7 +9,7 @@ Vcs-Git: git://www.verdnatura.es/var/git/hedera-web
Package: hedera-web Package: hedera-web
Architecture: all Architecture: all
Depends: apache2, php5-mysql, php5-mcrypt, php-vn-web Depends: apache2, php5-mysql, php5-mcrypt, php5-ssh2, php-vn-lib, nodejs, npm
Suggests: php-text-captcha, php5-imap, vn-image, tinymce Suggests: php-text-captcha, php5-imap, vn-image, tinymce
Section: misc Section: misc
Priority: optional Priority: optional

8
debian/cron.d vendored
View File

@ -1,2 +1,8 @@
MAILTO=webmaster MAILTO=webmaster
*/4 * * * * www-data php5 /usr/share/hedera-web/tpv/imap.php */4 * * * * root php /usr/share/hedera-web/cli.php -m tpv/confirm-mail
*/2 * * * * root php /usr/share/hedera-web/cli.php -m edi/load
0 23 * * * root php /usr/share/hedera-web/cli.php -m edi/clean
0 5 * * * root php /usr/share/hedera-web/cli.php -m edi/update
*/1 * * * * root php /usr/share/hedera-web/cli.php -m misc/mail
0 5 * * * root php /usr/share/hedera-web/cli.php -m misc/exchange-rate
45 14 20 11 * root php /usr/share/hedera-web/cli.php -m misc/exchange-rate

16
debian/install vendored
View File

@ -1,4 +1,14 @@
debian/conf/* etc/hedera-web conf/* etc/hedera-web
vn usr/share/php web usr/share/php/vn
doc/* usr/share/doc/hedera-web doc/* usr/share/doc/hedera-web
web/* usr/share/hedera-web forms usr/share/hedera-web
image usr/share/hedera-web
js usr/share/hedera-web
locale usr/share/hedera-web
pages usr/share/hedera-web
reports usr/share/hedera-web
rest usr/share/hedera-web
index.php usr/share/hedera-web
cli.php usr/share/hedera-web
package.json usr/share/hedera-web
build usr/share/hedera-web

2
debian/postinst vendored
View File

@ -4,3 +4,5 @@ a2enconf hedera-web
service apache2 reload service apache2 reload
service cron restart service cron restart
cd /usr/share/hedera-web && npm install --production

7
debian/rules vendored
View File

@ -5,3 +5,10 @@
%: %:
dh $@ dh $@
clean:
npm --production run clean
dh_clean $@
build:
npm --production run build

14
environ.php Normal file
View File

@ -0,0 +1,14 @@
<?php
require_once (__DIR__.'/../php-vn-lib/environ.php');
set_include_path (__DIR__.PATH_SEPARATOR.get_include_path ());
$vnAutoloadMap['vn/web'] = __DIR__.'/web';
const _DEV_MODE = TRUE;
const _CONFIG_DIR = __DIR__.'/../../.config';
const _LOG_DIR = '/tmp';
const _DATA_DIR = '/tmp';
?>

View File

@ -1,7 +1,7 @@
Vn.AddressList = new Class Hedera.AddressList = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,activate: function () ,activate: function ()
{ {

View File

@ -23,11 +23,10 @@
<h1><t>Addresses</t></h1> <h1><t>Addresses</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button <htk-bar-button
image="image/dark/add.svg" icon="add"
tip="_AddAddress" tip="_AddAddress"
on-click="onAddAddressClick" on-click="onAddAddressClick"/>
showText="true"/>
</div> </div>
<div id="form" class="address-list"> <div id="form" class="address-list">
<div class="box"> <div class="box">
@ -48,13 +47,13 @@
form="iter" form="iter"
column="id" column="id"
tip="_RemoveAddress" tip="_RemoveAddress"
image="image/delete.svg" icon="delete"
on-click="onRemoveAddressClick"/> on-click="onRemoveAddressClick"/>
<htk-button <htk-button
form="iter" form="iter"
column="id" column="id"
tip="_EditAddress" tip="_EditAddress"
image="image/edit.svg" icon="edit"
on-click="onEditAddressClick"/> on-click="onEditAddressClick"/>
</div> </div>
<p class="important"> <p class="important">

View File

@ -1,13 +1,13 @@
Vn.Address = new Class Hedera.Address = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,activate: function () ,activate: function ()
{ {
this.$('model').setInfo ('a', 'address_view', 'hedera', ['id'], 'id'); this.$('model').setInfo ('a', 'address_view', 'hedera', ['id'], 'id');
this.$('model').setDefault ('customer_id', 'a', this.$('model').setDefault ('customer_id', 'a',
new Sql.Func ({schema: 'account', name: 'user_get_id'})); new Sql.Function ({schema: 'account', name: 'user_get_id'}));
} }
,onStatusChange: function (form) ,onStatusChange: function (form)

View File

@ -28,16 +28,14 @@
<h1><t>AddEditAddress</t></h1> <h1><t>AddEditAddress</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button <htk-bar-button
image="image/dark/ok.svg" icon="ok"
tip="_Accept" tip="_Accept"
on-click="onAcceptClick" on-click="onAcceptClick"/>
showText="true"/> <htk-bar-button
<htk-button icon="close"
image="image/dark/close.svg"
tip="_Return" tip="_Return"
on-click="onReturnClick" on-click="onReturnClick"/>
showText="true"/>
</div> </div>
<div id="form" class="address"> <div id="form" class="address">
<div class="box"> <div class="box">

View File

@ -0,0 +1,80 @@
Hedera.Conf = new Class
({
Extends: Hedera.Form
,activate: function ()
{
this.$('user-model').setInfo ('c', 'customer_view', 'hedera');
this.$('addresses').setInfo ('a', 'address_view', 'hedera');
}
,onPassChangeClick: function ()
{
this.$('old-password').value = '';
this.$('new-password').value = '';
this.$('repeat-password').value = '';
var recoverPass = this.$('user-form').get ('recoverPass');
this.$('old-password').style.display = recoverPass ? 'none' : 'block';
this.$('change-password').show ();
if (recoverPass)
this.$('new-password').focus ();
else
this.$('old-password').focus ();
}
,onPassModifyClick: function ()
{
try {
var oldPassword = this.$('old-password').value;
var newPassword = this.$('new-password').value;
var repeatedPassword = this.$('repeat-password').value;
if (newPassword == '' && repeatedPassword == '')
throw new Error (_('Passwords empty'));
if (newPassword !== repeatedPassword)
throw new Error (_('Passwords doesn\'t match'));
var batch = new Sql.Batch ();
batch.addValues ({
'oldPassword': oldPassword,
'newPassword': newPassword
});
var query = 'CALL account.userChangePassword (#oldPassword, #newPassword)';
this.conn.execQuery (query, this.onPasswordUpdate.bind (this), batch);
}
catch (e)
{
Htk.Toast.showError (e.message);
}
}
,onPasswordUpdate: function (resultSet)
{
try {
resultSet.fetchResult ();
this.$('change-password').hide ();
Htk.Toast.showMessage (_('Password changed!'));
this.$('user-form').refresh ();
}
catch (e)
{
Htk.Toast.showError (_('Password doesn\'t meet the requirements'));
this.$('old-password').select ();
}
}
,onPassInfoClick: function ()
{
this.$('password-info').show ();
}
,onAddressesClick: function ()
{
this.hash.set ({'form': 'account/address-list'});
}
});

View File

@ -17,3 +17,17 @@
{ {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.pass-change
{
max-width: 15em;
}
.pass-info
{
width: 15em;
}
.pass-info ul
{
list-style-type: none;
}

122
forms/account/conf/ui.xml Executable file
View File

@ -0,0 +1,122 @@
<vn>
<vn-group>
<db-form id="password-form">
<db-model property="model">
<custom>
SELECT length, nAlpha, nUpper, nDigits, nPunct
FROM account.userPassword
</custom>
</db-model>
</db-form>
<db-form id="user-form">
<db-model property="model" id="user-model" updatable="true">
<custom>
SELECT u.id, u.name, u.recoverPass,
c.email, c.mail, c.user_id
FROM account.userView u
LEFT JOIN customer_view c
ON u.id = c.user_id
</custom>
</db-model>
</db-form>
<db-model id="addresses" updatable="true">
<custom>
SELECT a.id, a.consignee, p.name province,
a.zip_code, a.city, a.name, a.active, c.Pais country
FROM address_view a
LEFT JOIN vn2008.province p ON a.province_id = p.province_id
JOIN vn2008.Paises c ON c.Id = p.Paises_Id
WHERE active
</custom>
</db-model>
</vn-group>
<div id="title">
<h1><t>Configuration</t></h1>
</div>
<div id="actions">
<htk-bar-button
icon="place"
tip="_Addresses"
on-click="onAddressesClick"/>
<htk-bar-button
icon="preferences"
tip="_Change password"
on-click="onPassChangeClick"/>
</div>
<div id="form" class="conf">
<div class="box">
<div class="form">
<div class="form-group">
<label for="user-name"><t>UserName</t></label>
<htk-text column="name" form="user-form"/>
</div>
<div class="form-group">
<label for="email"><t>Email</t></label>
<htk-entry column="email" form="user-form"></htk-entry>
</div>
<div class="form-group">
<label for="mail"><t>ReceiveInvoicesByEmail</t></label>
<htk-check column="mail" form="user-form"/>
</div>
</div>
</div>
</div>
<htk-popup
id="change-password"
modal="true">
<div property="child-node" class="dialog pass-change">
<div>
<input
id="old-password"
type="password"
placeholder="_Old password"/>
<input
id="new-password"
type="password"
placeholder="_New password"/>
<input
id="repeat-password"
type="password"
placeholder="_Repeat password"/>
</div>
<button class="thin" on-click="onPassModifyClick">
<t>Modify</t>
</button>
<button class="thin" on-click="onPassInfoClick">
<t>Info</t>
</button>
<div class="clear"/>
</div>
</htk-popup>
<htk-popup
id="password-info"
modal="true">
<div property="child-node" class="dialog pass-info">
<h3>
<t>Password requirements</t>
</h3>
<ul>
<li>
<htk-text form="password-form" column="length"/>
<t>characters long</t>
</li>
<li>
<htk-text form="password-form" column="nAlpha"/>
<t>alphabetic characters</t>
</li>
<li>
<htk-text form="password-form" column="nUpper"/>
<t>capital letters</t>
</li>
<li>
<htk-text form="password-form" column="nDigits"/>
<t>digits</t>
</li>
<li>
<htk-text form="password-form" column="nPunct"/>
<t>symbols</t>
</li>
</ul>
</div>
</htk-popup>
</vn>

View File

@ -0,0 +1,6 @@
Hedera.AccessLog = new Class
({
Extends: Hedera.Form
});

View File

@ -1,7 +1,7 @@
Vn.Connections = new Class Hedera.Connections = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,_timeoutId: null ,_timeoutId: null
@ -36,11 +36,11 @@ Vn.Connections = new Class
,onChangeUserClick: function (button, form) ,onChangeUserClick: function (button, form)
{ {
this.gui.supplantUser (form.get ('user_id'), this.gui.supplantUser (form.get ('user'),
this.onUserSupplant.bind (this)); this._onUserSupplant.bind (this));
} }
,onUserSupplant: function (userName) ,_onUserSupplant: function (userName)
{ {
this.hash.set ({'form': 'ecomerce/orders'}); this.hash.set ({'form': 'ecomerce/orders'});
} }

View File

@ -3,11 +3,10 @@
<h1><t>Connections</t></h1> <h1><t>Connections</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button <htk-bar-button
image="image/dark/refresh.svg" icon="refresh"
tip="_Refresh" tip="_Refresh"
on-click="onRefreshClick" on-click="onRefreshClick"/>
showText="true"/>
<div class="connections-sum"> <div class="connections-sum">
<htk-text> <htk-text>
<db-calc-sum <db-calc-sum
@ -24,9 +23,9 @@
<db-model property="model" id="sessions" on-status-changed="onModelStatusChange"> <db-model property="model" id="sessions" on-status-changed="onModelStatusChange">
<custom> <custom>
SELECT s.id, e.user_id, c.Cliente, e.date_time login, is_new, SELECT s.id, e.user_id, c.Cliente, e.date_time login, is_new,
s.date_time last_activity, a.platform, a.browser, a.version s.lastUpdate last_activity, a.platform, a.browser, a.version, u.name user
FROM user_session s FROM userSession s
JOIN visit_user e ON s.visit_user_id = e.id JOIN visit_user e ON s.userVisit = e.id
JOIN visit_access c ON e.access_id = c.id JOIN visit_access c ON e.access_id = c.id
JOIN visit_agent a ON c.agent_id = a.id JOIN visit_agent a ON c.agent_id = a.id
JOIN visit v ON a.visit_id = v.id JOIN visit v ON a.visit_id = v.id
@ -41,13 +40,13 @@
form="iter" form="iter"
column="id" column="id"
tip="_Supplant user" tip="_Supplant user"
image="image/incognito.svg" icon="incognito"
on-click="onChangeUserClick"/> on-click="onChangeUserClick"/>
<htk-button <htk-button
form="iter" form="iter"
column="id" column="id"
tip="_Access log" tip="_Access log"
image="image/gnome.svg" icon="gnome"
on-click="onAccessLogClick"/> on-click="onAccessLogClick"/>
<p class="important"> <p class="important">
<htk-text form="iter" column="Cliente"/> <htk-text form="iter" column="Cliente"/>

View File

@ -1,7 +1,7 @@
Vn.Items = new Class Hedera.Items = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,activate: function () ,activate: function ()
{ {

View File

@ -2,6 +2,12 @@
<div id="title"> <div id="title">
<h1><t>Item list</t></h1> <h1><t>Item list</t></h1>
</div> </div>
<div id="actions" class="action-bar">
<htk-bar-button
icon="print"
tip="_Preview"
on-click="onPreviewClick"/>
</div>
<div id="form" class="items"> <div id="form" class="items">
<div class="box"> <div class="box">
<div class="form"> <div class="form">
@ -38,11 +44,6 @@
</select> </select>
</div> </div>
</div> </div>
<div class="footer">
<button class="thin" on-click="onPreviewClick">
<t>Preview</t>
</button>
</div>
</div> </div>
</div> </div>
</vn> </vn>

View File

@ -1,7 +1,7 @@
Vn.Links = new Class Hedera.Links = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,repeaterFunc: function (res, form) ,repeaterFunc: function (res, form)
{ {

View File

@ -0,0 +1,37 @@
Hedera.Photos = new Class
({
Extends: Hedera.Form
,activate: function ()
{
this.$('schema').value = 'catalog';
this.$('photo-id').focus ();
var self = this;
this.$('html-form').onsubmit = function ()
{ self._onSubmit (); return false; };
}
,_onSubmit: function ()
{
this.$('schema-field').value = this.$('schema').value;
this.$('submit').disabled = true;
this.conn.sendFormMultipart (this.$('html-form'),
this._onResponse.bind (this));
}
,_onResponse: function (json, error)
{
this.$('submit').disabled = false;
if (error)
throw error;
this.$('photo-id').value = '';
this.$('photo-id').focus ();
Htk.Toast.showMessage (_('ImageAdded'));
}
});

View File

@ -20,11 +20,12 @@
/* Footer */ /* Footer */
.photos button .photos input[type=submit]
{ {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
padding: 0.6em; padding: 0.6em;
margin-top: 1.5em; margin-top: 1.5em;
font-size: 1.2em;
} }

View File

@ -7,10 +7,8 @@
<div class="form"> <div class="form">
<form <form
id="html-form" id="html-form"
method="post" enctype="multipart/form-data">
enctype="multipart/form-data" <input type="hidden" name="srv" value="json:image/upload"/>
target="photos-iframe"
on-submit="onFormSubmit">
<div class="form-group"> <div class="form-group">
<label><t>Id</t></label> <label><t>Id</t></label>
<input type="number" name="id" id="photo-id"/> <input type="number" name="id" id="photo-id"/>
@ -20,27 +18,22 @@
<input type="text" name="name"/> <input type="text" name="name"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Schema</t></label> <label><t>Collection</t></label>
<input type="hidden" name="schema" id="schema-field"/>
<htk-combo id="schema"> <htk-combo id="schema">
<db-model property="model"> <db-model property="model">
<custom>
SELECT name, `desc` FROM image_schema ORDER BY `desc` SELECT name, `desc` FROM image_schema ORDER BY `desc`
</custom>
</db-model> </db-model>
</htk-combo> </htk-combo>
<input type="hidden" name="schema" id="schema-field"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>ImageFile</t></label> <label><t>ImageFile</t></label>
<input type="file" name="image"/> <input type="file" name="image"/>
<input type="hidden" name="MAX_FILE_SIZE" id="photo-size"/>
</div> </div>
<button class="thin" id="submit"> <input id="submit" type="submit" class="thin"/>
<t>Upload</t>
</button>
</form> </form>
<iframe
id="iframe"
name="photos-iframe"
on-load="onImageUpload"/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
Vn.Queries = new Class Hedera.Queries = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,activate: function () ,activate: function ()
{ {

View File

@ -3,16 +3,14 @@
<h1><t>Queries</t></h1> <h1><t>Queries</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button <htk-bar-button
image="image/dark/ok.svg" icon="ok"
tip="_Execute" tip="_Execute"
on-click="_onExecuteClick" on-click="_onExecuteClick"/>
showText="true"/> <htk-bar-button
<htk-button icon="delete"
image="image/dark/delete.svg"
tip="_Clean" tip="_Clean"
on-click="_onCleanClick" on-click="_onCleanClick"/>
showText="true"/>
</div> </div>
<div id="form" class="queries"> <div id="form" class="queries">
<div class="box form"> <div class="box form">

View File

@ -0,0 +1,52 @@
Hedera.Shelves = new Class
({
Extends: Hedera.Form
,activate: function ()
{
this.$('date').value = new Date ();
}
,onConfigChange: function ()
{
var fields = [
'realm'
,'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
];
for (var i = 0; i < fields.length; i++)
this.$(fields[i]).value = this.$('config').get (fields[i]);
}
,onPreviewClick: function ()
{
var fields = [
'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
,'useIds'
,'date'
];
var batch = new Sql.Batch ();
for (var i = 0; i < fields.length; i++)
batch.addValue (fields[i], this.$(fields[i]).value);
this.gui.openReport ('shelves-report', batch);
}
});

View File

@ -28,16 +28,3 @@
margin: 0; margin: 0;
width: 100%; width: 100%;
} }
/* Footer */
.shelves .footer
{
text-align: center;
margin-top: 1.5em;
}
.shelves .footer > button
{
margin: 0 .2em;
}

View File

@ -2,16 +2,22 @@
<vn-group> <vn-group>
<db-model property="model" id="configs-model"> <db-model property="model" id="configs-model">
<custom> <custom>
SELECT c.id, c.name, c.name_prefix, c.warehouse_id, c.family_id, SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf_id, c.max_amount, c.show_packing, c.stack, t.reino_id c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelf_config c FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family_id JOIN vn2008.Tipos t ON t.tipo_id = c.family
</custom> </custom>
</db-model> </db-model>
</vn-group> </vn-group>
<div id="title"> <div id="title">
<h1><t>Shelves</t></h1> <h1><t>Shelves</t></h1>
</div> </div>
<div id="actions" class="action-bar">
<htk-bar-button
icon="print"
tip="_Preview"
on-click="onPreviewClick"/>
</div>
<div id="form" class="shelves"> <div id="form" class="shelves">
<div class="box"> <div class="box">
<div class="form"> <div class="form">
@ -30,8 +36,8 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Reign</t></label> <label><t>Reign</t></label>
<htk-combo id="reign"> <htk-combo id="realm">
<db-model property="model" id="reigns"> <db-model property="model" id="realms">
<custom> <custom>
SELECT id, reino FROM vn2008.reinos SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino WHERE display != FALSE ORDER BY reino
@ -45,11 +51,11 @@
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT tipo_id, Tipo FROM vn2008.Tipos SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #reign ORDER BY Tipo WHERE reino_id = #realm ORDER BY Tipo
</custom> </custom>
<sql-batch property="batch"> <sql-batch property="batch">
<custom> <custom>
<item name="reign" param="reign"/> <item name="realm" param="realm"/>
</custom> </custom>
</sql-batch> </sql-batch>
</db-model> </db-model>
@ -78,29 +84,28 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Name prefix</t></label> <label><t>Name prefix</t></label>
<htk-entry id="filter"/> <htk-entry id="namePrefix"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Limit amount per item</t></label> <label><t>Limit amount per item</t></label>
<htk-entry id="max-amount"/> <htk-entry id="maxAmount"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Title</t></label> <label><t>Title</t></label>
<htk-entry id="report-title"/> <htk-entry id="reportTitle"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Show packing</t></label> <label><t>Show packing</t></label>
<htk-check id="show-packing"/> <htk-check id="showPacking"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Stack different items</t></label> <label><t>Stack different items</t></label>
<htk-check id="stack"/> <htk-check id="stack"/>
</div> </div>
<div class="form-group">
<label><t>Use ids instead of names</t></label>
<htk-check id="useIds"/>
</div> </div>
<div class="footer">
<button class="thin" on-click="onPreviewClick">
<t>Preview</t>
</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -35,13 +35,13 @@
form="iter" form="iter"
column="id" column="id"
tip="_AccessAsUser" tip="_AccessAsUser"
image="image/incognito.svg" icon="incognito"
on-click="onChangeUserClick"/> on-click="onChangeUserClick"/>
<htk-button <htk-button
form="iter" form="iter"
column="id" column="id"
tip="_AccessLog" tip="_AccessLog"
image="image/gnome.svg" icon="gnome"
on-click="onAccessLogClick"/> on-click="onAccessLogClick"/>
<p class="important"> <p class="important">
<htk-text form="iter" column="Cliente"/> <htk-text form="iter" column="Cliente"/>

View File

@ -1,7 +1,7 @@
Vn.Users = new Class Hedera.Users = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,onAccessLogClick: function (button, form) ,onAccessLogClick: function (button, form)
{ {
@ -13,7 +13,7 @@ Vn.Users = new Class
,onChangeUserClick: function (button, form) ,onChangeUserClick: function (button, form)
{ {
this.gui.supplantUser (form.get ('id'), this.gui.supplantUser (form.get ('name'),
this.onUserSupplant.bind (this)); this.onUserSupplant.bind (this));
} }

View File

@ -3,16 +3,14 @@
<h1><t>Visits</t></h1> <h1><t>Visits</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button <htk-bar-button
image="image/dark/refresh.svg" icon="refresh"
tip="_Refresh" tip="_Refresh"
on-click="onRefreshClick" on-click="onRefreshClick"/>
showText="true"/> <htk-bar-button
<htk-button icon="user-info"
image="image/dark/user-info.svg"
tip="_Connections" tip="_Connections"
on-click="onSessionsClick" on-click="onSessionsClick"/>
showText="true"/>
</div> </div>
<div id="form" class="visits"> <div id="form" class="visits">
<div class="box"> <div class="box">

View File

@ -1,7 +1,7 @@
Vn.Visits = new Class Hedera.Visits = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,activate: function () ,activate: function ()
{ {

View File

@ -1,7 +1,7 @@
Vn.Packages = new Class Hedera.Packages = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,onShowClick: function (column, agencyId) ,onShowClick: function (column, agencyId)
{ {

View File

@ -12,7 +12,7 @@
</db-model> </db-model>
<htk-column-button <htk-column-button
column="agency_id" column="agency_id"
image="image/show.svg" icon="show"
tip="_ShowByProvince" tip="_ShowByProvince"
on-clicked="onShowClick"/> on-clicked="onShowClick"/>
<htk-column-text title="_Agency" column="Agencia"/> <htk-column-text title="_Agency" column="Agencia"/>

View File

@ -0,0 +1,6 @@
Hedera.Provinces = new Class
({
Extends: Hedera.Form
});

6
forms/cms/about/about.js Normal file
View File

@ -0,0 +1,6 @@
Hedera.About = new Class
({
Extends: Hedera.Form
});

View File

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 182 KiB

View File

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 298 KiB

View File

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

Before

Width:  |  Height:  |  Size: 285 KiB

After

Width:  |  Height:  |  Size: 285 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 426 KiB

After

Width:  |  Height:  |  Size: 426 KiB

View File

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 297 KiB

After

Width:  |  Height:  |  Size: 297 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 153 KiB

View File

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View File

@ -0,0 +1,46 @@
Hedera.Contact = new Class
({
Extends: Hedera.Form
,activate: function ()
{
var self = this;
this.$('contact-form').onsubmit = function ()
{ self._onSubmit (); return false; };
this.refreshCaptcha ();
}
,refreshCaptcha: function ()
{
params = {
'srv': 'rest:core/captcha',
'stamp': new Date ().getTime ()
};
this.$('captcha-img').src = '?'+ Vn.Url.makeUri (params);
}
,_onSubmit: function ()
{
this.conn.sendForm (this.$('contact-form'),
this._onResponse.bind (this));
}
,_onResponse: function (json, error)
{
var form = this.$('contact-form');
if (json)
{
form.reset ();
Htk.Toast.showMessage (_('DataSentSuccess'));
}
else
Htk.Toast.showError (_('ErrorSendingData'));
form['captcha'].value = '';
this.refreshCaptcha ();
}
});

View File

@ -46,10 +46,10 @@
.captcha img .captcha img
{ {
vertical-align: middle; vertical-align: middle;
margin-left: 1em;
} }
.captcha input .captcha input
{ {
margin-left: 1em;
max-width: 8em; max-width: 8em;
} }

View File

@ -11,7 +11,9 @@
<p> <p>
<t>OrCallUs</t> <t>OrCallUs</t>
</p> </p>
<form action="forms/cms/contact/send-data.php" method="post" id="contact-form"> <form
id="contact-form">
<input type="hidden" name="srv" value="json:misc/contact"/>
<div class="form-group"> <div class="form-group">
<label><t>Name</t></label> <label><t>Name</t></label>
<input type="text" name="name"/> <input type="text" name="name"/>

View File

@ -1,7 +1,7 @@
Vn.Home = new Class Hedera.Home = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,onStartOrderClick: function () ,onStartOrderClick: function ()
{ {

View File

@ -3,12 +3,11 @@
<h1><t>Home</t></h1> <h1><t>Home</t></h1>
</div> </div>
<div id="actions" class="catalog-actions"> <div id="actions" class="catalog-actions">
<htk-button <htk-bar-button
class="start-order" class="start-order"
image="image/dark/new-order.svg" icon="new-order"
tip="_Start order" tip="_Start order"
on-click="onStartOrderClick" on-click="onStartOrderClick"/>
showText="true"/>
</div> </div>
<div id="form" class="home"> <div id="form" class="home">
<div class="column mansonry" id="news-column"> <div class="column mansonry" id="news-column">
@ -16,7 +15,6 @@
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT title, date_time, text, image, id FROM news SELECT title, date_time, text, image, id FROM news
WHERE tag != 'course'
ORDER BY priority, date_time DESC ORDER BY priority, date_time DESC
</custom> </custom>
</db-model> </db-model>

View File

@ -1,9 +1,9 @@
var gmapsIsLoaded = false; var gmapsIsLoaded = false;
Vn.Location = new Class Hedera.Location = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,locations: null ,locations: null

View File

@ -0,0 +1,5 @@
Hedera.Training = new Class
({
Extends: Hedera.Form
});

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -15,7 +15,7 @@
<li><t>BecauseOurWorkShop</t></li> <li><t>BecauseOurWorkShop</t></li>
<li><t>BecauseWeHaveWhatYouNeed</t></li> <li><t>BecauseWeHaveWhatYouNeed</t></li>
</ul> </ul>
<img src="image/store.png" alt="Store photo"/> <img src="forms/cms/why/store.png" alt="Store photo"/>
</div> </div>
</div> </div>
</div> </div>

6
forms/cms/why/why.js Normal file
View File

@ -0,0 +1,6 @@
Hedera.Why = new Class
({
Extends: Hedera.Form
});

View File

@ -1,14 +1,14 @@
Vn.Basket = new Class Hedera.Basket = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,open: function () ,open: function ()
{ {
this.close (); this.close ();
this.isOpen = true; this.isOpen = true;
Vn.BasketChecker.check (this.conn, Hedera.BasketChecker.check (this.conn,
this.onBasketCheck.bind (this)); this.onBasketCheck.bind (this));
} }
@ -18,6 +18,11 @@ Vn.Basket = new Class
this.loadUi (); this.loadUi ();
} }
,activate: function ()
{
this.$('items').setInfo ('i', 'basket_item', 'hedera');
}
,onConfigureClick: function () ,onConfigureClick: function ()
{ {
Htk.Toast.showWarning (_('RememberReconfiguringImpact')); Htk.Toast.showWarning (_('RememberReconfiguringImpact'));

View File

@ -3,21 +3,18 @@
<h1><t>ShoppingBasket</t></h1> <h1><t>ShoppingBasket</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button <htk-bar-button
image="image/dark/ok.svg" icon="ok"
tip="_Checkout" tip="_Checkout"
on-click="onCheckoutClick" on-click="onCheckoutClick"/>
show-text="true"/> <htk-bar-button
<htk-button icon="view-dual"
image="image/dark/view-dual.svg"
tip="_Catalog" tip="_Catalog"
on-click="onCatalogClick" on-click="onCatalogClick"/>
show-text="true"/> <htk-bar-button
<htk-button icon="preferences"
image="image/dark/preferences.svg"
tip="_ConfigureOrder" tip="_ConfigureOrder"
on-click="onConfigureClick" on-click="onConfigureClick"/>
show-text="true"/>
</div> </div>
<div id="form" class="basket"> <div id="form" class="basket">
<div class="box"> <div class="box">
@ -47,7 +44,7 @@
column="ticket_id" column="ticket_id"
class="delete" class="delete"
tip="_Remove" tip="_Remove"
image="image/delete.svg" icon="delete"
on-click="onDeleteClick"/> on-click="onDeleteClick"/>
<htk-image <htk-image
form="iter" form="iter"

View File

@ -1,7 +1,7 @@
Vn.Catalog = new Class Hedera.Catalog = new Class
({ ({
Extends: Vn.Form Extends: Hedera.Form
,_menuShown: false ,_menuShown: false
@ -10,9 +10,9 @@ Vn.Catalog = new Class
this.close (); this.close ();
this.isOpen = true; this.isOpen = true;
if (!Vn.Cookie.check ('hedera_guest')) if (!localStorage.getItem ('hederaGuest'))
{ {
Vn.BasketChecker.check (this.conn, Hedera.BasketChecker.check (this.conn,
this.onBasketCheck.bind (this)); this.onBasketCheck.bind (this));
} }
else else
@ -34,10 +34,10 @@ Vn.Catalog = new Class
this.$('items-model').setInfo ('a', 'Articles', 'vn2008', ['item_id']); this.$('items-model').setInfo ('a', 'Articles', 'vn2008', ['item_id']);
if (Vn.Cookie.check ('hedera_view')) if (localStorage.getItem ('hederaView'))
this.setView (Vn.Cookie.getInt ('hedera_view')); this.setView (parseInt (localStorage.getItem ('hederaView')));
else else
this.setView (Vn.Catalog.View.GRID); this.setView (Hedera.Catalog.View.GRID);
} }
,deactivate: function () ,deactivate: function ()
@ -49,34 +49,34 @@ Vn.Catalog = new Class
,setView: function (view) ,setView: function (view)
{ {
if (view === Vn.Catalog.View.GRID) if (view === Hedera.Catalog.View.GRID)
{ {
this.$('view-button').setProperties ({ this.$('view-button').setProperties ({
image: 'image/dark/view-list.svg', icon: 'view-list',
tip: _('List view') tip: _('List view')
}); });
this.view = Vn.Catalog.View.GRID; this.view = Hedera.Catalog.View.GRID;
var className = 'grid-view'; var className = 'grid-view';
} }
else else
{ {
this.$('view-button').setProperties ({ this.$('view-button').setProperties ({
image: 'image/dark/view-grid.svg', icon: 'view-grid',
tip: _('Grid view') tip: _('Grid view')
}); });
this.view = Vn.Catalog.View.LIST; this.view = Hedera.Catalog.View.LIST;
var className = 'list-view'; var className = 'list-view';
} }
var node = this.$('grid-view').getNode (); var node = this.$('grid-view').getNode ();
node.className = className; node.className = className;
Vn.Cookie.set ('hedera_view', this.view); localStorage.setItem ('hederaView', this.view);
} }
,onSwitchViewClick: function () ,onSwitchViewClick: function ()
{ {
this.setView (this.view === Vn.Catalog.View.LIST ? this.setView (this.view === Hedera.Catalog.View.LIST ?
Vn.Catalog.View.GRID : Vn.Catalog.View.LIST); Hedera.Catalog.View.GRID : Hedera.Catalog.View.LIST);
} }
,onBasketReady: function (form) ,onBasketReady: function (form)
@ -123,7 +123,7 @@ Vn.Catalog = new Class
}); });
var img = builder.$('image'); var img = builder.$('image');
img.src = 'image/family_dark/'+ form.get ('id') +'.svg'; img.src = 'image/family/light/'+ form.get ('id') +'.svg';
img.title = form.get ('name'); img.title = form.get ('name');
img.alt = img.title; img.alt = img.title;
} }
@ -237,7 +237,7 @@ Vn.Catalog = new Class
,isGuest: function () ,isGuest: function ()
{ {
if (Vn.Cookie.check ('hedera_guest')) if (localStorage.getItem ('hederaGuest'))
{ {
Htk.Toast.showError (_('YouMustBeLoggedIn')); Htk.Toast.showError (_('YouMustBeLoggedIn'));
return true; return true;
@ -348,7 +348,7 @@ Vn.Catalog = new Class
} }
}); });
Vn.Catalog.extend Hedera.Catalog.extend
({ ({
View: { View: {
LIST: 0, LIST: 0,
@ -496,9 +496,11 @@ Vn.Filter = new Class
this._onCloseClick.bind (this, li)); this._onCloseClick.bind (this, li));
li.appendChild (button); li.appendChild (button);
var img = document.createElement ('img'); var icon = new Htk.Icon ({
img.src = 'image/close.svg'; icon: 'close',
button.appendChild (img); alt: _('Close')
});
button.appendChild (icon.node);
var text = this._label = document.createTextNode (''); var text = this._label = document.createTextNode ('');
li.appendChild (text); li.appendChild (text);

Some files were not shown because too many files have changed in this diff Show More