Skip to content
Merged
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.
38 changes: 25 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
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