Browse Source

Merge branch 'master' of https://github.com/unacms/una

AntonLV 8 months ago
parent
commit
08e2f85b03

+ 1 - 1
modules/boonex/glossary/install/sql/uninstall.sql

@@ -22,7 +22,7 @@ DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_glossary';
 DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_glossary_cats');
 
 -- COMMENTS
-DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_glossary';
+DELETE FROM `sys_objects_cmts` WHERE `Name` IN ('bx_glossary', 'bx_glossary_notes');
 
 -- VOTES
 DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_glossary', 'bx_glossary_reactions');

+ 2 - 0
modules/boonex/reputation/classes/BxReputationConfig.php

@@ -33,6 +33,7 @@ class BxReputationConfig extends BxBaseModNotificationsConfig
 
             // page URIs
             'URL_LEADERBOARD' => 'page.php?i=leaderboard',
+            'URL_MANAGE' => 'page.php?i=reputation-manage',
             'URL_HISTORY' => 'page.php?i=points-history',
 
             // some params
@@ -50,6 +51,7 @@ class BxReputationConfig extends BxBaseModNotificationsConfig
             'OBJECT_MENU_SUBMENU' => 'bx_reputation_submenu',
             'OBJECT_GRID_HANDLERS' => 'bx_reputation_handlers',
             'OBJECT_GRID_LEVELS' => 'bx_reputation_levels',
+            'OBJECT_GRID_MANAGE_LEADERBOARD' => 'bx_reputation_manage_leaderboard',
 
             // some language keys
             'T' => [

+ 5 - 4
modules/boonex/reputation/classes/BxReputationDb.php

@@ -112,18 +112,18 @@ class BxReputationDb extends BxBaseModNotificationsDb
         if(isset($aParams['context_id']) && $aParams['context_id'] !== false) {
             $aBindings['context_id'] = $aParams['context_id'];
 
-            $sWhereSubClause .= ' AND `context_id` = :context_id';
+            $sWhereSubClause .= ' AND `te`.`context_id` = :context_id';
         }
 
         if(!empty($aParams['days'])) {
             $aBindings['days'] = (int)$aParams['days'];
 
-            $sWhereSubClause .= ' AND `date` >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL :days DAY))';
+            $sWhereSubClause .= ' AND `te`.`date` >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL :days DAY))';
         }
 
         $sGroupSubClause = 'GROUP BY `owner_id`';
 
-        $sTableClause = '(SELECT `owner_id` AS `profile_id`, SUM(`points`) AS `points` FROM `' . $CNF['TABLE_EVENTS'] . '` WHERE 1 ' . $sWhereSubClause . ' ' . $sGroupSubClause . ')';
+        $sTableClause = '(SELECT `te`.`owner_id` AS `profile_id`, SUM(`te`.`points`) AS `points` FROM `' . $CNF['TABLE_EVENTS'] . '` AS `te` INNER JOIN `' . $CNF['TABLE_PROFILES'] . '` AS `tp` ON `te`.`owner_id`=`tp`.`profile_id` AND `te`.`context_id`=`tp`.`context_id` AND `tp`.`visible`<>0 WHERE 1 ' . $sWhereSubClause . ' ' . $sGroupSubClause . ')';
 
         $sSelectPosition = 'SELECT COUNT(DISTINCT `tre2`.`points`) FROM ' . $sTableClause . ' AS `tre2` WHERE `tre2`.`points` >= `tre`.`points`';
 
@@ -254,7 +254,7 @@ class BxReputationDb extends BxBaseModNotificationsDb
                 $aMethod['params'][1] = 'profile_id';
                 $aMethod['params'][2] = [];
 
-                $sSelectPosition = 'SELECT COUNT(DISTINCT `trp2`.`points`) FROM `' . $CNF['TABLE_PROFILES'] . '` AS `trp2` WHERE `trp2`.`points` >= `trp`.`points`';
+                $sSelectPosition = 'SELECT COUNT(DISTINCT `trp2`.`points`) FROM `' . $CNF['TABLE_PROFILES'] . '` AS `trp2` WHERE `visible`<>0 AND `trp2`.`points` >= `trp`.`points`';
 
                 if(isset($aParams['context_id']) && $aParams['context_id'] !== false) {
                     $aMethod['params'][2]['context_id'] = $aParams['context_id'];
@@ -269,6 +269,7 @@ class BxReputationDb extends BxBaseModNotificationsDb
                 }
 
                 $sSelectClause .= ', (' . $sSelectPosition . ') AS `position`';
+                $sWhereClause .= ' AND `trp`.`visible`<>0';
                 $sOrderClause = '`trp`.`points` DESC';
                 $sLimitClause = '0, ' . (int)$aParams['limit'];
                 break;

+ 63 - 0
modules/boonex/reputation/classes/BxReputationGridManageLeaderboard.php

@@ -0,0 +1,63 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Reputation Reputation
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxReputationGridManageLeaderboard extends BxTemplGrid
+{
+    protected $_sModule;
+    protected $_oModule;
+    
+    protected $_iContextId;
+    
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_reputation';
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct ($aOptions, $oTemplate);
+
+        $this->_sDefaultSortingOrder = 'DESC';
+
+        $this->_iContextId = 0;
+        if(($iContextId = bx_get('context_id')) !== false)
+            $this->setContextId($iContextId);
+    }
+
+    public function setContextId($iContextId)
+    {
+        $this->_iContextId = (int)$iContextId;
+        $this->_aQueryAppend['context_id'] = $this->_iContextId;
+    }
+
+    protected function _getCellProfileId($mixedValue, $sKey, $aField, $aRow)
+    {
+        if($this->_bIsApi)
+            return ['type' => 'profile', 'data' => BxDolProfile::getData($mixedValue)];
+
+        if(($oProfile = BxDolProfile::getInstanceMagic($mixedValue)));
+            $mixedValue = $oProfile->getUnit();
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellPoints($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+        $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `context_id`=?", $this->_iContextId);
+
+        return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
+    }
+}
+
+/** @} */

+ 60 - 2
modules/boonex/reputation/classes/BxReputationModule.php

@@ -162,12 +162,13 @@ class BxReputationModule extends BxBaseModNotificationsModule
         return $this->_oTemplate->getBlockHistory($iProfileId, $iContextId, $iStart, $iLimit);
     }
 
