diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index adb8716..75cb759 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,5 +9,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' + issue-message: 'Thank you for creating this issue. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.' diff --git a/Admin/Install/Media.install.json b/Admin/Install/Media.install.json index 7f9b9d0..9ae2568 100755 --- a/Admin/Install/Media.install.json +++ b/Admin/Install/Media.install.json @@ -12,19 +12,5 @@ "name": "Suppliers", "virtualPath": "/Modules/SupplierManagement", "user": 1 - }, - { - "type": "type", - "name": "supplier_profile_image", - "l11n": [ - { - "title": "Profile image", - "lang": "en" - }, - { - "title": "Profilbild", - "lang": "de" - } - ] } ] \ No newline at end of file diff --git a/Admin/Install/SearchCommands.php b/Admin/Install/SearchCommands.php index 89b166e..7aeafe0 100644 --- a/Admin/Install/SearchCommands.php +++ b/Admin/Install/SearchCommands.php @@ -23,6 +23,7 @@ return [ 'dest' => '\Modules\SupplierManagement\Controller\SearchController:searchGeneral', 'verb' => RouteVerb::ANY, 'active' => true, + 'order' => 5, 'permission' => [ 'module' => SearchController::NAME, 'type' => PermissionType::READ, diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php index d859646..9cdc31e 100644 --- a/Controller/ApiAttributeController.php +++ b/Controller/ApiAttributeController.php @@ -66,7 +66,7 @@ final class ApiAttributeController extends Controller ->where('id', (int) $request->getData('type')) ->execute(); - if (!$type->repeatable) { + if (!$type->isRepeatable) { $attr = SupplierAttributeMapper::count() ->with('type') ->where('type/id', $type->id) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index e89d7f3..56e753b 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -372,7 +372,7 @@ final class ApiController extends Controller basePath: __DIR__ . '/../../../Modules/Media/Files/Modules/SupplierManagement/Suppliers/' . ($request->getData('supplier') ?? '0'), virtualPath: '/Modules/SupplierManagement/Suppliers/' . ($request->getData('supplier') ?? '0'), pathSettings: PathSettings::FILE_PATH, - type: $request->getDataInt('type'), + tag: $request->getDataInt('tag'), rel: (int) $request->getData('supplier'), mapper: SupplierMapper::class, field: 'files' diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 1267d7a..4ec3b0b 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -17,7 +17,6 @@ namespace Modules\SupplierManagement\Controller; use Modules\Attribute\Models\NullAttributeValue; use Modules\Auditor\Models\AuditMapper; use Modules\Media\Models\MediaMapper; -use Modules\Media\Models\MediaTypeMapper; use Modules\Organization\Models\Attribute\UnitAttributeMapper; use Modules\SupplierManagement\Models\Attribute\SupplierAttributeTypeL11nMapper; use Modules\SupplierManagement\Models\Attribute\SupplierAttributeTypeMapper; @@ -25,6 +24,7 @@ use Modules\SupplierManagement\Models\Attribute\SupplierAttributeValueL11nMapper use Modules\SupplierManagement\Models\Attribute\SupplierAttributeValueMapper; use Modules\SupplierManagement\Models\PermissionCategory; use Modules\SupplierManagement\Models\SupplierMapper; +use Modules\Tag\Models\TagMapper; use phpOMS\Account\PermissionType; use phpOMS\Asset\AssetType; use phpOMS\Contract\RenderableInterface; @@ -300,12 +300,12 @@ final class BackendController extends Controller ->on(SupplierMapper::HAS_MANY['files']['table'] . '.' . SupplierMapper::HAS_MANY['files']['self'], '=', SupplierMapper::TABLE . '.' . SupplierMapper::PRIMARYFIELD) ->leftJoin(MediaMapper::TABLE) ->on(SupplierMapper::HAS_MANY['files']['table'] . '.' . SupplierMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD) - ->leftJoin(MediaMapper::HAS_MANY['types']['table']) - ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self']) - ->leftJoin(MediaTypeMapper::TABLE) - ->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD) + ->leftJoin(MediaMapper::HAS_MANY['tags']['table']) + ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['self']) + ->leftJoin(TagMapper::TABLE) + ->on(MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['external'], '=', TagMapper::TABLE . '.' . TagMapper::PRIMARYFIELD) ->where(SupplierMapper::HAS_MANY['files']['self'], '=', $view->data['supplier']->id) - ->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'supplier_profile_image'); + ->where(TagMapper::TABLE . '.' . TagMapper::getColumnByMember('name'), '=', 'profile_image'); $view->data['supplierImage'] = MediaMapper::get() ->where('id', $results) diff --git a/Controller/SearchController.php b/Controller/SearchController.php index e8d7b44..9e9d39d 100644 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -16,8 +16,8 @@ namespace Modules\SupplierManagement\Controller; use Modules\Admin\Models\ContactType; use Modules\Media\Models\MediaMapper; -use Modules\Media\Models\MediaTypeMapper; use Modules\SupplierManagement\Models\SupplierMapper; +use Modules\Tag\Models\TagMapper; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; @@ -79,12 +79,12 @@ final class SearchController extends Controller ->on(SupplierMapper::HAS_MANY['files']['table'] . '.' . SupplierMapper::HAS_MANY['files']['self'], '=', SupplierMapper::TABLE . '.' . SupplierMapper::PRIMARYFIELD) ->leftJoin(MediaMapper::TABLE) ->on(SupplierMapper::HAS_MANY['files']['table'] . '.' . SupplierMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD) - ->leftJoin(MediaMapper::HAS_MANY['types']['table']) - ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self']) - ->leftJoin(MediaTypeMapper::TABLE) - ->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD) + ->leftJoin(MediaMapper::HAS_MANY['tags']['table']) + ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['self']) + ->leftJoin(TagMapper::TABLE) + ->on(MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['external'], '=', TagMapper::TABLE . '.' . TagMapper::PRIMARYFIELD) ->where(SupplierMapper::HAS_MANY['files']['self'], '=', $account->id) - ->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'supplier_profile_image'); + ->where(TagMapper::TABLE . '.' . TagMapper::getColumnByMember('name'), '=', 'profile_image'); $image = MediaMapper::get() ->where('id', $iResults) diff --git a/Models/Attribute/SupplierAttributeTypeMapper.php b/Models/Attribute/SupplierAttributeTypeMapper.php index b365845..415b5de 100644 --- a/Models/Attribute/SupplierAttributeTypeMapper.php +++ b/Models/Attribute/SupplierAttributeTypeMapper.php @@ -42,7 +42,7 @@ final class SupplierAttributeTypeMapper extends DataMapperFactory 'suppliermgmt_attr_type_datatype' => ['name' => 'suppliermgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], 'suppliermgmt_attr_type_fields' => ['name' => 'suppliermgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], 'suppliermgmt_attr_type_custom' => ['name' => 'suppliermgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], - 'suppliermgmt_attr_type_repeatable' => ['name' => 'suppliermgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], + 'suppliermgmt_attr_type_repeatable' => ['name' => 'suppliermgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'], 'suppliermgmt_attr_type_internal' => ['name' => 'suppliermgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'], 'suppliermgmt_attr_type_pattern' => ['name' => 'suppliermgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], 'suppliermgmt_attr_type_required' => ['name' => 'suppliermgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 8ce3d80..7ce5abd 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -108,7 +108,7 @@ return ['SupplierManagement' => [ 'Account' => 'Konto', 'EarningIndicator' => 'Verkaufssteuerkennzeichen', 'CostIndicator' => 'Einkaufssteuerkennzeichen', - 'Zip' => 'Reißverschluss', + 'Postal' => 'Reißverschluss', 'Status' => 'Status', 'Bills' => 'Rechnungen', 'ViewAccount' => 'Buchhaltung', diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index eaedf6d..aac37b4 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -105,7 +105,7 @@ return ['SupplierManagement' => [ 'CostIndicator' => 'Purchase tax code', 'Wire' => 'Wire', 'YTDSales' => 'YTD Sales', - 'Zip' => 'Zip', + 'Postal' => 'Postal', 'SLV' => 'SLV', 'Bill' => 'Bill', 'Status' => 'Status', diff --git a/Theme/Backend/supplier-list.tpl.php b/Theme/Backend/supplier-list.tpl.php index 5c6d3cf..7a11c6f 100755 --- a/Theme/Backend/supplier-list.tpl.php +++ b/Theme/Backend/supplier-list.tpl.php @@ -63,7 +63,7 @@ echo $this->data['nav']->render(); ?> - getHtml('Zip'); ?> + getHtml('Postal'); ?>