bug fixes and subscription improvements

This commit is contained in:
Dennis Eichhorn 2023-04-25 01:51:27 +00:00
parent ab53291e37
commit f431897c0c
3 changed files with 6 additions and 88 deletions

View File

@ -15,8 +15,8 @@ jsOMS.Modules.ClientManagement = class {
bind (id) bind (id)
{ {
const charts = typeof id === 'undefined' ? document.getElementsByTagName('canvas') : [document.getElementById(id)]; const charts = typeof id === 'undefined' ? document.getElementsByTagName('canvas') : [document.getElementById(id)];
let length = charts.length; let length = charts.length;
for (let i = 0; i < length; ++i) { for (let i = 0; i < length; ++i) {
if (charts[i].getAttribute('data-chart') === null if (charts[i].getAttribute('data-chart') === null
@ -28,8 +28,8 @@ jsOMS.Modules.ClientManagement = class {
this.bindChart(charts[i]); this.bindChart(charts[i]);
} }
const maps = typeof id === 'undefined' ? document.getElementsByClassName('map') : [document.getElementById(id)]; const maps = typeof id === 'undefined' ? document.getElementsByClassName('map') : [document.getElementById(id)];
length = maps.length; length = maps.length;
for (let i = 0; i < length; ++i) { for (let i = 0; i < length; ++i) {
this.bindMap(maps[i]); this.bindMap(maps[i]);

View File

@ -19,7 +19,6 @@ use Modules\Admin\Models\Address;
use Modules\Admin\Models\NullAddress; use Modules\Admin\Models\NullAddress;
use Modules\Editor\Models\EditorDoc; use Modules\Editor\Models\EditorDoc;
use Modules\Media\Models\Media; use Modules\Media\Models\Media;
use Modules\Media\Models\NullMedia;
use Modules\Payment\Models\Payment; use Modules\Payment\Models\Payment;
use Modules\Profile\Models\ContactElement; use Modules\Profile\Models\ContactElement;
use Modules\Profile\Models\NullContactElement; use Modules\Profile\Models\NullContactElement;
@ -51,14 +50,6 @@ class Client
public Account $account; public Account $account;
/**
* Attributes.
*
* @var \Modules\Attribute\Models\Attribute[]
* @since 1.0.0
*/
private array $attributes = [];
/** /**
* Payments. * Payments.
* *
@ -75,14 +66,6 @@ class Client
*/ */
private array $notes = []; private array $notes = [];
/**
* Files.
*
* @var Media[]
* @since 1.0.0
*/
private array $files = [];
private array $contactElements = []; private array $contactElements = [];
public Address $mainAddress; public Address $mainAddress;
@ -209,20 +192,6 @@ class Client
return $this->notes; return $this->notes;
} }
/**
* Add media.
*
* @param Media $file Media
*
* @return void
*
* @since 1.0.0
*/
public function addFile(Media $file) : void
{
$this->files[] = $file;
}
/** /**
* Get addresses. * Get addresses.
* *
@ -358,58 +327,6 @@ class Client
$this->contactElements[] = $element; $this->contactElements[] = $element;
} }
/**
* Get files
*
* @return Media[]
*
* @since 1.0.0
*/
public function getFiles() : array
{
return $this->files;
}
/**
* Get media file by type
*
* @param int $type Media type
*
* @return Media
*
* @since 1.0.0
*/
public function getFileByType(int $type) : Media
{
foreach ($this->files as $file) {
if ($file->hasMediaTypeId($type)) {
return $file;
}
}
return new NullMedia();
}
/**
* Get all media files by type name
*
* @param string $type Media type
*
* @return Media
*
* @since 1.0.0
*/
public function getFileByTypeName(string $type) : Media
{
foreach ($this->files as $file) {
if ($file->hasMediaTypeName($type)) {
return $file;
}
}
return new NullMedia();
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -433,5 +350,6 @@ class Client
return $this->toArray(); return $this->toArray();
} }
use \Modules\Media\Models\MediaListTrait;
use \Modules\Attribute\Models\AttributeHolderTrait; use \Modules\Attribute\Models\AttributeHolderTrait;
} }

View File

@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
* *
* @template T of BaseStringL11n * @template T of ClientL11n
* @extends DataMapperFactory<T> * @extends DataMapperFactory<T>
*/ */
final class ClientL11nMapper extends DataMapperFactory final class ClientL11nMapper extends DataMapperFactory