Jelajahi Sumber

Ticket #3367 - Usage in Organizations. Related changes.

AntonLV 5 tahun lalu
induk
melakukan
436fc3e29c

+ 29 - 6
modules/base/groups/classes/BxBaseModGroupsGridPricesView.php

@@ -31,20 +31,43 @@ class BxBaseModGroupsGridPricesView extends BxBaseModGroupsGridPrices
     {
         parent::__construct ($aOptions, $oTemplate);
 
-        $CNF = &$this->_oModule->_oConfig->CNF;
-
         $this->_aJsCodes = array();
+    }
+
+    public function setClientId($iClientId = 0)
+    {
+        $this->_iClient = $iClientId;
+        if(empty($this->_iClient))
+            $this->_iClient = bx_get_logged_profile_id();
+
+        $this->_iClientRole = 0;
+        if(!empty($this->_iGroupProfileId))
+            $this->_iClientRole = $this->_oModule->getRole($this->_iGroupProfileId, $this->_iClient);
+    }
 
-        $this->_oPayment = BxDolPayments::getInstance();
+    public function setSellerId($iSellerId = 0)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $this->_iSeller = $this->_aGroupContentInfo[$CNF['FIELD_AUTHOR']];
-        $this->_iClient = bx_get_logged_profile_id();
-        $this->_iClientRole = $this->_oModule->getRole($this->_iGroupProfileId, $this->_iClient);
+        $this->_iSeller = $iSellerId;
+        if(empty($this->_iSeller) && !empty($this->_aGroupContentInfo) && is_array($this->_aGroupContentInfo))
+            $this->_iSeller = $this->_aGroupContentInfo[$CNF['FIELD_AUTHOR']];
+
+        if(empty($this->_oPayment))
+            $this->_oPayment = BxDolPayments::getInstance();
 
         $this->_bTypeSingle = $this->_oPayment->isAcceptingPayments($this->_iSeller, BX_PAYMENT_TYPE_SINGLE);
         $this->_bTypeRecurring = $this->_oPayment->isAcceptingPayments($this->_iSeller, BX_PAYMENT_TYPE_RECURRING);
     }
 
+    public function setProfileId($iProfileId)
+    {
+        parent::setProfileId($iProfileId);
+
+        $this->setClientId();
+        $this->setSellerId();
+    }
+
     public function performActionChoose()
     {
         $CNF = &$this->_oModule->_oConfig->CNF;

+ 33 - 18
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -642,51 +642,66 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         return true;
     }
 
-    public function serviceIsPaidJoinAvaliable($iProfileId)
+    public function serviceIsPaidJoinAvaliable($iGroupProfileId, $iProfileId = 0)
     {
-        return $this->isPaidJoinByProfile($iProfileId);
+        return $this->isPaidJoinByProfileForProfile($iGroupProfileId, $iProfileId);
     }
 
-    public function serviceIsPaidJoinAvaliableByContent($iContentId)
+    public function serviceIsPaidJoinAvaliableByContent($iGroupContentId, $iProfileId = 0)
     {
-        $oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->getName());
-        if(!$oProfile)
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($iGroupContentId, $this->getName());
+        if(!$oGroupProfile)
             return false;
 
-        return $this->isPaidJoinByProfile($oProfile->id());
+        return $this->isPaidJoinByProfileForProfile($oGroupProfile->id(), $iProfileId);
     }
 
-    public function serviceIsFreeJoinAvaliable($iProfileId)
+    public function serviceIsFreeJoinAvaliable($iGroupProfileId, $iProfileId = 0)
     {
-        return !$this->isPaidJoinByProfile($iProfileId);
+        return !$this->isPaidJoinByProfileForProfile($iGroupProfileId, $iProfileId);
     }
 
-    public function serviceIsFreeJoinAvaliableByContent($iContentId)
+    public function serviceIsFreeJoinAvaliableByContent($iGroupContentId, $iProfileId = 0)
     {
-        $oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->getName());
-        if(!$oProfile)
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($iGroupContentId, $this->getName());
+        if(!$oGroupProfile)
             return false;
 
-        return !$this->isPaidJoinByProfile($oProfile->id());
+        return !$this->isPaidJoinByProfileForProfile($oGroupProfile->id(), $iProfileId);
     }
 
     /**
-     * Is Paid Join enabled as is and whether a group has pricing plans added.
+     * Is Paid Join enabled in the group and whether a profile can use it.
      * 
-     * @param type $iProfileId - Group profile ID.
+     * @param type $iGroupProfileId - Group profile ID.
+     * @param type $iProfileId - Profile ID of the user who wants to join.
      * @return boolean
      */
-    public function isPaidJoinByProfile($iProfileId)
+    public function isPaidJoinByProfileForProfile($iGroupProfileId, $iProfileId = 0)
     {
         $CNF = &$this->_oConfig->CNF;
 
-        if(!$this->_oConfig->isPaidJoin())
+        if(empty($iProfileId))
+            $iProfileId = $this->_iProfileId;
+
+        if(BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS'])->isConnected($iProfileId, $iGroupProfileId))
             return false;
 
-        if(BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS'])->isConnected($this->_iProfileId, $iProfileId))
+        return $this->isPaidJoinByProfile($iGroupProfileId);
+    }
+
+    /**
+     * Is Paid Join enabled as is and whether a group has pricing plans added.
+     * 
+     * @param type $iGroupProfileId - Group profile ID.
+     * @return boolean
+     */
+    public function isPaidJoinByProfile($iGroupProfileId)
+    {
+        if(!$this->_oConfig->isPaidJoin())
             return false;
 
-        $aPrices = $this->_oDb->getPrices(array('type' => 'by_profile_id', 'profile_id' => $iProfileId));
+        $aPrices = $this->_oDb->getPrices(array('type' => 'by_profile_id', 'profile_id' => $iGroupProfileId));
         if(empty($aPrices) || !is_array($aPrices))
             return false;
 

+ 13 - 0
modules/base/groups/template/css/prices.css

@@ -0,0 +1,13 @@
+/*--- Top Controls ---*/
+div.bx-grid-header div.bx-form-element-wrapper {
+    position: relative;
+    float: left;
+}
+
+div.bx-grid-header div#bx-form-element-role {
+    margin-right: 20px;
+}
+div.bx-grid-header div#bx-form-element-role,
+div.bx-grid-header div#bx-form-element-keyword {
+    margin-top: 0px;
+}

+ 26 - 6
modules/boonex/organizations/classes/BxOrgsConfig.php

@@ -43,6 +43,7 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
             'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
             'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
+            'TABLE_PRICES' => $aModule['db_prefix'] . 'prices',
 
             // database fields
             'FIELD_ID' => 'id',
@@ -67,6 +68,9 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             'FIELD_MULTICAT' => 'multicat',
             'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
 
+            'FIELD_PRICE_ROLE_ID' => 'role_id',
+            'FIELD_PRICE_NAME' => 'name',
+
             // page URIs
             'URI_VIEW_ENTRY' => 'view-organization-profile',
             'URI_VIEW_FRIENDS' => 'organization-profile-friends',
@@ -74,6 +78,7 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             'URI_VIEW_FAVORITES' => 'organization-profile-favorites',
             'URI_EDIT_ENTRY' => 'edit-organization-profile',
             'URI_EDIT_COVER' => 'edit-organization-cover',
+            'URI_JOIN_ENTRY' => 'join-organization-profile',
             'URI_JOINED_ENTRIES' => 'joined-organizations',
             'URI_MANAGE_COMMON' => 'organizations-manage',
             'URI_VIEW_SUBSCRIPTIONS' => 'organization-profile-subscriptions',
@@ -95,6 +100,8 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_organizations_per_page_browse_showcase',
             'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_organizations_per_page_browse_recommended',
             'PARAM_MMODE' => 'bx_organizations_members_mode',
+            'PARAM_PAID_JOIN_ENABLED' => true,
+            'PARAM_RECURRING_RESERVE' => 3, // 3 days for recurring payment to be registered
             'PARAM_PUBLIC_SBSN' => 'bx_organizations_public_subscriptions',
             'PARAM_PUBLIC_SBSD' => 'bx_organizations_public_subscribed_me',
             'PARAM_SBS_WO_JOIN' => 'bx_organizations_enable_subscribe_wo_join',
@@ -134,6 +141,9 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_organization_edit_cover',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_organization_delete',
             'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_organization_invite',
+            'OBJECT_FORM_PRICE' => 'bx_organizations_price',
+            'OBJECT_FORM_PRICE_DISPLAY_ADD' => 'bx_organizations_price_add',
+            'OBJECT_FORM_PRICE_DISPLAY_EDIT' => 'bx_organizations_price_edit',
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_organizations_view_actions', // actions menu on view entry page
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_organizations_view_actions_more', // actions menu on view entry page for "more" popup
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_organizations_view_actions_all', // all actions menu on view entry page
@@ -154,10 +164,13 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             'OBJECT_GRID_ADMINISTRATION' => 'bx_organizations_administration',
             'OBJECT_GRID_COMMON' => 'bx_organizations_common',
             'OBJECT_GRID_CONNECTIONS' => 'bx_organizations_fans',
+            'OBJECT_GRID_PRICES_MANAGE' => 'bx_organizations_prices_manage',
+            'OBJECT_GRID_PRICES_VIEW' => 'bx_organizations_prices_view',
             'OBJECT_CONNECTIONS' => 'bx_organizations_fans',
             'OBJECT_UPLOADERS_COVER' => array('bx_organizations_cover_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_organizations_picture_crop'),
             'OBJECT_PRE_LIST_ROLES' => 'bx_organizations_roles',
+            'OBJECT_PRE_LIST_PERIOD_UNITS' => 'bx_organizations_period_units',
             
             'BADGES_AVALIABLE' => true,
 
@@ -253,26 +266,33 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
                 'option_activation_on' => '_bx_orgs_option_activation_on',
             	'option_activation_off' => '_bx_orgs_option_activation_off',
             	'option_activation_add' => '_bx_orgs_option_activation_add',
-                'option_activation_edit' => '_bx_orgs_option_activation_edit'
+                'option_activation_edit' => '_bx_orgs_option_activation_edit',
+                'txt_n_unit' => '_bx_orgs_txt_n_unit',
+                'txt_buy_title' => '_bx_orgs_grid_action_title_buy_title',
+                'txt_cart_item_title' => '_bx_orgs_txt_cart_item_title',
+                'txt_subscribe_title' => '_bx_orgs_grid_action_title_subscribe_title',
+                'msg_performed' => '_bx_orgs_msg_performed',
+                'err_cannot_perform' => '_bx_orgs_err_cannot_perform',
             ),
         ));
 
         $this->_aJsClasses = array(
             'main' => 'BxOrgsMain',
             'manage_tools' => 'BxOrgsManageTools',
-            'categories' => 'BxDolCategories'
+            'categories' => 'BxDolCategories',
+            'prices' => 'BxOrgsPrices'
         );
 
         $this->_aJsObjects = array(
             'main' => 'oBxOrgsMain',
             'manage_tools' => 'oBxOrgsManageTools',
-            'categories' => 'oBxDolCategories'
+            'categories' => 'oBxDolCategories',
+            'prices' => 'oBxOrgsPrices'
         );
 
         $this->_aGridObjects = array(
-        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
-        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
-        	
+            'common' => $this->CNF['OBJECT_GRID_COMMON'],
+            'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
         );
     }
 

