Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/copilot_instructions.md
Original file line number Diff line number Diff line change
@@ -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.
36 changes: 25 additions & 11 deletions DashboardConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

Expand All @@ -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');
}
}

Expand All @@ -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');
}
}

Expand Down Expand Up @@ -155,6 +166,9 @@
<label for="Script">', __('Script Name'), '</label>
<select name="Script">';
$Scripts = glob('dashboard/*.php');
if (!isset($ScriptArray)) {
$ScriptArray = array();
}
foreach ($Scripts as $ScriptName) {
$ScriptName = basename($ScriptName);
if ($ScriptName != 'template.php' and !in_array($ScriptName, $ScriptArray)) {
Expand Down