-    public function serviceGetBlockLeaderboard($iContextId = 0, $iDays = 0, $bFilters = false)
+    public function serviceGetBlockLeaderboard($iContextId = 0, $iDays = 0, $bFilters = false, $bManage = false)
     {
         $mixedResult = $this->_oTemplate->getBlockLeaderboard([
             'context_id' => (int)$iContextId, 
             'days' => (int)$iDays,
-            'filters' => (bool)$bFilters
+            'filters' => (bool)$bFilters,
+            'manage' => (bool)$bManage
         ]);
 
         return !$this->_bIsApi ? $mixedResult : [
@@ -175,6 +176,30 @@ class BxReputationModule extends BxBaseModNotificationsModule
         ];
     }
 
+    public function serviceGetBlockManage($iContextId = 0)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!$iContextId && ($_iContextId = bx_get('context_id')) !== false)
+            $iContextId = (int)$_iContextId;
+
+        if(($mixedResult = $this->checkAllowedManage($iContextId)) !== CHECK_ACTION_RESULT_ALLOWED)
+            return $this->_bIsApi ? [bx_api_get_msg($mixedResult)] : MsgBox($mixedResult);
+
+        $oGrid = BxDolGrid::getObjectInstance($CNF['OBJECT_GRID_MANAGE_LEADERBOARD']);
+        if(!$oGrid)
+            return '';
+
+        $oGrid->setContextId($iContextId);
+
+        if($this->_bIsApi)
+            return [
+                bx_api_get_block('grid', $oGrid->getCodeAPI())
+            ];
+
+        return $oGrid->getCode();
+    }
+
     public function serviceGetBlockWidget($iProfileId = 0, $iContextId = 0, $aParams = [])
     {
         $iLoggedId = 0;
@@ -259,6 +284,39 @@ class BxReputationModule extends BxBaseModNotificationsModule
         return $this->_oTemplate->getBlockSummary($iProfileId, $iContextId);
     }
 
