diff --git a/Config/phpcs.xml b/Config/phpcs.xml
index 1130e7d..8430a01 100755
--- a/Config/phpcs.xml
+++ b/Config/phpcs.xml
@@ -7,6 +7,7 @@
*.tpl.php
*.xls.php
*/Build/*
+*/MainRepository/*
*/Cache/*
*/Demo/*
*/Docs/*
diff --git a/Config/phpmetrics.json b/Config/phpmetrics.json
new file mode 100644
index 0000000..53d2b82
--- /dev/null
+++ b/Config/phpmetrics.json
@@ -0,0 +1,12 @@
+{
+ "composer": true,
+ "excludes": [
+ ".git",
+ "tests",
+ "MainRepository",
+ "vendor",
+ "Admin/Install/Application",
+ "Install/Application",
+ "Resources"
+ ]
+}
\ No newline at end of file
diff --git a/Config/phpstan_autoloader.php b/Config/phpstan_autoloader.php
index 241a45d..8f3a133 100755
--- a/Config/phpstan_autoloader.php
+++ b/Config/phpstan_autoloader.php
@@ -12,6 +12,8 @@ function module_autoloader($class) {
__DIR__ . '/../../MainRepository/Resources/',
__DIR__ . '/../../MainRepository/Resources/tcpdf/',
__DIR__ . '/../../MainRepository/Resources/Stripe/',
+ __DIR__ . '/../../src/',
+ __DIR__ . '/../../../',
];
$class = \ltrim($class, '\\');
@@ -37,6 +39,7 @@ function module_autoloader($class) {
}
}
+ // github and normal
foreach ($paths as $path) {
if (($file = \realpath($path . $class2 . '.php'))) {
include_once $file;
@@ -52,6 +55,38 @@ function module_autoloader($class) {
return;
}
}
+
+ // own server
+ foreach ($paths as $path) {
+ if (($file = \realpath($path . 'oms-' . $class2 . '.php'))) {
+ include_once $file;
+
+ return;
+ } elseif (($file = \realpath($file = $path . 'oms-' . $class3 . '.php')) && \stripos($file, $class2) !== false) {
+ include_once $file;
+
+ return;
+ } elseif (\is_file($file = $path . 'oms-' . $class . '.php')) {
+ include_once $file;
+
+ return;
+ }
+ }
+
+ $paths[] = __DIR__ . '/../../src/Karaka/';
+
+ $class = \ltrim(\str_replace('Modules/', '/', $class), '/');
+ foreach ($paths as $path) {
+ if (\is_file($file = $path . $class . '.php')) {
+ include_once $file;
+
+ return;
+ } elseif (\is_file($file = $path . 'oms-' . $class . '.php')) {
+ include_once $file;
+
+ return;
+ }
+ }
}
spl_autoload_register('module_autoloader');
diff --git a/Helper/Scripts/cloneall.sh b/Helper/Scripts/cloneall.sh
new file mode 100644
index 0000000..15ae18b
--- /dev/null
+++ b/Helper/Scripts/cloneall.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+CNTX="users"; NAME="Karaka-Management"; PAGE=1
+curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" |
+ grep -e 'clone_url*' |
+ cut -d \" -f 4 |
+ xargs -L1 git clone
+
+find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git checkout develop" \;
+find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git submodule foreach 'git checkout develop || true'" \;
+find ./src -maxdepth 1 -type d \( ! -name . \) -exec bash -c "git -C '{}' pull" \;
+find ./src -maxdepth 1 -type d \( ! -name . \) -exec bash -c "Build/php.sh '{}' '{}/build'" \;
\ No newline at end of file
diff --git a/Helper/Scripts/copycontent.sh b/Helper/Scripts/copycontent.sh
new file mode 100644
index 0000000..01408d7
--- /dev/null
+++ b/Helper/Scripts/copycontent.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+find ./Modules -type f -name README.md -exec sh -c 'cat README.md > "{}"' \;
\ No newline at end of file
diff --git a/Helper/Scripts/install.sh b/Helper/Scripts/install.sh
index d4a4b35..0a870dd 100644
--- a/Helper/Scripts/install.sh
+++ b/Helper/Scripts/install.sh
@@ -16,7 +16,13 @@ add-apt-repository ppa:ondrej/php
apt-get update
-apt-get install php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 mysql-server wkhtmltopdf tesseract-ocr poppler-utils
+apt-get install php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 mariadb-server mariadb-client wkhtmltopdf tesseract-ocr poppler-utils
+
+apt-get install curl libcurl4-openssl-dev libxml2 libxml2-dev
+
+mysql_secure_installation
+systemctl start mariadb
+systemctl enable mariadb
a2enmod rewrite
a2enmod headers
@@ -49,7 +55,7 @@ borg key export /var/www/html repokey
## Developer
###############################################################
-apt-get install npm git composer cmake postgresql postgresql-contrib pcov
+apt-get install npm git composer nodejs cmake postgresql postgresql-contrib pcov
composer install
composer update
npm install -D jasmine jasmine-node istanbul jasmine-console-reporter supertest jasmine-supertest selenium-webdriver chromedriver geckodriver eslint
diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh
index 2d3a771..6dbe78d 100644
--- a/Helper/Scripts/serverInstall.sh
+++ b/Helper/Scripts/serverInstall.sh
@@ -10,7 +10,7 @@ export PROMPT_COMMAND='echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >
apt-get update
apt-get upgrade
-apt-get install git git-lfs snapd ufw software-properties-common
+apt-get install git snapd ufw software-properties-common composer nodejs npm
# Security
@@ -39,6 +39,9 @@ service fail2ban restart
apt-get install php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 libapache2-mpm-itk apache2-utils mariadb-server mariadb-client wkhtmltopdf tesseract-ocr poppler-utils
+pecl install pcov
+#echo "extension=pcov.so" > /etc/php/cli/conf.d/20-xdebug.ini
+
mkdir -p /var/cache/apache2
mkdir -p /var/cache/apache2/tmrank
chown -R www-data:www-data /var/cache/apache2
@@ -63,12 +66,15 @@ mysql -u root -p
CREATE USER 'jingga'@'%' IDENTIFIED BY 'dYg8#@wLiWJ3vE';
CREATE USER 'demo'@'%' IDENTIFIED BY 'orange';
+CREATE USER 'test'@'%' IDENTIFIED BY 'orange';
CREATE DATABASE jingga COMMENT 'Main application database';
CREATE DATABASE demo COMMENT 'Demo application database';
+CREATE DATABASE omt COMMENT 'Tests';
GRANT ALL PRIVILEGES ON jingga.* TO 'jingga'@'%';
GRANT ALL PRIVILEGES ON demo.* TO 'demo'@'%';
+GRANT ALL PRIVILEGES ON omt.* TO 'test'@'%';
FLUSH PRIVILEGES;
@@ -150,6 +156,23 @@ cat << EOF > /etc/apache2/sites-available/000-demo.conf
EOF
+cat << EOF > /etc/apache2/sites-available/000-dev.conf
+
+ ServerAdmin info@jingga.app
+ DocumentRoot /var/www/html/dev
+ ServerName dev.jingga.app
+
+
+ Options Indexes FollowSymLinks
+ AllowOverride All
+ Require all granted
+
+
+ ErrorLog \${APACHE_LOG_DIR}/error.log
+ CustomLog \${APACHE_LOG_DIR}/access.log combined
+
+EOF
+
cat << EOF > /etc/apache2/sites-available/000-services.conf
ServerAdmin info@jingga.app
@@ -535,6 +558,7 @@ mkdir -p /var/www/html/backup/bash
chmod -R 766 /var/www/html/backup
a2ensite 000-demo.conf
+a2ensite 000-dev.conf
a2ensite 000-shop.conf
a2ensite 000-services.conf
a2ensite 000-software.conf
diff --git a/Helper/Scripts/testall.sh b/Helper/Scripts/testall.sh
new file mode 100644
index 0000000..d4f53ab
--- /dev/null
+++ b/Helper/Scripts/testall.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+GITHUB[0]="https://github.com/Karaka-Management/jsOMS.git"
+GITHUB[1]="https://github.com/Karaka-Management/Karaka.git"
+GITHUB[2]="https://github.com/Karaka-Management/oms-Accounting.git"
+GITHUB[3]="https://github.com/Karaka-Management/oms-AccountsPayable.git"
+GITHUB[4]="https://github.com/Karaka-Management/oms-AccountsReceivable.git"
+GITHUB[5]="https://github.com/Karaka-Management/oms-Admin.git"
+GITHUB[6]="https://github.com/Karaka-Management/oms-AreaManager.git"
+GITHUB[7]="https://github.com/Karaka-Management/oms-Arrival.git"
+GITHUB[8]="https://github.com/Karaka-Management/oms-AssemblyManagement.git"
+GITHUB[9]="https://github.com/Karaka-Management/oms-AssetManagement.git"
+GITHUB[10]="https://github.com/Karaka-Management/oms-Attribute.git"
+GITHUB[11]="https://github.com/Karaka-Management/oms-Auditor.git"
+GITHUB[12]="https://github.com/Karaka-Management/oms-Backup.git"
+GITHUB[13]="https://github.com/Karaka-Management/oms-Balance.git"
+GITHUB[14]="https://github.com/Karaka-Management/oms-BankAccounting.git"
+GITHUB[15]="https://github.com/Karaka-Management/oms-Billing.git"
+GITHUB[16]="https://github.com/Karaka-Management/oms-BudgetManagement.git"
+GITHUB[17]="https://github.com/Karaka-Management/oms-BusinessExpenses.git"
+GITHUB[18]="https://github.com/Karaka-Management/oms-Calendar.git"
+GITHUB[19]="https://github.com/Karaka-Management/oms-CapacityPlanning.git"
+GITHUB[20]="https://github.com/Karaka-Management/oms-CashManagement.git"
+GITHUB[21]="https://github.com/Karaka-Management/oms-Chart.git"
+GITHUB[22]="https://github.com/Karaka-Management/oms-Chat.git"
+GITHUB[23]="https://github.com/Karaka-Management/oms-Checklist.git"
+GITHUB[24]="https://github.com/Karaka-Management/oms-ClientEvaluation.git"
+GITHUB[25]="https://github.com/Karaka-Management/oms-ClientManagement.git"
+GITHUB[26]="https://github.com/Karaka-Management/oms-CMS.git"
+GITHUB[27]="https://github.com/Karaka-Management/oms-Comments.git"
+GITHUB[28]="https://github.com/Karaka-Management/oms-Contact.git"
+GITHUB[29]="https://github.com/Karaka-Management/oms-ContractManagement.git"
+GITHUB[30]="https://github.com/Karaka-Management/oms-Controlling.git"
+GITHUB[31]="https://github.com/Karaka-Management/oms-CreditManagement.git"
+GITHUB[32]="https://github.com/Karaka-Management/oms-Dashboard.git"
+GITHUB[33]="https://github.com/Karaka-Management/oms-Database.git"
+GITHUB[34]="https://github.com/Karaka-Management/oms-DatabaseEditor.git"
+GITHUB[35]="https://github.com/Karaka-Management/oms-Draw.git"
+GITHUB[36]="https://github.com/Karaka-Management/oms-Editor.git"
+GITHUB[37]="https://github.com/Karaka-Management/oms-EmployeeEvaluation.git"
+GITHUB[38]="https://github.com/Karaka-Management/oms-EquipmentManagement.git"
+GITHUB[39]="https://github.com/Karaka-Management/oms-EventManagement.git"
+GITHUB[40]="https://github.com/Karaka-Management/oms-Exchange.git"
+GITHUB[41]="https://github.com/Karaka-Management/oms-Finance.git"
+GITHUB[42]="https://github.com/Karaka-Management/oms-FleetManagement.git"
+GITHUB[43]="https://github.com/Karaka-Management/oms-Help.git"
+GITHUB[44]="https://github.com/Karaka-Management/oms-Helper.git"
+GITHUB[45]="https://github.com/Karaka-Management/oms-Home.git"
+GITHUB[46]="https://github.com/Karaka-Management/oms-HumanResourceManagement.git"
+GITHUB[47]="https://github.com/Karaka-Management/oms-HumanResourceTimeRecording.git"
+GITHUB[48]="https://github.com/Karaka-Management/oms-IncomeStatement.git"
+GITHUB[49]="https://github.com/Karaka-Management/oms-InvestmentManagement.git"
+GITHUB[50]="https://github.com/Karaka-Management/oms-ItemManagement.git"
+GITHUB[51]="https://github.com/Karaka-Management/oms-Kanban.git"
+GITHUB[52]="https://github.com/Karaka-Management/oms-Knowledgebase.git"
+GITHUB[53]="https://github.com/Karaka-Management/oms-KPI.git"
+GITHUB[54]="https://github.com/Karaka-Management/oms-Labeling.git"
+GITHUB[55]="https://github.com/Karaka-Management/oms-LoanManagement.git"
+GITHUB[56]="https://github.com/Karaka-Management/oms-Logistics.git"
+GITHUB[57]="https://github.com/Karaka-Management/oms-LotTracking.git"
+GITHUB[58]="https://github.com/Karaka-Management/oms-Marketing.git"
+GITHUB[59]="https://github.com/Karaka-Management/oms-Media.git"
+GITHUB[60]="https://github.com/Karaka-Management/oms-Messages.git"
+GITHUB[61]="https://github.com/Karaka-Management/oms-Monitoring.git"
+GITHUB[62]="https://github.com/Karaka-Management/oms-MyPrivate.git"
+GITHUB[63]="https://github.com/Karaka-Management/oms-Navigation.git"
+GITHUB[64]="https://github.com/Karaka-Management/oms-News.git"
+GITHUB[65]="https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git"
+GITHUB[66]="https://github.com/Karaka-Management/oms-Organization.git"
+GITHUB[67]="https://github.com/Karaka-Management/oms-Payment.git"
+GITHUB[68]="https://github.com/Karaka-Management/oms-Payroll.git"
+GITHUB[69]="https://github.com/Karaka-Management/oms-Production.git"
+GITHUB[70]="https://github.com/Karaka-Management/oms-ProductionPlanning.git"
+GITHUB[71]="https://github.com/Karaka-Management/oms-Profile.git"
+GITHUB[72]="https://github.com/Karaka-Management/oms-ProjectManagement.git"
+GITHUB[73]="https://github.com/Karaka-Management/oms-Purchase.git"
+GITHUB[74]="https://github.com/Karaka-Management/oms-PurchaseAnalysis.git"
+GITHUB[75]="https://github.com/Karaka-Management/oms-QA.git"
+GITHUB[76]="https://github.com/Karaka-Management/oms-QualityAssurance.git"
+GITHUB[77]="https://github.com/Karaka-Management/oms-QualityControl.git"
+GITHUB[78]="https://github.com/Karaka-Management/oms-QualityManagement.git"
+GITHUB[79]="https://github.com/Karaka-Management/oms-ResearchDevelopment.git"
+GITHUB[80]="https://github.com/Karaka-Management/oms-RiskManagement.git"
+GITHUB[81]="https://github.com/Karaka-Management/oms-Sales.git"
+GITHUB[82]="https://github.com/Karaka-Management/oms-SalesAnalysis.git"
+GITHUB[83]="https://github.com/Karaka-Management/oms-Search.git"
+GITHUB[84]="https://github.com/Karaka-Management/oms-ShiftPlanning.git"
+GITHUB[85]="https://github.com/Karaka-Management/oms-Shipping.git"
+GITHUB[86]="https://github.com/Karaka-Management/oms-Shop.git"
+GITHUB[87]="https://github.com/Karaka-Management/oms-Spreadsheet.git"
+GITHUB[88]="https://github.com/Karaka-Management/oms-StockTaking.git"
+GITHUB[89]="https://github.com/Karaka-Management/oms-SupplierManagement.git"
+GITHUB[90]="https://github.com/Karaka-Management/oms-Support.git"
+GITHUB[91]="https://github.com/Karaka-Management/oms-Surveys.git"
+GITHUB[92]="https://github.com/Karaka-Management/oms-Tag.git"
+GITHUB[93]="https://github.com/Karaka-Management/oms-Tasks.git"
+GITHUB[94]="https://github.com/Karaka-Management/oms-TestModule.git"
+GITHUB[95]="https://github.com/Karaka-Management/oms-Tools.git"
+GITHUB[96]="https://github.com/Karaka-Management/oms-WarehouseManagement.git"
+GITHUB[97]="https://github.com/Karaka-Management/oms-Workflow.git"
+GITHUB[99]="https://github.com/Karaka-Management/phpOMS.git"
+
+for i in "${GITHUB[@]}"
+do
+ sh Build/php.sh "$i" ./src
+done
\ No newline at end of file
diff --git a/Inspection/Html/static_text.sh b/Inspection/Html/static_text.sh
index 8b003b8..670014c 100644
--- a/Inspection/Html/static_text.sh
+++ b/Inspection/Html/static_text.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-. config.sh
+. "${BUILD_PATH}/config.sh"
echo "#################################################"
echo "Start static text inspection"
echo "#################################################"
-grep -rlnP '(title|alt|aria\-label)(=\")((?!\<\?).)*(>)' --include \*.tpl.php Modules >> ${INSPECTION_PATH}/Modules/static_text.log
-grep -rlnP '(\| |\ | |\|\)[0-9a-zA-Z\.\?]+' --include \*.tpl.php Modules >> ${INSPECTION_PATH}/Modules/static_text.log
+grep -rlnP '(title|alt|aria\-label)(=\")((?!\<\?).)*(>)' --include \*.tpl.php ${INSPECTION_PATH} >> ${OUTPUT_PATH}/static_text.log
+grep -rlnP '(\| |\ | |\|\)[0-9a-zA-Z\.\?]+' --include \*.tpl.php ${INSPECTION_PATH} >> ${OUTPUT_PATH}/static_text.log
diff --git a/Inspection/Html/syntax.sh b/Inspection/Html/syntax.sh
index 4e37711..e61eda6 100644
--- a/Inspection/Html/syntax.sh
+++ b/Inspection/Html/syntax.sh
@@ -1,33 +1,20 @@
#!/bin/bash
-. config.sh
+. "${BUILD_PATH}/config.sh"
echo "#################################################"
echo "Start html syntax inspection"
echo "#################################################"
#
-echo "Image alt missing:" > ${INSPECTION_PATH}/Modules/html_syntax.log
-grep -rlnP '(\ )' --include \*.tpl.php Modules >> ${INSPECTION_PATH}/Modules/html_syntax.log
+echo "Image alt missing:" > ${OUTPUT_PATH}/html_syntax.log
+grep -rlnP '(\ )' --include \*.tpl.php ${INSPECTION_PATH} >> ${OUTPUT_PATH}/html_syntax.log
-echo "Input type missing:" >> ${INSPECTION_PATH}/Modules/html_syntax.log
-grep -rlnP '()' --include \*.tpl.php Modules >> ${INSPECTION_PATH}/Modules/html_syntax.log
+echo "Input type missing:" >> ${OUTPUT_PATH}/html_syntax.log
+grep -rlnP '()' --include \*.tpl.php ${INSPECTION_PATH} >> ${OUTPUT_PATH}/html_syntax.log
-echo "Input name missing:" >> ${INSPECTION_PATH}/Modules/html_syntax.log
-grep -rlnP '()' --include \*.tpl.php Modules >> ${INSPECTION_PATH}/Modules/html_syntax.log
+echo "Input name missing:" >> ${OUTPUT_PATH}/html_syntax.log
+grep -rlnP '()' --include \*.tpl.php ${INSPECTION_PATH} >> ${OUTPUT_PATH}/html_syntax.log
-echo "Form id missing:" >> ${INSPECTION_PATH}/Modules/html_syntax.log
-grep -rlnP '(\ | |