Просмотр исходного кода

Ticket #1748 - Integration with Organizations.

AntonLV 8 лет назад
Родитель
Сommit
394837dccc

+ 29 - 28
modules/boonex/organizations/classes/BxOrgsConfig.php

@@ -16,16 +16,16 @@ class BxOrgsConfig extends BxBaseModProfileConfig
         parent::__construct($aModule);
         parent::__construct($aModule);
 
 
         $this->_aMenuItems2MethodsSubmenu = array_merge($this->_aMenuItems2MethodsSubmenu, array(
         $this->_aMenuItems2MethodsSubmenu = array_merge($this->_aMenuItems2MethodsSubmenu, array(
-        	'organization-profile-subscriptions' => 'checkAllowedSubscriptionsView'
+            'organization-profile-subscriptions' => 'checkAllowedSubscriptionsView'
         ));
         ));
 
 
         $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
         $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
             'view-organization-profile' => 'checkAllowedView',
             'view-organization-profile' => 'checkAllowedView',
             'edit-organization-profile' => 'checkAllowedEdit',
             'edit-organization-profile' => 'checkAllowedEdit',
             'edit-organization-cover' => 'checkAllowedChangeCover',
             'edit-organization-cover' => 'checkAllowedChangeCover',
-        	'invite-to-organization' => 'checkAllowedInvite',
+            'invite-to-organization' => 'checkAllowedInvite',
             'delete-organization-profile' => 'checkAllowedDelete',
             'delete-organization-profile' => 'checkAllowedDelete',
-        	'profile-fan-add' => 'checkAllowedFanAdd',
+            'profile-fan-add' => 'checkAllowedFanAdd',
             'profile-fan-remove' => 'checkAllowedFanRemove',
             'profile-fan-remove' => 'checkAllowedFanRemove',
         ));
         ));
 
 
@@ -37,7 +37,7 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             // database tables
             // database tables
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
             'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
             'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
-        	'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
+            'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
 
 
             // database fields
             // database fields
             'FIELD_ID' => 'id',
             'FIELD_ID' => 'id',
@@ -45,13 +45,13 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'FIELD_ADDED' => 'added',
             'FIELD_ADDED' => 'added',
             'FIELD_CHANGED' => 'changed',
             'FIELD_CHANGED' => 'changed',
             'FIELD_NAME' => 'org_name',
             'FIELD_NAME' => 'org_name',
-        	'FIELD_TITLE' => 'org_name',
-        	'FIELD_TEXT' => 'org_desc',
+            'FIELD_TITLE' => 'org_name',
+            'FIELD_TEXT' => 'org_desc',
             'FIELD_PICTURE' => 'picture',
             'FIELD_PICTURE' => 'picture',
             'FIELD_COVER' => 'cover',
             'FIELD_COVER' => 'cover',
-        	'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
+            'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
-        	'FIELD_VIEWS' => 'views',
+            'FIELD_VIEWS' => 'views',
             'FIELD_COMMENTS' => 'comments',
             'FIELD_COMMENTS' => 'comments',
             'FIELDS_QUICK_SEARCH' => array('org_name'),
             'FIELDS_QUICK_SEARCH' => array('org_name'),
             'FIELD_LOCATION_PREFIX' => 'location',
             'FIELD_LOCATION_PREFIX' => 'location',
@@ -60,13 +60,13 @@ class BxOrgsConfig extends BxBaseModProfileConfig
 
 
             // page URIs
             // page URIs
             'URI_VIEW_ENTRY' => 'view-organization-profile',
             'URI_VIEW_ENTRY' => 'view-organization-profile',
-        	'URI_VIEW_FRIENDS' => 'organization-profile-friends',
-        	'URI_VIEW_FRIEND_REQUESTS' => 'organization-friend-requests',
-        	'URI_VIEW_FAVORITES' => 'organization-profile-favorites',
+            'URI_VIEW_FRIENDS' => 'organization-profile-friends',
+            'URI_VIEW_FRIEND_REQUESTS' => 'organization-friend-requests',
+            'URI_VIEW_FAVORITES' => 'organization-profile-favorites',
             'URI_EDIT_ENTRY' => 'edit-organization-profile',
             'URI_EDIT_ENTRY' => 'edit-organization-profile',
             'URI_EDIT_COVER' => 'edit-organization-cover',
             'URI_EDIT_COVER' => 'edit-organization-cover',