+    /**
+     * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.
+     */
+    public function checkAllowedManage ($iContextId = 0, $isPerformAction = false)
+    {
+        // moderator have access
+        if($this->_isModerator($isPerformAction))
+            return CHECK_ACTION_RESULT_ALLOWED;
+
+        // check for context's admins 
+        if($iContextId && ($oContext = BxDolProfile::getInstance($iContextId)) !== false) {
+            $sModule = $oContext->getModule();
+            $oModule = BxDolModule::getInstance($sModule);
+
+            // check for context's extra roles with rights
+            if (method_exists($oModule, 'isAllowedModuleActionByProfile')) {
+                $bResult = $oModule->isAllowedModuleActionByProfile($oContext->getContentId(), $this->getName(), 'edit_any');
+                if($bResult !== NULL) 
+                    return $bResult;
+            }
+
+            $aEntity = [];
+            if(($sMethod = 'get_all') && bx_is_srv($sModule, $sMethod))
+                $aEntity = bx_srv($sModule, $sMethod, [['type' => 'id', 'id' => $oContext->getContentId()]]);
+
+            // if allowed edit a group then allowed to edit anything inside its context
+            if(!empty($aEntity) && $oModule->checkAllowedEdit($aEntity) === CHECK_ACTION_RESULT_ALLOWED)
+                return CHECK_ACTION_RESULT_ALLOWED;
+        }
+
+        return _t('_sys_txt_access_denied');
+    }
+
     /**
      * COMMON METHODS
      */

+ 11 - 3
modules/boonex/reputation/classes/BxReputationTemplate.php

@@ -252,6 +252,7 @@ class BxReputationTemplate extends BxBaseModNotificationsTemplate
 
         $sName = $aParams['name'] ?? $iContextId . '-' . $iDays;
         $bFilters = $aParams['filters'] ?? false;
+        $bManage = $aParams['manage'] ?? false;
 
         if($bGrowth) 
             $aItems = $this->_oDb->getEventsStats([
@@ -309,11 +310,18 @@ class BxReputationTemplate extends BxBaseModNotificationsTemplate
                 'oRequestParams' => ['days' => $iDays]
             ]);
 
-            $aResult['buttons'] = [
-                ['title' => _t('_bx_reputation_txt_filters'), 'href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $this->_oConfig->getJsObject('leaderboard') . '.changeLeaderboardFilters(this)']
-            ];
+            if(!isset($aResult['buttons']))
+                $aResult['buttons'] = [];
+
+            $aResult['buttons'][] = ['title' => _t('_bx_reputation_txt_filters'), 'href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $this->_oConfig->getJsObject('leaderboard') . '.changeLeaderboardFilters(this)'];
         }
 
+        if($bManage && $this->getModule()->checkAllowedManage($iContextId) === CHECK_ACTION_RESULT_ALLOWED)
+            $aResult['buttons'][] = [
+                'title' => _t('_bx_reputation_txt_manage'), 
+                'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE'], ['context_id' => $iContextId])
+            ];
+
         $this->addCss(['main.css']);
         return $aResult;
     }

+ 10 - 0
modules/boonex/reputation/install/langs/en.xml

@@ -58,6 +58,9 @@
 
     <string name="_bx_reputation_form_input_err"><![CDATA[The field is essential. Please, fill it in.]]></string>
 
