auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:54:00 +00:00
parent ccb2f80638
commit ef17a40bbe
8 changed files with 78 additions and 55 deletions

View File

@ -10,37 +10,37 @@ return [
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/components(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/components(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewComponents',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/imprint(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/imprint(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewImprint',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/terms(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/terms(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewTerms',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/privacy(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/privacy(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewDataPrivacy',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/list(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/list(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewList',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/item(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/item(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewItem',
'verb' => RouteVerb::GET,

View File

@ -16,7 +16,7 @@ declare(strict_types=1);
<div class="content">
<div class="floater">
<h1>Imprint</h1>
<p>Karaka</p>
<p>Jingga</p>
<h2>Vertreten durch</h2>
<p>Dennis Eichhorn</p>
@ -31,7 +31,7 @@ declare(strict_types=1);
<p>Nicht vorhanden</p>
<h2>Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV</h2>
<p>Karaka</p>
<p>Jingga</p>
<p>Dennis Eichhorn</p>
<h2>Datenschutzbeauftragter</h2>

View File

@ -16,7 +16,7 @@ declare(strict_types=1);
<div class="content">
<div class="floater">
<h1>Privacy Policy</h1>
<p>This privacy policy ("POLICY") will help you understand how [name] ("us", "we", "our") uses and protects the data you provide to us when you visit and use Karaka ("website", "service" and "application").</p>
<p>This privacy policy ("POLICY") will help you understand how [name] ("us", "we", "our") uses and protects the data you provide to us when you visit and use Jingga ("website", "service" and "application").</p>
<h2>Definitions</h2>
<p>For the purposes of these POLICIES:<p>
@ -24,7 +24,7 @@ declare(strict_types=1);
<ul>
<li>AFFILIATED means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.</li>
<li>COUNTRY refers to Germany</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Karaka, Kirchstr. 33, 61191 Rosbach.</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Jingga, Kirchstr. 33, 61191 Rosbach.</li>
<li>DEVICE means any device that can access the SERVICE such as a computer, a cellphone or a digital tablet.</li>
<li>SERVICE refers to the Website</li>
<li>POLICY or AGREEMENT mean these policies that form the entire agreement between You and the COMPANY regarding the use of the SERVICE.</li>
@ -55,7 +55,7 @@ declare(strict_types=1);
</ul>
<h2>Safeguarding and Securing the Data</h2>
<p>Karaka is committed to securing your data and keeping it confidential. Karaka has done all in its power to prevent data theft, unauthorized access, and disclosure by implementing the latest technologies and software, which help us safeguard all the information we collect online.</p>
<p>Jingga is committed to securing your data and keeping it confidential. Jingga has done all in its power to prevent data theft, unauthorized access, and disclosure by implementing the latest technologies and software, which help us safeguard all the information we collect online.</p>
<h2>Our Cookie Policy</h2>
<p>Once you agree to allow our WEBSITE or APPLICATION to use cookies, you also agree to these POLICIES.</p>
@ -76,7 +76,7 @@ declare(strict_types=1);
<li>If you have already agreed to share your information with us, feel free to contact us via email and we will be more than happy to change this for you.</li>
</ul>
<p>Karaka will not lease, sell or distribute your personal information to any third parties, unless we have your permission. We might do so if the law forces us. Your personal information will be used when we need to send you promotional materials if you agree to this privacy policy.</p>
<p>Jingga will not lease, sell or distribute your personal information to any third parties, unless we have your permission. We might do so if the law forces us. Your personal information will be used when we need to send you promotional materials if you agree to this privacy policy.</p>
<h2>Governing Law</h2>
<p>The laws of the COUNTRY, excluding its conflicts of law rules, shall govern this POLICY and Your use of the SERVICE. Your use of the APPLICATION may also be subject to other local, state, national, or international laws.</p>

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
<ul>
<li>AFFILIATED means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.</li>
<li>COUNTRY refers to Germany</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Karaka, Kirchstr. 33, 61191 Rosbach.</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Jingga, Kirchstr. 33, 61191 Rosbach.</li>
<li>DEVICE means any device that can access the Service such as a computer, a cellphone or a digital tablet.</li>
<li>SERVICE refers to the Website</li>
<li>TERMS or AGREEMENT mean these terms that form the entire agreement between You and the COMPANY regarding the use of the SERVICE.</li>
@ -41,7 +41,7 @@ declare(strict_types=1);
<p>Your access to and use of the SERVICE is also conditioned on Your acceptance of and compliance with the Privacy Policy of the COMPANY. Our Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your personal information when You use the Application or the WEBSITE and tells You about Your privacy rights and how the law protects You. Please read Our Privacy Policy carefully before using Our SERVICE.</p>
<h2>Copyright</h2>
<p>Unless otherwise noted, all materials including without limitation, logos, brand names, images, designs, photographs, videos, audio, source code and written and other materials that appear as part of our WEBSITE are copyrights, trademarks, service marks, trade dress and/or other intellectual property whether registered or unregistered ("Intellectual Property") owned, controlled or licensed by Karaka. Our WEBSITE as a whole is protected by copyright and trade dress. Nothing on our WEBSITE should be construed as granting, by implication, estoppel or otherwise, any license or right to use any Intellectual Property displayed or used on our WEBSITE, without the prior written permission of the Intellectual Property owner. Karaka aggressively enforces its intellectual property rights to the fullest extent of the law. The names and logos of Karaka, may not be used in any way, including in advertising or publicity pertaining to distribution of materials on our WEBSITE, without prior, written permission from Karaka. Karaka prohibits use of any logo of Karaka or any of its affiliates as part of a link to or from any WEBSITE unless Karaka approves such link in advance and in writing. Fair use of Karaka Intellectual Property requires proper acknowledgment. Other product and company names mentioned in our Website may be the Intellectual Property of their respective owners.</p>
<p>Unless otherwise noted, all materials including without limitation, logos, brand names, images, designs, photographs, videos, audio, source code and written and other materials that appear as part of our WEBSITE are copyrights, trademarks, service marks, trade dress and/or other intellectual property whether registered or unregistered ("Intellectual Property") owned, controlled or licensed by Jingga. Our WEBSITE as a whole is protected by copyright and trade dress. Nothing on our WEBSITE should be construed as granting, by implication, estoppel or otherwise, any license or right to use any Intellectual Property displayed or used on our WEBSITE, without the prior written permission of the Intellectual Property owner. Jingga aggressively enforces its intellectual property rights to the fullest extent of the law. The names and logos of Jingga, may not be used in any way, including in advertising or publicity pertaining to distribution of materials on our WEBSITE, without prior, written permission from Jingga. Jingga prohibits use of any logo of Jingga or any of its affiliates as part of a link to or from any WEBSITE unless Jingga approves such link in advance and in writing. Fair use of Jingga Intellectual Property requires proper acknowledgment. Other product and company names mentioned in our Website may be the Intellectual Property of their respective owners.</p>
<h2>Links</h2>
<p>Our SERVICE may contain links to third-party web sites or services that are not owned or controlled by the COMPANY.</p>

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/shop/oneclick/buy.*$' => [
'^.*/shop/oneclick/buy(\?.*$|$)' => [
[
'dest' => '\Modules\Shop\Controller\ApiController:apiOneClickBuy',
'verb' => RouteVerb::GET,
@ -29,7 +29,7 @@ return [
],
],
],
'^.*/shop/media/download.*$' => [
'^.*/shop/media/download(\?.*$|$)' => [
[
'dest' => '\Modules\Shop\Controller\ApiController:apiItemFileDownload',
'verb' => RouteVerb::GET,

View File

@ -15,6 +15,7 @@ declare(strict_types=1);
namespace Modules\Shop\Controller;
use Modules\Admin\Models\AccountMapper;
use Modules\Billing\Models\BillElementMapper;
use Modules\Billing\Models\BillMapper;
use Modules\Billing\Models\BillStatus;
use Modules\ClientManagement\Models\ClientMapper;
@ -96,7 +97,7 @@ final class ApiController extends Controller
$items = [];
foreach ($bills as $bill) {
$elements = $bill->getElements();
$elements = $bill->elements;
foreach ($elements as $element) {
/** @var \Modules\ItemManagement\Models\Item $item */
@ -322,12 +323,12 @@ final class ApiController extends Controller
if ($client->id === 0) {
/** @var \Modules\Admin\Models\Account $account */
$account = AccountMapper::get()
->with('locations')
->with('addresses')
->where('id', $request->header->account)
->execute();
// @todo what if the primary address is not in position 1?
$address = \reset($account->locations);
$address = \reset($account->addresses);
$address = $address === false ? new NullAddress() : $address;
$internalRequest = new HttpRequest();
@ -354,6 +355,10 @@ final class ApiController extends Controller
->with('attributes/value')
->with('account')
->where('account', $request->header->account)
->where('attributes/type/name', [
'segment', 'section', 'client_group', 'client_type',
'sales_tax_code',
], 'IN')
->execute();
}
@ -386,19 +391,26 @@ final class ApiController extends Controller
->with('attributes/value')
->with('l11n/type')
->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN')
->where('l11n/language', $bill->language);
->where('l11n/language', $bill->language)
->where('attributes/type/name', [
'segment', 'section', 'sales_group', 'product_group', 'product_type',
'sales_tax_code', 'purchase_tax_code', 'costcenter', 'costobject',
'default_purchase_container', 'default_sales_container',
'one_click_pay_cc', 'subscription',
], 'IN');
/** @var \Modules\ItemManagement\Models\Item $item */
$item = $itemMapper->execute();
// @todo consider to first create an offer = cart and only when paid turn it into an invoice. This way it's also easy to analyse the conversion rate.
$billElement = $this->app->moduleManager->get('Billing', 'ApiBill')->createBaseBillElement($client, $item, $bill, $request);
$billElement = $this->app->moduleManager->get('Billing', 'ApiBill')->createBaseBillElement($item, $bill, $request);
$bill->addElement($billElement);
$this->updateModel($request->header->account, $old, $bill, BillMapper::class, 'bill_element', $request->getOrigin());
$this->createModel($request->header->account, null, $billElement, BillElementMapper::class, 'bill_element', $request->getOrigin());
$this->updateModel($request->header->account, $old, $bill, BillMapper::class, 'bill', $request->getOrigin());
// @tood: make this configurable (either from the customer payment info or some item default setting)!!!
// @todo make this configurable (either from the customer payment info or some item default setting)!!!
if ($item->getAttribute('subscription')->value->getValue() === 1) {
$response->header->status = RequestStatusCode::R_303;
$response->header->set(

View File

@ -75,8 +75,8 @@ final class Autoloader
*/
public static function defaultAutoloader(string $class) : void
{
$class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//');
$class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//');
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);

View File

@ -1,4 +1,15 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Shop\tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
\ini_set('memory_limit', '2048M');
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
$CONFIG = [
'db' => [
'db' => [
'core' => [
'masters' => [
'admin' => [
'admin' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -80,7 +91,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -90,7 +101,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -100,7 +111,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -110,7 +121,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -120,7 +131,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -132,7 +143,7 @@ $CONFIG = [
],
],
'postgresql' => [
'admin' => [
'admin' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -142,7 +153,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -152,7 +163,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -162,7 +173,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -172,7 +183,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -182,7 +193,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -194,37 +205,37 @@ $CONFIG = [
],
],
'sqlite' => [
'admin' => [
'admin' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
@ -232,7 +243,7 @@ $CONFIG = [
],
],
'mssql' => [
'admin' => [
'admin' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -242,7 +253,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -252,7 +263,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -262,7 +273,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -272,7 +283,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -282,7 +293,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -322,16 +333,16 @@ $CONFIG = [
'password' => '123456',
],
],
'log' => [
'log' => [
'file' => [
'path' => __DIR__ . '/Logs',
],
],
'page' => [
'page' => [
'root' => '/',
'https' => false,
],
'app' => [
'app' => [
'path' => __DIR__,
'default' => [
'app' => 'Backend',
@ -350,7 +361,7 @@ $CONFIG = [
],
],
],
'socket' => [
'socket' => [
'master' => [
'host' => '127.0.0.1',
'limit' => 300,
@ -360,7 +371,7 @@ $CONFIG = [
'language' => [
'en',
],
'apis' => [
'apis' => [
],
];