diff --git a/.github/copilot_instructions.md b/.github/copilot_instructions.md
new file mode 100644
index 000000000..0a82c3d81
--- /dev/null
+++ b/.github/copilot_instructions.md
@@ -0,0 +1,14 @@
+# webERP Coding Standards
+
+This repository is webERP.
+
+Requirements:
+
+- PHP compatibility consistent with webERP standards.
+- Avoid modern framework assumptions.
+- Use procedural PHP where appropriate.
+- Preserve existing coding style.
+- Use mysqli functions already used by the project.
+- Maintain backwards compatibility.
+- Generate SQL compatible with MariaDB/MySQL.
+- Keep changes small and reviewable.
diff --git a/.gitignore b/.gitignore
index adabe3af3..032bf431e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,24 +1,36 @@
-# Ignore NetBeans project metadata
+# ignore IDE scaffolding
+## NetBeans
/nbproject/
-# As well as Jetbrains stuff
+
+## Jetbrains
/.idea/
-# And VSCode
+
+## VSCode
/.vscode/launch.json
-# And random assorted tooling files
-Thumbs.db
-# Only config.distrib.php is to be distributed
-/config.php
+# ignore tooling
+## Windows / WSL
+Thumbs.db
+.DS_Store
+*:Zone.Identifier
-# Ignore everything in the companies directory...
-/companies/*
-# ...except for weberpdemo
-!/companies/weberpdemo
+## fonts created JIT by DOMPDF
+/vendor/dompdf/dompdf/lib/fonts/*.json
-# the per-developer phpunit config and phpunit cache
+## phpunit config and phpunit cache (per-developer)
/.phpunit.result.cache
/phpunit.xml
-# And the eventual .git dir from composer-installed projects which are downloaded as git clones instead of zipballs
+## .git/ in composer-installed projects (created by git clone not zipball)
/vendor/phplot/phplot/.git/
+
+## other
KLConfig/
+
+# DO NOT EVER distribute the local config.php to avoid accidential disclosure
+# of database or other credentials (only config.distrib.php is distributed)
+/config.php
+
+# ignore everything in companies/ except weberpdemo/
+/companies/*
+!/companies/weberpdemo
diff --git a/DashboardConfig.php b/DashboardConfig.php
index ad3cc3439..8cc70018f 100644
--- a/DashboardConfig.php
+++ b/DashboardConfig.php
@@ -23,7 +23,7 @@
if (DB_error_no() == 0) {
prnMsg(__('The script was successfully removed'), 'success');
} else {
- prnMsg(__('There was a peoblem removing the script'), 'error');
+ prnMsg(__('There was a problem removing the script'), 'error');
}
}
@@ -36,14 +36,22 @@
description='" . $_POST['Description'] . "'
WHERE id='" . $_POST['ID'] . "'";
$Result = DB_query($SQL);
- $SQL = "UPDATE scripts SET pagesecurity='" . $_POST['PageSecurity'] . "',
- description='" . $_POST['Description'] . "'
- WHERE script='" . $MyRow['scripts'] . "'";
+ $SQL = "INSERT INTO scripts (script,
+ pagesecurity,
+ description
+ ) VALUES (
+ '" . $MyRow['scripts'] . "',
+ '" . $_POST['PageSecurity'] . "',
+ '" . $_POST['Description'] . "'
+ )
+ ON DUPLICATE KEY UPDATE
+ pagesecurity = VALUES(pagesecurity),
+ description = VALUES(description)";
$Result = DB_query($SQL);
if (DB_error_no() == 0) {
prnMsg(__('The script was successfully updated'), 'success');
} else {
- prnMsg(__('There was a peoblem updating the script'), 'error');
+ prnMsg(__('There was a problem updating the script'), 'error');
}
}
@@ -62,16 +70,19 @@
$SQL = "INSERT INTO scripts (script,
pagesecurity,
description
- ) VALUES (
- '" . $_POST['Script'] . "',
- '" . $_POST['PageSecurity'] . "',
- '" . $_POST['Description'] . "'
- )";
+ ) VALUES (
+ '" . $_POST['Script'] . "',
+ '" . $_POST['PageSecurity'] . "',
+ '" . $_POST['Description'] . "'
+ )
+ ON DUPLICATE KEY UPDATE
+ pagesecurity = VALUES(pagesecurity),
+ description = VALUES(description)";
$Result = DB_query($SQL);
if (DB_error_no() == 0) {
prnMsg(__('The script was successfully inserted'), 'success');
} else {
- prnMsg(__('There was a peoblem inserting the script'), 'error');
+ prnMsg(__('There was a problem inserting the script'), 'error');
}
}
@@ -155,6 +166,9 @@