diff --git a/addons/default/visiosoft/advs-module/factories/OptionConfigurationFactory.php b/addons/default/visiosoft/advs-module/factories/OptionConfigurationFactory.php new file mode 100644 index 000000000..86a320aa0 --- /dev/null +++ b/addons/default/visiosoft/advs-module/factories/OptionConfigurationFactory.php @@ -0,0 +1,10 @@ +define( + Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel::class, + function (Faker\Generator $faker) { + return [ + //'title' => $faker->words(2), + ]; + } +); diff --git a/addons/default/visiosoft/advs-module/factories/OptionsConfigurationFactory.php b/addons/default/visiosoft/advs-module/factories/OptionsConfigurationFactory.php new file mode 100644 index 000000000..b6bbb136f --- /dev/null +++ b/addons/default/visiosoft/advs-module/factories/OptionsConfigurationFactory.php @@ -0,0 +1,10 @@ +define( + Visiosoft\AdvsModule\OptionsConfiguration\OptionsConfigurationModel::class, + function (Faker\Generator $faker) { + return [ + //'title' => $faker->words(2), + ]; + } +); diff --git a/addons/default/visiosoft/advs-module/factories/ProductoptionFactory.php b/addons/default/visiosoft/advs-module/factories/ProductoptionFactory.php new file mode 100644 index 000000000..7a1bc3379 --- /dev/null +++ b/addons/default/visiosoft/advs-module/factories/ProductoptionFactory.php @@ -0,0 +1,10 @@ +define( + Visiosoft\AdvsModule\Productoption\ProductoptionModel::class, + function (Faker\Generator $faker) { + return [ + //'title' => $faker->words(2), + ]; + } +); diff --git a/addons/default/visiosoft/advs-module/factories/ProductoptionsValueFactory.php b/addons/default/visiosoft/advs-module/factories/ProductoptionsValueFactory.php new file mode 100644 index 000000000..bdfb8e393 --- /dev/null +++ b/addons/default/visiosoft/advs-module/factories/ProductoptionsValueFactory.php @@ -0,0 +1,10 @@ +define( + Visiosoft\AdvsModule\ProductoptionsValue\ProductoptionsValueModel::class, + function (Faker\Generator $faker) { + return [ + //'title' => $faker->words(2), + ]; + } +); diff --git a/addons/default/visiosoft/advs-module/migrations/2020_10_15_130044_visiosoft.module.advs__create_productoptions_stream.php b/addons/default/visiosoft/advs-module/migrations/2020_10_15_130044_visiosoft.module.advs__create_productoptions_stream.php new file mode 100644 index 000000000..a8bdf8a7f --- /dev/null +++ b/addons/default/visiosoft/advs-module/migrations/2020_10_15_130044_visiosoft.module.advs__create_productoptions_stream.php @@ -0,0 +1,47 @@ + 'anomaly.field_type.select', + ]; + /** + * The stream definition. + * + * @var array + */ + protected $stream = [ + 'slug' => 'productoptions', + 'title_column' => 'name', + 'translatable' => true, + 'versionable' => false, + 'trashable' => true, + 'searchable' => false, + 'sortable' => false, + ]; + + /** + * The stream assignments. + * + * @var array + */ + protected $assignments = [ + 'categories', + 'name' => [ + 'translatable' => true, + 'required' => true, + ], + ]; +} diff --git a/addons/default/visiosoft/advs-module/migrations/2020_10_15_131614_visiosoft.module.advs__create_productoptions_value_stream.php b/addons/default/visiosoft/advs-module/migrations/2020_10_15_131614_visiosoft.module.advs__create_productoptions_value_stream.php new file mode 100644 index 000000000..47fff9601 --- /dev/null +++ b/addons/default/visiosoft/advs-module/migrations/2020_10_15_131614_visiosoft.module.advs__create_productoptions_value_stream.php @@ -0,0 +1,56 @@ + [ + 'type' => 'anomaly.field_type.relationship', + 'config' => [ + 'related' => ProductoptionModel::class, + ], + ] + ]; + + /** + * The stream definition. + * + * @var array + */ + protected $stream = [ + 'slug' => 'productoptions_value', + 'title_column' => 'name', + 'translatable' => true, + 'versionable' => false, + 'trashable' => true, + 'searchable' => false, + 'sortable' => false, + ]; + + /** + * The stream assignments. + * + * @var array + */ + protected $assignments = [ + 'name' => [ + 'translatable' => true, + 'required' => true, + ], + 'product_option' => [ + 'required' => true, + ], + ]; +} diff --git a/addons/default/visiosoft/advs-module/migrations/2020_10_16_082339_visiosoft.module.advs__added_options_field.php b/addons/default/visiosoft/advs-module/migrations/2020_10_16_082339_visiosoft.module.advs__added_options_field.php new file mode 100644 index 000000000..d00e201c7 --- /dev/null +++ b/addons/default/visiosoft/advs-module/migrations/2020_10_16_082339_visiosoft.module.advs__added_options_field.php @@ -0,0 +1,48 @@ + 'advs', + ]; + + /** + * The addon fields. + * + * @var array + */ + protected $fields = [ + 'product_options_value' => [ + 'type' => 'anomaly.field_type.multiple', + 'config' => [ + 'mode' => 'lookup', + 'related' => \Visiosoft\AdvsModule\ProductoptionsValue\ProductoptionsValueModel::class, + ], + ] + ]; + + /** + * The field's assignment. + * + * @var array + */ + protected $assignments = [ + 'product_options_value', + ]; +} diff --git a/addons/default/visiosoft/advs-module/migrations/2020_10_16_124151_visiosoft.module.advs__create_option_configuration_stream.php b/addons/default/visiosoft/advs-module/migrations/2020_10_16_124151_visiosoft.module.advs__create_option_configuration_stream.php new file mode 100644 index 000000000..b42c31acf --- /dev/null +++ b/addons/default/visiosoft/advs-module/migrations/2020_10_16_124151_visiosoft.module.advs__create_option_configuration_stream.php @@ -0,0 +1,58 @@ + 'visiosoft.field_type.json', + ]; + + /** + * The stream definition. + * + * @var array + */ + protected $stream = [ + 'slug' => 'option_configuration', + 'title_column' => 'option_json', + 'translatable' => false, + 'versionable' => false, + 'trashable' => false, + 'searchable' => false, + 'sortable' => false, + ]; + + /** + * The stream assignments. + * + * @var array + */ + protected $assignments = [ + 'parent_adv' => [ + 'required' => true, + ], + 'price' => [ + 'required' => true, + ], + 'currency' => [ + 'required' => true, + ], + 'stock' => [ + 'required' => true, + ], + 'option_json' => [ + 'required' => true, + ], + ]; + +} diff --git a/addons/default/visiosoft/advs-module/resources/config/permissions.php b/addons/default/visiosoft/advs-module/resources/config/permissions.php index eae0b67cd..cead467e5 100644 --- a/addons/default/visiosoft/advs-module/resources/config/permissions.php +++ b/addons/default/visiosoft/advs-module/resources/config/permissions.php @@ -21,4 +21,29 @@ return [ 'write', 'delete', ], + 'productoptions' => [ + 'read', + 'write', + 'delete', + ], + 'productoptions_value' => [ + 'read', + 'write', + 'delete', + ], + 'options_configuration' => [ + 'read', + 'write', + 'delete', + ], + 'option_configuration' => [ + 'read', + 'write', + 'delete', + ], + 'option_configuration' => [ + 'read', + 'write', + 'delete', + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/button.php b/addons/default/visiosoft/advs-module/resources/lang/en/button.php index ab988e7b0..c3ff863ad 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/button.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/button.php @@ -32,5 +32,10 @@ return [ 'name' => 'Update Category' ], 'new_option' => 'New Option', - 'export' => 'Export' + 'export' => 'Export', + 'new_productoption' => 'New Productoption', + 'new_productoptions_value' => 'New Productoptions value', + 'new_options_configuration' => 'New Options configuration', + 'new_option_configuration' => 'New Option configuration', + 'new_option_configuration' => 'New Option configuration', ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/field.php b/addons/default/visiosoft/advs-module/resources/lang/en/field.php index 7ebc16101..493583f1f 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/field.php @@ -313,4 +313,10 @@ return [ 'site' => 'Site', 'subscription' => 'Subscription', 'created' => 'Created', + 'product_option' => [ + 'name' => 'Product Option' + ], + 'option_json' => [ + 'name' => 'Option' + ] ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/permission.php b/addons/default/visiosoft/advs-module/resources/lang/en/permission.php index a75575d96..0a094c9f1 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/permission.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/permission.php @@ -57,4 +57,44 @@ return [ 'delete' => 'Can delete options?', ], ], + 'productoptions' => [ + 'name' => 'Productoptions', + 'option' => [ + 'read' => 'Can read productoptions?', + 'write' => 'Can create/edit productoptions?', + 'delete' => 'Can delete productoptions?', + ], + ], + 'productoptions_value' => [ + 'name' => 'Productoptions value', + 'option' => [ + 'read' => 'Can read productoptions value?', + 'write' => 'Can create/edit productoptions value?', + 'delete' => 'Can delete productoptions value?', + ], + ], + 'options_configuration' => [ + 'name' => 'Options configuration', + 'option' => [ + 'read' => 'Can read options configuration?', + 'write' => 'Can create/edit options configuration?', + 'delete' => 'Can delete options configuration?', + ], + ], + 'option_configuration' => [ + 'name' => 'Option configuration', + 'option' => [ + 'read' => 'Can read option configuration?', + 'write' => 'Can create/edit option configuration?', + 'delete' => 'Can delete option configuration?', + ], + ], + 'option_configuration' => [ + 'name' => 'Option configuration', + 'option' => [ + 'read' => 'Can read option configuration?', + 'write' => 'Can create/edit option configuration?', + 'delete' => 'Can delete option configuration?', + ], + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/section.php b/addons/default/visiosoft/advs-module/resources/lang/en/section.php index b3ebe1995..fa686c524 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/section.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/section.php @@ -45,4 +45,19 @@ return [ 'title' => 'Options', ], 'ads_image' => 'Ads Image', + 'product_options' => [ + 'title' => 'Product Options', + ], + 'productoptions_value' => [ + 'title' => 'Productoptions value', + ], + 'options_configuration' => [ + 'title' => 'Options configuration', + ], + 'option_configuration' => [ + 'title' => 'Option configuration', + ], + 'option_configuration' => [ + 'title' => 'Option configuration', + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/stream.php b/addons/default/visiosoft/advs-module/resources/lang/en/stream.php index 29e720836..bd46a1466 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/stream.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/stream.php @@ -22,4 +22,19 @@ return [ 'options' => [ 'name' => 'Options', ], + 'product_options' => [ + 'name' => 'Produc Options', + ], + 'productoptions_value' => [ + 'name' => 'Productoptions value', + ], + 'options_configuration' => [ + 'name' => 'Options configuration', + ], + 'option_configuration' => [ + 'name' => 'Option configuration', + ], + 'option_configuration' => [ + 'name' => 'Option configuration', + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig index 4ccfbcfda..94d172535 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig @@ -138,6 +138,15 @@ +
+