mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-02-08 12:58:43 +00:00
add address and client element support
This commit is contained in:
parent
176db29f64
commit
c76fcaabcf
|
|
@ -46,6 +46,14 @@
|
||||||
"null": false,
|
"null": false,
|
||||||
"foreignTable": "profile_account",
|
"foreignTable": "profile_account",
|
||||||
"foreignKey": "profile_account_id"
|
"foreignKey": "profile_account_id"
|
||||||
|
},
|
||||||
|
"clientmgmt_client_address": {
|
||||||
|
"name": "clientmgmt_client_address",
|
||||||
|
"type": "INT",
|
||||||
|
"null": true,
|
||||||
|
"default": null,
|
||||||
|
"foreignTable": "address",
|
||||||
|
"foreignKey": "address_id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -63,8 +71,8 @@
|
||||||
"name": "clientmgmt_client_contactelement_dst",
|
"name": "clientmgmt_client_contactelement_dst",
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
"null": false,
|
"null": false,
|
||||||
"foreignTable": "profile_contactelement",
|
"foreignTable": "profile_contact_element",
|
||||||
"foreignKey": "profile_contactelement_id"
|
"foreignKey": "profile_contact_element_id"
|
||||||
},
|
},
|
||||||
"clientmgmt_client_contactelement_src": {
|
"clientmgmt_client_contactelement_src": {
|
||||||
"name": "clientmgmt_client_contactelement_src",
|
"name": "clientmgmt_client_contactelement_src",
|
||||||
|
|
@ -72,11 +80,6 @@
|
||||||
"null": false,
|
"null": false,
|
||||||
"foreignTable": "clientmgmt_client",
|
"foreignTable": "clientmgmt_client",
|
||||||
"foreignKey": "clientmgmt_client_id"
|
"foreignKey": "clientmgmt_client_id"
|
||||||
},
|
|
||||||
"clientmgmt_client_contactelement_type": {
|
|
||||||
"name": "clientmgmt_client_contactelement_type",
|
|
||||||
"type": "TINYINT",
|
|
||||||
"null": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
43
Controller.js
Normal file
43
Controller.js
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
import { Autoloader } from '../../jsOMS/Autoloader.js';
|
||||||
|
import { NotificationMessage } from '../../jsOMS/Message/Notification/NotificationMessage.js';
|
||||||
|
import { NotificationType } from '../../jsOMS/Message/Notification/NotificationType.js';
|
||||||
|
|
||||||
|
Autoloader.defineNamespace('jsOMS.Modules');
|
||||||
|
|
||||||
|
jsOMS.Modules.ClientManager = class {
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
constructor (app)
|
||||||
|
{
|
||||||
|
this.app = app;
|
||||||
|
};
|
||||||
|
|
||||||
|
bind (id)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
const map = document.getElementById('iMap');
|
||||||
|
fetch(map.src).then(res => res.text()).then(data => {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const svg = parser.parseFromString(data, 'image/svg+xml').querySelector('svg');
|
||||||
|
|
||||||
|
if (map.id) svg.id = map.id;
|
||||||
|
if (map.className) svg.classList = map.classList;
|
||||||
|
|
||||||
|
map.parentNode.replaceChild(svg, map);
|
||||||
|
|
||||||
|
return svg;
|
||||||
|
})
|
||||||
|
.then(svg => {
|
||||||
|
//svg.setAttribute('width', 100);
|
||||||
|
//svg.setAttribute('height', 136);
|
||||||
|
//svg.setAttribute('viewbox', '0 0 1000 1360');
|
||||||
|
//svg.style.width = '100%';
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
window.omsApp.moduleManager.get('ClientManager').bind();
|
||||||
|
|
@ -19,6 +19,7 @@ use phpOMS\Contract\RenderableInterface;
|
||||||
use phpOMS\Message\RequestAbstract;
|
use phpOMS\Message\RequestAbstract;
|
||||||
use phpOMS\Message\ResponseAbstract;
|
use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Views\View;
|
use phpOMS\Views\View;
|
||||||
|
use phpOMS\Asset\AssetType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClientManagement class.
|
* ClientManagement class.
|
||||||
|
|
@ -45,7 +46,7 @@ final class BackendController extends Controller
|
||||||
public function viewClientManagementClientList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewClientManagementClientList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/ClientManagement/Theme/Backend/clients-list');
|
$view->setTemplate('/Modules/ClientManagement/Theme/Backend/client-list');
|
||||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003102001, $request, $response));
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003102001, $request, $response));
|
||||||
|
|
||||||
$client = ClientMapper::getAll();
|
$client = ClientMapper::getAll();
|
||||||
|
|
@ -69,7 +70,7 @@ final class BackendController extends Controller
|
||||||
public function viewClientManagementClientCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewClientManagementClientCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/ClientManagement/Theme/Backend/clients-create');
|
$view->setTemplate('/Modules/ClientManagement/Theme/Backend/client-create');
|
||||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003102001, $request, $response));
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003102001, $request, $response));
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
|
|
@ -89,8 +90,11 @@ final class BackendController extends Controller
|
||||||
*/
|
*/
|
||||||
public function viewClientManagementClientProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewClientManagementClientProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
|
$head = $response->get('Content')->getData('head');
|
||||||
|
$head->addAsset(AssetType::JSLATE, 'Modules/ClientManagement/Controller.js', ['type' => 'module']);
|
||||||
|
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/ClientManagement/Theme/Backend/clients-profile');
|
$view->setTemplate('/Modules/ClientManagement/Theme/Backend/client-profile');
|
||||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003102001, $request, $response));
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003102001, $request, $response));
|
||||||
|
|
||||||
$client = ClientMapper::get((int) $request->getData('id'));
|
$client = ClientMapper::get((int) $request->getData('id'));
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,11 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\ClientManagement\Models;
|
namespace Modules\ClientManagement\Models;
|
||||||
|
|
||||||
|
use Modules\Admin\Models\NullAddress;
|
||||||
use Modules\Media\Models\Media;
|
use Modules\Media\Models\Media;
|
||||||
use Modules\Profile\Models\Profile;
|
use Modules\Profile\Models\Profile;
|
||||||
|
use Modules\Profile\Models\ContactElement;
|
||||||
|
use Modules\Profile\Models\NullContactElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Account class.
|
* Account class.
|
||||||
|
|
@ -49,6 +52,8 @@ class Client
|
||||||
|
|
||||||
private array $contactElements = [];
|
private array $contactElements = [];
|
||||||
|
|
||||||
|
private $mainAddress = null;
|
||||||
|
|
||||||
private array $address = [];
|
private array $address = [];
|
||||||
|
|
||||||
private array $partners = [];
|
private array $partners = [];
|
||||||
|
|
@ -70,6 +75,7 @@ class Client
|
||||||
{
|
{
|
||||||
$this->createdAt = new \DateTimeImmutable('now');
|
$this->createdAt = new \DateTimeImmutable('now');
|
||||||
$this->profile = new Profile();
|
$this->profile = new Profile();
|
||||||
|
$this->mainAddress = new NullAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -334,6 +340,16 @@ class Client
|
||||||
$this->profile = $profile;
|
$this->profile = $profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setMainAddress($address) : void
|
||||||
|
{
|
||||||
|
$this->mainAddress = $address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMainAddress()
|
||||||
|
{
|
||||||
|
return $this->mainAddress;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get media.
|
* Get media.
|
||||||
*
|
*
|
||||||
|
|
@ -383,4 +399,27 @@ class Client
|
||||||
{
|
{
|
||||||
return $this->contactElements;
|
return $this->contactElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function orderContactElements(ContactElement $a, ContactElement $b) : int
|
||||||
|
{
|
||||||
|
return $a->getOrder() <=> $b->getOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMainContactElement(int $type) : ContactElement
|
||||||
|
{
|
||||||
|
\uasort($this->contactElements, [$this, 'orderContactElements']);
|
||||||
|
|
||||||
|
foreach ($this->contactElements as $element) {
|
||||||
|
if ($element->getType() === $type) {
|
||||||
|
return $element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new NullContactElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addContactElement($element) : void
|
||||||
|
{
|
||||||
|
$this->contactElements[] = $element;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\ClientManagement\Models;
|
namespace Modules\ClientManagement\Models;
|
||||||
|
|
||||||
|
use Modules\Admin\Models\AddressMapper;
|
||||||
use Modules\Media\Models\MediaMapper;
|
use Modules\Media\Models\MediaMapper;
|
||||||
use Modules\Profile\Models\ContactElementMapper;
|
use Modules\Profile\Models\ContactElementMapper;
|
||||||
use Modules\Profile\Models\ProfileMapper;
|
use Modules\Profile\Models\ProfileMapper;
|
||||||
|
|
@ -44,6 +45,7 @@ final class ClientMapper extends DataMapperAbstract
|
||||||
'clientmgmt_client_info' => ['name' => 'clientmgmt_client_info', 'type' => 'string', 'internal' => 'info'],
|
'clientmgmt_client_info' => ['name' => 'clientmgmt_client_info', 'type' => 'string', 'internal' => 'info'],
|
||||||
'clientmgmt_client_created_at' => ['name' => 'clientmgmt_client_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
'clientmgmt_client_created_at' => ['name' => 'clientmgmt_client_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||||
'clientmgmt_client_profile' => ['name' => 'clientmgmt_client_profile', 'type' => 'int', 'internal' => 'profile'],
|
'clientmgmt_client_profile' => ['name' => 'clientmgmt_client_profile', 'type' => 'int', 'internal' => 'profile'],
|
||||||
|
'clientmgmt_client_address' => ['name' => 'clientmgmt_client_address', 'type' => 'int', 'internal' => 'mainAddress'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -81,6 +83,10 @@ final class ClientMapper extends DataMapperAbstract
|
||||||
'mapper' => ProfileMapper::class,
|
'mapper' => ProfileMapper::class,
|
||||||
'self' => 'clientmgmt_client_profile',
|
'self' => 'clientmgmt_client_profile',
|
||||||
],
|
],
|
||||||
|
'mainAddress' => [
|
||||||
|
'mapper' => AddressMapper::class,
|
||||||
|
'self' => 'clientmgmt_client_address',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -99,8 +105,8 @@ final class ClientMapper extends DataMapperAbstract
|
||||||
'contactElements' => [
|
'contactElements' => [
|
||||||
'mapper' => ContactElementMapper::class,
|
'mapper' => ContactElementMapper::class,
|
||||||
'table' => 'clientmgmt_client_contactelement',
|
'table' => 'clientmgmt_client_contactelement',
|
||||||
'external' => 'clientmgmt_client_contactelement_dst',
|
'external' => 'clientmgmt_client_contactelement_src',
|
||||||
'self' => 'clientmgmt_client_contactelement_src',
|
'self' => 'clientmgmt_client_contactelement_dst',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
64
Theme/Backend/client-list.tpl.php
Normal file
64
Theme/Backend/client-list.tpl.php
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.4
|
||||||
|
*
|
||||||
|
* @package Modules\ClientManagement
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
|
/** @var \phpOMS\Views\View $this */
|
||||||
|
$clients = $this->getData('client');
|
||||||
|
|
||||||
|
echo $this->getData('nav')->render(); ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<section class="portlet">
|
||||||
|
<div class="portlet-head"><?= $this->getHtml('Clients'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
||||||
|
<table id="iSalesClientList" class="default">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||||
|
<input id="clientList-r1-asc" name="clientList-sort" type="radio"><label for="clientList-r1-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
|
||||||
|
<input id="clientList-r1-desc" name="clientList-sort" type="radio"><label for="clientList-r1-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
|
||||||
|
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||||
|
<input id="clientList-r2-asc" name="clientList-sort" type="radio"><label for="clientList-r2-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
|
||||||
|
<input id="clientList-r2-desc" name="clientList-sort" type="radio"><label for="clientList-r2-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
|
||||||
|
<td><?= $this->getHtml('City'); ?>
|
||||||
|
<input id="clientList-r5-asc" name="clientList-sort" type="radio"><label for="clientList-r5-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
|
||||||
|
<input id="clientList-r5-desc" name="clientList-sort" type="radio"><label for="clientList-r5-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
|
||||||
|
<td><?= $this->getHtml('Zip'); ?>
|
||||||
|
<input id="clientList-r6-asc" name="clientList-sort" type="radio"><label for="clientList-r6-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
|
||||||
|
<input id="clientList-r6-desc" name="clientList-sort" type="radio"><label for="clientList-r6-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
|
||||||
|
<td><?= $this->getHtml('Address'); ?>
|
||||||
|
<input id="clientList-r7-asc" name="clientList-sort" type="radio"><label for="clientList-r7-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
|
||||||
|
<input id="clientList-r7-desc" name="clientList-sort" type="radio"><label for="clientList-r7-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
|
||||||
|
<td><?= $this->getHtml('Country'); ?>
|
||||||
|
<input id="clientList-r8-asc" name="clientList-sort" type="radio"><label for="clientList-r8-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
|
||||||
|
<input id="clientList-r8-desc" name="clientList-sort" type="radio"><label for="clientList-r8-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
|
||||||
|
<tbody>
|
||||||
|
<?php $count = 0; foreach ($clients as $key => $value) : ++$count;
|
||||||
|
$url = UriFactory::build('{/prefix}sales/client/profile?{?}&id=' . $value->getId()); ?>
|
||||||
|
<tr data-href="<?= $url; ?>">
|
||||||
|
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getNumber()); ?></a>
|
||||||
|
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getProfile()->getAccount()->getName1()); ?> <?= $this->printHtml($value->getProfile()->getAccount()->getName2()); ?></a>
|
||||||
|
<td data-label="<?= $this->getHtml('City'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getMainAddress()->getCity()); ?></a>
|
||||||
|
<td data-label="<?= $this->getHtml('Zip'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getMainAddress()->getPostal()); ?></a>
|
||||||
|
<td data-label="<?= $this->getHtml('Address'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getMainAddress()->getAddress()); ?></a>
|
||||||
|
<td data-label="<?= $this->getHtml('Country'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getMainAddress()->getCountry()); ?></a>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -12,6 +12,12 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Modules\Profile\Models\ContactType;
|
||||||
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
|
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
|
||||||
|
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Modules\ClientManagement\Models\Client $client
|
* @var \Modules\ClientManagement\Models\Client $client
|
||||||
*/
|
*/
|
||||||
|
|
@ -63,11 +69,6 @@ echo $this->getData('nav')->render();
|
||||||
<tr><td><input type="text" id="iName2" name="name2" value="<?= $this->printHtml($client->getProfile()->getAccount()->getName2()); ?>">
|
<tr><td><input type="text" id="iName2" name="name2" value="<?= $this->printHtml($client->getProfile()->getAccount()->getName2()); ?>">
|
||||||
<tr><td><label for="iName3"><?= $this->getHtml('Name3'); ?></label>
|
<tr><td><label for="iName3"><?= $this->getHtml('Name3'); ?></label>
|
||||||
<tr><td><input type="text" id="iName3" name="name3" value="<?= $this->printHtml($client->getProfile()->getAccount()->getName3()); ?>">
|
<tr><td><input type="text" id="iName3" name="name3" value="<?= $this->printHtml($client->getProfile()->getAccount()->getName3()); ?>">
|
||||||
<tr><td>Address
|
|
||||||
<tr><td>
|
|
||||||
<tr><td>
|
|
||||||
<tr><td>
|
|
||||||
<tr><td>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-foot">
|
<div class="portlet-foot">
|
||||||
|
|
@ -76,27 +77,48 @@ echo $this->getData('nav')->render();
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="portlet highlight-4">
|
<section class="portlet">
|
||||||
|
<div class="portlet-head">Contact</div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<textarea class="undecorated"></textarea>
|
<table class="layout wf-100">
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Phone'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::PHONE)->getContent()); ?>">
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Email'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::EMAIL)->getContent()); ?>">
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Website'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::WEBSITE)->getContent()); ?>">
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="portlet">
|
<section class="portlet">
|
||||||
<div class="portlet-head">Contact</div>
|
<div class="portlet-head"><?= $this->getHtml('Address'); ?></div>
|
||||||
|
<div class="portlet-body">
|
||||||
|
<table class="layout wf-100">
|
||||||
|
<?php if (!empty($client->getMainAddress()->getAddition())) : ?>
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Addition'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainAddress()->getAddition()); ?>">
|
||||||
|
<?php endif; ?>
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Address'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainAddress()->getAddress()); ?>" required>
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Postal'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainAddress()->getPostal()); ?>" required>
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('City'); ?></label>
|
||||||
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainAddress()->getCity()); ?>" required>
|
||||||
|
<tr><td><label for="iName1"><?= $this->getHtml('Country'); ?></label>
|
||||||
|
<tr><td><select>
|
||||||
|
<?php foreach ($countryCodes as $code3 => $code2) : ?>
|
||||||
|
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $client->getMainAddress()->getCountry() ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<tr><td><img id="iMap" style="width: 100%;" src="<?= UriFactory::build('phpOMS/Localization/Maps/svg/' . \strtolower($client->getMainAddress()->getCountry()) . '.svg'); ?>">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="portlet highlight-4">
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<table>
|
<textarea class="undecorated"><?= $this->printHtml($client->getInfo()); ?></textarea>
|
||||||
<tr><td>Main:
|
|
||||||
<tr><td>Phone:
|
|
||||||
<td>
|
|
||||||
<tr><td>Email:
|
|
||||||
<td>
|
|
||||||
<tr><td>Accounting:
|
|
||||||
<tr><td>Phone:
|
|
||||||
<td>
|
|
||||||
<tr><td>Email:
|
|
||||||
<td>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -325,7 +347,7 @@ echo $this->getData('nav')->render();
|
||||||
<section class="box wf-100">
|
<section class="box wf-100">
|
||||||
<header><h1><?= $this->getHtml('Price'); ?></h1></header>
|
<header><h1><?= $this->getHtml('Price'); ?></h1></header>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<form action="<?= \phpOMS\Uri\UriFactory::build('{/api}...'); ?>" method="post">
|
<form action="<?= UriFactory::build('{/api}...'); ?>" method="post">
|
||||||
<table class="layout wf-100">
|
<table class="layout wf-100">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td colspan="2"><label for="iPType"><?= $this->getHtml('Type'); ?></label>
|
<tr><td colspan="2"><label for="iPType"><?= $this->getHtml('Type'); ?></label>
|
||||||
|
|
@ -367,7 +389,7 @@ echo $this->getData('nav')->render();
|
||||||
<section class="box wf-100">
|
<section class="box wf-100">
|
||||||
<header><h1><?= $this->getHtml('AreaManager'); ?></h1></header>
|
<header><h1><?= $this->getHtml('AreaManager'); ?></h1></header>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<form action="<?= \phpOMS\Uri\UriFactory::build('{/api}...'); ?>" method="post">
|
<form action="<?= UriFactory::build('{/api}...'); ?>" method="post">
|
||||||
<table class="layout wf-100">
|
<table class="layout wf-100">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td><label for="iManager"><?= $this->getHtml('AreaManager'); ?></label>
|
<tr><td><label for="iManager"><?= $this->getHtml('AreaManager'); ?></label>
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Orange Management
|
|
||||||
*
|
|
||||||
* PHP Version 7.4
|
|
||||||
*
|
|
||||||
* @package Modules\ClientManagement
|
|
||||||
* @copyright Dennis Eichhorn
|
|
||||||
* @license OMS License 1.0
|
|
||||||
* @version 1.0.0
|
|
||||||
* @link https://orange-management.org
|
|
||||||
*/
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use phpOMS\Uri\UriFactory;
|
|
||||||
|
|
||||||
/** @var \phpOMS\Views\View $this */
|
|
||||||
$clients = $this->getData('client');
|
|
||||||
|
|
||||||
echo $this->getData('nav')->render(); ?>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<section class="portlet">
|
|
||||||
<div class="portlet-head"><?= $this->getHtml('Clients'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
|
||||||
<table class="default">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
|
||||||
<td><?= $this->getHtml('Name1'); ?>
|
|
||||||
<td><?= $this->getHtml('Name2'); ?>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('Name3'); ?>
|
|
||||||
<td><?= $this->getHtml('City'); ?>
|
|
||||||
<td><?= $this->getHtml('Zip'); ?>
|
|
||||||
<td><?= $this->getHtml('Address'); ?>
|
|
||||||
<td><?= $this->getHtml('Country'); ?>
|
|
||||||
<tbody>
|
|
||||||
<?php $count = 0; foreach ($clients as $key => $value) : ++$count;
|
|
||||||
$url = UriFactory::build('{/prefix}sales/client/profile?{?}&id=' . $value->getId()); ?>
|
|
||||||
<tr data-href="<?= $url; ?>">
|
|
||||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getNumber()); ?></a>
|
|
||||||
<td data-label="<?= $this->getHtml('Name1'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getProfile()->getAccount()->getName1()); ?></a>
|
|
||||||
<td data-label="<?= $this->getHtml('Name2'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getProfile()->getAccount()->getName2()); ?></a>
|
|
||||||
<td data-label="<?= $this->getHtml('Name3'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getProfile()->getAccount()->getName3()); ?></a>
|
|
||||||
<td data-label="<?= $this->getHtml('City'); ?>">
|
|
||||||
<td data-label="<?= $this->getHtml('Zip'); ?>">
|
|
||||||
<td data-label="<?= $this->getHtml('Address'); ?>">
|
|
||||||
<td data-label="<?= $this->getHtml('Country'); ?>">
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ($count === 0) : ?>
|
|
||||||
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
Loading…
Reference in New Issue
Block a user