-        	'URI_JOINED_ENTRIES' => 'joined-organizations',
-        	'URI_MANAGE_COMMON' => 'organizations-manage',
+            'URI_JOINED_ENTRIES' => 'joined-organizations',
+            'URI_MANAGE_COMMON' => 'organizations-manage',
 
 
             'URL_HOME' => 'page.php?i=organizations-home',
             'URL_HOME' => 'page.php?i=organizations-home',
             'URL_CREATE' => 'page.php?i=create-organization-profile',
             'URL_CREATE' => 'page.php?i=create-organization-profile',
@@ -83,9 +83,9 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'PARAM_SEARCHABLE_FIELDS' => 'bx_organizations_searchable_fields',
             'PARAM_SEARCHABLE_FIELDS' => 'bx_organizations_searchable_fields',
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_organizations_per_page_browse_showcase',
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_organizations_per_page_browse_showcase',
             'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_organizations_per_page_browse_recommended',
             'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_organizations_per_page_browse_recommended',
-        	'PARAM_PUBLIC_SBSN' => 'bx_organizations_public_subscriptions',
+            'PARAM_PUBLIC_SBSN' => 'bx_organizations_public_subscriptions',
             'PARAM_PUBLIC_SBSD' => 'bx_organizations_public_subscribed_me',
             'PARAM_PUBLIC_SBSD' => 'bx_organizations_public_subscribed_me',
-        	'PARAM_REDIRECT_AADD' => 'bx_organizations_redirect_aadd',
+            'PARAM_REDIRECT_AADD' => 'bx_organizations_redirect_aadd',
             'PARAM_REDIRECT_AADD_CUSTOM_URL' => 'bx_organizations_redirect_aadd_custom_url',
             'PARAM_REDIRECT_AADD_CUSTOM_URL' => 'bx_organizations_redirect_aadd_custom_url',
             'PARAM_LABELS' => 'bx_organizations_labels',
             'PARAM_LABELS' => 'bx_organizations_labels',
 
 
@@ -98,23 +98,23 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_organizations_picture',
             'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_organizations_picture',
             'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_organizations_cover',
             'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_organizations_cover',
             'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_organizations_cover_thumb',
             'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_organizations_cover_thumb',
-        	'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_organizations_gallery',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_organizations_gallery',
             'OBJECT_VIEWS' => 'bx_organizations',
             'OBJECT_VIEWS' => 'bx_organizations',
-        	'OBJECT_VOTES' => '',
-        	'OBJECT_SCORES' => 'bx_organizations',
-        	'OBJECT_FAVORITES' => 'bx_organizations',
-        	'OBJECT_FEATURED' => 'bx_organizations',
+            'OBJECT_VOTES' => 'bx_organizations',
+            'OBJECT_SCORES' => 'bx_organizations',
+            'OBJECT_FAVORITES' => 'bx_organizations',
+            'OBJECT_FEATURED' => 'bx_organizations',
             'OBJECT_COMMENTS' => 'bx_organizations',
             'OBJECT_COMMENTS' => 'bx_organizations',
-        	'OBJECT_REPORTS' => 'bx_organizations',
+            'OBJECT_REPORTS' => 'bx_organizations',
             'OBJECT_METATAGS' => 'bx_organizations',
             'OBJECT_METATAGS' => 'bx_organizations',
             'OBJECT_FORM_ENTRY' => 'bx_organization',
             'OBJECT_FORM_ENTRY' => 'bx_organization',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_organization_view',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_organization_view',
-        	'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_organization_view_full', // for "info" tab on view profile page
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_organization_view_full', // for "info" tab on view profile page
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_organization_add',
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_organization_add',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_organization_edit',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_organization_edit',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_organization_edit_cover',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_organization_edit_cover',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_organization_delete',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_organization_delete',
-        	'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_organization_invite',
+            'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_organization_invite',
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_organizations_view_actions', // actions menu on view entry page
             '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_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
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_organizations_view_actions_all', // all actions menu on view entry page
@@ -128,16 +128,16 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'OBJECT_PAGE_VIEW_ENTRY' => 'bx_organizations_view_profile',
             'OBJECT_PAGE_VIEW_ENTRY' => 'bx_organizations_view_profile',
             'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_organizations_view_profile_closed',
             'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_organizations_view_profile_closed',
             'OBJECT_PRIVACY_VIEW' => 'bx_organizations_allow_view_to',
             'OBJECT_PRIVACY_VIEW' => 'bx_organizations_allow_view_to',
