mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-01-11 11:48:41 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
36e7864fd0
commit
5b3e51c237
|
|
@ -26,5 +26,47 @@
|
|||
"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",
|
||||
"l11n": {
|
||||
|
|
@ -663,7 +650,7 @@
|
|||
"name": "one_click_pay_cc",
|
||||
"l11n": {
|
||||
"en": "One Click CC payment link",
|
||||
"de": "One Click CC Beyahllink"
|
||||
"de": "One Click CC Bezahl-Link"
|
||||
},
|
||||
"value_type": 2,
|
||||
"is_custom_allowed": true,
|
||||
|
|
@ -676,7 +663,7 @@
|
|||
"name": "one_click_pay_cc_id",
|
||||
"l11n": {
|
||||
"en": "One Click CC payment ID",
|
||||
"de": "One Click CC Beyahl ID"
|
||||
"de": "One Click CC Bezahl-ID"
|
||||
},
|
||||
"value_type": 2,
|
||||
"is_custom_allowed": true,
|
||||
|
|
@ -689,7 +676,7 @@
|
|||
"name": "one_click_pay_paypal",
|
||||
"l11n": {
|
||||
"en": "One Click Paypal payment link",
|
||||
"de": "One Click Paypal Beyahllink"
|
||||
"de": "One Click Paypal Bezahl-Link"
|
||||
},
|
||||
"value_type": 2,
|
||||
"is_custom_allowed": true,
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ return [
|
|||
'state' => PermissionCategory::SALES_ITEM,
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ use phpOMS\System\MimeType;
|
|||
use phpOMS\Uri\HttpUri;
|
||||
|
||||
/**
|
||||
Item* ItemManagement class.
|
||||
* ItemManagement class.
|
||||
*
|
||||
* @package Modules\ItemManagement
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
Item*/
|
||||
*/
|
||||
final class ApiController extends Controller
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
106
Models/Item.php
106
Models/Item.php
|
|
@ -56,15 +56,7 @@ class Item implements \JsonSerializable
|
|||
public Money $purchasePrice;
|
||||
|
||||
/**
|
||||
* Files.
|
||||
*
|
||||
* @var Media[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $files = [];
|
||||
|
||||
/**
|
||||
* Files.
|
||||
* Notes.
|
||||
*
|
||||
* @var EditorDoc[]
|
||||
* @since 1.0.0
|
||||
|
|
@ -79,14 +71,6 @@ class Item implements \JsonSerializable
|
|||
*/
|
||||
private array $l11n = [];
|
||||
|
||||
/**
|
||||
* Attributes.
|
||||
*
|
||||
* @var \Modules\Attribute\Models\Attribute[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $attributes = [];
|
||||
|
||||
public ?int $partslist = null;
|
||||
|
||||
public ?int $disposal = null;
|
||||
|
|
@ -211,20 +195,6 @@ class Item implements \JsonSerializable
|
|||
$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
|
||||
*
|
||||
|
|
@ -251,79 +221,6 @@ class Item implements \JsonSerializable
|
|||
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}
|
||||
*/
|
||||
|
|
@ -346,5 +243,6 @@ class Item implements \JsonSerializable
|
|||
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 ItemL11n
|
||||
* @extends DataMapperFactory<T>
|
||||
*/
|
||||
final class ItemL11nMapper extends DataMapperFactory
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user