@@ -847,7 +847,7 @@ |
||
| 847 | 847 | |
| 848 | 848 | /** |
| 849 | 849 | * @param OrganizationElement $element |
| 850 | - * @param $newOwnerId |
|
| 850 | + * @param integer $newOwnerId |
|
| 851 | 851 | * @return bool |
| 852 | 852 | * @throws \Exception |
| 853 | 853 | * @throws \yii\db\Exception |
@@ -10,17 +10,17 @@ |
||
| 10 | 10 | |
| 11 | 11 | use Craft; |
| 12 | 12 | use craft\db\Query; |
| 13 | +use craft\elements\User as UserElement; |
|
| 13 | 14 | use craft\elements\db\ElementQueryInterface; |
| 14 | 15 | use craft\elements\db\UserQuery; |
| 15 | -use craft\elements\User as UserElement; |
|
| 16 | 16 | use craft\helpers\DateTimeHelper; |
| 17 | 17 | use craft\models\FieldLayout as FieldLayoutModel; |
| 18 | 18 | use craft\records\Element as ElementRecord; |
| 19 | -use flipbox\organization\elements\db\Organization as OrganizationQuery; |
|
| 19 | +use flipbox\organization\Organization as OrganizationPlugin; |
|
| 20 | 20 | use flipbox\organization\elements\Organization as OrganizationElement; |
| 21 | +use flipbox\organization\elements\db\Organization as OrganizationQuery; |
|
| 21 | 22 | use flipbox\organization\events\ChangeOwner as ChangeOwnerEvent; |
| 22 | 23 | use flipbox\organization\events\ChangeStatus as ChangeStatusEvent; |
| 23 | -use flipbox\organization\Organization as OrganizationPlugin; |
|
| 24 | 24 | use flipbox\organization\records\Organization as OrganizationRecord; |
| 25 | 25 | use flipbox\spark\helpers\ArrayHelper; |
| 26 | 26 | use flipbox\spark\helpers\RecordHelper; |
@@ -171,10 +171,8 @@ discard block |
||
| 171 | 171 | // Quick logic to determine the status |
| 172 | 172 | if (empty($existingStatus)) { |
| 173 | 173 | $existingStatus = (!empty($query['archived']) ? |
| 174 | - OrganizationElement::STATUS_ARCHIVED : |
|
| 175 | - ($query['enabled'] ? |
|
| 176 | - OrganizationElement::STATUS_ENABLED : |
|
| 177 | - OrganizationElement::STATUS_DISABLED |
|
| 174 | + OrganizationElement::STATUS_ARCHIVED : ($query['enabled'] ? |
|
| 175 | + OrganizationElement::STATUS_ENABLED : OrganizationElement::STATUS_DISABLED |
|
| 178 | 176 | ) |
| 179 | 177 | ); |
| 180 | 178 | } |
@@ -449,7 +447,7 @@ discard block |
||
| 449 | 447 | $organization->slug = $request->getBodyParam('slug', $organization->slug); |
| 450 | 448 | |
| 451 | 449 | // Enabled |
| 452 | - $organization->enabledForSite = (bool)$request->getBodyParam( |
|
| 450 | + $organization->enabledForSite = (bool) $request->getBodyParam( |
|
| 453 | 451 | 'enabledForSite', |
| 454 | 452 | $organization->enabledForSite |
| 455 | 453 | ); |
@@ -12,11 +12,11 @@ |
||
| 12 | 12 | use craft\db\Query; |
| 13 | 13 | use craft\elements\User as UserElement; |
| 14 | 14 | use craft\helpers\ArrayHelper; |
| 15 | -use flipbox\organization\elements\db\User as UserQuery; |
|
| 15 | +use flipbox\organization\Organization as OrganizationPlugin; |
|
| 16 | 16 | use flipbox\organization\elements\Organization as OrganizationElement; |
| 17 | +use flipbox\organization\elements\db\User as UserQuery; |
|
| 17 | 18 | use flipbox\organization\events\ManageOrganizationUser; |
| 18 | 19 | use flipbox\organization\helpers\Query as QueryHelper; |
| 19 | -use flipbox\organization\Organization as OrganizationPlugin; |
|
| 20 | 20 | use flipbox\organization\records\User as OrganizationUserRecord; |
| 21 | 21 | use flipbox\spark\helpers\RecordHelper; |
| 22 | 22 | use yii\base\Component; |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | namespace flipbox\organization\validators; |
| 10 | 10 | |
| 11 | 11 | use Craft; |
| 12 | -use craft\elements\db\UserQuery; |
|
| 13 | 12 | use craft\elements\User as UserElement; |
| 13 | +use craft\elements\db\UserQuery; |
|
| 14 | 14 | use craft\helpers\Json; |
| 15 | 15 | use yii\validators\Validator; |
| 16 | 16 | |
@@ -9,9 +9,9 @@ |
||
| 9 | 9 | namespace flipbox\organization\web\twig\variables; |
| 10 | 10 | |
| 11 | 11 | use craft\elements\User; |
| 12 | -use flipbox\organization\elements\db\Organization as OrganizationQuery; |
|
| 13 | -use flipbox\organization\elements\Organization as OrganizationElement; |
|
| 14 | 12 | use flipbox\organization\Organization as OrganizationPlugin; |
| 13 | +use flipbox\organization\elements\Organization as OrganizationElement; |
|
| 14 | +use flipbox\organization\elements\db\Organization as OrganizationQuery; |
|
| 15 | 15 | use yii\di\ServiceLocator; |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -8,8 +8,8 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace flipbox\organization\web\twig\variables; |
| 10 | 10 | |
| 11 | -use flipbox\organization\elements\Organization; |
|
| 12 | 11 | use flipbox\organization\Organization as OrganizationPlugin; |
| 12 | +use flipbox\organization\elements\Organization; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * @author Flipbox Factory <[email protected]> |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | Event::on( |
| 81 | 81 | User::class, |
| 82 | 82 | User::EVENT_REGISTER_ACTIONS, |
| 83 | - function (RegisterElementActionsEvent $event) { |
|
| 83 | + function(RegisterElementActionsEvent $event) { |
|
| 84 | 84 | if ($event->source == '*') { |
| 85 | 85 | $event->actions = [ |
| 86 | 86 | [ |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | Event::on( |
| 100 | 100 | User::class, |
| 101 | 101 | User::EVENT_REGISTER_SOURCES, |
| 102 | - function (RegisterElementSourcesEvent $event) { |
|
| 102 | + function(RegisterElementSourcesEvent $event) { |
|
| 103 | 103 | if ($event->context == 'index') { |
| 104 | 104 | $event->sources = [ |
| 105 | 105 | [ |
@@ -16,8 +16,8 @@ |
||
| 16 | 16 | use craft\models\FieldLayout as FieldLayoutModel; |
| 17 | 17 | use craft\services\Elements; |
| 18 | 18 | use craft\services\Fields; |
| 19 | -use craft\web\twig\variables\CraftVariable; |
|
| 20 | 19 | use craft\web\UrlManager; |
| 20 | +use craft\web\twig\variables\CraftVariable; |
|
| 21 | 21 | use flipbox\organization\controllers\OrganizationController; |
| 22 | 22 | use flipbox\organization\elements\Organization as OrganizationElement; |
| 23 | 23 | use flipbox\organization\fields\Organization as OrganizationField; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | Event::on( |
| 62 | 62 | Fields::class, |
| 63 | 63 | Fields::EVENT_REGISTER_FIELD_TYPES, |
| 64 | - function (RegisterComponentTypesEvent $event) { |
|
| 64 | + function(RegisterComponentTypesEvent $event) { |
|
| 65 | 65 | $event->types[] = OrganizationField::class; |
| 66 | 66 | $event->types[] = UserField::class; |
| 67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | Event::on( |
| 72 | 72 | Elements::class, |
| 73 | 73 | Elements::EVENT_REGISTER_ELEMENT_TYPES, |
| 74 | - function (RegisterComponentTypesEvent $event) { |
|
| 74 | + function(RegisterComponentTypesEvent $event) { |
|
| 75 | 75 | $event->types[] = OrganizationElement::class; |
| 76 | 76 | } |
| 77 | 77 | ); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | Event::on( |
| 88 | 88 | CraftVariable::class, |
| 89 | 89 | CraftVariable::EVENT_INIT, |
| 90 | - function (Event $event) { |
|
| 90 | + function(Event $event) { |
|
| 91 | 91 | /** @var CraftVariable $variable */ |
| 92 | 92 | $variable = $event->sender; |
| 93 | 93 | $variable->set('organization', OrganizationVariable::class); |