-        	'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_organizations_allow_view_notification_to',
+            'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_organizations_allow_view_notification_to',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_organizations_administration',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_organizations_administration',
             'OBJECT_GRID_COMMON' => 'bx_organizations_common',
             'OBJECT_GRID_COMMON' => 'bx_organizations_common',
-        	'OBJECT_GRID_CONNECTIONS' => 'bx_organizations_fans',
-        	'OBJECT_CONNECTIONS' => 'bx_organizations_fans',
+            'OBJECT_GRID_CONNECTIONS' => 'bx_organizations_fans',
+            'OBJECT_CONNECTIONS' => 'bx_organizations_fans',
             'OBJECT_UPLOADERS_COVER' => array('bx_organizations_cover_crop'),
             'OBJECT_UPLOADERS_COVER' => array('bx_organizations_cover_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_organizations_picture_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_organizations_picture_crop'),
 
 
             'EMAIL_FRIEND_REQUEST' => 'bx_organizations_friend_request',
             'EMAIL_FRIEND_REQUEST' => 'bx_organizations_friend_request',
-        	'EMAIL_INVITATION' => 'bx_organizations_invitation',
+            'EMAIL_INVITATION' => 'bx_organizations_invitation',
             'EMAIL_JOIN_REQUEST' => 'bx_organizations_join_request',
             'EMAIL_JOIN_REQUEST' => 'bx_organizations_join_request',
             'EMAIL_JOIN_CONFIRM' => 'bx_organizations_join_confirm',
             'EMAIL_JOIN_CONFIRM' => 'bx_organizations_join_confirm',
             'EMAIL_FAN_BECOME_ADMIN' => 'bx_organizations_fan_become_admin',
             'EMAIL_FAN_BECOME_ADMIN' => 'bx_organizations_fan_become_admin',
@@ -148,7 +148,7 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_profile_view_submenu',
             'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_profile_view_submenu',
             'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_profile_snippet_meta',
             'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_profile_snippet_meta',
             'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_profile_view_actions',
             'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_profile_view_actions',
