mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-02-18 13:18:42 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
36e7864fd0
commit
5b3e51c237
|
|
@ -26,5 +26,47 @@
|
||||||
"lang": "de"
|
"lang": "de"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": "item_demo_download",
|
||||||
|
"l11n": [
|
||||||
|
{
|
||||||
|
"title": "Public Download",
|
||||||
|
"lang": "en"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Oeffentlich Download",
|
||||||
|
"lang": "de"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": "item_private_download",
|
||||||
|
"l11n": [
|
||||||
|
{
|
||||||
|
"title": "Private Download",
|
||||||
|
"lang": "en"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Privat Download",
|
||||||
|
"lang": "de"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "type",
|
||||||
|
"name": "item_purchase_download",
|
||||||
|
"l11n": [
|
||||||
|
{
|
||||||
|
"title": "Purchased Download",
|
||||||
|
"lang": "en"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Gekaufter Download",
|
||||||
|
"lang": "de"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -633,19 +633,6 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "download_link",
|
|
||||||
"l11n": {
|
|
||||||
"en": "Download link",
|
|
||||||
"de": "Download Link"
|
|
||||||
},
|
|
||||||
"value_type": 2,
|
|
||||||
"is_custom_allowed": true,
|
|
||||||
"validation_pattern": "",
|
|
||||||
"is_required": false,
|
|
||||||
"default_value": "",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "demo_link",
|
"name": "demo_link",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
|
|
@ -663,7 +650,7 @@
|
||||||
"name": "one_click_pay_cc",
|
"name": "one_click_pay_cc",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
"en": "One Click CC payment link",
|
"en": "One Click CC payment link",
|
||||||
"de": "One Click CC Beyahllink"
|
"de": "One Click CC Bezahl-Link"
|
||||||
},
|
},
|
||||||
"value_type": 2,
|
"value_type": 2,
|
||||||
"is_custom_allowed": true,
|
"is_custom_allowed": true,
|
||||||
|
|
@ -676,7 +663,7 @@
|
||||||
"name": "one_click_pay_cc_id",
|
"name": "one_click_pay_cc_id",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
"en": "One Click CC payment ID",
|
"en": "One Click CC payment ID",
|
||||||
"de": "One Click CC Beyahl ID"
|
"de": "One Click CC Bezahl-ID"
|
||||||
},
|
},
|
||||||
"value_type": 2,
|
"value_type": 2,
|
||||||
"is_custom_allowed": true,
|
"is_custom_allowed": true,
|
||||||
|
|
@ -689,7 +676,7 @@
|
||||||
"name": "one_click_pay_paypal",
|
"name": "one_click_pay_paypal",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
"en": "One Click Paypal payment link",
|
"en": "One Click Paypal payment link",
|
||||||
"de": "One Click Paypal Beyahllink"
|
"de": "One Click Paypal Bezahl-Link"
|
||||||
},
|
},
|
||||||
"value_type": 2,
|
"value_type": 2,
|
||||||
"is_custom_allowed": true,
|
"is_custom_allowed": true,
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,5 @@ return [
|
||||||
'state' => PermissionCategory::SALES_ITEM,
|
'state' => PermissionCategory::SALES_ITEM,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,13 @@ use phpOMS\System\MimeType;
|
||||||
use phpOMS\Uri\HttpUri;
|
use phpOMS\Uri\HttpUri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Item* ItemManagement class.
|
* ItemManagement class.
|
||||||
*
|
*
|
||||||
* @package Modules\ItemManagement
|
* @package Modules\ItemManagement
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
Item*/
|
*/
|
||||||
final class ApiController extends Controller
|
final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
106
Models/Item.php
106
Models/Item.php
|
|
@ -56,15 +56,7 @@ class Item implements \JsonSerializable
|
||||||
public Money $purchasePrice;
|
public Money $purchasePrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Files.
|
* Notes.
|
||||||
*
|
|
||||||
* @var Media[]
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private array $files = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Files.
|
|
||||||
*
|
*
|
||||||
* @var EditorDoc[]
|
* @var EditorDoc[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -79,14 +71,6 @@ class Item implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
private array $l11n = [];
|
private array $l11n = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Attributes.
|
|
||||||
*
|
|
||||||
* @var \Modules\Attribute\Models\Attribute[]
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private array $attributes = [];
|
|
||||||
|
|
||||||
public ?int $partslist = null;
|
public ?int $partslist = null;
|
||||||
|
|
||||||
public ?int $disposal = null;
|
public ?int $disposal = null;
|
||||||
|
|
@ -211,20 +195,6 @@ class Item implements \JsonSerializable
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add media to item
|
|
||||||
*
|
|
||||||
* @param Media $media Media
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function addFile(Media $media) : void
|
|
||||||
{
|
|
||||||
$this->files[] = $media;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add note to item
|
* Add note to item
|
||||||
*
|
*
|
||||||
|
|
@ -251,79 +221,6 @@ class Item implements \JsonSerializable
|
||||||
return $this->notes;
|
return $this->notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all media files by type name
|
|
||||||
*
|
|
||||||
* @param string $type Media type
|
|
||||||
*
|
|
||||||
* @return Media[]
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFilesByTypeName(string $type) : array
|
|
||||||
{
|
|
||||||
$files = [];
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeName($type)) {
|
|
||||||
$files[] = $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $files;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
@ -346,5 +243,6 @@ class Item implements \JsonSerializable
|
||||||
return $this->toArray();
|
return $this->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use \Modules\Media\Models\MediaListTrait;
|
||||||
use \Modules\Attribute\Models\AttributeHolderTrait;
|
use \Modules\Attribute\Models\AttributeHolderTrait;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 ItemL11n
|
||||||
* @extends DataMapperFactory<T>
|
* @extends DataMapperFactory<T>
|
||||||
*/
|
*/
|
||||||
final class ItemL11nMapper extends DataMapperFactory
|
final class ItemL11nMapper extends DataMapperFactory
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user