Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb5276ee44 | ||
|
|
9c242ed1b9 | ||
|
|
0fcbe91ea2 | ||
|
|
ee4417fc52 | ||
|
|
ee1dafd8d8 | ||
|
|
96104095d0 | ||
|
|
a311552c56 | ||
|
|
f694539a0b | ||
|
|
2f1388494f | ||
|
|
06fe9657e2 | ||
|
|
d4e5f92277 | ||
|
|
b2c0a57924 | ||
|
|
5522348c8a | ||
|
|
ed01d248ec | ||
|
|
899ddc011c | ||
|
|
a86eaf0f02 |
@@ -109,8 +109,9 @@ return [
|
|||||||
// ignore the old qq tests
|
// ignore the old qq tests
|
||||||
'www/admin/qq_file_upload_front.php',
|
'www/admin/qq_file_upload_front.php',
|
||||||
'www/admin/qq_file_upload_ajax.php',
|
'www/admin/qq_file_upload_ajax.php',
|
||||||
// symlink files for msarty
|
// symlink ignore
|
||||||
'www/lib/smarty-3.1.30/SmartyBC.class.php',
|
'www/lib/smarty-3.1.30/SmartyBC.class.php',
|
||||||
|
'www/lib/htmlMimeMail-2.5.1/HtmlMimeMailCreate.php',
|
||||||
],
|
],
|
||||||
|
|
||||||
// what not to show as problem
|
// what not to show as problem
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ function/set_generic.sql
|
|||||||
function/random_string.sql
|
function/random_string.sql
|
||||||
function/set_edit_generic.sql
|
function/set_edit_generic.sql
|
||||||
function/edit_set_access_uid.sql
|
function/edit_set_access_uid.sql
|
||||||
function/edit_log_partition_trigger.sql
|
function/edit_log_partition_insert.sql
|
||||||
# generic tables
|
# generic tables
|
||||||
table/edit_temp_files.sql
|
table/edit_temp_files.sql
|
||||||
table/edit_generic.sql
|
table/edit_generic.sql
|
||||||
@@ -30,7 +30,6 @@ trigger/trg_edit_access_right.sql
|
|||||||
trigger/trg_edit_access.sql
|
trigger/trg_edit_access.sql
|
||||||
trigger/trg_edit_access_data.sql
|
trigger/trg_edit_access_data.sql
|
||||||
trigger/trg_edit_access_user.sql
|
trigger/trg_edit_access_user.sql
|
||||||
trigger/trg_edit_generic.sql
|
|
||||||
trigger/trg_edit_group.sql
|
trigger/trg_edit_group.sql
|
||||||
trigger/trg_edit_language.sql
|
trigger/trg_edit_language.sql
|
||||||
trigger/trg_edit_log.sql
|
trigger/trg_edit_log.sql
|
||||||
|
|||||||
@@ -15,22 +15,20 @@ function_name="set_generic";
|
|||||||
#sql_path_prep=`echo $sql_path | sed -e "s/\///g"`;
|
#sql_path_prep=`echo $sql_path | sed -e "s/\///g"`;
|
||||||
|
|
||||||
# goes for each file and strips headers and endings, and creates trigger name
|
# goes for each file and strips headers and endings, and creates trigger name
|
||||||
for name in $sql_path*;
|
for name in $sql_path*; do
|
||||||
do
|
|
||||||
echo "Wokring on $name";
|
echo "Wokring on $name";
|
||||||
# strip ending
|
# strip ending
|
||||||
# t_name=`echo $name | sed -e 's/.sql$//g' | sed -e "s/^$sql_path_prep//g" | sed -e 's/\///g'`;
|
# t_name=`echo $name | sed -e 's/.sql$//g' | sed -e "s/^$sql_path_prep//g" | sed -e 's/\///g'`;
|
||||||
t_name=`echo $name | sed -e 's/^.*\///g' | sed -e 's/.sql$//g'`;
|
t_name=`echo $name | sed -e 's/^.*\///g' | sed -e 's/.sql$//g'`;
|
||||||
# clean all beginnings
|
# clean all beginnings
|
||||||
for prefix in $file_prefix;
|
for prefix in $file_prefix; do
|
||||||
do
|
|
||||||
prefix=$prefix"_";
|
prefix=$prefix"_";
|
||||||
t_name=`echo $t_name | sed -e "s/\$prefix//g"`;
|
t_name=`echo $t_name | sed -e "s/\$prefix//g"`;
|
||||||
done;
|
done;
|
||||||
|
|
||||||
# those tables don't need a trigger
|
# those tables don't need a trigger
|
||||||
# edit_generic
|
# edit_generic
|
||||||
# generic
|
# generic
|
||||||
|
|
||||||
# copy the trigger template to the target
|
# copy the trigger template to the target
|
||||||
trg_filename=$trigger_path$trigger_prefix"_"$t_name".sql";
|
trg_filename=$trigger_path$trigger_prefix"_"$t_name".sql";
|
||||||
|
|||||||
@@ -14,17 +14,14 @@ file_prefix="trg";
|
|||||||
trigger_prefix="trg";
|
trigger_prefix="trg";
|
||||||
index_prefix="idx";
|
index_prefix="idx";
|
||||||
|
|
||||||
for file in `cat ORDER`;
|
for file in `cat ORDER`; do
|
||||||
do
|
if [ -f $file ]; then
|
||||||
if [ -f $file ];
|
|
||||||
then
|
|
||||||
# write them into a var, so we can re order them in the other way
|
# write them into a var, so we can re order them in the other way
|
||||||
new_order=$file" "$new_order;
|
new_order=$file" "$new_order;
|
||||||
fi;
|
fi;
|
||||||
done;
|
done;
|
||||||
|
|
||||||
for file in $new_order;
|
for file in $new_order; do
|
||||||
do
|
|
||||||
sqltype=`echo $file | egrep "table/"`;
|
sqltype=`echo $file | egrep "table/"`;
|
||||||
trgtype=`echo $file | egrep "trigger/"`;
|
trgtype=`echo $file | egrep "trigger/"`;
|
||||||
idxtype=`echo $file | egrep "index/"`;
|
idxtype=`echo $file | egrep "index/"`;
|
||||||
@@ -32,43 +29,34 @@ do
|
|||||||
datatype=`echo $file | egrep "data/"`;
|
datatype=`echo $file | egrep "data/"`;
|
||||||
# remove all around to get table name
|
# remove all around to get table name
|
||||||
t_file=`echo $file | sed -e 's/^.*\///g' | sed -e 's/.sql$//g'`;
|
t_file=`echo $file | sed -e 's/^.*\///g' | sed -e 's/.sql$//g'`;
|
||||||
for prefix in $file_prefix;
|
for prefix in $file_prefix; do
|
||||||
do
|
|
||||||
prefix=$prefix"_";
|
prefix=$prefix"_";
|
||||||
t_file=`echo $t_file | sed -e "s/\$prefix//g"`;
|
t_file=`echo $t_file | sed -e "s/\$prefix//g"`;
|
||||||
done;
|
done;
|
||||||
# copy the trigger template to the target
|
# copy the trigger template to the target
|
||||||
|
|
||||||
for path in $schemas;
|
for path in $schemas; do
|
||||||
do
|
if [ $sqltype ]; then
|
||||||
if [ $sqltype ];
|
|
||||||
then
|
|
||||||
echo "SQL "$path"."$t_file;
|
echo "SQL "$path"."$t_file;
|
||||||
echo "DROP TABLE "$path"."$t_file" CASCADE;" | psql -U $user -h $host $db
|
echo "DROP TABLE "$path"."$t_file" CASCADE;" | psql -U $user -h $host $db
|
||||||
fi;
|
fi;
|
||||||
if [ $trgtype ];
|
if [ $trgtype ]; then
|
||||||
then
|
|
||||||
trigger=$trigger_prefix"_"$t_file;
|
trigger=$trigger_prefix"_"$t_file;
|
||||||
echo "TRG $trigger TBL "$path".$t_file";
|
echo "TRG $trigger TBL "$path".$t_file";
|
||||||
echo "DROP TRIGGER "$path".$trigger ON "$t_file" CASCADE;" | psql -U $user -h $host $db
|
echo "DROP TRIGGER "$path".$trigger ON "$t_file" CASCADE;" | psql -U $user -h $host $db
|
||||||
fi;
|
fi;
|
||||||
if [ $fcttype ];
|
if [ $fcttype ]; then
|
||||||
then
|
|
||||||
echo "FCT "$path"."$t_file;
|
echo "FCT "$path"."$t_file;
|
||||||
echo "DROP FUNCTION "$path"."$t_file"();" | psql -U $user -h $host $db
|
echo "DROP FUNCTION "$path"."$t_file"();" | psql -U $user -h $host $db
|
||||||
fi;
|
fi;
|
||||||
if [ $idxtype ];
|
if [ $idxtype ]; then
|
||||||
then
|
|
||||||
index=$index_prefix"_"$t_file;
|
index=$index_prefix"_"$t_file;
|
||||||
# echo "IDX "$t_file;
|
# echo "IDX "$t_file;
|
||||||
# echo "DROP INDEX $index ON $t_file;" | psql -U $user -h $host $db
|
# echo "DROP INDEX $index ON $t_file;" | psql -U $user -h $host $db
|
||||||
fi;
|
fi;
|
||||||
if [ $datatype ];
|
if [ $datatype ]; then
|
||||||
then
|
|
||||||
echo "DATA "$t_file;
|
echo "DATA "$t_file;
|
||||||
# echo "DROP FUNCTION "$t_file"();" | psql -U $user -h $host $db
|
# echo "DROP FUNCTION "$t_file"();" | psql -U $user -h $host $db
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# psql -U cms_user -h 192.168.12.14 -f $file CMSv2
|
|
||||||
done;
|
done;
|
||||||
done;
|
done;
|
||||||
|
|||||||
2
4dev/database/log/.gitignore
vendored
Normal file
2
4dev/database/log/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
4
4dev/database/trigger/trg_set_edit_access_uid.sql
Normal file
4
4dev/database/trigger/trg_set_edit_access_uid.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-- DROP TRIGGER trg_set_edit_access_uid ON edit_access;
|
||||||
|
CREATE TRIGGER trg_set_edit_access_uid
|
||||||
|
BEFORE INSERT OR UPDATE ON edit_access
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE set_edit_access_uid();
|
||||||
17
phpstan.neon
17
phpstan.neon
@@ -5,14 +5,17 @@ parameters:
|
|||||||
level: 1
|
level: 1
|
||||||
paths:
|
paths:
|
||||||
- %currentWorkingDirectory%/www
|
- %currentWorkingDirectory%/www
|
||||||
#bootstrap: %currentWorkingDirectory%/phpstan-bootstrap.php
|
bootstrapFiles:
|
||||||
#bootstrap: phpstan-bootstrap.php
|
|
||||||
autoload_directories:
|
|
||||||
autoload_files:
|
|
||||||
- %currentWorkingDirectory%/phpstan-bootstrap.php
|
- %currentWorkingDirectory%/phpstan-bootstrap.php
|
||||||
|
scanDirectories:
|
||||||
|
- www/lib/Smarty
|
||||||
|
scanFiles:
|
||||||
|
- www/configs/config.php
|
||||||
- www/configs/config.master.php
|
- www/configs/config.master.php
|
||||||
- www/lib/autoloader.php
|
- www/lib/autoloader.php
|
||||||
- www/vendor/autoload.php
|
- www/vendor/autoload.php
|
||||||
|
- www/lib/Smarty/Autoloader.php
|
||||||
|
- www/lib/CoreLibs/Template/SmartyExtend.php
|
||||||
excludes_analyse:
|
excludes_analyse:
|
||||||
# no check admin
|
# no check admin
|
||||||
- www/admin/qq_file_upload_front.php
|
- www/admin/qq_file_upload_front.php
|
||||||
@@ -40,10 +43,12 @@ parameters:
|
|||||||
- www/tmp
|
- www/tmp
|
||||||
- www/lib/pChart
|
- www/lib/pChart
|
||||||
- www/lib/pChart2.1.4
|
- www/lib/pChart2.1.4
|
||||||
- www/lib/Smarty/
|
- www/lib/Smarty
|
||||||
- www/lib/smarty-3.1.30/
|
- www/lib/smarty-3.1.30
|
||||||
# ignore composer
|
# ignore composer
|
||||||
- www/vendor
|
- www/vendor
|
||||||
|
# ignore the smartyextend
|
||||||
|
- www/lib/CoreLibs/Template/SmartyExtend.php
|
||||||
# ignore errores with
|
# ignore errores with
|
||||||
# ignoreErrors:
|
# ignoreErrors:
|
||||||
#- 'error regex'
|
#- 'error regex'
|
||||||
|
|||||||
@@ -213,6 +213,16 @@ print "RETURN DATA FOR search_path: ".$data."<br>";
|
|||||||
$status = $basic->dbExec("INSERT INTO test.schema_test (contents, id) VALUES ('TIME: ".time()."', ".rand(1, 10).")");
|
$status = $basic->dbExec("INSERT INTO test.schema_test (contents, id) VALUES ('TIME: ".time()."', ".rand(1, 10).")");
|
||||||
print "OTHER SCHEMA INSERT STATUS: ".$status." | PK NAME: ".$basic->pk_name.", PRIMARY KEY: ".$basic->insert_id."<br>";
|
print "OTHER SCHEMA INSERT STATUS: ".$status." | PK NAME: ".$basic->pk_name.", PRIMARY KEY: ".$basic->insert_id."<br>";
|
||||||
|
|
||||||
|
print "<b>NULL TEST DB READ</b><br>";
|
||||||
|
$q = "SELECT uid, null_varchar, null_int FROM test_null_data WHERE uid = 'A'";
|
||||||
|
$res = $basic->dbReturnRow($q);
|
||||||
|
var_dump($res);
|
||||||
|
print "RES: ".$basic->printAr($res)."<br>";
|
||||||
|
print "ISSET: ".isset($res['null_varchar'])."<br>";
|
||||||
|
print "EMPTY: ".empty($res['null_varchar'])."<br>";
|
||||||
|
|
||||||
|
// data read test
|
||||||
|
|
||||||
// time string thest
|
// time string thest
|
||||||
$timestamp = 5887998.33445;
|
$timestamp = 5887998.33445;
|
||||||
$time_string = $basic->timeStringFormat($timestamp);
|
$time_string = $basic->timeStringFormat($timestamp);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ $options = array (
|
|||||||
|
|
||||||
if (is_object($smarty)) {
|
if (is_object($smarty)) {
|
||||||
$smarty->DATA['drop_down_test'] = $options;
|
$smarty->DATA['drop_down_test'] = $options;
|
||||||
|
$smarty->DATA['loop_start'] = 2;
|
||||||
// require BASE.INCLUDES.'admin_smarty.php';
|
// require BASE.INCLUDES.'admin_smarty.php';
|
||||||
$smarty->setSmartyVarsAdmin();
|
$smarty->setSmartyVarsAdmin();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ define('PUBLIC_SCHEMA', 'public');
|
|||||||
define('DEV_SCHEMA', 'public');
|
define('DEV_SCHEMA', 'public');
|
||||||
define('TEST_SCHEMA', 'public');
|
define('TEST_SCHEMA', 'public');
|
||||||
define('LIVE_SCHEMA', 'public');
|
define('LIVE_SCHEMA', 'public');
|
||||||
|
define('GLOBAL_DB_SCHEMA', '');
|
||||||
|
define('LOGIN_DB_SCHEMA', '');
|
||||||
|
|
||||||
/************* CORE HOST SETTINGS *****************/
|
/************* CORE HOST SETTINGS *****************/
|
||||||
if (file_exists(BASE.CONFIGS.'config.host.php')) {
|
if (file_exists(BASE.CONFIGS.'config.host.php')) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
if (!isset($position)) {
|
if (!isset($position)) {
|
||||||
$position = array();
|
$position = array();
|
||||||
}
|
}
|
||||||
$row_data_id = $_POST['row_data_id'];
|
$row_data_id = $_POST['row_data_id'] ?? [];
|
||||||
$original_id = $row_data_id;
|
$original_id = $row_data_id;
|
||||||
if (count($position)) {
|
if (count($position)) {
|
||||||
$row_data_order = $_POST['row_data_order'];
|
$row_data_order = $_POST['row_data_order'];
|
||||||
@@ -116,8 +116,8 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
// this gets the old before (moves one "up")
|
// this gets the old before (moves one "up")
|
||||||
// is done for every element in row
|
// is done for every element in row
|
||||||
// echo "A: ".$row_data_id[$position[$i]]." (".$row_data_order[$position[$i]].") -- ".$row_data_id[$position[$i]-1]." (".$row_data_order[$position[$i]-1].")<br>";
|
// echo "A: ".$row_data_id[$position[$i]]." (".$row_data_order[$position[$i]].") -- ".$row_data_id[$position[$i]-1]." (".$row_data_order[$position[$i]-1].")<br>";
|
||||||
$temp_id = $row_data_id[$position[$i]];
|
$temp_id = $row_data_id[$position[$i]] ?? null;
|
||||||
$row_data_id[$position[$i]] = $row_data_id[$position[$i] - 1];
|
$row_data_id[$position[$i]] = $row_data_id[$position[$i] - 1] ?? null;
|
||||||
$row_data_id[$position[$i] - 1] = $temp_id;
|
$row_data_id[$position[$i] - 1] = $temp_id;
|
||||||
// echo "A: ".$row_data_id[$position[$i]]." (".$row_data_order[$position[$i]].") -- ".$row_data_id[$position[$i]-1]." (".$row_data_order[$position[$i]-1].")<br>";
|
// echo "A: ".$row_data_id[$position[$i]]." (".$row_data_order[$position[$i]].") -- ".$row_data_id[$position[$i]-1]." (".$row_data_order[$position[$i]-1].")<br>";
|
||||||
} // for
|
} // for
|
||||||
@@ -129,8 +129,8 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
// same as up, just up in other way, starts from bottom (last element) and moves "up"
|
// same as up, just up in other way, starts from bottom (last element) and moves "up"
|
||||||
// element before actuel gets temp, this element, becomes element after this,
|
// element before actuel gets temp, this element, becomes element after this,
|
||||||
// element after this, gets this
|
// element after this, gets this
|
||||||
$temp_id = $row_data_id[$position[$i] + 1];
|
$temp_id = $row_data_id[$position[$i] + 1] ?? null;
|
||||||
$row_data_id[$position[$i] + 1] = $row_data_id[$position[$i]];
|
$row_data_id[$position[$i] + 1] = $row_data_id[$position[$i]] ?? null;
|
||||||
$row_data_id[$position[$i]] = $temp_id;
|
$row_data_id[$position[$i]] = $temp_id;
|
||||||
} // for
|
} // for
|
||||||
} // if down
|
} // if down
|
||||||
@@ -140,8 +140,10 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
(isset($down) && ($position[count($position) - 1] != (count($row_data_id) - 1)))
|
(isset($down) && ($position[count($position) - 1] != (count($row_data_id) - 1)))
|
||||||
) {
|
) {
|
||||||
for ($i = 0; $i < count($row_data_id); $i ++) {
|
for ($i = 0; $i < count($row_data_id); $i ++) {
|
||||||
$q = "UPDATE ".$table_name." SET order_number = ".$row_data_order[$i]." WHERE ".$table_name."_id = ".$row_data_id[$i];
|
if (isset($row_data_order[$i]) && isset($row_data_id[$i])) {
|
||||||
$q = $form->dbExec($q);
|
$q = "UPDATE ".$table_name." SET order_number = ".$row_data_order[$i]." WHERE ".$table_name."_id = ".$row_data_id[$i];
|
||||||
|
$q = $form->dbExec($q);
|
||||||
|
}
|
||||||
} // for all article ids ...
|
} // for all article ids ...
|
||||||
} // if write
|
} // if write
|
||||||
} // if there is something to move
|
} // if there is something to move
|
||||||
@@ -187,7 +189,9 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
// list of points to order
|
// list of points to order
|
||||||
for ($j = 0; $j < count($position); $j++) {
|
for ($j = 0; $j < count($position); $j++) {
|
||||||
// if matches, put into select array
|
// if matches, put into select array
|
||||||
if ($original_id[$position[$j]] == $row_data[$i]['id']) {
|
if (isset($original_id[$position[$j]]) && isset($row_data[$i]['id']) &&
|
||||||
|
$original_id[$position[$j]] == $row_data[$i]['id']
|
||||||
|
) {
|
||||||
$options_selected[] = $i;
|
$options_selected[] = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +305,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
(!$data['hostname'] || strstr($data['hostname'], CONTENT_PATH) !== false)
|
(!$data['hostname'] || strstr($data['hostname'], CONTENT_PATH) !== false)
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
$position = $j;
|
$position = $i;
|
||||||
$menu_data[$i]['position'] = 1;
|
$menu_data[$i]['position'] = 1;
|
||||||
$menu_data[$i]['popup'] = 0;
|
$menu_data[$i]['popup'] = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -326,7 +330,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
} // for
|
} // for
|
||||||
// $form->debug('MENU ARRAY', $form->printAr($menu_data));
|
// $form->debug('MENU ARRAY', $form->printAr($menu_data));
|
||||||
$DATA['menu_data'] = $menu_data;
|
$DATA['menu_data'] = $menu_data;
|
||||||
$DATA['page_name'] = $menuarray[$position]['page_name'];
|
$DATA['page_name'] = $menuarray[$position]['page_name'] ?? '-Undefined ['.$position.'] -';
|
||||||
$L_TITLE = $DATA['page_name'];
|
$L_TITLE = $DATA['page_name'];
|
||||||
// html title
|
// html title
|
||||||
$HEADER['HTML_TITLE'] = $form->l->__($L_TITLE);
|
$HEADER['HTML_TITLE'] = $form->l->__($L_TITLE);
|
||||||
|
|||||||
@@ -12,13 +12,19 @@
|
|||||||
<div class="jq-container">
|
<div class="jq-container">
|
||||||
<div id="jq-test" class="jp-test">
|
<div id="jq-test" class="jp-test">
|
||||||
<div id="test-div" class="test-div">
|
<div id="test-div" class="test-div">
|
||||||
Some content ehre or asdfasdfasf
|
Some content here or asdfasdfasf
|
||||||
</div>
|
</div>
|
||||||
<div id="translate-div">
|
<div id="translate-div">
|
||||||
TRANSLATION SMARTY: {t}I should be translated{/t}
|
TRANSLATION SMARTY: {t}I should be translated{/t}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="loop-test">
|
||||||
|
<div>LOOP TEST</div>
|
||||||
|
{section name=page_list start=1 loop=$loop_start+1}
|
||||||
|
<div>LOOP OUTPUT: {$smarty.section.page_list.index}</div>
|
||||||
|
{/section}
|
||||||
|
</div>
|
||||||
{* progresss indicator *}
|
{* progresss indicator *}
|
||||||
<div id="indicator"></div>
|
<div id="indicator"></div>
|
||||||
{* the action confirm box *}
|
{* the action confirm box *}
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ input[type="text"]:focus, textarea:focus, select:focus {
|
|||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 100;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
/* Animation for above progress */
|
/* Animation for above progress */
|
||||||
@keyframes rotate {
|
@keyframes rotate {
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ if (!DEBUG) {
|
|||||||
});
|
});
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
// open overlay boxes counter
|
||||||
|
var GL_OB_S = 10;
|
||||||
|
var GL_OB_BASE = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* opens a popup window with winName and given features (string)
|
* opens a popup window with winName and given features (string)
|
||||||
* @param {String} theURL the url
|
* @param {String} theURL the url
|
||||||
@@ -121,8 +125,7 @@ function setCenter(id, left, top)
|
|||||||
function goToPos(element, offset = 0)
|
function goToPos(element, offset = 0)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if ($('#' + element).length)
|
if ($('#' + element).length) {
|
||||||
{
|
|
||||||
$('body,html').animate({
|
$('body,html').animate({
|
||||||
scrollTop: $('#' + element).offset().top - offset
|
scrollTop: $('#' + element).offset().top - offset
|
||||||
}, 500);
|
}, 500);
|
||||||
@@ -339,6 +342,31 @@ function valueInObject(object, value)
|
|||||||
// }) ? true : false;
|
// }) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* true deep copy for Javascript objects
|
||||||
|
* if Object.assign({}, obj) is not working (shallow)
|
||||||
|
* or if JSON.parse(JSON.stringify(obj)) is failing
|
||||||
|
* @param {Object} inObject Object to copy
|
||||||
|
* @return {Object} Copied Object
|
||||||
|
*/
|
||||||
|
function deepCopyFunction(inObject)
|
||||||
|
{
|
||||||
|
var outObject, value, key;
|
||||||
|
if (typeof inObject !== "object" || inObject === null) {
|
||||||
|
return inObject; // Return the value if inObject is not an object
|
||||||
|
}
|
||||||
|
// Create an array or object to hold the values
|
||||||
|
outObject = Array.isArray(inObject) ? [] : {};
|
||||||
|
// loop over ech entry in object
|
||||||
|
for (key in inObject) {
|
||||||
|
value = inObject[key];
|
||||||
|
// Recursively (deep) copy for nested objects, including arrays
|
||||||
|
outObject[key] = deepCopyFunction(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return outObject;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks if a DOM element actually exists
|
* checks if a DOM element actually exists
|
||||||
* @param {String} id Element id to check for
|
* @param {String} id Element id to check for
|
||||||
@@ -394,6 +422,20 @@ function errorCatch(err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************
|
||||||
|
* OLD action indicator and overlay boxes calls
|
||||||
|
* DO NOT USE
|
||||||
|
* actionIndicator -> showActionIndicator
|
||||||
|
* actionIndicator -> hideActionIndicator
|
||||||
|
* actionIndicatorShow -> showActionIndicator
|
||||||
|
* actionIndicatorHide -> hideActionIndicator
|
||||||
|
* overlayBoxShow -> showOverlayBoxLayers
|
||||||
|
* overlayBoxHide -> hideOverlayBoxLayers
|
||||||
|
* setOverlayBox -> showOverlayBoxLayers
|
||||||
|
* hideOverlayBox -> hideOverlayBoxLayers
|
||||||
|
* ClearCall -> ClearCallActionBox
|
||||||
|
* ***********************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* show or hide the "do" overlay
|
* show or hide the "do" overlay
|
||||||
* @param {String} loc location name for action indicator
|
* @param {String} loc location name for action indicator
|
||||||
@@ -402,10 +444,10 @@ function errorCatch(err)
|
|||||||
*/
|
*/
|
||||||
function actionIndicator(loc, overlay = true)
|
function actionIndicator(loc, overlay = true)
|
||||||
{
|
{
|
||||||
if ($('#overlayBox').is(':visible')) {
|
if ($('#indicator').is(':visible')) {
|
||||||
actionIndicatorHide(loc, overlay);
|
actionIndicatorHide(loc, overlay);
|
||||||
} else {
|
} else {
|
||||||
actionIndicatorShow(loc, overlay);
|
actionIndicatorShow(loc, overlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,9 +460,11 @@ function actionIndicator(loc, overlay = true)
|
|||||||
*/
|
*/
|
||||||
function actionIndicatorShow(loc, overlay = true)
|
function actionIndicatorShow(loc, overlay = true)
|
||||||
{
|
{
|
||||||
console.log('Indicator: SHOW [%s]', loc);
|
// console.log('Indicator: SHOW [%s]', loc);
|
||||||
if (!$('#indicator').is(':visible')) {
|
if (!$('#indicator').is(':visible')) {
|
||||||
$('#indicator').addClass('progress');
|
if (!$('#indicator').hasClass('progress')) {
|
||||||
|
$('#indicator').addClass('progress');
|
||||||
|
}
|
||||||
setCenter('indicator', true, true);
|
setCenter('indicator', true, true);
|
||||||
$('#indicator').show();
|
$('#indicator').show();
|
||||||
}
|
}
|
||||||
@@ -438,16 +482,15 @@ function actionIndicatorShow(loc, overlay = true)
|
|||||||
*/
|
*/
|
||||||
function actionIndicatorHide(loc, overlay = true)
|
function actionIndicatorHide(loc, overlay = true)
|
||||||
{
|
{
|
||||||
console.log('Indicator: HIDE [%s]', loc);
|
// console.log('Indicator: HIDE [%s]', loc);
|
||||||
$('#indicator').hide();
|
$('#indicator').hide();
|
||||||
$('#indicator').removeClass('progress');
|
|
||||||
if (overlay === true) {
|
if (overlay === true) {
|
||||||
overlayBoxHide();
|
overlayBoxHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* shows the overlay box
|
* shows the overlay box or if already visible, bumps the zIndex to 100
|
||||||
*/
|
*/
|
||||||
function overlayBoxShow()
|
function overlayBoxShow()
|
||||||
{
|
{
|
||||||
@@ -456,16 +499,17 @@ function overlayBoxShow()
|
|||||||
$('#overlayBox').css('zIndex', '100');
|
$('#overlayBox').css('zIndex', '100');
|
||||||
} else {
|
} else {
|
||||||
$('#overlayBox').show();
|
$('#overlayBox').show();
|
||||||
|
$('#overlayBox').css('zIndex', '98');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hides the overlay box
|
* hides the overlay box or if zIndex is 100 bumps it down to previous level
|
||||||
*/
|
*/
|
||||||
function overlayBoxHide()
|
function overlayBoxHide()
|
||||||
{
|
{
|
||||||
// if the overlay box z-index is 100, do no hide, but set to 98
|
// if the overlay box z-index is 100, do no hide, but set to 98
|
||||||
if ($('#overlayBox').css('zIndex') == 100) {
|
if ($('#overlayBox').css('zIndex') >= 100) {
|
||||||
$('#overlayBox').css('zIndex', '98');
|
$('#overlayBox').css('zIndex', '98');
|
||||||
} else {
|
} else {
|
||||||
$('#overlayBox').hide();
|
$('#overlayBox').hide();
|
||||||
@@ -482,16 +526,180 @@ function setOverlayBox()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* opposite of set, always hides overlay box
|
||||||
|
*/
|
||||||
|
function hideOverlayBox()
|
||||||
|
{
|
||||||
|
if ($('#overlayBox').is(':visible')) {
|
||||||
|
$('#overlayBox').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the abort call, clears the action box and hides it and the overlay box
|
* the abort call, clears the action box and hides it and the overlay box
|
||||||
*/
|
*/
|
||||||
function ClearCall()
|
function ClearCall()
|
||||||
{
|
{
|
||||||
$('#actionBox').innerHTML = '';
|
$('#actionBox').html('');
|
||||||
$('#actionBox').hide();
|
$('#actionBox').hide();
|
||||||
$('#overlayBox').hide();
|
$('#overlayBox').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************
|
||||||
|
* NEW action indicator and overlay box calls
|
||||||
|
* USE THIS
|
||||||
|
* ***********************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show action indicator
|
||||||
|
* - checks if not existing and add
|
||||||
|
* - only shows if not visible (else ignore)
|
||||||
|
* - overlaybox check is called and shown on a fixzed
|
||||||
|
* zIndex of 1000
|
||||||
|
* - indicator is page centered
|
||||||
|
* @param {String} loc ID string, only used for console log
|
||||||
|
*/
|
||||||
|
function showActionIndicator(loc)
|
||||||
|
{
|
||||||
|
// console.log('Indicator: SHOW [%s]', loc);
|
||||||
|
// check if indicator element exists
|
||||||
|
if ($('#indicator').length == 0) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'progress hide';
|
||||||
|
el.id = 'indicator';
|
||||||
|
$('body').append(el);
|
||||||
|
} else if (!$('#indicator').hasClass('progress')) {
|
||||||
|
$('#indicator').addClass('progress');
|
||||||
|
}
|
||||||
|
// indicator not visible
|
||||||
|
if (!$('#indicator').is(':visible')) {
|
||||||
|
// check if overlay box element exits
|
||||||
|
checkOverlayExists();
|
||||||
|
// if not visible show
|
||||||
|
if (!$('#overlayBox').is(':visible')) {
|
||||||
|
$('#overlayBox').show();
|
||||||
|
}
|
||||||
|
// always set to 1000 zIndex to be top
|
||||||
|
$('#overlayBox').css('zIndex', 1000);
|
||||||
|
// show indicator
|
||||||
|
$('#indicator').show();
|
||||||
|
// center it
|
||||||
|
setCenter('indicator', true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hide action indicator, if it is visiable
|
||||||
|
* If the global variable GL_OB_S is > 10 then
|
||||||
|
* the overlayBox is not hidden but the zIndex
|
||||||
|
* is set to this value
|
||||||
|
* @param {String} loc ID string, only used for console log
|
||||||
|
*/
|
||||||
|
function hideActionIndicator(loc)
|
||||||
|
{
|
||||||
|
// console.log('Indicator: HIDE [%s]', loc);
|
||||||
|
// check if indicator is visible
|
||||||
|
if ($('#indicator').is(':visible')) {
|
||||||
|
// hide indicator
|
||||||
|
$('#indicator').hide();
|
||||||
|
// if global overlay box count is > 0
|
||||||
|
// then set it to this level and keep
|
||||||
|
if (GL_OB_S > GL_OB_BASE) {
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_S);
|
||||||
|
} else {
|
||||||
|
// else hide overlay box and set zIndex to 0
|
||||||
|
$('#overlayBox').hide();
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_BASE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if overlayBox exists, if not it is
|
||||||
|
* added as hidden item at the body end
|
||||||
|
*/
|
||||||
|
function checkOverlayExists()
|
||||||
|
{
|
||||||
|
// check if overlay box exists, if not create it
|
||||||
|
if ($('#overlayBox').length == 0) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'overlayBoxElement hide';
|
||||||
|
el.id = 'overlayBox';
|
||||||
|
$('body').append(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show overlay box
|
||||||
|
* if not visible show and set zIndex to 10 (GL_OB_BASE)
|
||||||
|
* if visible, add +1 to the GL_OB_S variable and
|
||||||
|
* up zIndex by this value
|
||||||
|
*/
|
||||||
|
function showOverlayBoxLayers(el_id)
|
||||||
|
{
|
||||||
|
// console.log('SHOW overlaybox: %s', GL_OB_S);
|
||||||
|
// if overlay box is not visible show and set zIndex to 0
|
||||||
|
if (!$('#overlayBox').is(':visible')) {
|
||||||
|
$('#overlayBox').show();
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_BASE);
|
||||||
|
// also set start variable to 0
|
||||||
|
GL_OB_S = GL_OB_BASE;
|
||||||
|
}
|
||||||
|
// up the overlay box counter by 1
|
||||||
|
GL_OB_S ++;
|
||||||
|
// set zIndex
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_S);
|
||||||
|
// if element given raise zIndex and show
|
||||||
|
if (el_id) {
|
||||||
|
if ($('#' + el_id).length > 0) {
|
||||||
|
$('#' + el_id).css('zIndex', GL_OB_S + 1);
|
||||||
|
$('#' + el_id).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log('SHOW overlaybox NEW zIndex: %s', $('#overlayBox').css('zIndex'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hide overlay box
|
||||||
|
* lower GL_OB_S value by -1
|
||||||
|
* if we are 10 (GL_OB_BASE) or below hide the overlayIndex
|
||||||
|
* and set zIndex and GL_OB_S to 0
|
||||||
|
* else just set zIndex to the new GL_OB_S value
|
||||||
|
* @param {String} el_id Target to hide layer
|
||||||
|
*/
|
||||||
|
function hideOverlayBoxLayers(el_id)
|
||||||
|
{
|
||||||
|
// console.log('HIDE overlaybox: %s', GL_OB_S);
|
||||||
|
// remove on layer
|
||||||
|
GL_OB_S --;
|
||||||
|
// if 0 or lower (overflow) hide it and
|
||||||
|
// set zIndex to 0
|
||||||
|
if (GL_OB_S <= GL_OB_BASE) {
|
||||||
|
GL_OB_S = GL_OB_BASE;
|
||||||
|
$('#overlayBox').hide();
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_BASE);
|
||||||
|
} else {
|
||||||
|
// if OB_S > 0 then set new zIndex
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_S);
|
||||||
|
}
|
||||||
|
if (el_id) {
|
||||||
|
$('#' + el_id).hide();
|
||||||
|
$('#' + el_id).css('zIndex', 0);
|
||||||
|
}
|
||||||
|
// console.log('HIDE overlaybox NEW zIndex: %s', $('#overlayBox').css('zIndex'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only for single action box
|
||||||
|
*/
|
||||||
|
function clearCallActionBox()
|
||||||
|
{
|
||||||
|
$('#actionBox').html('');
|
||||||
|
$('#actionBox').hide();
|
||||||
|
hideOverlayBoxLayers();
|
||||||
|
}
|
||||||
|
|
||||||
// *** DOM MANAGEMENT FUNCTIONS
|
// *** DOM MANAGEMENT FUNCTIONS
|
||||||
/**
|
/**
|
||||||
* reates object for DOM element creation flow
|
* reates object for DOM element creation flow
|
||||||
@@ -558,6 +766,21 @@ function aelx(base, ...attach)
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* same as aelx, but instead of using objects as parameters
|
||||||
|
* get an array of objects to attach
|
||||||
|
* @param {Object} base object to where we attach the elements
|
||||||
|
* @param {Array} attach array of objects to attach
|
||||||
|
* @return {Object} "none", technically there is no return needed, global attach
|
||||||
|
*/
|
||||||
|
function aelxar(base, attach)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < attach.length; i ++) {
|
||||||
|
base.sub.push(Object.assign({}, attach[i]));
|
||||||
|
}
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resets the sub elements of the base element given
|
* resets the sub elements of the base element given
|
||||||
* @param {Object} base cel created element
|
* @param {Object} base cel created element
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ function setCenter(id, left, top)
|
|||||||
var viewport = getWindowSize();
|
var viewport = getWindowSize();
|
||||||
var offset = getScrollOffset();
|
var offset = getScrollOffset();
|
||||||
|
|
||||||
console.log('Id %s, type: %s, dimensions %s x %s, viewport %s x %s', id, type, dimensions.width, dimensions.height, viewport.width, viewport.height);
|
// console.log('Id %s, type: %s, dimensions %s x %s, viewport %s x %s', id, type, dimensions.width, dimensions.height, viewport.width, viewport.height);
|
||||||
// console.log('Scrolloffset left: %s, top: %s', offset.left, offset.top);
|
// console.log('Scrolloffset left: %s, top: %s', offset.left, offset.top);
|
||||||
// console.log('Left: %s, Top: %s (%s)', parseInt((viewport.width / 2) - (dimensions.width / 2) + offset.left), parseInt((viewport.height / 2) - (dimensions.height / 2) + offset.top), parseInt((viewport.height / 2) - (dimensions.height / 2)));
|
// console.log('Left: %s, Top: %s (%s)', parseInt((viewport.width / 2) - (dimensions.width / 2) + offset.left), parseInt((viewport.height / 2) - (dimensions.height / 2) + offset.top), parseInt((viewport.height / 2) - (dimensions.height / 2)));
|
||||||
if (left) {
|
if (left) {
|
||||||
@@ -201,8 +201,7 @@ function setCenter(id, left, top)
|
|||||||
function goToPos(element, offset = 0)
|
function goToPos(element, offset = 0)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if ($(element))
|
if ($(element)) {
|
||||||
{
|
|
||||||
// get the element pos
|
// get the element pos
|
||||||
var pos = $(element).cumulativeOffset();
|
var pos = $(element).cumulativeOffset();
|
||||||
// if not top element and no offset given, set auto offset for top element
|
// if not top element and no offset given, set auto offset for top element
|
||||||
@@ -485,7 +484,7 @@ function actionIndicator(loc = '')
|
|||||||
*/
|
*/
|
||||||
function actionIndicatorShow(loc = '')
|
function actionIndicatorShow(loc = '')
|
||||||
{
|
{
|
||||||
console.log('Indicator: SHOW [%s]', loc);
|
// console.log('Indicator: SHOW [%s]', loc);
|
||||||
$('indicator').addClassName('progress');
|
$('indicator').addClassName('progress');
|
||||||
setCenter('indicator', true, true);
|
setCenter('indicator', true, true);
|
||||||
$('indicator').show();
|
$('indicator').show();
|
||||||
@@ -499,14 +498,14 @@ function actionIndicatorShow(loc = '')
|
|||||||
*/
|
*/
|
||||||
function actionIndicatorHide(loc = '')
|
function actionIndicatorHide(loc = '')
|
||||||
{
|
{
|
||||||
console.log('Indicator: HIDE [%s]', loc);
|
// console.log('Indicator: HIDE [%s]', loc);
|
||||||
$('indicator').hide();
|
$('indicator').hide();
|
||||||
$('indicator').removeClassName('progress');
|
$('indicator').removeClassName('progress');
|
||||||
overlayBoxHide();
|
overlayBoxHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* shows the overlay box
|
* shows the overlay box or if already visible, bumps the zIndex to 100
|
||||||
*/
|
*/
|
||||||
function overlayBoxShow()
|
function overlayBoxShow()
|
||||||
{
|
{
|
||||||
@@ -519,7 +518,7 @@ function overlayBoxShow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hides the overlay box
|
* hides the overlay box or if zIndex is 100 bumps it down to previous level
|
||||||
*/
|
*/
|
||||||
function overlayBoxHide()
|
function overlayBoxHide()
|
||||||
{
|
{
|
||||||
@@ -544,6 +543,16 @@ function setOverlayBox()
|
|||||||
$('overlayBox').show();
|
$('overlayBox').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* opposite of set, always hides overlay box
|
||||||
|
*/
|
||||||
|
function hideOverlayBox()
|
||||||
|
{
|
||||||
|
if ($('overlayBox').visible()) {
|
||||||
|
$('overlayBox').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the abort call, clears the action box and hides it and the overlay box
|
* the abort call, clears the action box and hides it and the overlay box
|
||||||
*/
|
*/
|
||||||
@@ -618,6 +627,21 @@ function aelx(base, ...attach)
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* same as aelx, but instead of using objects as parameters
|
||||||
|
* get an array of objects to attach
|
||||||
|
* @param {Object} base object to where we attach the elements
|
||||||
|
* @param {Array} attach array of objects to attach
|
||||||
|
* @return {Object} "none", technically there is no return needed, global attach
|
||||||
|
*/
|
||||||
|
function aelxar(base, attach)
|
||||||
|
{
|
||||||
|
attach.each(function(t) {
|
||||||
|
base.sub.push(Object.assign({}, t));
|
||||||
|
});
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resets the sub elements of the base element given
|
* resets the sub elements of the base element given
|
||||||
* @param {Object} base cel created element
|
* @param {Object} base cel created element
|
||||||
|
|||||||
@@ -53,7 +53,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
time_24hr: true,
|
time_24hr: true,
|
||||||
rangeSeparator: ' から '
|
rangeSeparator: " から ",
|
||||||
|
firstDayOfWeek: 1
|
||||||
};
|
};
|
||||||
fp.l10ns.ja = Japanese;
|
fp.l10ns.ja = Japanese;
|
||||||
var ja = fp.l10ns;
|
var ja = fp.l10ns;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -161,8 +161,7 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
|
|
||||||
// if we have a search path we need to set it, to use the correct DB to login
|
// if we have a search path we need to set it, to use the correct DB to login
|
||||||
// check what schema to use. if there is a login schema use this, else check if there is a schema set in the config, or fall back to DB_SCHEMA if this exists, if this also does not exists use public schema
|
// check what schema to use. if there is a login schema use this, else check if there is a schema set in the config, or fall back to DB_SCHEMA if this exists, if this also does not exists use public schema
|
||||||
if (defined('LOGIN_DB_SCHEMA')) {
|
if (defined('LOGIN_DB_SCHEMA') && LOGIN_DB_SCHEMA) {
|
||||||
/** @phan-suppress-next-line PhanUndeclaredConstant */
|
|
||||||
$SCHEMA = LOGIN_DB_SCHEMA;
|
$SCHEMA = LOGIN_DB_SCHEMA;
|
||||||
} elseif (isset($db_config['db_schema']) && $db_config['db_schema']) {
|
} elseif (isset($db_config['db_schema']) && $db_config['db_schema']) {
|
||||||
$SCHEMA = $db_config['db_schema'];
|
$SCHEMA = $db_config['db_schema'];
|
||||||
@@ -598,7 +597,7 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
// unset mem limit if debug is set to 1
|
// unset mem limit if debug is set to 1
|
||||||
// if (($GLOBALS["DEBUG_ALL"] || $GLOBALS["DB_DEBUG"] || $_SESSION["DEBUG_ALL"] || $_SESSION["DB_DEBUG"]) && ini_get('memory_limit') != -1)
|
// if (($GLOBALS["DEBUG_ALL"] || $GLOBALS["DB_DEBUG"] || $_SESSION["DEBUG_ALL"] || $_SESSION["DB_DEBUG"]) && ini_get('memory_limit') != -1)
|
||||||
// ini_set('memory_limit', -1);
|
// ini_set('memory_limit', -1);
|
||||||
if ($res['filename'] == $this->page_name) {
|
if (isset($res['filename']) && $res['filename'] == $this->page_name) {
|
||||||
$this->permission_okay = true;
|
$this->permission_okay = true;
|
||||||
} else {
|
} else {
|
||||||
$this->login_error = 103;
|
$this->login_error = 103;
|
||||||
|
|||||||
@@ -169,8 +169,7 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check schema
|
// check schema
|
||||||
if (defined('LOGIN_DB_SCHEMA')) {
|
if (defined('LOGIN_DB_SCHEMA') && LOGIN_DB_SCHEMA) {
|
||||||
/** @phan-suppress-next-line PhanUndeclaredConstant */
|
|
||||||
$SCHEMA = LOGIN_DB_SCHEMA;
|
$SCHEMA = LOGIN_DB_SCHEMA;
|
||||||
} elseif ($this->dbGetSchema()) {
|
} elseif ($this->dbGetSchema()) {
|
||||||
$SCHEMA = $this->dbGetSchema();
|
$SCHEMA = $this->dbGetSchema();
|
||||||
@@ -256,7 +255,6 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
$type = 'popup';
|
$type = 'popup';
|
||||||
} else {
|
} else {
|
||||||
$type = 'normal';
|
$type = 'normal';
|
||||||
/** @phan-suppress-next-line PhanTypeArraySuspicious */
|
|
||||||
$data['popup'] = 0;
|
$data['popup'] = 0;
|
||||||
}
|
}
|
||||||
$query_string = '';
|
$query_string = '';
|
||||||
@@ -342,6 +340,7 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
if ($filename === null) {
|
if ($filename === null) {
|
||||||
return $enabled;
|
return $enabled;
|
||||||
}
|
}
|
||||||
|
/** @phan-suppress-next-line PhanNoopSwitchCases */
|
||||||
switch ($filename) {
|
switch ($filename) {
|
||||||
default:
|
default:
|
||||||
$enabled = true;
|
$enabled = true;
|
||||||
@@ -443,8 +442,7 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
string $associate = null,
|
string $associate = null,
|
||||||
string $file = null
|
string $file = null
|
||||||
): void {
|
): void {
|
||||||
if (defined('GLOBAL_DB_SCHEMA')) {
|
if (defined('GLOBAL_DB_SCHEMA') && GLOBAL_DB_SCHEMA) {
|
||||||
/** @phan-suppress-next-line PhanUndeclaredConstant */
|
|
||||||
$SCHEMA = GLOBAL_DB_SCHEMA;
|
$SCHEMA = GLOBAL_DB_SCHEMA;
|
||||||
} elseif ($this->dbGetSchema()) {
|
} elseif ($this->dbGetSchema()) {
|
||||||
$SCHEMA = $this->dbGetSchema();
|
$SCHEMA = $this->dbGetSchema();
|
||||||
|
|||||||
@@ -866,64 +866,64 @@ class Basic
|
|||||||
*/
|
*/
|
||||||
private function writeErrorMsg(string $level, string $error_string): void
|
private function writeErrorMsg(string $level, string $error_string): void
|
||||||
{
|
{
|
||||||
if ($this->doDebugTrigger('debug', $level)) {
|
// only write if write is requested
|
||||||
// only write if write is requested
|
if ($this->doDebugTrigger('debug', $level) &&
|
||||||
if ($this->doDebugTrigger('print', $level)) {
|
$this->doDebugTrigger('print', $level)
|
||||||
// replace all html tags
|
) {
|
||||||
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "##\\2##", $error_string);
|
// replace all html tags
|
||||||
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "", $error_string);
|
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "##\\2##", $error_string);
|
||||||
// replace special line break tag
|
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "", $error_string);
|
||||||
// $error_string = str_replace('<!--#BR#-->', "\n", $error_string);
|
// replace special line break tag
|
||||||
|
// $error_string = str_replace('<!--#BR#-->', "\n", $error_string);
|
||||||
|
|
||||||
// init output variable
|
// init output variable
|
||||||
$output = $error_string; // output formated error string to output file
|
$output = $error_string; // output formated error string to output file
|
||||||
// init base file path
|
// init base file path
|
||||||
$fn = BASE.LOG.$this->log_print_file.'.'.$this->log_file_name_ext;
|
$fn = BASE.LOG.$this->log_print_file.'.'.$this->log_file_name_ext;
|
||||||
// log ID prefix settings, if not valid, replace with empty
|
// log ID prefix settings, if not valid, replace with empty
|
||||||
if (preg_match("/^[A-Za-z0-9]+$/", $this->log_file_id)) {
|
if (preg_match("/^[A-Za-z0-9]+$/", $this->log_file_id)) {
|
||||||
$rpl_string = '_'.$this->log_file_id;
|
$rpl_string = '_'.$this->log_file_id;
|
||||||
} else {
|
} else {
|
||||||
$rpl_string = '';
|
$rpl_string = '';
|
||||||
|
}
|
||||||
|
$fn = str_replace('##LOGID##', $rpl_string, $fn); // log id (like a log file prefix)
|
||||||
|
|
||||||
|
if ($this->log_per_run) {
|
||||||
|
if (isset($GLOBALS['LOG_FILE_UNIQUE_ID'])) {
|
||||||
|
$this->log_file_unique_id = $GLOBALS['LOG_FILE_UNIQUE_ID'];
|
||||||
}
|
}
|
||||||
$fn = str_replace('##LOGID##', $rpl_string, $fn); // log id (like a log file prefix)
|
if (!$this->log_file_unique_id) {
|
||||||
|
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid((string)mt_rand(), true)), 0, 8);
|
||||||
if ($this->log_per_run) {
|
|
||||||
if (isset($GLOBALS['LOG_FILE_UNIQUE_ID'])) {
|
|
||||||
$this->log_file_unique_id = $GLOBALS['LOG_FILE_UNIQUE_ID'];
|
|
||||||
}
|
|
||||||
if (!$this->log_file_unique_id) {
|
|
||||||
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid((string)mt_rand(), true)), 0, 8);
|
|
||||||
}
|
|
||||||
$rpl_string = '_'.$this->log_file_unique_id; // add 8 char unique string
|
|
||||||
} else {
|
|
||||||
$rpl_string = !$this->log_print_file_date ? '' : '_'.date('Y-m-d'); // add date to file
|
|
||||||
}
|
}
|
||||||
$fn = str_replace('##DATE##', $rpl_string, $fn); // create output filename
|
$rpl_string = '_'.$this->log_file_unique_id; // add 8 char unique string
|
||||||
|
} else {
|
||||||
|
$rpl_string = !$this->log_print_file_date ? '' : '_'.date('Y-m-d'); // add date to file
|
||||||
|
}
|
||||||
|
$fn = str_replace('##DATE##', $rpl_string, $fn); // create output filename
|
||||||
|
|
||||||
$rpl_string = !$this->log_per_level ? '' : '_'.$level; // if request to write to one file
|
$rpl_string = !$this->log_per_level ? '' : '_'.$level; // if request to write to one file
|
||||||
$fn = str_replace('##LEVEL##', $rpl_string, $fn); // create output filename
|
$fn = str_replace('##LEVEL##', $rpl_string, $fn); // create output filename
|
||||||
|
|
||||||
$rpl_string = !$this->log_per_class ? '' : '_'.str_replace('\\', '-', get_class($this)); // set sub class settings
|
$rpl_string = !$this->log_per_class ? '' : '_'.str_replace('\\', '-', get_class($this)); // set sub class settings
|
||||||
$fn = str_replace('##CLASS##', $rpl_string, $fn); // create output filename
|
$fn = str_replace('##CLASS##', $rpl_string, $fn); // create output filename
|
||||||
|
|
||||||
$rpl_string = !$this->log_per_page ? '' : '_'.$this->getPageName(1); // if request to write to one file
|
$rpl_string = !$this->log_per_page ? '' : '_'.$this->getPageName(1); // if request to write to one file
|
||||||
$fn = str_replace('##PAGENAME##', $rpl_string, $fn); // create output filename
|
$fn = str_replace('##PAGENAME##', $rpl_string, $fn); // create output filename
|
||||||
|
|
||||||
// write to file
|
// write to file
|
||||||
// first check if max file size is is set and file is bigger
|
// first check if max file size is is set and file is bigger
|
||||||
if ($this->log_max_filesize > 0 && ((filesize($fn) / 1024) > $this->log_max_filesize)) {
|
if ($this->log_max_filesize > 0 && ((filesize($fn) / 1024) > $this->log_max_filesize)) {
|
||||||
// for easy purpose, rename file only to attach timestamp, nur sequence numbering
|
// for easy purpose, rename file only to attach timestamp, nur sequence numbering
|
||||||
rename($fn, $fn.'.'.date("YmdHis"));
|
rename($fn, $fn.'.'.date("YmdHis"));
|
||||||
}
|
}
|
||||||
$fp = fopen($fn, 'a');
|
$fp = fopen($fn, 'a');
|
||||||
if ($fp !== false) {
|
if ($fp !== false) {
|
||||||
fwrite($fp, $output);
|
fwrite($fp, $output);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
} else {
|
} else {
|
||||||
echo "<!-- could not open file: $fn //-->";
|
echo "<!-- could not open file: $fn //-->";
|
||||||
}
|
}
|
||||||
} // do write to file
|
} // do write to file
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1808,6 +1808,7 @@ class Basic
|
|||||||
*/
|
*/
|
||||||
public static function stringByteFormat($number, bool $dot_thousand = false)
|
public static function stringByteFormat($number, bool $dot_thousand = false)
|
||||||
{
|
{
|
||||||
|
$matches = [];
|
||||||
// detects up to exo bytes
|
// detects up to exo bytes
|
||||||
preg_match("/([\d.,]*)\s?(eb|pb|tb|gb|mb|kb|e|p|t|g|m|k|b)$/", strtolower($number), $matches);
|
preg_match("/([\d.,]*)\s?(eb|pb|tb|gb|mb|kb|e|p|t|g|m|k|b)$/", strtolower($number), $matches);
|
||||||
if (isset($matches[1]) && isset($matches[2])) {
|
if (isset($matches[1]) && isset($matches[2])) {
|
||||||
@@ -2181,6 +2182,8 @@ class Basic
|
|||||||
}
|
}
|
||||||
// if type is not in the list, but returns as PDF, we need to convert to JPEG before
|
// if type is not in the list, but returns as PDF, we need to convert to JPEG before
|
||||||
if (!$type) {
|
if (!$type) {
|
||||||
|
$output = [];
|
||||||
|
$return = null;
|
||||||
// is this a PDF, if no, return from here with nothing
|
// is this a PDF, if no, return from here with nothing
|
||||||
$convert_prefix = 'png:';
|
$convert_prefix = 'png:';
|
||||||
# TEMP convert to PNG, we then override the file name
|
# TEMP convert to PNG, we then override the file name
|
||||||
@@ -2562,17 +2565,33 @@ class Basic
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* detects the source encoding of the string and if doesn't match to the given target encoding it convert is
|
* detects the source encoding of the string and if doesn't match
|
||||||
|
* to the given target encoding it convert is
|
||||||
|
* if source encoding is set and auto check is true (default) a second
|
||||||
|
* check is done so that the source string encoding actually matches
|
||||||
|
* will be skipped if source encoding detection is ascii
|
||||||
* @param string $string string to convert
|
* @param string $string string to convert
|
||||||
* @param string $to_encoding target encoding
|
* @param string $to_encoding target encoding
|
||||||
* @param string $source_encoding optional source encoding, will try to auto detect
|
* @param string $source_encoding optional source encoding, will try to auto detect
|
||||||
|
* @param bool $auto_check default true, if source encoding is set
|
||||||
|
* check that the source is actually matching
|
||||||
|
* to what we sav the source is
|
||||||
* @return string encoding converted string
|
* @return string encoding converted string
|
||||||
*/
|
*/
|
||||||
public static function convertEncoding(string $string, string $to_encoding, string $source_encoding = ''): string
|
public static function convertEncoding(string $string, string $to_encoding, string $source_encoding = '', bool $auto_check = true): string
|
||||||
{
|
{
|
||||||
// set if not given
|
// set if not given
|
||||||
if (!$source_encoding) {
|
if (!$source_encoding) {
|
||||||
$source_encoding = mb_detect_encoding($string);
|
$source_encoding = mb_detect_encoding($string);
|
||||||
|
} else {
|
||||||
|
$_source_encoding = mb_detect_encoding($string);
|
||||||
|
}
|
||||||
|
if ($auto_check === true &&
|
||||||
|
isset($_source_encoding) &&
|
||||||
|
$_source_encoding == $source_encoding
|
||||||
|
) {
|
||||||
|
// trigger check if we have override source encoding.
|
||||||
|
// if different (_source is all but not ascii) then trigger skip if matching
|
||||||
}
|
}
|
||||||
if ($source_encoding != $to_encoding) {
|
if ($source_encoding != $to_encoding) {
|
||||||
if ($source_encoding) {
|
if ($source_encoding) {
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
|
|
||||||
// endless loop protection
|
// endless loop protection
|
||||||
private $MAX_QUERY_CALL;
|
private $MAX_QUERY_CALL;
|
||||||
|
private $DEFAULT_MAX_QUERY_CALL = 20; // default
|
||||||
private $query_called = array();
|
private $query_called = array();
|
||||||
// error string
|
// error string
|
||||||
protected $error_string = array();
|
protected $error_string = array();
|
||||||
@@ -357,6 +358,8 @@ class IO extends \CoreLibs\Basic
|
|||||||
$this->error_string['40'] = 'Query async call failed.';
|
$this->error_string['40'] = 'Query async call failed.';
|
||||||
$this->error_string['41'] = 'Connection is busy with a different query. Cannot execute.';
|
$this->error_string['41'] = 'Connection is busy with a different query. Cannot execute.';
|
||||||
$this->error_string['42'] = 'Cannot check for async query, none has been started yet.';
|
$this->error_string['42'] = 'Cannot check for async query, none has been started yet.';
|
||||||
|
$this->error_string['50'] = 'Setting max query call to -1 will disable loop protection for all subsequent runs';
|
||||||
|
$this->error_string['51'] = 'Max query call needs to be set to at least 1';
|
||||||
|
|
||||||
// set debug, either via global var, or debug var during call
|
// set debug, either via global var, or debug var during call
|
||||||
$this->db_debug = false;
|
$this->db_debug = false;
|
||||||
@@ -633,6 +636,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
*/
|
*/
|
||||||
private function __dbReturnTable(string $query): array
|
private function __dbReturnTable(string $query): array
|
||||||
{
|
{
|
||||||
|
$matches = [];
|
||||||
if (preg_match("/^SELECT /i", $query)) {
|
if (preg_match("/^SELECT /i", $query)) {
|
||||||
preg_match("/ (FROM) (([\w_]+)\.)?([\w_]+) /i", $query, $matches);
|
preg_match("/ (FROM) (([\w_]+)\.)?([\w_]+) /i", $query, $matches);
|
||||||
} else {
|
} else {
|
||||||
@@ -655,6 +659,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
*/
|
*/
|
||||||
private function __dbPrepareExec(string $query, string $pk_name)
|
private function __dbPrepareExec(string $query, string $pk_name)
|
||||||
{
|
{
|
||||||
|
$matches= [];
|
||||||
// to either use the returning method or the guess method for getting primary keys
|
// to either use the returning method or the guess method for getting primary keys
|
||||||
$this->returning_id = false;
|
$this->returning_id = false;
|
||||||
// set the query
|
// set the query
|
||||||
@@ -729,7 +734,10 @@ class IO extends \CoreLibs\Basic
|
|||||||
$this->query_called[$md5] = 0;
|
$this->query_called[$md5] = 0;
|
||||||
}
|
}
|
||||||
// count up the run, if this is run more than the max_run then exit with error
|
// count up the run, if this is run more than the max_run then exit with error
|
||||||
if ($this->query_called[$md5] > $this->MAX_QUERY_CALL) {
|
// if set to -1, then ignore it
|
||||||
|
if ($this->MAX_QUERY_CALL != -1 &&
|
||||||
|
$this->query_called[$md5] > $this->MAX_QUERY_CALL
|
||||||
|
) {
|
||||||
$this->error_id = 30;
|
$this->error_id = 30;
|
||||||
$this->__dbError();
|
$this->__dbError();
|
||||||
$this->__dbDebug('db', $this->query, 'dbExec', 'Q[nc]');
|
$this->__dbDebug('db', $this->query, 'dbExec', 'Q[nc]');
|
||||||
@@ -855,6 +863,52 @@ class IO extends \CoreLibs\Basic
|
|||||||
return $this->db_debug;
|
return $this->db_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set max query calls, set to --1 to disable loop
|
||||||
|
* protection. this will generate a warning
|
||||||
|
* empty call (null) will reset to default
|
||||||
|
* @param int|null $max_calls Set the max loops allowed
|
||||||
|
* @return bool True for succesfull set
|
||||||
|
*/
|
||||||
|
public function dbSetMaxQueryCall(?int $max_calls = null): bool
|
||||||
|
{
|
||||||
|
$success = false;
|
||||||
|
// if null then reset to default
|
||||||
|
if ($max_calls === null) {
|
||||||
|
$max_calls = $this->DEFAULT_MAX_QUERY_CALL;
|
||||||
|
}
|
||||||
|
// if -1 then disable loop check
|
||||||
|
// DANGEROUS, WARN USER
|
||||||
|
if ($max_calls == -1) {
|
||||||
|
$this->warning_id = 50;
|
||||||
|
$this->__dbError();
|
||||||
|
}
|
||||||
|
// negative or 0
|
||||||
|
if ($max_calls < -1 || $max_calls == 0) {
|
||||||
|
$this->error_id = 51;
|
||||||
|
$this->__dbError();
|
||||||
|
// early abort
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// ok entry, set
|
||||||
|
if ($max_calls == -1 ||
|
||||||
|
$max_calls > 0
|
||||||
|
) {
|
||||||
|
$this->MAX_QUERY_CALL = $max_calls;
|
||||||
|
$succes = true;
|
||||||
|
}
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns current set max query calls for loop avoidance
|
||||||
|
* @return int Integer number, if -1 the loop check is disabled
|
||||||
|
*/
|
||||||
|
public function dbGetMaxQueryCall(): int
|
||||||
|
{
|
||||||
|
return $this->MAX_QUERY_CALL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resets the call times for the max query called to 0
|
* resets the call times for the max query called to 0
|
||||||
* USE CAREFULLY: rather make the query prepare -> execute
|
* USE CAREFULLY: rather make the query prepare -> execute
|
||||||
@@ -1454,6 +1508,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
*/
|
*/
|
||||||
public function dbPrepare(string $stm_name, string $query, string $pk_name = '')
|
public function dbPrepare(string $stm_name, string $query, string $pk_name = '')
|
||||||
{
|
{
|
||||||
|
$matches = [];
|
||||||
if (!$query) {
|
if (!$query) {
|
||||||
$this->error_id = 11;
|
$this->error_id = 11;
|
||||||
$this->__dbError();
|
$this->__dbError();
|
||||||
@@ -1507,6 +1562,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
$this->prepare_cursor[$stm_name]['pk_name'] = $pk_name;
|
$this->prepare_cursor[$stm_name]['pk_name'] = $pk_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$match = [];
|
||||||
// search for $1, $2, in the query and push it into the control array
|
// search for $1, $2, in the query and push it into the control array
|
||||||
preg_match_all('/(\$[0-9]{1,})/', $query, $match);
|
preg_match_all('/(\$[0-9]{1,})/', $query, $match);
|
||||||
$this->prepare_cursor[$stm_name]['count'] = count($match[1]);
|
$this->prepare_cursor[$stm_name]['count'] = count($match[1]);
|
||||||
@@ -1665,6 +1721,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
*/
|
*/
|
||||||
public function dbCompareVersion(string $compare): bool
|
public function dbCompareVersion(string $compare): bool
|
||||||
{
|
{
|
||||||
|
$matches = [];
|
||||||
// compare has =, >, < prefix, and gets stripped, if the rest is not X.Y format then error
|
// compare has =, >, < prefix, and gets stripped, if the rest is not X.Y format then error
|
||||||
preg_match("/^([<>=]{1,})(\d{1,})\.(\d{1,})/", $compare, $matches);
|
preg_match("/^([<>=]{1,})(\d{1,})\.(\d{1,})/", $compare, $matches);
|
||||||
$compare = $matches[1];
|
$compare = $matches[1];
|
||||||
@@ -1909,10 +1966,10 @@ class IO extends \CoreLibs\Basic
|
|||||||
*/
|
*/
|
||||||
public function dbTimeFormat(string $age, bool $show_micro = false): string
|
public function dbTimeFormat(string $age, bool $show_micro = false): string
|
||||||
{
|
{
|
||||||
|
$matches = [];
|
||||||
// in string (datetime diff): 1786 days 22:11:52.87418
|
// in string (datetime diff): 1786 days 22:11:52.87418
|
||||||
// or (age): 4 years 10 mons 21 days 12:31:11.87418
|
// or (age): 4 years 10 mons 21 days 12:31:11.87418
|
||||||
// also -09:43:54.781021 or without - prefix
|
// also -09:43:54.781021 or without - prefix
|
||||||
|
|
||||||
preg_match("/(.*)?(\d{2}):(\d{2}):(\d{2})(\.(\d+))/", $age, $matches);
|
preg_match("/(.*)?(\d{2}):(\d{2}):(\d{2})(\.(\d+))/", $age, $matches);
|
||||||
|
|
||||||
$prefix = $matches[1] != '-' ? $matches[1] : '';
|
$prefix = $matches[1] != '-' ? $matches[1] : '';
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ class PgSQL
|
|||||||
$q .= "AND indisprimary";
|
$q .= "AND indisprimary";
|
||||||
$cursor = $this->__dbQuery($q);
|
$cursor = $this->__dbQuery($q);
|
||||||
if ($cursor) {
|
if ($cursor) {
|
||||||
return $this->__dbFetchArray($cursor)['column_name'];
|
return $this->__dbFetchArray($cursor)['column_name'] ?? false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -829,7 +829,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$data['checked'] = 0;
|
$data['checked'] = 0;
|
||||||
for ($i = (count($this->table_array[$element_name]['element_list']) - 1); $i >= 0; $i --) {
|
for ($i = (count($this->table_array[$element_name]['element_list']) - 1); $i >= 0; $i --) {
|
||||||
$data['value'][] = $i;
|
$data['value'][] = $i;
|
||||||
$data['output'][] = $this->table_array[$element_name]['element_list'][$i];
|
$data['output'][] = $this->table_array[$element_name]['element_list'][$i] ?? null;
|
||||||
$data['name'] = $element_name;
|
$data['name'] = $element_name;
|
||||||
if (isset($this->table_array[$element_name]['value']) &&
|
if (isset($this->table_array[$element_name]['value']) &&
|
||||||
(($i && $this->table_array[$element_name]['value']) ||
|
(($i && $this->table_array[$element_name]['value']) ||
|
||||||
@@ -1234,9 +1234,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
} elseif ($data_array['type'] == 'radio_group' && !isset($_POST[$prfx.$el_name])) {
|
} elseif ($data_array['type'] == 'radio_group' && !isset($_POST[$prfx.$el_name])) {
|
||||||
// radio group and set where one not active
|
// radio group and set where one not active
|
||||||
// $this->debug('edit_error_chk', 'RADIO GROUP');
|
// $this->debug('edit_error_chk', 'RADIO GROUP');
|
||||||
$row_okay[$_POST[$prfx.$el_name][$i]] = 0;
|
$row_okay[$_POST[$prfx.$el_name][$i] ?? 0] = 0;
|
||||||
$default_wrong[$_POST[$prfx.$el_name][$i]] = 1;
|
$default_wrong[$_POST[$prfx.$el_name][$i] ?? 0] = 1;
|
||||||
$error[$_POST[$prfx.$el_name][$i]] = 1;
|
$error[$_POST[$prfx.$el_name][$i] ?? 0] = 1;
|
||||||
} elseif (isset($_POST[$prfx.$el_name][$i]) && !isset($error[$i])) {
|
} elseif (isset($_POST[$prfx.$el_name][$i]) && !isset($error[$i])) {
|
||||||
// $this->debug('edit_error_chk', '[$i]');
|
// $this->debug('edit_error_chk', '[$i]');
|
||||||
$element_set[$i] = 1;
|
$element_set[$i] = 1;
|
||||||
@@ -1646,7 +1646,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// data part, read from where [POST]
|
// data part, read from where [POST]
|
||||||
// radio group selections (only one can be active)
|
// radio group selections (only one can be active)
|
||||||
if ($data_array['type'] == 'radio_group') {
|
if ($data_array['type'] == 'radio_group') {
|
||||||
if ($i == $_POST[$prfx.$el_name]) {
|
if (isset($_POST[$prfx.$el_name]) && $i == $_POST[$prfx.$el_name]) {
|
||||||
$_value = $i + 1;
|
$_value = $i + 1;
|
||||||
} else {
|
} else {
|
||||||
$_value = 'NULL';
|
$_value = 'NULL';
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
xmlns="https://getpsalm.org/schema/config"
|
xmlns="https://getpsalm.org/schema/config"
|
||||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||||
autoloader="lib/autoloader.php"
|
autoloader="lib/autoloader.php"
|
||||||
|
errorLevel="8"
|
||||||
>
|
>
|
||||||
<projectFiles>
|
<projectFiles>
|
||||||
<file name="admin/class_test.php" />
|
<file name="admin/class_test.php" />
|
||||||
@@ -28,7 +29,8 @@
|
|||||||
<directory name="tmp" />
|
<directory name="tmp" />
|
||||||
<directory name="log" />
|
<directory name="log" />
|
||||||
<directory name="media" />
|
<directory name="media" />
|
||||||
<directory name="lib/pChart" />
|
<directory name="lib/FileUpload" />
|
||||||
|
<directory name="lib/pChart" />
|
||||||
<directory name="lib/pChart2.1.4" />
|
<directory name="lib/pChart2.1.4" />
|
||||||
<directory name="lib/Smarty" />
|
<directory name="lib/Smarty" />
|
||||||
<directory name="lib/smarty-3.1.30" />
|
<directory name="lib/smarty-3.1.30" />
|
||||||
|
|||||||
Reference in New Issue
Block a user