diff --git a/src/Campaign.php b/src/Campaign.php index cb1a47e5..fb41cebf 100644 --- a/src/Campaign.php +++ b/src/Campaign.php @@ -11,6 +11,7 @@ use craft\console\controllers\ResaveController; use craft\controllers\PreviewController; use craft\elements\User; +use craft\enums\CmsEdition; use craft\events\DefineConsoleActionsEvent; use craft\events\DefineFieldLayoutFieldsEvent; use craft\events\PluginEvent; @@ -236,8 +237,8 @@ public function init(): void $this->registerWidgets(); } - // If Craft edition is pro - if (Craft::$app->getEdition() === Craft::Pro) { + // If Craft edition is at least Team + if (Craft::$app->edition >= CmsEdition::Team) { $this->registerUserPermissions(); $this->sync->registerUserEvents(); } @@ -297,7 +298,7 @@ public function getSettingsResponse(): Response } /** - * Returns true if pro version. + * Returns true if Pro version. */ public function getIsPro(): bool { @@ -305,7 +306,7 @@ public function getIsPro(): bool } /** - * Throws an exception if the plugin edition is not pro. + * Throws an exception if the plugin edition is not Pro. */ public function requirePro(): void { diff --git a/src/controllers/SegmentsController.php b/src/controllers/SegmentsController.php index 84f9a88f..03e162b5 100644 --- a/src/controllers/SegmentsController.php +++ b/src/controllers/SegmentsController.php @@ -24,7 +24,6 @@ class SegmentsController extends Controller */ public function beforeAction($action): bool { - // Require pro Campaign::$plugin->requirePro(); return parent::beforeAction($action); diff --git a/src/controllers/SyncController.php b/src/controllers/SyncController.php index 09eb25ee..51fe30a4 100644 --- a/src/controllers/SyncController.php +++ b/src/controllers/SyncController.php @@ -22,7 +22,6 @@ class SyncController extends Controller */ public function beforeAction($action): bool { - // Require pro Campaign::$plugin->requirePro(); // Require permission diff --git a/src/elements/SendoutElement.php b/src/elements/SendoutElement.php index 906ce218..fbf14edd 100755 --- a/src/elements/SendoutElement.php +++ b/src/elements/SendoutElement.php @@ -324,8 +324,8 @@ protected static function defineTableAttributes(): array 'lastSent' => ['label' => Craft::t('campaign', 'Last Sent')], ]); - // Hide sender if not Craft Pro edition - if (Craft::$app->edition !== CmsEdition::Pro) { + // Hide sender if not at least Craft Team edition + if (Craft::$app->edition < CmsEdition::Team) { unset($attributes['sender']); } diff --git a/src/services/ReportsService.php b/src/services/ReportsService.php index bbdc4b8d..6bf6f20d 100755 --- a/src/services/ReportsService.php +++ b/src/services/ReportsService.php @@ -738,7 +738,7 @@ private function getActivity(array $models, string $interaction = null, int $lim $contactActivityModel->sourceUrl = UrlHelper::cpUrl('campaign/contacts/import/' . $model->source); break; case 'user': - $path = (Craft::$app->edition !== CmsEdition::Solo && $model->source) ? 'users/' . $model->source : 'myaccount'; + $path = (Craft::$app->edition >= CmsEdition::Team && $model->source) ? 'users/' . $model->source : 'myaccount'; $contactActivityModel->sourceUrl = UrlHelper::cpUrl($path); break; default: diff --git a/src/variables/CampaignVariable.php b/src/variables/CampaignVariable.php index 5370486c..f0fc0e78 100644 --- a/src/variables/CampaignVariable.php +++ b/src/variables/CampaignVariable.php @@ -38,7 +38,7 @@ public function getIsPro(): bool } /** - * Throws an exception if the plugin edition is not pro. + * Throws an exception if the plugin edition is not Pro. */ public function requirePro(): void {