diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig index b2f6b6724..d77daf183 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig @@ -17,6 +17,9 @@ {% endif %}
+ + {{ addBlock('advs/preview/button', {'adID': adv.id})|raw }} + {% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %} {% set continueLink = url_route('visiosoft.module.packages::add_package', [adv.id]) %} {% elseif isActive('dopings') %} @@ -45,6 +48,9 @@
+ + {{ addBlock('advs/preview/button', {'adID': adv.id})|raw }} + {% if not setting_value('visiosoft.module.advs::hide_configurations') %} @@ -63,4 +69,4 @@ {{ asset_add("styles.css", "visiosoft.module.advs::css/detail.css") }} {{ asset_add("styles.css", "visiosoft.module.advs::css/preview.css") }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index 8acd42a55..1ebe01dd3 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -505,4 +505,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface { $this->update(['status' => $status]); } + + public function canEdit() + { + return $this->created_by_id == \auth()->id() || \auth()->user()->isAdmin(); + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php index be650c398..de1339d4e 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php @@ -91,4 +91,6 @@ interface AdvInterface extends EntryInterface public function approve(); public function changeStatus($status); + + public function canEdit(); }