+    <!-- ACL -->
+    <string name="_bx_reputation_acl_action_edit_any_entry"><![CDATA[Manage Any Leaderboard]]></string>
+
     <!-- Pages -->
     <string name="_bx_reputation_page_title_sys_leaderboard"><![CDATA[Leaderboard]]></string>
     <string name="_bx_reputation_page_title_leaderboard"><![CDATA[Leaderboard]]></string>
@@ -65,6 +68,9 @@
     <string name="_bx_reputation_page_block_title_leaderboard_week"><![CDATA[7 days]]></string>
     <string name="_bx_reputation_page_block_title_leaderboard_month"><![CDATA[30 days]]></string>
     <string name="_bx_reputation_page_block_title_leaderboard_all_time"><![CDATA[All-time]]></string>
+    <string name="_bx_reputation_page_title_sys_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_reputation_page_title_manage"><![CDATA[Manage Leaderboard]]></string>
+    <string name="_bx_reputation_page_block_title_manage"><![CDATA[Manage Leaderboard]]></string>
     <string name="_bx_reputation_page_title_sys_history"><![CDATA[Points history]]></string>
     <string name="_bx_reputation_page_title_history"><![CDATA[My Points]]></string>
     <string name="_bx_reputation_page_block_title_system_summary"><![CDATA[Summary]]></string>
@@ -113,6 +119,9 @@
     <string name="_bx_reputation_grid_action_title_lvl_edit"><![CDATA[Edit level]]></string>
     <string name="_bx_reputation_grid_action_title_lvl_delete"><![CDATA[Delete level]]></string>
 
+    <string name="_bx_reputation_grid_column_title_mng_lb_profile_id"><![CDATA[Profile]]></string>
+    <string name="_bx_reputation_grid_column_title_mng_lb_points"><![CDATA[Points]]></string>
+
     <string name="_bx_reputation_grid_action_err_perform"><![CDATA[Cannot perform the action for selected items(s).]]></string>
 
     <!-- Errors, Warnings, Messages -->
@@ -121,6 +130,7 @@
 
     <!-- Other -->
     <string name="_bx_reputation_txt_filters"><![CDATA[Filters]]></string>
+    <string name="_bx_reputation_txt_manage"><![CDATA[Manage]]></string>
     <string name="_bx_reputation_txt_level_newcomer"><![CDATA[Newcomer]]></string>
     <string name="_bx_reputation_txt_level_explorer"><![CDATA[Explorer]]></string>
     <string name="_bx_reputation_txt_level_contributor"><![CDATA[Contributor]]></string>

+ 6 - 1
modules/boonex/reputation/install/sql/disable.sql