-        	'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_profile_view_entry',
+            'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_profile_view_entry',
 
 
             // menu items which visibility depends on custom visibility checking
             // menu items which visibility depends on custom visibility checking
             'MENU_ITEM_TO_METHOD' => array (
             'MENU_ITEM_TO_METHOD' => array (
@@ -180,6 +180,7 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'T' => array (
             'T' => array (
                 'txt_sample_single' => '_bx_orgs_txt_sample_single',
                 'txt_sample_single' => '_bx_orgs_txt_sample_single',
             	'txt_sample_comment_single' => '_bx_orgs_txt_sample_comment_single',
             	'txt_sample_comment_single' => '_bx_orgs_txt_sample_comment_single',
+                'txt_sample_vote_single' => '_bx_orgs_txt_sample_vote_single',
             	'txt_sample_pp_single' => '_bx_orgs_txt_sample_pp_single',
             	'txt_sample_pp_single' => '_bx_orgs_txt_sample_pp_single',
             	'txt_sample_pp_single_with_article' => '_bx_orgs_txt_sample_pp_single_with_article',
             	'txt_sample_pp_single_with_article' => '_bx_orgs_txt_sample_pp_single_with_article',
                 'txt_sample_pc_single' => '_bx_orgs_txt_sample_pc_single',
                 'txt_sample_pc_single' => '_bx_orgs_txt_sample_pc_single',

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

@@ -356,6 +356,7 @@
 
 
     <string name="_bx_orgs_txt_sample_single"><![CDATA[organization]]></string>
     <string name="_bx_orgs_txt_sample_single"><![CDATA[organization]]></string>
     <string name="_bx_orgs_txt_sample_comment_single"><![CDATA[comment to organization]]></string>
     <string name="_bx_orgs_txt_sample_comment_single"><![CDATA[comment to organization]]></string>
+    <string name="_bx_orgs_txt_sample_vote_single"><![CDATA[vote to organization]]></string>
     <string name="_bx_orgs_txt_sample_pp_single"><![CDATA[profile picture]]></string>
     <string name="_bx_orgs_txt_sample_pp_single"><![CDATA[profile picture]]></string>
     <string name="_bx_orgs_txt_sample_pp_single_with_article"><![CDATA[a profile picture]]></string>
     <string name="_bx_orgs_txt_sample_pp_single_with_article"><![CDATA[a profile picture]]></string>
     <string name="_bx_orgs_txt_sample_pc_single"><![CDATA[profile cover]]></string>
     <string name="_bx_orgs_txt_sample_pc_single"><![CDATA[profile cover]]></string>

+ 3 - 0
modules/boonex/organizations/install/sql/disable.sql

@@ -25,6 +25,9 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_organizations';
 -- VIEWS
 -- VIEWS
 DELETE FROM `sys_objects_view` WHERE `name` = 'bx_organizations';
 DELETE FROM `sys_objects_view` WHERE `name` = 'bx_organizations';
 
 
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_organizations';
+
 -- SCORES
 -- SCORES
 DELETE FROM `sys_objects_score` WHERE `name` = 'bx_organizations';
 DELETE FROM `sys_objects_score` WHERE `name` = 'bx_organizations';
 
 

+ 10 - 4
modules/boonex/organizations/install/sql/enable.sql

@@ -280,15 +280,16 @@ 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);
 ('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`, `active`, `copyable`, `order`) VALUES 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_organizations_view_actions_all', 'bx_organizations', 'profile-fan-add', '_bx_organizations_menu_item_title_system_become_fan', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 10),
-('bx_organizations_view_actions_all', 'bx_organizations', 'profile-fan-remove', '_bx_organizations_menu_item_title_system_leave_group', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
+('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),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-friend-add', '_bx_orgs_menu_item_title_system_befriend', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 30),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-friend-remove', '_bx_orgs_menu_item_title_system_unfriend', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 40),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-friend-remove', '_bx_orgs_menu_item_title_system_unfriend', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 40),
-('bx_organizations_view_actions_all', 'bx_organizations', 'profile-subscribe-add', '_bx_organizations_menu_item_title_system_subscribe', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 50),
-('bx_organizations_view_actions_all', 'bx_organizations', 'profile-subscribe-remove', '_bx_organizations_menu_item_title_system_unsubscribe', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 60),
+('bx_organizations_view_actions_all', 'bx_organizations', 'profile-subscribe-add', '_bx_orgs_menu_item_title_system_subscribe', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 50),
+('bx_organizations_view_actions_all', 'bx_organizations', 'profile-subscribe-remove', '_bx_orgs_menu_item_title_system_unsubscribe', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 60),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '', '', '', '', '', '', '', 0, 192, 1, 0, 70),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '', '', '', '', '', '', '', 0, 192, 1, 0, 70),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
+('bx_organizations_view_actions_all', 'bx_organizations', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 215),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 220),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 220),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 230),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 230),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 240),
 ('bx_organizations_view_actions_all', 'bx_organizations', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 240),
