diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index adb8716..75cb759 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,5 +9,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' + issue-message: 'Thank you for creating this issue. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.' diff --git a/Controller/BackendController.php b/Controller/BackendController.php index d46efde..39d6cc4 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,7 +14,6 @@ declare(strict_types=1); namespace Modules\Sales\Controller; -use Modules\Sales\Models\SalesRep; use Modules\Sales\Models\SalesRepMapper; use phpOMS\Contract\RenderableInterface; use phpOMS\Message\RequestAbstract; @@ -48,7 +47,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Sales/Theme/Backend/rep-list'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001601001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response); $view->data['rep'] = SalesRepMapper::getAll() ->with('main') @@ -74,10 +73,11 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Sales/Theme/Backend/rep-view'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001601001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response); $view->data['rep'] = SalesRepMapper::get() ->with('main') + ->where('id', (int) $request->getData('id')) ->execute(); return $view; @@ -99,7 +99,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Sales/Theme/Backend/rep-view'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001601001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response); return $view; } diff --git a/Models/NullSalesRep.php b/Models/NullSalesRep.php index 2f1b4ed..578dda7 100644 --- a/Models/NullSalesRep.php +++ b/Models/NullSalesRep.php @@ -34,7 +34,6 @@ final class NullSalesRep extends SalesRep public function __construct(int $id = 0) { $this->id = $id; - parent::__construct(); } /** diff --git a/Models/SalesRep.php b/Models/SalesRep.php index da76504..6e36202 100644 --- a/Models/SalesRep.php +++ b/Models/SalesRep.php @@ -45,13 +45,4 @@ class SalesRep public ?Account $main = null; public array $accounts = []; - - /** - * Constructor - * - * @since 1.0.0 - */ - public function __construct() - { - } } diff --git a/Models/SalesRepMapper.php b/Models/SalesRepMapper.php index 36da173..151b8b3 100644 --- a/Models/SalesRepMapper.php +++ b/Models/SalesRepMapper.php @@ -71,19 +71,4 @@ final class SalesRepMapper extends DataMapperFactory 'external' => 'sales_rep_main', ], ]; - - /** - * Has many relation. - * - * @var array - * @since 1.0.0 - */ - public const HAS_MANY = [ - 'files' => [ - 'mapper' => MediaMapper::class, /* mapper of the related object */ - 'table' => 'sales_rep_media', /* table of the related object, null if no relation table is used (many->1) */ - 'external' => 'sales_rep_media_dst', - 'self' => 'sales_rep_media_src', - ], - ]; } diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index 519f9c9..1b00318 100755 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -14,7 +14,7 @@ declare(strict_types=1); return ['Navigation' => [ 'Sales' => 'Sales', - 'SalesReps' => 'SalesReps', + 'SalesReps' => 'Sales Reps', 'List' => 'List', 'Create' => 'Create', ]]; diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 81037a5..21a5fea 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -103,6 +103,7 @@ return ['Sales' => [ 'Turnover' => 'Umsatz', 'Type' => 'Typ', 'ZipCode' => 'Postleitzahl', + 'Code' => 'Kodierung', 'SalesRep' => 'Verkäufer', 'SalesReps' => 'Verkäufer', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 0eaf2cc..33f0182 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -102,7 +102,8 @@ return ['Sales' => [ 'Trend' => 'Trend', 'Turnover' => 'Turnover', 'Type' => 'Type', - 'ZipCode' => 'ZipCode', + 'ZipCode' => 'Zip Code', + 'Code' => 'Code', 'SalesRep' => 'Sales Rep', 'SalesReps' => 'Sales Reps', ]]; diff --git a/Theme/Backend/rep-view.tpl.php b/Theme/Backend/rep-view.tpl.php index e69de29..98612d0 100644 --- a/Theme/Backend/rep-view.tpl.php +++ b/Theme/Backend/rep-view.tpl.php @@ -0,0 +1,72 @@ +data['rep'] ?? new NullSalesRep(); +$isNew = $rep->id === 0; + +echo $this->data['nav']->render(); ?> +
+
+
+
> +
getHtml('SalesRep'); ?>
+
+
+ + +
+ +
+ +
+
printHtml($rep->main?->name1); ?> printHtml($rep->main?->name2); ?>
+ +
+
+
+
+
+ + + + + +
+
+
+
+