@@ -7,7 +7,7 @@ DELETE FROM `tot`, `toc`, `to` USING `sys_options_types` AS `tot` LEFT JOIN `sys
 
 -- PAGES & BLOCKS
 DELETE FROM `sys_objects_page` WHERE `module` = @sName;
-DELETE FROM `sys_pages_blocks` WHERE `module` = @sName OR `object` IN('bx_reputation_leaderboard', 'bx_reputation_history', 'bx_reputation_info');
+DELETE FROM `sys_pages_blocks` WHERE `module` = @sName OR `object` IN('bx_reputation_leaderboard', 'bx_reputation_manage', 'bx_reputation_history', 'bx_reputation_info');
 
 
 -- MENU
@@ -16,6 +16,11 @@ DELETE FROM `sys_menu_sets` WHERE `module` = @sName;
 DELETE FROM `sys_menu_items` WHERE `module` = @sName OR `set_name` IN('bx_reputation_submenu');
 
 
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = @sName;
+DELETE FROM `sys_acl_actions` WHERE `Module` = @sName;
+
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_reputation_%';
 DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_reputation_%';

+ 32 - 1
modules/boonex/reputation/install/sql/enable.sql

@@ -26,7 +26,14 @@ INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designb
 ('bx_reputation_leaderboard', 0, @sName, '_bx_reputation_page_block_title_leaderboard_week', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_reputation";s:6:"method";s:21:"get_block_leaderboard";s:6:"params";a:2:{i:0;i:0;i:1;i:7;}}', 0, 1, 1),
 ('bx_reputation_leaderboard', 0, @sName, '_bx_reputation_page_block_title_leaderboard_month', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_reputation";s:6:"method";s:21:"get_block_leaderboard";s:6:"params";a:2:{i:0;i:0;i:1;i:30;}}', 0, 1, 1),
 ('bx_reputation_leaderboard', 0, @sName, '_bx_reputation_page_block_title_leaderboard_all_time', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_reputation";s:6:"method";s:21:"get_block_leaderboard";}', 0, 1, 1),
-('bx_reputation_leaderboard', 1, @sName, '_bx_reputation_page_block_title_leaderboard', 13, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_reputation";s:6:"method";s:21:"get_block_leaderboard";s:6:"params";a:3:{i:0;i:0;i:1;i:0;i:2;b:1;}}', 0, 1, 1);
+('bx_reputation_leaderboard', 1, @sName, '_bx_reputation_page_block_title_leaderboard', 13, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_reputation";s:6:"method";s:21:"get_block_leaderboard";s:6:"params";a:4:{i:0;i:0;i:1;i:0;i:2;b:1;i:3;b:1;}}', 0, 1, 1);
+
+-- PAGE: manage leaderboard
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_reputation_manage', '_bx_reputation_page_title_sys_manage', '_bx_reputation_page_title_manage', @sName, 13, 2147483647, 1, 'reputation-manage', 'page.php?i=reputation-manage', '', '', '', 0, 1, 0, 'BxReputationPageBrowse', 'modules/boonex/reputation/classes/BxReputationPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_reputation_manage', 1, @sName, '_bx_reputation_page_block_title_manage', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_reputation";s:6:"method";s:16:"get_block_manage";s:6:"params";a:1:{i:0;i:0;}}', 0, 1, 1);
 
 -- PAGE: history
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
@@ -79,6 +86,21 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 ('sys_site', @sName, 'leaderboard', '_bx_reputation_menu_item_title_system_leaderboard', '_bx_reputation_menu_item_title_leaderboard', 'page.php?i=leaderboard', '', '', 'star', '', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
 
 
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+(@sName, 'edit any entry', NULL, '_bx_reputation_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = LAST_INSERT_ID();
+
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny);
+
+
 -- GRIDS: administration tools
 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_reputation_handlers', 'Sql', 'SELECT * FROM `bx_reputation_handlers` WHERE 1 ', 'bx_reputation_handlers', 'id', '', 'active', '', 20, NULL, 'start', '', 'type,alert_unit,alert_action', '', 'like', 'reports', '', 192, 'BxReputationGridHandlers', 'modules/boonex/reputation/classes/BxReputationGridHandlers.php');
@@ -116,6 +138,15 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 ('bx_reputation_levels', 'single', 'edit', '_bx_reputation_grid_action_title_lvl_edit', 'pencil-alt', 1, 0, 1),
 ('bx_reputation_levels', 'single', 'delete', '_bx_reputation_grid_action_title_lvl_delete', 'remove', 1, 1, 2);
 
+-- GRIDS: manage leaderboard
+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`, `override_class_name`, `override_class_file`) VALUES
+('bx_reputation_manage_leaderboard', 'Sql', 'SELECT * FROM `bx_reputation_profiles` WHERE 1 AND `profile_id`<>0 ', 'bx_reputation_profiles', 'id', 'points', 'visible', '', 20, NULL, 'start', '', '', '', 'like', '', '', 'BxReputationGridManageLeaderboard', 'modules/boonex/reputation/classes/BxReputationGridManageLeaderboard.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_reputation_manage_leaderboard', 'switcher', '', '10%', 0, 0, '', 1),
+('bx_reputation_manage_leaderboard', 'profile_id', '_bx_reputation_grid_column_title_mng_lb_profile_id', '70%', 0, 0, '', 2),
+('bx_reputation_manage_leaderboard', 'points', '_bx_reputation_grid_column_title_mng_lb_points', '20%', 0, 0, '', 3);
+
 
 -- ALERTS
 INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 