@@ -477,6 +478,11 @@ INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_o
 ('bx_organizations', 'bx_organizations', 'bx_organizations_views_track', '86400', '1', 'bx_organizations_data', 'id', 'author', 'views', '', '');
 ('bx_organizations', 'bx_organizations', 'bx_organizations_views_track', '86400', '1', 'bx_organizations_data', 'id', 'author', 'views', '', '');
 
 
 
 
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_organizations', 'bx_organizations_votes', 'bx_organizations_votes_track', '604800', '1', '1', '0', '1', 'bx_organizations_data', 'id', 'author', 'rate', 'votes', '', '');
+
+
 -- SCORES
 -- SCORES
 INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
 INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
 ('bx_organizations', 'bx_organizations', 'bx_organizations_scores', 'bx_organizations_scores_track', '604800', '0', 'bx_organizations_data', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
 ('bx_organizations', 'bx_organizations', 'bx_organizations_scores', 'bx_organizations_scores_track', '604800', '0', 'bx_organizations_data', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');

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

@@ -13,6 +13,8 @@ CREATE TABLE IF NOT EXISTS `bx_organizations_data` (
   `org_cat` int(11) NOT NULL,
   `org_cat` int(11) NOT NULL,
   `org_desc` text NOT NULL,
   `org_desc` text NOT NULL,
   `views` int(11) NOT NULL default '0',
   `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
   `score` int(11) NOT NULL default '0',
   `score` int(11) NOT NULL default '0',
   `sc_up` int(11) NOT NULL default '0',
   `sc_up` int(11) NOT NULL default '0',
   `sc_down` int(11) NOT NULL default '0',
   `sc_down` int(11) NOT NULL default '0',
@@ -87,6 +89,25 @@ CREATE TABLE IF NOT EXISTS `bx_organizations_views_track` (
   KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
   KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
 );
 );
 
 
+-- TABLE: VOTES
+CREATE TABLE IF NOT EXISTS `bx_organizations_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_organizations_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
 -- TABLE: favorites
 -- TABLE: favorites
 CREATE TABLE IF NOT EXISTS `bx_organizations_favorites_track` (
 CREATE TABLE IF NOT EXISTS `bx_organizations_favorites_track` (
   `object_id` int(11) NOT NULL default '0',
   `object_id` int(11) NOT NULL default '0',

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

@@ -1,6 +1,6 @@
 
 
 -- TABLES
 -- TABLES
-DROP TABLE IF EXISTS `bx_organizations_data`, `bx_organizations_pics`, `bx_organizations_pics_resized`, `bx_organizations_cmts`, `bx_organizations_views_track`, `bx_organizations_favorites_track`, `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_views_track`, `bx_organizations_votes`, `bx_organizations_votes_track`, `bx_organizations_favorites_track`, `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`;
 
 
 -- PROFILES
 -- PROFILES
 DELETE FROM sys_profiles WHERE `type` = 'bx_organizations';
 DELETE FROM sys_profiles WHERE `type` = 'bx_organizations';

+ 2 - 1
modules/boonex/russian/data/langs/bx_organizations/ru.xml

@@ -242,7 +242,7 @@
     <string name="_bx_orgs_menu_item_title_become_fan"><![CDATA[Присоединиться]]></string>
     <string name="_bx_orgs_menu_item_title_become_fan"><![CDATA[Присоединиться]]></string>
     <string name="_bx_orgs_menu_item_title_become_fan_sent"><![CDATA[Присоединение запрошено]]></string>
     <string name="_bx_orgs_menu_item_title_become_fan_sent"><![CDATA[Присоединение запрошено]]></string>
     <string name="_bx_orgs_menu_item_title_become_fan_confirm"><![CDATA[Одобрить присоединение]]></string>
     <string name="_bx_orgs_menu_item_title_become_fan_confirm"><![CDATA[Одобрить присоединение]]></string>
-    <string name="_bx_orgs_menu_item_title_system_leave_group"><![CDATA[Покинуть организацию]]></string>
+    <string name="_bx_orgs_menu_item_title_system_leave_organization"><![CDATA[Покинуть организацию]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization"><![CDATA[Покинуть организацию]]></string>
     <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_cancel_request"><![CDATA[Отменить присоединение]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization_reject_request"><![CDATA[Отвергнуть присоединение]]></string>
     <string name="_bx_orgs_menu_item_title_leave_organization_reject_request"><![CDATA[Отвергнуть присоединение]]></string>
@@ -356,6 +356,7 @@
 
 
     <string name="_bx_orgs_txt_sample_single"><![CDATA[Организация]]></string>
     <string name="_bx_orgs_txt_sample_single"><![CDATA[Организация]]></string>
     <string name="_bx_orgs_txt_sample_comment_single"><![CDATA[комментарий к организации]]></string>
     <string name="_bx_orgs_txt_sample_comment_single"><![CDATA[комментарий к организации]]></string>
+    <string name="_bx_orgs_txt_sample_vote_single"><![CDATA[голос за организацию]]></string>
     <string name="_bx_orgs_txt_sample_pp_single"><![CDATA[изображение профиля]]></string>
     <string name="_bx_orgs_txt_sample_pp_single"><![CDATA[изображение профиля]]></string>
     <string name="_bx_orgs_txt_sample_pp_single_with_article"><![CDATA[изображение профиля]]></string>
     <string name="_bx_orgs_txt_sample_pp_single_with_article"><![CDATA[изображение профиля]]></string>
     <string name="_bx_orgs_txt_sample_pc_single"><![CDATA[обложка профиля]]></string>
     <string name="_bx_orgs_txt_sample_pc_single"><![CDATA[обложка профиля]]></string>