+ 22 - 0
modules/boonex/organizations/classes/BxOrgsCronPruning.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Organizations Organizations
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxOrgsCronPruning extends BxBaseModGroupsCronPruning
+{
+    public function __construct()
+    {
+        $this->_sModule = 'bx_organizations';
+
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/organizations/classes/BxOrgsFormPrice.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Organizations Organizations
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxOrgsFormPrice extends BxBaseModGroupsFormPrice
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_organizations';
+
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/organizations/classes/BxOrgsGridPricesManage.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Organizations Organizations
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxOrgsGridPricesManage extends BxBaseModGroupsGridPricesManage
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_organizations';
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 30 - 0
modules/boonex/organizations/classes/BxOrgsGridPricesView.php

@@ -0,0 +1,30 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Organizations Organizations
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxOrgsGridPricesView extends BxBaseModGroupsGridPricesView
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_organizations';
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+    
+    public function setSellerId($iSellerId = 0)
+    {
+        if(empty($iSellerId) && !empty($this->_iGroupProfileId))
+            $iSellerId = $this->_iGroupProfileId;
+
+        parent::setSellerId($iSellerId);
+    }
+}
+
+/** @} */

+ 10 - 0
modules/boonex/organizations/classes/BxOrgsMenuViewActionsAll.php

@@ -21,6 +21,11 @@ class BxOrgsMenuViewActionsAll extends BxBaseModGroupsMenuViewActionsAll
         parent::__construct($aObject, $oTemplate);
     }
 
