mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-01-11 15:28:41 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
ab53291e37
commit
f431897c0c
|
|
@ -15,8 +15,8 @@ jsOMS.Modules.ClientManagement = class {
|
|||
|
||||
bind (id)
|
||||
{
|
||||
const charts = typeof id === 'undefined' ? document.getElementsByTagName('canvas') : [document.getElementById(id)];
|
||||
let length = charts.length;
|
||||
const charts = typeof id === 'undefined' ? document.getElementsByTagName('canvas') : [document.getElementById(id)];
|
||||
let length = charts.length;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if (charts[i].getAttribute('data-chart') === null
|
||||
|
|
@ -28,8 +28,8 @@ jsOMS.Modules.ClientManagement = class {
|
|||
this.bindChart(charts[i]);
|
||||
}
|
||||
|
||||
const maps = typeof id === 'undefined' ? document.getElementsByClassName('map') : [document.getElementById(id)];
|
||||
length = maps.length;
|
||||
const maps = typeof id === 'undefined' ? document.getElementsByClassName('map') : [document.getElementById(id)];
|
||||
length = maps.length;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
this.bindMap(maps[i]);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ use Modules\Admin\Models\Address;
|
|||
use Modules\Admin\Models\NullAddress;
|
||||
use Modules\Editor\Models\EditorDoc;
|
||||
use Modules\Media\Models\Media;
|
||||
use Modules\Media\Models\NullMedia;
|
||||
use Modules\Payment\Models\Payment;
|
||||
use Modules\Profile\Models\ContactElement;
|
||||
use Modules\Profile\Models\NullContactElement;
|
||||
|
|
@ -51,14 +50,6 @@ class Client
|
|||
|
||||
public Account $account;
|
||||
|
||||
/**
|
||||
* Attributes.
|
||||
*
|
||||
* @var \Modules\Attribute\Models\Attribute[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $attributes = [];
|
||||
|
||||
/**
|
||||
* Payments.
|
||||
*
|
||||
|
|
@ -75,14 +66,6 @@ class Client
|
|||
*/
|
||||
private array $notes = [];
|
||||
|
||||
/**
|
||||
* Files.
|
||||
*
|
||||
* @var Media[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $files = [];
|
||||
|
||||
private array $contactElements = [];
|
||||
|
||||
public Address $mainAddress;
|
||||
|
|
@ -209,20 +192,6 @@ class Client
|
|||
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.
|
||||
*
|
||||
|
|
@ -358,58 +327,6 @@ class Client
|
|||
$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}
|
||||
*/
|
||||
|
|
@ -433,5 +350,6 @@ class Client
|
|||
return $this->toArray();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
use \Modules\Attribute\Models\AttributeHolderTrait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @template T of BaseStringL11n
|
||||
* @template T of ClientL11n
|
||||
* @extends DataMapperFactory<T>
|
||||
*/
|
||||
final class ClientL11nMapper extends DataMapperFactory
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user