+
-
+
diff --git a/package/usr/share/hedera-web/pages/web/style.css b/package/usr/share/hedera-web/pages/web/style.css
index db3fbb55..2259e4ba 100755
--- a/package/usr/share/hedera-web/pages/web/style.css
+++ b/package/usr/share/hedera-web/pages/web/style.css
@@ -135,7 +135,7 @@ body
{
height: 2em;
}
-#menu-background
+#background
{
z-index: 10;
position: absolute;
@@ -147,7 +147,8 @@ body
display: none;
}
#menu-box,
-#menu > li
+#menu > li,
+ul.submenu
{
width: 15em;
}
@@ -195,6 +196,10 @@ body
{
background-color: #DDD /* #AC6 */;
}
+#menu a.selected
+{
+ background-color: #EEE;
+}
ul.submenu
{
display: none;
@@ -203,20 +208,15 @@ ul.submenu
border-radius: 1px;
background-color: white;
box-shadow: 0 0.2em 0.2em #CCC;
- z-index: 10;
+ z-index: 50;
list-style-type: none;
padding-left: 0;
- width: 14em;
}
ul.submenu a
{
width: 60%;
padding: 0.7em 20%;
}
-#menu li.selected
-{
- background-color: #EEE;
-}
/* Links */
@@ -232,6 +232,7 @@ ul.submenu a
padding: 0.1em;
display: block;
float: left;
+ max-width: 2.2em;
}
#links img
{
@@ -250,10 +251,20 @@ ul.submenu a
overflow: auto;
}
-@media screen and (max-device-width: 1100px) and (min-resolution: 100dpi)
+@media screen and (min-resolution: 100dpi)
{
#menu-button { display: block; }
#menu-box { display: none; }
#form { left: 0; }
+
+ ul.submenu
+ {
+ display: block;
+ position: relative;
+ border: none;
+ border-radius: 0;
+ background-color: white;
+ box-shadow: none;
+ }
}
diff --git a/package/usr/share/hedera-web/pages/web/web.js b/package/usr/share/hedera-web/pages/web/web.js
index dfd56cbe..6e7446ec 100755
--- a/package/usr/share/hedera-web/pages/web/web.js
+++ b/package/usr/share/hedera-web/pages/web/web.js
@@ -6,7 +6,7 @@ Vn.Web =
{
forms: {}
,activeForm: null
- ,activeFormPath: null
+ ,activeCss: null
,requestedForm: null
,menuShown: false
,menuOptions: {}
@@ -15,9 +15,9 @@ Vn.Web =
,initialize: function ()
{
this.loadingCount = 0;
- this.loader = Vn.get ('loader');
+ this.loader = $('loader');
- this.formHolder = Vn.get ('form');
+ this.formHolder = $('form');
this.hash = new Vn.Hash ();
this.hashLink = new Vn.HashLink
@@ -32,32 +32,36 @@ Vn.Web =
this.conn.on ('loading-changed', this.onConnLoading, this);
this.conn.open (null, null, null, this.connOpened.bind (this));
- var menuButton = Vn.get ('menu-button');
- menuButton.addEventListener ('click', this.onMenuClick.bind (this));
+ $('menu-button').addEventListener ('click', function (event)
+ {
+ event.stopPropagation ();
- var menuBox = Vn.get ('menu-box');
- menuBox.addEventListener ('click', function (event)
+ if (!this.menuShown)
+ this.showMenu ();
+ else
+ this.hideMenu ();
+ }.bind (this));
+
+ $('menu-box').addEventListener ('click', function (event)
{
event.stopPropagation ();
});
}
- ,onMenuClick: function (event)
+ ,showBackground: function ()
{
- event.stopPropagation ();
+ $('background').style.display = 'block';
+ }
- if (!this.menuShown)
- this.showMenu ();
- else
- this.hideMenu ();
+ ,hideBackground: function ()
+ {
+ $('background').style.display = 'none';
}
,showMenu: function ()
{
- var menu = Vn.get ('menu-box');
- menu.style.display = 'block';
- var menuBackground = Vn.get ('menu-background');
- menuBackground.style.display = 'block';
+ this.showBackground ();
+ $('menu-box').style.display = 'block';
this.menuShown = true;
this.hideMenuCallback = this.hideMenu.bind (this);
@@ -66,10 +70,9 @@ Vn.Web =
,hideMenu: function ()
{
- var menu = Vn.get ('menu-box');
- menu.style.display = 'none';
- var menuBackground = Vn.get ('menu-background');
- menuBackground.style.display = 'none';
+ this.hideBackground ();
+ $('menu-box').style.display = 'none';
+ $('menu-button').style.display = 'initial';
this.menuShown = false;
document.removeEventListener ('click', this.hideMenuCallback);
@@ -101,7 +104,7 @@ Vn.Web =
if (userName)
{
- var span = Vn.get ('user-name');
+ var span = $('user-name');
span.appendChild (document.createTextNode (', '+ userName));
}
@@ -121,7 +124,7 @@ Vn.Web =
sectionMap[parent].push (i);
}
- this.createMenu (res, sectionMap, null, Vn.get ('menu'));
+ this.createMenu (res, sectionMap, null, $('menu'));
// Loading the default form
@@ -209,10 +212,10 @@ Vn.Web =
var li = document.createElement ('li');
ul.appendChild (li);
- this.menuOptions[res.get ('path')] = li;
var a = document.createElement ('a');
a.href = this.hash.make ({'form': res.get ('path')});
+ this.menuOptions[res.get ('path')] = a;
li.appendChild (a);
var text = document.createTextNode (_(res.get ('description')));
@@ -222,21 +225,14 @@ Vn.Web =
if (sectionMap[formId])
{
- var submenu;
-
- if (!Vn.isMobile ())
- {
- submenu = document.createElement ('ul');
- submenu.className = 'submenu';
- li.appendChild (submenu);
+ var submenu = document.createElement ('ul');
+ submenu.className = 'submenu';
+ li.appendChild (submenu);
- li.addEventListener ('mouseover',
- this.onLiMouseHover.bind (this, submenu, a));
- li.addEventListener ('mouseout',
- this.onLiMouseOut.bind (this));
- }
- else
- submenu = ul;
+ li.addEventListener ('mouseover',
+ this.onLiMouseHover.bind (this, submenu, a));
+ li.addEventListener ('mouseout',
+ this.onLiMouseOut.bind (this));
this.createMenu (res, sectionMap, formId, submenu);
}
@@ -245,6 +241,9 @@ Vn.Web =
,onLiMouseHover: function (submenu, parent)
{
+ if (Vn.isMobile ())
+ return;
+
this.hideSubmenu ();
this.activeSubmenu = submenu;
@@ -284,12 +283,25 @@ Vn.Web =
this.hideMenu ();
this.requestedForm = formPath;
- this.loadForm (formPath, this.onFormLoad.bind (this));
+ this.loadForm (formPath, null);
}
,loadForm: function (formPath, callback)
{
var formInfo = this.forms[formPath];
+ var path = 'forms/'+ formPath;
+
+ if (this.activeForm)
+ {
+ this.activeForm.close ();
+ this.activeForm = null;
+ }
+
+ if (this.activeCss)
+ Vn.excludeCss (this.activeCss);
+
+ this.activeCss = path +'/style.css';
+ Vn.includeCss (this.activeCss);
if (!formInfo)
{
@@ -312,13 +324,10 @@ Vn.Web =
,callbacks: []
};
- var path = 'forms/'+ formPath;
-
Vn.Locale.load (path,
this.onFormLocaleReady.bind (this, formInfo));
Vn.includeJs (path +'/'+ formName +'.js',
this.onFormJsReady.bind (this, formInfo));
- Vn.includeCss (path +'/style.css');
var request = new XMLHttpRequest ();
request.onreadystatechange =
@@ -342,12 +351,9 @@ Vn.Web =
}
if (callback)
- {
- if (formInfo.ready)
- callback (formInfo);
- else
- formInfo.callbacks.push (callback);
- }
+ formInfo.callbacks.push (callback);
+ if (formInfo.ready)
+ this.onFormDownload (formInfo);
}
,onFormLocaleReady: function (formInfo)
@@ -379,25 +385,7 @@ Vn.Web =
formInfo.ready = true;
- var callbacks = formInfo.callbacks;
- delete formInfo.callbacks;
-
- for (var i = 0; i < callbacks.length; i++)
- callbacks[i] (formInfo);
-
- this.loaderPop ();
- }
-
- ,onFormLoad: function (formInfo)
- {
- if (formInfo.path != this.requestedForm)
- return;
-
- if (this.activeForm)
- this.activeForm.close ();
-
- this.activeFormPath = formInfo.path;
-
+ if (formInfo.path == this.requestedForm)
try {
var klass = eval (formInfo.klass);
this.activeForm = new klass (this, formInfo);
@@ -406,8 +394,16 @@ Vn.Web =
catch (e) {
console.error (e);
}
- }
-
+
+ var callbacks = formInfo.callbacks;
+ formInfo.callbacks = [];
+
+ for (var i = 0; i < callbacks.length; i++)
+ callbacks[i] (this.activeForm);
+
+ this.loaderPop ();
+ }
+
,unload: function ()
{
this.hashLink.disconnect ('changed', this.onFormChange, this);
diff --git a/package/usr/share/hedera-web/rest/query.php b/package/usr/share/hedera-web/rest/query.php
index 98cf97b5..f5850f6f 100755
--- a/package/usr/share/hedera-web/rest/query.php
+++ b/package/usr/share/hedera-web/rest/query.php
@@ -1,6 +1,7 @@
conn;
try {
- if ($conn->multiQuery ($_REQUEST['sql']))
+ $conn->multiQuery ($_REQUEST['sql']);
+
do {
$result = $conn->storeResult ();
@@ -23,7 +25,54 @@ class RestMod extends Rest\Module
$resultMap = [];
$resultMap['data'] = [];
- $resultMap['field'] = $columns;
+ $resultMap['field'] = [];
+
+ for ($i = 0; $i < $result->field_count; $i++)
+ {
+ $column = $columns[$i];
+
+ switch ($column->type)
+ {
+ case MYSQLI_TYPE_BIT:
+ $type = TYPE_BOOLEAN;
+ break;
+ case MYSQLI_TYPE_TINY:
+ case MYSQLI_TYPE_SHORT:
+ case MYSQLI_TYPE_LONG:
+ case MYSQLI_TYPE_LONGLONG:
+ case MYSQLI_TYPE_INT24:
+ case MYSQLI_TYPE_YEAR:
+ $type = TYPE_INTEGER;
+ break;
+ case MYSQLI_TYPE_FLOAT:
+ case MYSQLI_TYPE_DOUBLE:
+ case MYSQLI_TYPE_DECIMAL:
+ case MYSQLI_TYPE_NEWDECIMAL:
+ $type = TYPE_DOUBLE;
+ break;
+ case MYSQLI_TYPE_DATE:
+ $type = TYPE_DATE;
+ break;
+ case MYSQLI_TYPE_DATETIME:
+ case MYSQLI_TYPE_TIMESTAMP:
+ $type = TYPE_DATE_TIME;
+ break;
+ default;
+ $type = TYPE_STRING;
+ }
+
+ $resultMap['field'][] =
+ [
+ 'name' => $column->name,
+ 'orgname' => $column->orgname,
+ 'table' => $column->table,
+ 'orgtable' => $column->orgtable,
+ 'def' => $column->def,
+ 'db' => $column->db,
+ 'flags' => $column->flags,
+ 'type' => $type
+ ];
+ }
while ($row = $result->fetch_row ())
{
diff --git a/package/usr/share/php/vn/hedera/web.php b/package/usr/share/php/vn/hedera/web.php
index 745c35a4..c35c1408 100755
--- a/package/usr/share/php/vn/hedera/web.php
+++ b/package/usr/share/php/vn/hedera/web.php
@@ -27,7 +27,7 @@ class Web
self::$sysConn = new Conn ();
$sysConn = self::$sysConn;
$sysConn->open (
- 'p:'. $conf['db']['host']
+ 'p:'. $conf['db']['host']
,$conf['db']['user']
,base64_decode ($conf['db']['pass'])
,$conf['db']['schema']
@@ -128,7 +128,8 @@ class Web
try {
Auth::getCredentials ();
- self::$conn->open ($conf['db']['host']
+ self::$conn->open (
+ $conf['db']['host']
,Auth::getUser ()
,Auth::getPassword ()
,$conf['db']['schema']
diff --git a/package/usr/share/php/vn/tpv/soap-method.php b/package/usr/share/php/vn/tpv/soap-method.php
index 7193554c..967cac8f 100644
--- a/package/usr/share/php/vn/tpv/soap-method.php
+++ b/package/usr/share/php/vn/tpv/soap-method.php
@@ -39,7 +39,7 @@ function procesaNotificacionSIS ($XML)
// Confirms the transaction
Tpv::$conn->query (
- 'CALL transaction_confirm_new (#, #, #, #, #)',
+ 'CALL transaction_confirm (#, #, #, #, #)',
[
$request['Ds_Amount']
,$request['Ds_Order']