+    protected function _getMenuItemJoinOrganizationProfile($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+
     protected function _getMenuItemEditOrganizationCover($aItem)
     {
         return $this->_getMenuItemByNameActionsMore($aItem);
@@ -31,6 +36,11 @@ class BxOrgsMenuViewActionsAll extends BxBaseModGroupsMenuViewActionsAll
         return $this->_getMenuItemByNameActionsMore($aItem);
     }
 
+    protected function _getMenuItemEditOrganizationPricing($aItem)
+    {
+        return $this->_getMenuItemByNameActionsMore($aItem);
+    }
+
     protected function _getMenuItemInviteToOrganization($aItem)
     {
         return $this->_getMenuItemByNameActionsMore($aItem);

+ 67 - 0
modules/boonex/organizations/install/langs/en.xml

@@ -88,7 +88,32 @@
     <string name="_bx_orgs_form_profile_input_sys_followers_count"><![CDATA[Followers count]]></string>
     <string name="_bx_orgs_form_profile_input_followers_count"><![CDATA[Followers count]]></string>
 
+    <string name="_bx_orgs_form_price"><![CDATA[Price]]></string>
+    <string name="_bx_orgs_form_price_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_orgs_form_price_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_orgs_form_price_input_sys_id"><![CDATA[ID]]></string>
+    <string name="_bx_orgs_form_price_input_sys_role_id"><![CDATA[Role ID]]></string>
+    <string name="_bx_orgs_form_price_input_sys_name"><![CDATA[Name]]></string>
+    <string name="_bx_orgs_form_price_input_name"><![CDATA[Name]]></string>
+    <string name="_bx_orgs_form_price_input_inf_name"><![CDATA[Unique value which will be used in back end and API calls]]></string>
+    <string name="_bx_orgs_form_price_input_err_name"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_orgs_form_price_input_sys_period"><![CDATA[Period]]></string>
+    <string name="_bx_orgs_form_price_input_period"><![CDATA[Period]]></string>
+    <string name="_bx_orgs_form_price_input_inf_period"><![CDATA[Use 0 for lifetime]]></string>
+    <string name="_bx_orgs_form_price_input_sys_period_unit"><![CDATA[Period unit]]></string>
+    <string name="_bx_orgs_form_price_input_period_unit"><![CDATA[Period unit]]></string>
+    <string name="_bx_orgs_form_price_input_inf_period_unit"><![CDATA[Leave empty for lifetime level.]]></string>
+    <string name="_bx_orgs_form_price_input_err_period_unit"><![CDATA[You need to select a period unit here.]]></string>
+    <string name="_bx_orgs_form_price_input_sys_price"><![CDATA[Price]]></string>
+    <string name="_bx_orgs_form_price_input_price"><![CDATA[Price]]></string>
+    <string name="_bx_orgs_form_price_input_inf_price"><![CDATA[Use 0 or leave empty to create free level.]]></string>
+    <string name="_bx_orgs_form_price_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_orgs_form_price_input_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_orgs_form_price_input_sys_do_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_orgs_form_price_input_do_cancel"><![CDATA[Cancel]]></string>
+
 	<string name="_bx_orgs_acl_action_create_profile"><![CDATA[Create Organization's Profile]]></string>
+        <string name="_bx_orgs_acl_action_use_paid_join"><![CDATA[Use paid join]]></string>
 	<string name="_bx_orgs_acl_action_delete_profile"><![CDATA[Delete Organization's Profile]]></string>
 	<string name="_bx_orgs_acl_action_view_profile"><![CDATA[View Organization's Profile]]></string>
 	<string name="_bx_orgs_acl_action_edit_any_profile"><![CDATA[Edit Any Organization's Profile]]></string>
@@ -101,6 +126,8 @@
 	<string name="_bx_orgs_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
 	<string name="_bx_orgs_page_title_sys_delete_profile"><![CDATA[Delete Profile]]></string>
 	<string name="_bx_orgs_page_title_delete_profile"><![CDATA[Delete Profile]]></string>
+        <string name="_bx_orgs_page_title_sys_join_profile"><![CDATA[Join Organization]]></string>
+	<string name="_bx_orgs_page_title_join_profile"><![CDATA[Join Organization]]></string>
 	<string name="_bx_orgs_page_title_sys_view_profile"><![CDATA[View Profile]]></string>
 	<string name="_bx_orgs_page_title_sys_view_profile_closed"><![CDATA[View Profile with Limited Visibility]]></string>
 	<string name="_bx_orgs_page_title_view_profile"><![CDATA[{display_name}]]></string>
@@ -131,6 +158,8 @@
     <string name="_bx_orgs_page_title_profile_comments"><![CDATA[Comments]]></string>
 	<string name="_bx_orgs_page_title_sys_profile_info"><![CDATA[Profile Info]]></string>
 	<string name="_bx_orgs_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
+        <string name="_bx_orgs_page_title_sys_profile_pricing"><![CDATA[Pricing]]></string>
+	<string name="_bx_orgs_page_title_profile_pricing"><![CDATA[Pricing]]></string>
 	<string name="_bx_orgs_page_title_sys_recent"><![CDATA[New Organizations]]></string>
 	<string name="_bx_orgs_page_title_recent"><![CDATA[New Organizations]]></string>
 	<string name="_bx_orgs_page_title_sys_manage"><![CDATA[Manage Own Organizations]]></string>
@@ -156,11 +185,15 @@
 	<string name="_bx_orgs_page_block_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
 	<string name="_bx_orgs_page_block_title_delete_profile"><![CDATA[Delete Profile]]></string>
 	<string name="_bx_orgs_page_block_title_profile_all_actions"><![CDATA[All Actions]]></string>
+        <string name="_bx_orgs_page_block_title_join_profile"><![CDATA[Join Organization]]></string>
 	<string name="_bx_orgs_page_block_title_profile_info_link"><![CDATA[About <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_orgs_page_block_title_profile_info"><![CDATA[Info]]></string>
 	<string name="_bx_orgs_page_block_title_system_profile_info"><![CDATA[Info]]></string>
 	<string name="_bx_orgs_page_block_title_profile_membership"><![CDATA[Membership]]></string>
 	<string name="_bx_orgs_page_block_title_system_profile_membership"><![CDATA[Membership]]></string>
+        <string name="_bx_orgs_page_block_title_system_profile_pricing"><![CDATA[Pricing]]></string>
+        <string name="_bx_orgs_page_block_title_profile_pricing"><![CDATA[Pricing]]></string>
+        <string name="_bx_orgs_page_block_title_profile_pricing_link"><![CDATA[Pricing of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_orgs_page_block_title_profile_description"><![CDATA[Description]]></string>
 	<string name="_bx_orgs_page_block_title_profile_favorites"><![CDATA[Favorite Organizations]]></string>
 	<string name="_bx_orgs_page_block_title_system_profile_favorites"><![CDATA[Favorite Organizations]]></string>
@@ -239,6 +272,8 @@
     <string name="_bx_orgs_menu_item_title_clear_reports"><![CDATA[Clear reports]]></string>
     <string name="_bx_orgs_menu_item_title_system_edit_cover"><![CDATA[Edit Cover]]></string>
     <string name="_bx_orgs_menu_item_title_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_orgs_menu_item_title_system_edit_pricing"><![CDATA[Edit Pricing]]></string>
+    <string name="_bx_orgs_menu_item_title_edit_pricing"><![CDATA[Edit Pricing]]></string>
     <string name="_bx_orgs_menu_item_title_system_edit_profile"><![CDATA[Edit Organization]]></string>
     <string name="_bx_orgs_menu_item_title_edit_profile"><![CDATA[Edit Profile]]></string>
     <string name="_bx_orgs_menu_item_title_system_delete_profile"><![CDATA[Delete Organization]]></string>
@@ -289,6 +324,8 @@
     <string name="_bx_orgs_menu_item_title_leave_organization"><![CDATA[Leave Organization]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization_cancel_request"><![CDATA[Cancel Request]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization_reject_request"><![CDATA[Reject Request]]></string>
+    <string name="_bx_orgs_menu_item_title_system_pay_and_join"><![CDATA[Pay & Join]]></string>
+    <string name="_bx_orgs_menu_item_title_pay_and_join"><![CDATA[Pay & Join]]></string>
     <string name="_bx_orgs_menu_item_title_system_subscribe"><![CDATA[Follow]]></string>
     <string name="_bx_orgs_menu_item_title_subscribe"><![CDATA[Follow]]></string>
     <string name="_bx_orgs_menu_item_title_system_unsubscribe"><![CDATA[Unfollow]]></string>
@@ -354,6 +391,22 @@
     <string name="_bx_orgs_grid_action_err_delete"><![CDATA[Cannot delete the selected organization(s).]]></string>
     <string name="_bx_orgs_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
 
+    <string name="_bx_orgs_grid_column_title_name"><![CDATA[Name]]></string>
+    <string name="_bx_orgs_grid_column_title_role_id"><![CDATA[Role]]></string>
+    <string name="_bx_orgs_grid_column_title_period"><![CDATA[Period]]></string>
+    <string name="_bx_orgs_grid_column_title_price"><![CDATA[Price]]></string>
+    <string name="_bx_orgs_grid_action_title_add"><![CDATA[Add]]></string>
+    <string name="_bx_orgs_grid_action_title_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_orgs_grid_action_title_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_orgs_grid_action_title_buy"><![CDATA[Buy]]></string>
+    <string name="_bx_orgs_grid_action_title_buy_title"><![CDATA[One-time payment]]></string>
+    <string name="_bx_orgs_grid_action_title_subscribe"><![CDATA[Subscribe]]></string>
+    <string name="_bx_orgs_grid_action_title_subscribe_title"><![CDATA[Create a subscription with recurring billing]]></string>
+    <string name="_bx_orgs_grid_action_title_choose"><![CDATA[Choose]]></string>
+    <string name="_bx_orgs_grid_action_title_choose_title"><![CDATA[Switch to the level for free]]></string>
+    <string name="_bx_orgs_popup_title_price_add"><![CDATA[Add Pricing Plan]]></string>
+    <string name="_bx_orgs_popup_title_price_edit"><![CDATA[Edit Pricing Plan]]></string>
+
     <string name="_bx_orgs_chart_growth"><![CDATA[Organizations: Growth]]></string>
     <string name="_bx_orgs_chart_growth_speed"><![CDATA[Organizations: Growth Speed]]></string>
 
@@ -407,6 +460,12 @@
     <string name="_bx_orgs_role_administrator"><![CDATA[Administrator]]></string>
     <string name="_bx_orgs_role_moderator"><![CDATA[Moderator]]></string>
 
+    <string name="_bx_orgs_pre_lists_period_units"><![CDATA[Billing Interval]]></string>
+    <string name="_bx_orgs_period_unit_day"><![CDATA[day]]></string>
+    <string name="_bx_orgs_period_unit_week"><![CDATA[week]]></string>
+    <string name="_bx_orgs_period_unit_month"><![CDATA[month]]></string>
+    <string name="_bx_orgs_period_unit_year"><![CDATA[year]]></string>
+
     <string name="_bx_organizations_alert_action_fan_added"><![CDATA[member joined]]></string>
     <string name="_bx_organizations_alert_action_join_invitation_notif"><![CDATA[join invitation]]></string>
     <string name="_bx_organizations_alert_action_join_request"><![CDATA[join request]]></string>
@@ -430,9 +489,17 @@
     <string name="_bx_orgs_txt_sample_pi_action_user"><![CDATA[{0} changed {1}]]></string>
     <string name="_bx_orgs_txt_N_friends"><![CDATA[{0} friends]]></string>
     <string name="_bx_orgs_txt_role"><![CDATA[Role]]></string>
+    <string name="_bx_orgs_txt_role_added"><![CDATA[Added]]></string>
+    <string name="_bx_orgs_txt_role_expired"><![CDATA[Expires]]></string>
     <string name="_bx_orgs_txt_set_role"><![CDATA[Set Role]]></string>
     <string name="_bx_orgs_txt_private_organization"><![CDATA[Private organization]]></string>
     <string name="_bx_orgs_ps_group_title_participants"><![CDATA[Employees]]></string>
+    <string name="_bx_orgs_txt_n_unit"><![CDATA[{0} ({1})]]></string>
+    <string name="_bx_orgs_txt_cart_item_title"><![CDATA[{0}: {1} ({2} {3})]]></string>
+
+    <string name="_bx_orgs_msg_performed"><![CDATA[The action was successfully performed.]]></string>
+    <string name="_bx_orgs_err_price_duplicate"><![CDATA[Similar pricing plan is already exists.]]></string>
+    <string name="_bx_orgs_err_cannot_perform"><![CDATA[An error appeared. Please report.]]></string>
 
     <string name="_bx_orgs_email_friend_request"><![CDATA[Friend request]]></string>
     <string name="_bx_orgs_email_friend_request_subject"><![CDATA[Friendship Request]]></string>

+ 4 - 1
modules/boonex/organizations/install/sql/disable.sql

@@ -8,7 +8,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_organizations';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_organizations' OR `object` IN('bx_organizations_create_profile', 'bx_organizations_delete_profile', 'bx_organizations_edit_profile', 'bx_organizations_edit_profile_cover', 'bx_organizations_invite', 'bx_organizations_view_profile', 'bx_organizations_view_profile_closed', 'bx_organizations_profile_info', 'bx_organizations_fans', 'bx_organizations_profile_friends', 'bx_organizations_friend_requests', 'bx_organizations_profile_favorites', 'bx_organizations_profile_subscriptions', 'bx_organizations_profile_comments', 'bx_organizations_home', 'bx_organizations_search', 'bx_organizations_manage', 'bx_organizations_joined');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_organizations' OR `object` IN('bx_organizations_create_profile', 'bx_organizations_delete_profile', 'bx_organizations_join_profile', 'bx_organizations_edit_profile', 'bx_organizations_edit_profile_cover', 'bx_organizations_invite', 'bx_organizations_view_profile', 'bx_organizations_view_profile_closed', 'bx_organizations_profile_info', 'bx_organizations_profile_pricing', 'bx_organizations_fans', 'bx_organizations_profile_friends', 'bx_organizations_friend_requests', 'bx_organizations_profile_favorites', 'bx_organizations_profile_subscriptions', 'bx_organizations_profile_comments', 'bx_organizations_home', 'bx_organizations_search', 'bx_organizations_manage', 'bx_organizations_joined');
 
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_organizations';
@@ -58,3 +58,6 @@ DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_organizations';
 
 -- UPLOADERS
 DELETE FROM `sys_objects_uploader` WHERE `object` IN ('bx_organizations_cover_crop', 'bx_organizations_picture_crop');
+
+-- CRON
+DELETE FROM `sys_cron_jobs` WHERE `name` IN ('bx_organizations_pruning');

+ 92 - 28
modules/boonex/organizations/install/sql/enable.sql

@@ -98,6 +98,13 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_organizations_delete_profile', 1, 'bx_organizations', '_bx_orgs_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:16:\"bx_organizations\";s:6:\"method\";s:13:\"entity_delete\";}', 0, 0, 0);
 
+-- PAGE: join profile
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_organizations_join_profile', 'join-organization-profile', '_bx_orgs_page_title_sys_join_profile', '_bx_orgs_page_title_join_profile', 'bx_organizations', 5, 2147483647, 1, 'page.php?i=join-organization-profile', '', '', '', 0, 1, 0, 'BxOrgsPageEntry', 'modules/boonex/organizations/classes/BxOrgsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_organizations_join_profile', 1, 'bx_organizations', '_bx_orgs_page_block_title_join_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:16:"bx_organizations";s:6:"method";s:11:"entity_join";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 0, 0);
+
 -- PAGE: profile info
 INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_organizations_profile_info', 'organization-profile-info', '_bx_orgs_page_title_sys_profile_info', '_bx_orgs_page_title_profile_info', 'bx_organizations', 5, 2147483647, 1, 'page.php?i=organization-profile-info', '', '', '', 0, 1, 0, 'BxOrgsPageEntry', 'modules/boonex/organizations/classes/BxOrgsPageEntry.php');
@@ -106,6 +113,13 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_organizations_profile_info', 1, 'bx_organizations', '_bx_orgs_page_block_title_system_profile_info', '_bx_orgs_page_block_title_profile_info_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:16:\"bx_organizations\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1, 1),
 ('bx_organizations_profile_info', 1, 'bx_organizations', '', '_bx_orgs_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:16:\"bx_organizations\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 2);
 
+-- PAGE: manage profile pricing
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_organizations_profile_pricing', 'edit-organization-pricing', '_bx_orgs_page_title_sys_profile_pricing', '_bx_orgs_page_title_profile_pricing', 'bx_organizations', 5, 2147483647, 1, 'page.php?i=edit-organization-pricing', '', '', '', 0, 1, 0, 'BxOrgsPageEntry', 'modules/boonex/organizations/classes/BxOrgsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_organizations_profile_pricing', 1, 'bx_organizations', '_bx_orgs_page_block_title_system_profile_pricing', '_bx_orgs_page_block_title_profile_pricing_link', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:16:"bx_organizations";s:6:"method";s:14:"entity_pricing";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 0, 1, 1);
+
 -- PAGE: group fans
 INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_organizations_fans', 'organization-profile-fans', '_bx_orgs_page_title_sys_fans', '_bx_orgs_page_title_fans', 'bx_organizations', 5, 2147483647, 1, 'page.php?i=organization-profile-fans', '', '', '', 0, 1, 0, 'BxOrgsPageEntry', 'modules/boonex/organizations/classes/BxOrgsPageEntry.php');
@@ -274,6 +288,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_organizations_view_actions', 'bx_organizations', '_bx_orgs_menu_set_title_view_profile_actions', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_organizations_view_actions', 'bx_organizations', 'join-organization-profile', '_bx_orgs_menu_item_title_system_pay_and_join', '_bx_orgs_menu_item_title_pay_and_join', 'page.php?i=join-organization-profile&profile_id={profile_id}', '', '', 'sign-in-alt', '', 0, 2147483647, 'a:3:{s:6:"module";s:16:"bx_organizations";s:6:"method";s:22:"is_paid_join_avaliable";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 1, 0, 0, 4),
 ('bx_organizations_view_actions', 'bx_organizations', 'profile-fan-add', '_bx_orgs_menu_item_title_system_become_fan', '{title_add_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_organizations_fans\', \'add\', \'{profile_id}\')', '', 'sign-in-alt', '', 0, 2147483647, '', 1, 0, 0, 5),
 ('bx_organizations_view_actions', 'bx_organizations', 'profile-friend-add', '_bx_orgs_menu_item_title_system_befriend', '{title_add_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'add\', \'{profile_id}\')', '', 'user-plus', '', 0, 2147483647, '', 1, 0, 1, 10),
 ('bx_organizations_view_actions', 'bx_organizations', 'profile-relation-add', '_bx_orgs_menu_item_title_system_relation_add', '_bx_orgs_menu_item_title_relation_add', 'javascript:void(0)', 'bx_menu_popup(''sys_add_relation'', window, {}, {profile_id: {profile_id}});', '', 'sync', '', 0, 2147483647, '', 1, 0, 1, 15),
@@ -289,17 +304,18 @@ INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `templat
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_organizations_view_actions_more', 'bx_organizations', '_bx_orgs_menu_set_title_view_profile_actions_more', 0);
 
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-('bx_organizations_view_actions_more', 'bx_organizations', 'profile-fan-remove', '_bx_orgs_menu_item_title_system_leave_organization', '{title_remove_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_organizations_fans\', \'remove\', \'{profile_id}\')', '', 'sign-out-alt', '', 2147483647, 1, 0, 10),
-('bx_organizations_view_actions_more', 'bx_organizations', 'profile-friend-remove', '_bx_orgs_menu_item_title_system_unfriend', '{title_remove_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'remove\', \'{profile_id}\')', '', 'user-minus', '', 2147483647, 1, 0, 10),
-('bx_organizations_view_actions_more', 'bx_organizations', 'profile-relation-remove', '_bx_orgs_menu_item_title_system_relation_delete', '_bx_orgs_menu_item_title_relation_delete', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_relations\', \'remove\', \'{profile_id}\')', '', 'sync', '', 2147483647, 1, 0, 15),
-('bx_organizations_view_actions_more', 'bx_organizations', 'profile-subscribe-remove', '_bx_orgs_menu_item_title_system_unsubscribe', '_bx_orgs_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
-('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-cover', '_bx_orgs_menu_item_title_system_edit_cover', '_bx_orgs_menu_item_title_edit_cover', 'page.php?i=edit-organization-cover&id={content_id}', '', '', 'edit', '', 2147483647, 1, 0, 25),
-('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-profile', '_bx_orgs_menu_item_title_system_edit_profile', '_bx_orgs_menu_item_title_edit_profile', 'page.php?i=edit-organization-profile&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 30),
-('bx_organizations_view_actions_more', 'bx_organizations', 'invite-to-organization', '_bx_orgs_menu_item_title_system_invite', '_bx_orgs_menu_item_title_invite', 'page.php?i=invite-to-organization&id={content_id}', '', '', 'user-friends', '', 2147483647, 1, 0, 32),
-('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-profile', '_bx_orgs_menu_item_title_system_delete_profile', '_bx_orgs_menu_item_title_delete_profile', 'page.php?i=delete-organization-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40),
-('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account', '_bx_orgs_menu_item_title_system_delete_account', '_bx_orgs_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}', '', '', 'user-times', '', 128, 1, 0, 50),
-('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account-content', '_bx_orgs_menu_item_title_system_delete_account_content', '_bx_orgs_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'trash', '', 128, 1, 0, 60);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('bx_organizations_view_actions_more', 'bx_organizations', 'profile-fan-remove', '_bx_orgs_menu_item_title_system_leave_organization', '{title_remove_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_organizations_fans\', \'remove\', \'{profile_id}\')', '', 'sign-out-alt', '', 2147483647, '', 1, 0, 10),
+('bx_organizations_view_actions_more', 'bx_organizations', 'profile-friend-remove', '_bx_orgs_menu_item_title_system_unfriend', '{title_remove_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'remove\', \'{profile_id}\')', '', 'user-minus', '', 2147483647, '', 1, 0, 10),
+('bx_organizations_view_actions_more', 'bx_organizations', 'profile-relation-remove', '_bx_orgs_menu_item_title_system_relation_delete', '_bx_orgs_menu_item_title_relation_delete', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_relations\', \'remove\', \'{profile_id}\')', '', 'sync', '', 2147483647, '', 1, 0, 15),
+('bx_organizations_view_actions_more', 'bx_organizations', 'profile-subscribe-remove', '_bx_orgs_menu_item_title_system_unsubscribe', '_bx_orgs_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, '', 1, 0, 20),
+('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-cover', '_bx_orgs_menu_item_title_system_edit_cover', '_bx_orgs_menu_item_title_edit_cover', 'page.php?i=edit-organization-cover&id={content_id}', '', '', 'edit', '', 2147483647, '', 1, 0, 25),
+('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-profile', '_bx_orgs_menu_item_title_system_edit_profile', '_bx_orgs_menu_item_title_edit_profile', 'page.php?i=edit-organization-profile&id={content_id}', '', '', 'pencil-alt', '', 2147483647, '', 1, 0, 30),
+('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-pricing', '_bx_orgs_menu_item_title_system_edit_pricing', '_bx_orgs_menu_item_title_edit_pricing', 'page.php?i=edit-organization-pricing&profile_id={profile_id}', '', '', 'money-check-alt', '', 2147483647, 'a:3:{s:6:"module";s:16:"bx_organizations";s:6:"method";s:20:"is_pricing_avaliable";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 1, 0, 41),
+('bx_organizations_view_actions_more', 'bx_organizations', 'invite-to-organization', '_bx_orgs_menu_item_title_system_invite', '_bx_orgs_menu_item_title_invite', 'page.php?i=invite-to-organization&id={content_id}', '', '', 'user-friends', '', 2147483647, '', 1, 0, 32),
+('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-profile', '_bx_orgs_menu_item_title_system_delete_profile', '_bx_orgs_menu_item_title_delete_profile', 'page.php?i=delete-organization-profile&id={content_id}', '', '', 'remove', '', 2147483647, '', 1, 0, 40),
+('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account', '_bx_orgs_menu_item_title_system_delete_account', '_bx_orgs_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}', '', '', 'user-times', '', 128, '', 1, 0, 50),
+('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account-content', '_bx_orgs_menu_item_title_system_delete_account_content', '_bx_orgs_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'trash', '', 128, '', 1, 0, 60);
 
 -- MENU: all actions menu for view entry 
 
@@ -310,6 +326,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_organizations_view_actions_all', 'bx_organizations', '_sys_menu_set_title_view_actions', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES 
+('bx_organizations_view_actions_all', 'bx_organizations', 'join-organization-profile', '_bx_orgs_menu_item_title_system_pay_and_join', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 5),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-fan-add', '_bx_orgs_menu_item_title_system_become_fan', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-fan-remove', '_bx_orgs_menu_item_title_system_leave_organization', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-friend-add', '_bx_orgs_menu_item_title_system_befriend', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
@@ -334,6 +351,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_organizations_view_actions_all', 'bx_organizations', 'social-sharing-pinterest', '_sys_menu_item_title_system_social_sharing_pinterest', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 330),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'edit-organization-cover', '_bx_orgs_menu_item_title_system_edit_cover', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 400),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'edit-organization-profile', '_bx_orgs_menu_item_title_system_edit_profile', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 410),
+('bx_organizations_view_actions_all', 'bx_organizations', 'edit-organization-pricing', '_bx_orgs_menu_item_title_system_edit_pricing', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 415),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'invite-to-organization', '_bx_orgs_menu_item_title_system_invite', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 420),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'delete-organization-profile', '_bx_orgs_menu_item_title_system_delete_profile', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 430),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'delete-organization-account', '_bx_orgs_menu_item_title_system_delete_account', '', '', '', '', '', '', '', 0, 128, '', 1, 0, 440),
@@ -390,22 +408,23 @@ INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `templat
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_organizations_snippet_meta', 'bx_organizations', '_sys_menu_set_title_snippet_meta', 0);
 
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
-('bx_organizations_snippet_meta', 'bx_organizations', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 0, 0, 1, 1),
-('bx_organizations_snippet_meta', 'bx_organizations', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 2),
-('bx_organizations_snippet_meta', 'bx_organizations', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
-('bx_organizations_snippet_meta', 'bx_organizations', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
-('bx_organizations_snippet_meta', 'bx_organizations', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 2147483647, 1, 0, 1, 5),
-('bx_organizations_snippet_meta', 'bx_organizations', 'friends', '_sys_menu_item_title_system_sm_friends', '_sys_menu_item_title_sm_friends', '', '', '', '', '', 2147483647, 1, 0, 1, 6),
-('bx_organizations_snippet_meta', 'bx_organizations', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, 0, 0, 1, 7),
-('bx_organizations_snippet_meta', 'bx_organizations', 'membership', '_sys_menu_item_title_system_sm_membership', '_sys_menu_item_title_sm_membership', '', '', '', '', '', 2147483647, 0, 0, 1, 8),
-('bx_organizations_snippet_meta', 'bx_organizations', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, 1, 0, 1, 9),
-('bx_organizations_snippet_meta', 'bx_organizations', 'join', '_sys_menu_item_title_system_sm_join', '_sys_menu_item_title_sm_join', '', '', '', '', '', 2147483647, 1, 0, 1, 10),
-('bx_organizations_snippet_meta', 'bx_organizations', 'leave', '_sys_menu_item_title_system_sm_leave', '_sys_menu_item_title_sm_leave', '', '', '', '', '', 2147483647, 0, 0, 1, 11),
-('bx_organizations_snippet_meta', 'bx_organizations', 'befriend', '_sys_menu_item_title_system_sm_befriend', '_sys_menu_item_title_sm_befriend', '', '', '', '', '', 2147483647, 1, 0, 1, 12),
-('bx_organizations_snippet_meta', 'bx_organizations', 'unfriend', '_sys_menu_item_title_system_sm_unfriend', '_sys_menu_item_title_sm_unfriend', '', '', '', '', '', 2147483647, 0, 0, 1, 13),
-('bx_organizations_snippet_meta', 'bx_organizations', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, 0, 0, 1, 14),
-('bx_organizations_snippet_meta', 'bx_organizations', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, 0, 0, 1, 15);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_organizations_snippet_meta', 'bx_organizations', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, '', 0, 0, 1, 1),
+('bx_organizations_snippet_meta', 'bx_organizations', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, '', 0, 0, 1, 2),
+('bx_organizations_snippet_meta', 'bx_organizations', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, '', 0, 0, 1, 3),
+('bx_organizations_snippet_meta', 'bx_organizations', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, '', 0, 0, 1, 4),
+('bx_organizations_snippet_meta', 'bx_organizations', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 2147483647, '', 1, 0, 1, 5),
+('bx_organizations_snippet_meta', 'bx_organizations', 'friends', '_sys_menu_item_title_system_sm_friends', '_sys_menu_item_title_sm_friends', '', '', '', '', '', 2147483647, '', 1, 0, 1, 6),
+('bx_organizations_snippet_meta', 'bx_organizations', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, '', 0, 0, 1, 7),
+('bx_organizations_snippet_meta', 'bx_organizations', 'membership', '_sys_menu_item_title_system_sm_membership', '_sys_menu_item_title_sm_membership', '', '', '', '', '', 2147483647, '', 0, 0, 1, 8),
+('bx_organizations_snippet_meta', 'bx_organizations', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, '', 1, 0, 1, 9),
+('bx_organizations_snippet_meta', 'bx_organizations', 'join-paid', '_sys_menu_item_title_system_sm_join_paid', '_sys_menu_item_title_sm_join_paid', '', '', '', '', '', 2147483647, 'a:3:{s:6:"module";s:16:"bx_organizations";s:6:"method";s:33:"is_paid_join_avaliable_by_content";s:6:"params";a:1:{i:0;s:12:"{content_id}";}}', 1, 0, 1, 10),
+('bx_organizations_snippet_meta', 'bx_organizations', 'join', '_sys_menu_item_title_system_sm_join', '_sys_menu_item_title_sm_join', '', '', '', '', '', 2147483647, 'a:3:{s:6:"module";s:16:"bx_organizations";s:6:"method";s:33:"is_free_join_avaliable_by_content";s:6:"params";a:1:{i:0;s:12:"{content_id}";}}', 1, 0, 1, 11),
+('bx_organizations_snippet_meta', 'bx_organizations', 'leave', '_sys_menu_item_title_system_sm_leave', '_sys_menu_item_title_sm_leave', '', '', '', '', '', 2147483647, '', 0, 0, 1, 12),
+('bx_organizations_snippet_meta', 'bx_organizations', 'befriend', '_sys_menu_item_title_system_sm_befriend', '_sys_menu_item_title_sm_befriend', '', '', '', '', '', 2147483647, '', 1, 0, 1, 13),
+('bx_organizations_snippet_meta', 'bx_organizations', 'unfriend', '_sys_menu_item_title_system_sm_unfriend', '_sys_menu_item_title_sm_unfriend', '', '', '', '', '', 2147483647, '', 0, 0, 1, 14),
+('bx_organizations_snippet_meta', 'bx_organizations', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, '', 0, 0, 1, 15),
+('bx_organizations_snippet_meta', 'bx_organizations', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, '', 0, 0, 1, 16);
 
 -- MENU: notifications menu in account popup
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' AND `active` = 1 AND `order` < 9999 ORDER BY `order` DESC LIMIT 1);
@@ -451,6 +470,10 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
 ('bx_organizations', 'create entry', NULL, '_bx_orgs_acl_action_create_profile', '', 1, 1);
 SET @iIdActionProfileCreate = LAST_INSERT_ID();
 
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_organizations', 'use paid join', NULL, '_bx_orgs_acl_action_use_paid_join', '', 1, 1);
+SET @iIdActionUsePaidJoin = LAST_INSERT_ID();
+
 INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
 ('bx_organizations', 'delete entry', NULL, '_bx_orgs_acl_action_delete_profile', '', 1, 1);
 SET @iIdActionProfileDelete = LAST_INSERT_ID();
@@ -488,6 +511,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionProfileCreate),
 (@iPremium, @iIdActionProfileCreate),
 
+-- use paid join
+(@iStandard, @iIdActionUsePaidJoin),
+(@iModerator, @iIdActionUsePaidJoin),
+(@iAdministrator, @iIdActionUsePaidJoin),
+(@iPremium, @iIdActionUsePaidJoin),
+
 -- profile delete
 (@iAccount, @iIdActionProfileDelete),
 (@iStandard, @iIdActionProfileDelete),
@@ -557,7 +586,9 @@ INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `fie
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
 ('bx_organizations_fans', 'name', '_sys_name', '50%', '', 10),
 ('bx_organizations_fans', 'role', '_bx_orgs_txt_role', '10%', '', 15),
-('bx_organizations_fans', 'actions', '', '40%', '', 20);
+('bx_organizations_fans', 'role_added', '_bx_orgs_txt_role_added', '10%', '', 16),
+('bx_organizations_fans', 'role_expired', '_bx_orgs_txt_role_expired', '10%', '', 17),
+('bx_organizations_fans', 'actions', '', '20%', '', 20);
 
 INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
 ('bx_organizations_fans', 'single', 'accept', '_sys_accept', '', 0, 10),
@@ -596,6 +627,34 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 ('bx_organizations_common', 'bulk', 'delete_with_content', '_bx_orgs_grid_action_title_adm_delete_with_content', '', 0, 1, 2),
 ('bx_organizations_common', 'single', 'settings', '_bx_orgs_grid_action_title_adm_more_actions', 'cog', 1, 0, 1);
 
+-- GRIDS: Pricing
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_organizations_prices_manage', 'Sql', 'SELECT * FROM `bx_organizations_prices` WHERE 1 ', 'bx_organizations_prices', 'id', 'order', '', '', 100, NULL, 'start', '', 'period,period_unit,price', '', 'like', '', '', 2147483647, 'BxOrgsGridPricesManage', 'modules/boonex/organizations/classes/BxOrgsGridPricesManage.php'),
+('bx_organizations_prices_view', 'Sql', 'SELECT * FROM `bx_organizations_prices` WHERE 1 ', 'bx_organizations_prices', 'id', 'order', '', '', 100, NULL, 'start', '', 'period,period_unit,price', '', 'like', '', '', 2147483647, 'BxOrgsGridPricesView', 'modules/boonex/organizations/classes/BxOrgsGridPricesView.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_organizations_prices_manage', 'checkbox', '_sys_select', '1%', 0, '', '', 1),
+('bx_organizations_prices_manage', 'order', '', '1%', 0, '', '', 2),
+('bx_organizations_prices_manage', 'name', '_bx_orgs_grid_column_title_name', '38%', 0, 32, '', 3),
+('bx_organizations_prices_manage', 'price', '_bx_orgs_grid_column_title_price', '20%', 0, 16, '', 4),
+('bx_organizations_prices_manage', 'period', '_bx_orgs_grid_column_title_period', '20%', 0, 16, '', 5),
+('bx_organizations_prices_manage', 'actions', '', '20%', 0, '', '', 6),
+
+('bx_organizations_prices_view', 'role_id', '_bx_orgs_grid_column_title_role_id', '40%', 0, 32, '', 1),
+('bx_organizations_prices_view', 'price', '_bx_orgs_grid_column_title_price', '20%', 0, 16, '', 2),
+('bx_organizations_prices_view', 'period', '_bx_orgs_grid_column_title_period', '20%', 0, 16, '', 3),
+('bx_organizations_prices_view', 'actions', '', '20%', 0, '', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_organizations_prices_manage', 'independent', 'add', '_bx_orgs_grid_action_title_add', '', 0, 0, 1),
+('bx_organizations_prices_manage', 'single', 'edit', '_bx_orgs_grid_action_title_edit', 'pencil-alt', 1, 0, 1),
+('bx_organizations_prices_manage', 'single', 'delete', '_bx_orgs_grid_action_title_delete', 'remove', 1, 1, 2),
+('bx_organizations_prices_manage', 'bulk', 'delete', '_bx_orgs_grid_action_title_delete', '', 0, 1, 1),
+
+('bx_organizations_prices_view', 'single', 'buy', '_bx_orgs_grid_action_title_buy', 'cart-plus', 0, 0, 1),
+('bx_organizations_prices_view', 'single', 'subscribe', '_bx_orgs_grid_action_title_subscribe', 'credit-card', 0, 0, 2),
+('bx_organizations_prices_view', 'single', 'choose', '_bx_orgs_grid_action_title_choose', 'far check-square', 0, 0, 3);
+
 
 -- LIVE UPDATES
 INSERT INTO `sys_objects_live_updates`(`name`, `frequency`, `service_call`, `active`) VALUES
@@ -657,3 +716,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
 ('bx_organizations_cover_crop', 1, 'BxOrgsUploaderCoverCrop', 'modules/boonex/organizations/classes/BxOrgsUploaderCoverCrop.php'),
 ('bx_organizations_picture_crop', 1, 'BxOrgsUploaderPictureCrop', 'modules/boonex/organizations/classes/BxOrgsUploaderPictureCrop.php');
+
+
+-- CRON
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_organizations_pruning', '0 0 * * *', 'BxOrgsCronPruning', 'modules/boonex/organizations/classes/BxOrgsCronPruning.php', '');

+ 66 - 0
modules/boonex/organizations/install/sql/install.sql

@@ -219,7 +219,9 @@ CREATE TABLE IF NOT EXISTS `bx_organizations_admins` (
   `group_profile_id` int(10) unsigned NOT NULL,
   `fan_id` int(10) unsigned NOT NULL,
   `role` int(10) unsigned NOT NULL default '0',
+  `order` varchar(32) NOT NULL default '',
   `added` int(11) unsigned NOT NULL default '0',
+  `expired` int(11) unsigned NOT NULL default '0',
   PRIMARY KEY (`id`),
   UNIQUE KEY `admin` (`group_profile_id`,`fan_id`)
 );
@@ -243,6 +245,21 @@ CREATE TABLE IF NOT EXISTS `bx_organizations_scores_track` (
   KEY `vote` (`object_id`, `author_nip`)
 );
 
+-- TABLE: Pricing
+CREATE TABLE IF NOT EXISTS `bx_organizations_prices` (
+  `id` int(11) NOT NULL auto_increment,
+  `profile_id` int(11) NOT NULL default '0',
+  `role_id` int(11) unsigned NOT NULL default '0',
+  `name` varchar(128) NOT NULL default '',
+  `period` int(11) unsigned NOT NULL default '1',
+  `period_unit` varchar(32) NOT NULL default '',
+  `price` float unsigned NOT NULL default '1',
+  `order` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `name` (`name`),
+  UNIQUE KEY `type` (`profile_id`, `role_id`,`period`, `period_unit`)
+);
+
 
 -- STORAGES & TRANSCODERS
 INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
@@ -356,6 +373,45 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_organization_view_full', 'profile_email', 192, 1, 4),
 ('bx_organization_view_full', 'profile_status', 192, 1, 5);
 
+-- FORMS: Price
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_organizations_price', 'bx_organizations', '_bx_orgs_form_price', '', '', 'do_submit', 'bx_organizations_prices', 'id', '', '', '', 0, 1, 'BxOrgsFormPrice', 'modules/boonex/organizations/classes/BxOrgsFormPrice.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_organizations_price_add', 'bx_organizations', 'bx_organizations_price', '_bx_orgs_form_price_display_add', 0),
+('bx_organizations_price_edit', 'bx_organizations', 'bx_organizations_price', '_bx_orgs_form_price_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_organizations_price', 'bx_organizations', 'id', '', '', 0, 'hidden', '_bx_orgs_form_price_input_sys_id', '', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'role_id', '', '', 0, 'hidden', '_bx_orgs_form_price_input_sys_role_id', '', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'name', '', '', 0, 'text', '_bx_orgs_form_price_input_sys_name', '_bx_orgs_form_price_input_name', '_bx_orgs_form_price_input_inf_name', 1, 0, 0, '', '', '', 'Avail', '', '_bx_orgs_form_price_input_err_name', 'Xss', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'period', '', '', 0, 'text', '_bx_orgs_form_price_input_sys_period', '_bx_orgs_form_price_input_period', '_bx_orgs_form_price_input_inf_period', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'period_unit', '', '#!bx_organizations_period_units', 0, 'select', '_bx_orgs_form_price_input_sys_period_unit', '_bx_orgs_form_price_input_period_unit', '_bx_orgs_form_price_input_inf_period_unit', 1, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'price', '', '', 0, 'text', '_bx_orgs_form_price_input_sys_price', '_bx_orgs_form_price_input_price', '_bx_orgs_form_price_input_inf_price', 1, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'do_submit', '_bx_orgs_form_price_input_do_submit', '', 0, 'submit', '_bx_orgs_form_price_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_organizations_price', 'bx_organizations', 'do_cancel', '_bx_orgs_form_price_input_do_cancel', '', 0, 'button', '_bx_orgs_form_price_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_organizations_price_add', 'id', 2147483647, 0, 1),
+('bx_organizations_price_add', 'role_id', 2147483647, 1, 2),
+('bx_organizations_price_add', 'name', 2147483647, 1, 3),
+('bx_organizations_price_add', 'price', 2147483647, 1, 4),
+('bx_organizations_price_add', 'period', 2147483647, 1, 5),
+('bx_organizations_price_add', 'period_unit', 2147483647, 1, 6),
+('bx_organizations_price_add', 'controls', 2147483647, 1, 7),
+('bx_organizations_price_add', 'do_submit', 2147483647, 1, 8),
+('bx_organizations_price_add', 'do_cancel', 2147483647, 1, 9),
+
+('bx_organizations_price_edit', 'id', 2147483647, 1, 1),
+('bx_organizations_price_edit', 'role_id', 2147483647, 1, 2),
+('bx_organizations_price_edit', 'name', 2147483647, 1, 3),
+('bx_organizations_price_edit', 'price', 2147483647, 1, 4),
+('bx_organizations_price_edit', 'period', 2147483647, 1, 5),
+('bx_organizations_price_edit', 'period_unit', 2147483647, 1, 6),
+('bx_organizations_price_edit', 'controls', 2147483647, 1, 7),
+('bx_organizations_price_edit', 'do_submit', 2147483647, 1, 8),
+('bx_organizations_price_edit', 'do_cancel', 2147483647, 1, 9);
 
 -- PRE-VALUES
 INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
@@ -407,6 +463,16 @@ INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALU
 ('bx_organizations_roles', '1', 2, '_bx_orgs_role_administrator', ''),
 ('bx_organizations_roles', '2', 3, '_bx_orgs_role_moderator', '');
 
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_organizations_period_units', '_bx_orgs_pre_lists_period_units', 'bx_organizations', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_organizations_period_units', '', 0, '_sys_please_select', ''),
+('bx_organizations_period_units', 'day', 1, '_bx_orgs_period_unit_day', ''),
+('bx_organizations_period_units', 'week', 2, '_bx_orgs_period_unit_week', ''),
+('bx_organizations_period_units', 'month', 3, '_bx_orgs_period_unit_month', ''),
+('bx_organizations_period_units', 'year', 4, '_bx_orgs_period_unit_year', '');
+
 -- COMMENTS
 INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
 ('bx_organizations', 'bx_organizations', 'bx_organizations_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-organization-profile&id={object_id}', '', 'bx_organizations_data', 'id', 'author', 'org_name', 'comments', 'BxOrgsCmts', 'modules/boonex/organizations/classes/BxOrgsCmts.php'),

+ 2 - 2
modules/boonex/organizations/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_organizations_data`, `bx_organizations_pics`, `bx_organizations_pics_resized`, `bx_organizations_cmts`, `bx_organizations_cmts_notes`, `bx_organizations_views_track`, `bx_organizations_votes`, `bx_organizations_votes_track`, `bx_organizations_favorites_track`, `bx_organizations_favorites_lists`, `bx_organizations_reports`, `bx_organizations_reports_track`, `bx_organizations_meta_keywords`, `bx_organizations_meta_locations`, `bx_organizations_meta_mentions`, `bx_organizations_fans`, `bx_organizations_admins`, `bx_organizations_scores`, `bx_organizations_scores_track`;
+DROP TABLE IF EXISTS `bx_organizations_data`, `bx_organizations_pics`, `bx_organizations_pics_resized`, `bx_organizations_cmts`, `bx_organizations_cmts_notes`, `bx_organizations_views_track`, `bx_organizations_votes`, `bx_organizations_votes_track`, `bx_organizations_favorites_track`, `bx_organizations_favorites_lists`, `bx_organizations_reports`, `bx_organizations_reports_track`, `bx_organizations_meta_keywords`, `bx_organizations_meta_locations`, `bx_organizations_meta_mentions`, `bx_organizations_fans`, `bx_organizations_admins`, `bx_organizations_scores`, `bx_organizations_scores_track`, `bx_organizations_prices`;
 
 -- PROFILES
 DELETE FROM sys_profiles WHERE `type` = 'bx_organizations';
@@ -17,7 +17,7 @@ DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_organ
 DELETE FROM `sys_objects_form` WHERE `module` = 'bx_organizations';
 DELETE FROM `sys_form_displays` WHERE `module` = 'bx_organizations';
 DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_organizations';
-DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_organization_add', 'bx_organization_delete', 'bx_organization_edit', 'bx_organization_edit_cover', 'bx_organization_view', 'bx_organization_view_full', 'bx_organization_invite');
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_organization_add', 'bx_organization_delete', 'bx_organization_edit', 'bx_organization_edit_cover', 'bx_organization_view', 'bx_organization_view_full', 'bx_organization_invite', 'bx_organizations_price_add', 'bx_organizations_price_edit');
 
 -- PRE-VALUES
 DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_organizations';

+ 59 - 0
modules/boonex/organizations/js/prices.js

@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Organizations Organizations
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+
+function BxOrgsPrices(oOptions) {
+    this._sActionsUri = oOptions.sActionUri;
+    this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxOrgsPrices' : oOptions.sObjName;
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxOrgsPrices.prototype.checkName = function(sNameId, iId) {
+    var oDate = new Date();
+
+    var oName = jQuery("[name='" + sNameId + "']");
+    var sName = oName.val();
+
+    if(!sName.length)
+        return;
+
+    jQuery.get(
+        this._sActionsUrl + 'check_name',
+        {
+            name: sName,
+            id: iId && parseInt(iId) > 0 ? iId : 0,
+            _t: oDate.getTime()
+        },
+        function(oData) {
+            if(!oData || oData.name == undefined)
+                return;
+
+            oName.val(oData.name);
+        },
+        'json'
+    );
+};
+
+BxOrgsPrices.prototype.onChangeRole = function() {
+    this.reloadGrid($('#bx-grid-level-' + this._sObjNameGrid).val());
+};
+
+BxOrgsPrices.prototype.reloadGrid = function(iRoleId) {
+    if(glGrids[this._sObjNameGrid]._oQueryAppend['role_id'] == iRoleId)
+        return;
+
+    glGrids[this._sObjNameGrid]._oQueryAppend['role_id'] = iRoleId;
+    glGrids[this._sObjNameGrid].reload(0);
+};
+
+/** @} */

+ 1 - 0
modules/boonex/organizations/template/css/prices.css

@@ -0,0 +1 @@
+@import url(../../../../base/groups/template/css/prices.css);

+ 1 - 0
modules/boonex/organizations/template/popup_price.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/popup_price.html />

+ 67 - 0
modules/boonex/russian/data/langs/bx_organizations/ru.xml

@@ -85,7 +85,32 @@
     <string name="_bx_orgs_form_profile_input_followers_count"><![CDATA[Количество подписчиков]]></string>
     <string name="_bx_orgs_form_entry_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
 
+    <string name="_bx_orgs_form_price"><![CDATA[Цена]]></string>
+    <string name="_bx_orgs_form_price_display_add"><![CDATA[Добавление]]></string>
+    <string name="_bx_orgs_form_price_display_edit"><![CDATA[Редактирование]]></string>
+    <string name="_bx_orgs_form_price_input_sys_id"><![CDATA[ID]]></string>
+    <string name="_bx_orgs_form_price_input_sys_role_id"><![CDATA[ID роли]]></string>
+    <string name="_bx_orgs_form_price_input_sys_name"><![CDATA[Имя]]></string>
+    <string name="_bx_orgs_form_price_input_name"><![CDATA[Имя]]></string>
+    <string name="_bx_orgs_form_price_input_inf_name"><![CDATA[Уникальное значение, которое будет использоваться в серверной части и API запросах]]></string>
+    <string name="_bx_orgs_form_price_input_err_name"><![CDATA[Введите уникальное значение]]></string>
+    <string name="_bx_orgs_form_price_input_sys_period"><![CDATA[Период]]></string>
+    <string name="_bx_orgs_form_price_input_period"><![CDATA[Период]]></string>
+    <string name="_bx_orgs_form_price_input_inf_period"><![CDATA[Используйте 0 для пожизненного]]></string>
+    <string name="_bx_orgs_form_price_input_sys_period_unit"><![CDATA[Единица измерения периода]]></string>
+    <string name="_bx_orgs_form_price_input_period_unit"><![CDATA[Единица измерения периода]]></string>
+    <string name="_bx_orgs_form_price_input_inf_period_unit"><![CDATA[Оставьте пустым для пожизненного уровня.]]></string>
+    <string name="_bx_orgs_form_price_input_err_period_unit"><![CDATA[Здесь Вам необходимо выбрать единицу измерения периода.]]></string>
+    <string name="_bx_orgs_form_price_input_sys_price"><![CDATA[Цена]]></string>
+    <string name="_bx_orgs_form_price_input_price"><![CDATA[Цена]]></string>
+    <string name="_bx_orgs_form_price_input_inf_price"><![CDATA[Введите 0 или оставьте пустым для создания бесплатного уровня.]]></string>
+    <string name="_bx_orgs_form_price_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_orgs_form_price_input_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_orgs_form_price_input_sys_do_cancel"><![CDATA[Отменить]]></string>
+    <string name="_bx_orgs_form_price_input_do_cancel"><![CDATA[Отменить]]></string>
+    
 	<string name="_bx_orgs_acl_action_create_profile"><![CDATA[Создать профиль организации]]></string>
+        <string name="_bx_orgs_acl_action_use_paid_join"><![CDATA[Использовать платный вход в организацию]]></string>
 	<string name="_bx_orgs_acl_action_delete_profile"><![CDATA[Удалить профиль организации]]></string>
 	<string name="_bx_orgs_acl_action_view_profile"><![CDATA[Просмотреть профиль организации]]></string>
 	<string name="_bx_orgs_acl_action_edit_any_profile"><![CDATA[Редактировать профиль любой организации]]></string>
@@ -99,6 +124,8 @@
 	<string name="_bx_orgs_page_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
 	<string name="_bx_orgs_page_title_sys_delete_profile"><![CDATA[Удалить профиль]]></string>
 	<string name="_bx_orgs_page_title_delete_profile"><![CDATA[Удалить профиль]]></string>
+        <string name="_bx_orgs_page_title_sys_join_profile"><![CDATA[Присоединиться к организации]]></string>
+        <string name="_bx_orgs_page_title_join_profile"><![CDATA[Присоединиться к организации]]></string>
     <string name="_bx_orgs_page_title_sys_view_profile"><![CDATA[Просмотр профиля]]></string>
     <string name="_bx_orgs_page_title_sys_view_profile_closed"><![CDATA[Просмотр профиля с ограничением доступа]]></string>
 	<string name="_bx_orgs_page_title_view_profile"><![CDATA[{display_name}]]></string>
@@ -127,6 +154,8 @@
     <string name="_bx_orgs_page_title_fans"><![CDATA[Участники]]></string>
     <string name="_bx_orgs_page_title_sys_profile_comments"><![CDATA[Комментарии]]></string>
     <string name="_bx_orgs_page_title_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_orgs_page_title_sys_profile_pricing"><![CDATA[Цены]]></string>
+    <string name="_bx_orgs_page_title_profile_pricing"><![CDATA[Цены]]></string>
 	<string name="_bx_orgs_page_title_sys_profile_info"><![CDATA[Инфо профиля]]></string>
 	<string name="_bx_orgs_page_title_profile_info"><![CDATA[Инфо о {display_name}]]></string>
 	<string name="_bx_orgs_page_title_sys_recent"><![CDATA[Новые организации]]></string>
@@ -154,11 +183,15 @@
 	<string name="_bx_orgs_page_block_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
 	<string name="_bx_orgs_page_block_title_delete_profile"><![CDATA[Удалить профиль]]></string>
 	<string name="_bx_orgs_page_block_title_profile_all_actions"><![CDATA[Все действия]]></string>
+        <string name="_bx_orgs_page_block_title_join_profile"><![CDATA[Присоединиться к организации]]></string>
 	<string name="_bx_orgs_page_block_title_profile_info_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Инфо]]></string>
 	<string name="_bx_orgs_page_block_title_profile_info"><![CDATA[Инфо]]></string>
 	<string name="_bx_orgs_page_block_title_system_profile_info"><![CDATA[Инфо]]></string>
 	<string name="_bx_orgs_page_block_title_profile_membership"><![CDATA[Членство]]></string>
 	<string name="_bx_orgs_page_block_title_system_profile_membership"><![CDATA[Членство]]></string>
+        <string name="_bx_orgs_page_block_title_system_profile_pricing"><![CDATA[Цены]]></string>
+        <string name="_bx_orgs_page_block_title_profile_pricing"><![CDATA[Цены]]></string>
+        <string name="_bx_orgs_page_block_title_profile_pricing_link"><![CDATA[Расценки организации: <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_orgs_page_block_title_profile_description"><![CDATA[Описание]]></string>
 	<string name="_bx_orgs_page_block_title_profile_favorites"><![CDATA[Избранные организации]]></string>
 	<string name="_bx_orgs_page_block_title_system_profile_favorites"><![CDATA[Избранные организации]]></string>
@@ -233,6 +266,8 @@
     <string name="_bx_orgs_menu_item_title_clear_reports"><![CDATA[Очистить жалобы]]></string>
     <string name="_bx_orgs_menu_item_title_system_edit_cover"><![CDATA[Редактировать обложку]]></string>
     <string name="_bx_orgs_menu_item_title_edit_cover"><![CDATA[Редактировать обложку]]></string>
+    <string name="_bx_orgs_menu_item_title_system_edit_pricing"><![CDATA[Редактировать цены]]></string>
+    <string name="_bx_orgs_menu_item_title_edit_pricing"><![CDATA[Редактировать цены]]></string>
     <string name="_bx_orgs_menu_item_title_system_edit_profile"><![CDATA[Редактировать организацию]]></string>
     <string name="_bx_orgs_menu_item_title_edit_profile"><![CDATA[Редактировать профиль]]></string>
     <string name="_bx_orgs_menu_item_title_system_delete_profile"><![CDATA[Удалить организацию]]></string>
@@ -283,6 +318,8 @@
     <string name="_bx_orgs_menu_item_title_leave_organization"><![CDATA[Покинуть организацию]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization_cancel_request"><![CDATA[Отменить присоединение]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization_reject_request"><![CDATA[Отвергнуть присоединение]]></string>
+    <string name="_bx_orgs_menu_item_title_system_pay_and_join"><![CDATA[Оплатить и присоединиться]]></string>
+    <string name="_bx_orgs_menu_item_title_pay_and_join"><![CDATA[Оплатить и присоединиться]]></string>
     <string name="_bx_orgs_menu_item_title_system_subscribe"><![CDATA[Получать уведомления]]></string>
     <string name="_bx_orgs_menu_item_title_subscribe"><![CDATA[Получать уведомления]]></string>
     <string name="_bx_orgs_menu_item_title_system_unsubscribe"><![CDATA[Отключить уведомления]]></string>
@@ -348,6 +385,22 @@
 	<string name="_bx_orgs_grid_action_err_delete"><![CDATA[Невозможно удалить выбранную(ные) организацию(ции).]]></string>
 	<string name="_bx_orgs_grid_txt_account_manager"><![CDATA[Перенаправить в Управление аккаунтом.]]></string>
 
+    <string name="_bx_orgs_grid_column_title_name"><![CDATA[Название]]></string>
+    <string name="_bx_orgs_grid_column_title_role_id"><![CDATA[Роль]]></string>
+    <string name="_bx_orgs_grid_column_title_period"><![CDATA[Период]]></string>
+    <string name="_bx_orgs_grid_column_title_price"><![CDATA[Цена]]></string>
+    <string name="_bx_orgs_grid_action_title_add"><![CDATA[Добавить]]></string>
+    <string name="_bx_orgs_grid_action_title_edit"><![CDATA[Изменить]]></string>
+    <string name="_bx_orgs_grid_action_title_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_orgs_grid_action_title_buy"><![CDATA[Купить]]></string>
+    <string name="_bx_orgs_grid_action_title_buy_title"><![CDATA[Единовременный платеж]]></string>
+    <string name="_bx_orgs_grid_action_title_subscribe"><![CDATA[Подписаться]]></string>
+    <string name="_bx_orgs_grid_action_title_subscribe_title"><![CDATA[Создать подписку с регулярным выставлением счетов]]></string>
+    <string name="_bx_orgs_grid_action_title_choose"><![CDATA[Выбирать]]></string>
+    <string name="_bx_orgs_grid_action_title_choose_title"><![CDATA[Бесплатно переключиться на уровень]]></string>
+    <string name="_bx_orgs_popup_title_price_add"><![CDATA[Добавить ценовой план]]></string>
+    <string name="_bx_orgs_popup_title_price_edit"><![CDATA[Редактировать ценовой план]]></string>
+
     <string name="_bx_orgs_chart_growth"><![CDATA[Организации: Развитие]]></string>
     <string name="_bx_orgs_chart_growth_speed"><![CDATA[Организации: Скорость развития]]></string>
 
@@ -401,6 +454,12 @@
     <string name="_bx_orgs_role_administrator"><![CDATA[Администратор]]></string>
     <string name="_bx_orgs_role_moderator"><![CDATA[Модератор]]></string>
 
+    <string name="_bx_orgs_pre_lists_period_units"><![CDATA[Платежный интервал]]></string>
+    <string name="_bx_orgs_period_unit_day"><![CDATA[день]]></string>
+    <string name="_bx_orgs_period_unit_week"><![CDATA[неделя]]></string>
+    <string name="_bx_orgs_period_unit_month"><![CDATA[месяц]]></string>
+    <string name="_bx_orgs_period_unit_year"><![CDATA[год]]></string>
+
     <string name="_bx_organizations_alert_action_fan_added"><![CDATA[присоединение нового участника]]></string>
     <string name="_bx_organizations_alert_action_join_invitation_notif"><![CDATA[приглашение вступить в группу]]></string>
     <string name="_bx_organizations_alert_action_join_request"><![CDATA[запрос на присоединение к организации]]></string>
@@ -424,9 +483,17 @@
     <string name="_bx_orgs_txt_sample_pi_action_user"><![CDATA[{0} сменила {1}]]></string>
     <string name="_bx_orgs_txt_N_friends"><![CDATA[Друзья: {0}]]></string>
     <string name="_bx_orgs_txt_role"><![CDATA[Роль]]></string>
+    <string name="_bx_orgs_txt_role_added"><![CDATA[Начало]]></string>
+    <string name="_bx_orgs_txt_role_expired"><![CDATA[Окончание]]></string>
     <string name="_bx_orgs_txt_set_role"><![CDATA[Задать роль]]></string>
     <string name="_bx_orgs_txt_private_organization"><![CDATA[Приватная организация]]></string>
     <string name="_bx_orgs_ps_group_title_participants"><![CDATA[Сотрудники]]></string>
+    <string name="_bx_orgs_txt_n_unit"><![CDATA[{0} ({1})]]></string>
+    <string name="_bx_orgs_txt_cart_item_title"><![CDATA[{0}: {1} ({2} {3})]]></string>
+
+    <string name="_bx_orgs_msg_performed"><![CDATA[Действие было успешно выполнено.]]></string>
+    <string name="_bx_orgs_err_price_duplicate"><![CDATA[Аналогичный ценовой план уже существует.]]></string>
+    <string name="_bx_orgs_err_cannot_perform"><![CDATA[Невозможно выполнить действие. Пожалуйста, оповестите нас об этой проблеме.]]></string>
 
     <string name="_bx_orgs_email_friend_request"><![CDATA[Запрос на добавление в друзья]]></string>
     <string name="_bx_orgs_email_friend_request_subject"><![CDATA[Подружиться]]></string>