+ 1 - 0
modules/boonex/reputation/install/sql/install.sql

@@ -73,6 +73,7 @@ CREATE TABLE IF NOT EXISTS `bx_reputation_profiles` (
   `profile_id` int(11) NOT NULL DEFAULT '0',
   `context_id` int(11) NOT NULL default '0',
   `points` int(11) NOT NULL DEFAULT '0',
+  `visible` tinyint(4) NOT NULL default '1',
   PRIMARY KEY (`id`),
   UNIQUE KEY `profile` (`profile_id`, `context_id`)
 );

+ 10 - 0
modules/boonex/russian/data/langs/bx_reputation/ru.xml

@@ -58,6 +58,9 @@
 
     <string name="_bx_reputation_form_input_err"><![CDATA[Поле обязательно. Пожалуйста, заполните его.]]></string>
 
+    <!-- ACL -->
+    <string name="_bx_reputation_acl_action_edit_any_entry"><![CDATA[Управлять любой таблицей лидеров]]></string>
+
     <!-- Pages -->
     <string name="_bx_reputation_page_title_sys_leaderboard"><![CDATA[Таблица лидеров]]></string>
     <string name="_bx_reputation_page_title_leaderboard"><![CDATA[Таблица лидеров]]></string>
@@ -65,6 +68,9 @@
     <string name="_bx_reputation_page_block_title_leaderboard_week"><![CDATA[7 дней]]></string>
     <string name="_bx_reputation_page_block_title_leaderboard_month"><![CDATA[30 дней]]></string>
     <string name="_bx_reputation_page_block_title_leaderboard_all_time"><![CDATA[За все время)]]></string>
+    <string name="_bx_reputation_page_title_sys_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_reputation_page_title_manage"><![CDATA[Управление таблицей лидеров]]></string>
+    <string name="_bx_reputation_page_block_title_manage"><![CDATA[Управление таблицей лидеров]]></string>
     <string name="_bx_reputation_page_title_sys_history"><![CDATA[История баллов]]></string>
     <string name="_bx_reputation_page_title_history"><![CDATA[Мои баллы]]></string>
     <string name="_bx_reputation_page_block_title_system_summary"><![CDATA[Сводка]]></string>
@@ -113,6 +119,9 @@
     <string name="_bx_reputation_grid_action_title_lvl_edit"><![CDATA[Редактировать уровень]]></string>
     <string name="_bx_reputation_grid_action_title_lvl_delete"><![CDATA[Удалить уровень]]></string>
 
+    <string name="_bx_reputation_grid_column_title_mng_lb_profile_id"><![CDATA[Профиль]]></string>
+    <string name="_bx_reputation_grid_column_title_mng_lb_points"><![CDATA[Баллы]]></string>
+
     <string name="_bx_reputation_grid_action_err_perform"><![CDATA[Невозможно выполнить действие для выбранного(ых) элементов.]]></string>
 
     <!-- Errors, Warnings, Messages -->
@@ -121,6 +130,7 @@
 
     <!-- Other -->
     <string name="_bx_reputation_txt_filters"><![CDATA[Фильтры]]></string>
+    <string name="_bx_reputation_txt_manage"><![CDATA[Управление]]></string>
     <string name="_bx_reputation_txt_level_newcomer"><![CDATA[Новичок]]></string>
     <string name="_bx_reputation_txt_level_explorer"><![CDATA[Исследователь]]></string>
     <string name="_bx_reputation_txt_level_contributor"><![CDATA[Помощник]]></string>