Compare commits

..

2 Commits

Author SHA1 Message Date
Clemens Schwaighofer
729541f280 Add missing correct smarty settings in edit order 2019-05-17 16:41:14 +09:00
Clemens Schwaighofer
d47f525480 Javascript updates, bug fix in Form class
- Update JS files and remove some not needed code
- Bug fix in Form where the sub element list was not correctly processed
because the DB insert vars got reset on each loop run
- Add return success/failure variable to the ln10 reload
2019-05-17 15:31:59 +09:00
7 changed files with 27 additions and 31 deletions

View File

View File

@@ -193,6 +193,12 @@ $CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);
foreach ($CONTENT_DATA as $key => $value) {
$smarty->assign($key, $value);
}
if (is_dir(BASE.TEMPLATES_C)) {
$smarty->setCompileDir(BASE.TEMPLATES_C);
}
if (is_dir(BASE.CACHE)) {
$smarty->setCacheDir(BASE.CACHE);
}
$smarty->display('edit_order.tpl');
echo $login->printErrorMsg();

View File

@@ -10,7 +10,7 @@
//------------------------------ variable init start
// for dev test we set full error reporting; writes everything, except E_ERROR into logs/php_error-<day>.log
if ($DEBUG_ALL && $ENABLE_ERROR_HANDLING) {
include(BASE.LIBS."Error.Handling.inc");
include BASE.LIBS."Error.Handling.inc";
}
// predefine vars
$lang = '';

View File

@@ -1,30 +1,15 @@
/*
code is taken and adapted from dokuwiki
*/
/* general edit javascript */
/* jshint esversion: 6 */
/**
* Some browser detection
*/
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var is_gecko = ((clientPC.indexOf('gecko') != -1) && (clientPC.indexOf('spoofer') == -1) &&
(clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0') == -1));
var is_safari = ((clientPC.indexOf('AppleWebKit') != -1) && (clientPC.indexOf('spoofer') == -1));
var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ));
if (clientPC.indexOf('opera') != -1) {
var is_opera = true;
var is_opera_preseven = (window.opera && !document.childNodes);
var is_opera_seven = (window.opera && document.childNodes);
}
// debug set
var FRONTEND_DEBUG = false;
/*var FRONTEND_DEBUG = false;
var DEBUG = true;
if (!DEBUG) {
$($H(window.console)).each(function(w) {
window.console[w.key] = function() {};
});
}
}*/
// METHOD: pop
// PARAMS: url, window name, features

View File

@@ -3,14 +3,14 @@
* firebug 1.2+ and the webkit console */
var ConsoleSetup = function() {
if (!window.console)
window.console = {};
if (!window.console)
window.console = {};
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
for (var i = 0; i < names.length; ++i) {
if (!window.console[names[i]]) {
window.console[names[i]] = function() {};
}
}
for (var i = 0; i < names.length; ++i) {
if (!window.console[names[i]]) {
window.console[names[i]] = function() {};
}
}
}();

View File

@@ -63,6 +63,7 @@ class L10n extends \CoreLibs\Basic
// reloads the mofile, if the location of the lang file changes
public function l10nReloadMOfile($lang, $path = DEFAULT_TEMPLATE)
{
$success = false;
$old_mofile = $this->mofile;
$old_lang = $this->lang;
@@ -80,11 +81,14 @@ class L10n extends \CoreLibs\Basic
if (is_readable($this->mofile)) {
$this->input = new FileReader($this->mofile);
$this->l10n = new GetTextReader($this->input);
// we successfully loaded
$success = true;
} else {
// else fall back to the old ones
$this->mofile = $old_mofile;
$this->lang = $old_lang;
}
return $success;
}
public function __($text)

View File

@@ -1294,6 +1294,10 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
reset($this->element_list);
foreach ($this->element_list as $table_name => $reference_array) {
// init arrays
$q_names = array ();
$q_data = array ();
$q_values = array ();
// get the number of keys from the elements array
$keys = array_keys($reference_array["elements"]);
// element prefix name
@@ -1314,9 +1318,6 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// go through all submitted data
// for ($i = 0; $i < count($_POST[$el_name]); $i ++)
for ($i = 0; $i < $max; $i ++) {
$q_data[$i] = '';
$q_names[$i] = '';
$q_values[$i] = '';
// if we have enable name & delete set, then only insert/update those which are flagged as active
// check if mandatory field is set, if not set "do not write flag"
if ($data_array["mandatory"] && !$_POST[$prfx.$el_name][$i]) {
@@ -1355,7 +1356,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$q_data[$i] .= ", ";
}
// insert name part list
if ($q_names[$i]) {
if (strlen($q_names[$i])) {
$q_names[$i] .= ", ";
}
// insert value part list