Ver Fonte

Ticket #5076 - Profile badge. Persons.

AntonLV há 1 ano atrás
pai
commit
6b75538988

+ 6 - 0
modules/boonex/persons/classes/BxPersonsConfig.php

@@ -25,6 +25,7 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             'view-persons-profile' => 'checkAllowedView',
             'edit-persons-profile' => 'checkAllowedEdit',
             'edit-persons-cover' => 'checkAllowedChangeCover',
+            'edit-persons-badge' => 'checkAllowedChangeBadge',
             'delete-persons-profile' => 'checkAllowedDelete',
         ));
 
@@ -49,6 +50,8 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             'FIELD_PICTURE' => 'picture',
             'FIELD_COVER' => 'cover',
             'FIELD_COVER_POSITION' => 'cover_data',
+            'FIELD_BADGE' => 'badge',
+            'FIELD_BADGE_LINK' => 'badge_link',
             'FIELD_BIRTHDAY' => 'birthday',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_ALLOW_POST_TO' => 'allow_post_to',
@@ -101,6 +104,7 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             // objects
             'OBJECT_STORAGE' => 'bx_persons_pictures',
             'OBJECT_STORAGE_COVER' => 'bx_persons_pictures',
+            'OBJECT_STORAGE_BADGE' => 'bx_persons_pictures',
             'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_persons_thumb',
             'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_persons_icon',
             'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_persons_avatar',
@@ -109,6 +113,7 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_persons_cover',
             'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_persons_cover_thumb',
             'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_persons_gallery',
+            'OBJECT_IMAGES_TRANSCODER_BADGE' => 'bx_persons_badge',
             'OBJECT_VIEWS' => 'bx_persons',
             'OBJECT_VOTES' => 'bx_persons',
             'OBJECT_REACTIONS' => 'bx_persons_reactions',
@@ -125,6 +130,7 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_person_add',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_person_edit',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_person_edit_cover',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT_BADGE' => 'bx_person_edit_badge',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_person_delete',
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_persons_view_actions', // actions menu on view entry page
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_persons_view_actions_more', // actions menu on view entry page for "more" popup

+ 1 - 1
modules/boonex/persons/classes/BxPersonsSearchResult.php

@@ -38,7 +38,7 @@ class BxPersonsSearchResult extends BxBaseModProfileSearchResult
                     'table' => 'bx_persons_data',
                     'mainField' => 'content_id',
                     'onField' => 'id',
-                    'joinFields' => array('id', 'fullname', 'last_name', 'picture', 'cover', 'cover_data', 'added', 'author', 'allow_view_to'),
+                    'joinFields' => array('id', 'fullname', 'last_name', 'picture', 'cover', 'cover_data', 'badge', 'badge_link', 'added', 'author', 'allow_view_to'),
                 ),
                 'account' => array(
                     'type' => 'INNER',

+ 21 - 0
modules/boonex/persons/classes/BxPersonsUploaderBadgeCrop.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Persons Persons
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPersonsUploaderBadgeCrop extends BxBaseModProfileUploaderBadgeCrop
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_oModule = BxDolModule::getInstance('bx_persons');
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+}
+
+/** @} */

+ 2 - 1
modules/boonex/persons/install/config.php

@@ -84,7 +84,8 @@ $aConfig = array(
     	'bx_persons_picture',
     	'bx_persons_cover',
     	'bx_persons_cover_thumb',
-        'bx_persons_gallery'
+        'bx_persons_gallery',
+        'bx_persons_badge'
     ),
 
     /**

+ 60 - 50
modules/boonex/persons/install/langs/en.xml

@@ -54,6 +54,10 @@
     <string name="_bx_persons_form_profile_input_online_search"><![CDATA[Online only]]></string>
     <string name="_bx_persons_form_profile_input_sys_cover"><![CDATA[Cover Picture]]></string>
     <string name="_bx_persons_form_profile_input_cover"><![CDATA[Upload New Cover Picture]]></string>
+    <string name="_bx_persons_form_profile_input_sys_badge"><![CDATA[Badge Image]]></string>
+    <string name="_bx_persons_form_profile_input_badge"><![CDATA[Upload New Badge Image]]></string>
+    <string name="_bx_persons_form_profile_input_sys_badge_link"><![CDATA[Badge Link]]></string>
+    <string name="_bx_persons_form_profile_input_badge_link"><![CDATA[Badge Link]]></string>
     <string name="_bx_persons_form_profile_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
     <string name="_bx_persons_form_profile_input_delete_confirm"><![CDATA[I am sure I want to delete this profile]]></string>
     <string name="_bx_persons_form_profile_input_delete_confirm_info"><![CDATA[This action can not be undone.]]></string>
@@ -82,65 +86,68 @@
     <string name="_bx_persons_form_profile_input_sys_followers_count"><![CDATA[Followers count]]></string>
     <string name="_bx_persons_form_profile_input_followers_count"><![CDATA[Followers count]]></string>
 
-  <string name="_bx_persons_skills_form_profile"><![CDATA[Skills]]></string>
-  <string name="_bx_persons_skills_form_profile_display_add"><![CDATA[Add Skill]]></string>
-  <string name="_bx_persons_skills_form_profile_display_view"><![CDATA[View Skill]]></string>
-  <string name="_bx_persons_skills_form_profile_input_sys_skill_name"><![CDATA[Name]]></string>
-  <string name="_bx_persons_skills_form_profile_input_skill_name"><![CDATA[Name]]></string>
-  <string name="_bx_persons_skills_form_profile_input_skill_name_err"><![CDATA[This information is essential. Please, fill in this field.]]></string>
+    <string name="_bx_persons_skills_form_profile"><![CDATA[Skills]]></string>
+    <string name="_bx_persons_skills_form_profile_display_add"><![CDATA[Add Skill]]></string>
+    <string name="_bx_persons_skills_form_profile_display_view"><![CDATA[View Skill]]></string>
+    <string name="_bx_persons_skills_form_profile_input_sys_skill_name"><![CDATA[Name]]></string>
+    <string name="_bx_persons_skills_form_profile_input_skill_name"><![CDATA[Name]]></string>
+    <string name="_bx_persons_skills_form_profile_input_skill_name_err"><![CDATA[This information is essential. Please, fill in this field.]]></string>
 
-	<string name="_bx_persons_acl_action_create_profile"><![CDATA[Create Person's Profile]]></string>
-	<string name="_bx_persons_acl_action_delete_profile"><![CDATA[Delete Person's Profile]]></string>
-	<string name="_bx_persons_acl_action_view_profile"><![CDATA[View Person's Profile]]></string>
-	<string name="_bx_persons_acl_action_edit_any_profile"><![CDATA[Edit Any Person's Profile]]></string>
-	<string name="_bx_persons_acl_action_delete_any_profile"><![CDATA[Delete Any Person's Profile]]></string>
+    <string name="_bx_persons_acl_action_create_profile"><![CDATA[Create Person's Profile]]></string>
+    <string name="_bx_persons_acl_action_delete_profile"><![CDATA[Delete Person's Profile]]></string>
+    <string name="_bx_persons_acl_action_view_profile"><![CDATA[View Person's Profile]]></string>
+    <string name="_bx_persons_acl_action_change_badge"><![CDATA[Change Person's Profile Badge]]></string>
+    <string name="_bx_persons_acl_action_edit_any_profile"><![CDATA[Edit Any Person's Profile]]></string>
+    <string name="_bx_persons_acl_action_delete_any_profile"><![CDATA[Delete Any Person's Profile]]></string>
 
-	<string name="_bx_persons_page_title_sys_create_profile"><![CDATA[Create a Profile - Person]]></string>
-	<string name="_bx_persons_page_title_create_profile"><![CDATA[Create a Profile - Person]]></string>
-	<string name="_bx_persons_page_title_sys_edit_profile"><![CDATA[Edit Profile]]></string>
-	<string name="_bx_persons_page_title_edit_profile"><![CDATA[Edit Profile]]></string>
-	<string name="_bx_persons_page_title_sys_edit_profile_cover"><![CDATA[Edit Cover]]></string>
-	<string name="_bx_persons_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
-	<string name="_bx_persons_page_title_sys_delete_profile"><![CDATA[Delete Profile]]></string>
-	<string name="_bx_persons_page_title_delete_profile"><![CDATA[Delete Profile]]></string>
+    <string name="_bx_persons_page_title_sys_create_profile"><![CDATA[Create a Profile - Person]]></string>
+    <string name="_bx_persons_page_title_create_profile"><![CDATA[Create a Profile - Person]]></string>
+    <string name="_bx_persons_page_title_sys_edit_profile"><![CDATA[Edit Profile]]></string>
+    <string name="_bx_persons_page_title_edit_profile"><![CDATA[Edit Profile]]></string>
+    <string name="_bx_persons_page_title_sys_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_persons_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_persons_page_title_sys_edit_profile_badge"><![CDATA[Edit Badge]]></string>
+    <string name="_bx_persons_page_title_edit_profile_badge"><![CDATA[Edit Badge]]></string>
+    <string name="_bx_persons_page_title_sys_delete_profile"><![CDATA[Delete Profile]]></string>
+    <string name="_bx_persons_page_title_delete_profile"><![CDATA[Delete Profile]]></string>
     <string name="_bx_persons_page_title_sys_view_profile"><![CDATA[View Profile]]></string>
     <string name="_bx_persons_page_title_sys_view_profile_closed"><![CDATA[View Profile with Limited Visibility]]></string>
-	<string name="_bx_persons_page_title_view_profile"><![CDATA[{display_name}]]></string>
-	<string name="_bx_persons_page_title_browse"><![CDATA[People]]></string>
-	<string name="_bx_persons_page_title_browse_featured"><![CDATA[Featured People]]></string>
-	<string name="_bx_persons_page_title_browse_active"><![CDATA[Active People]]></string>
-	<string name="_bx_persons_page_title_browse_online"><![CDATA[Online People]]></string>
-	<string name="_bx_persons_page_title_browse_recent"><![CDATA[New People]]></string>
-	<string name="_bx_persons_page_title_browse_connections"><![CDATA[{0} connections]]></string>
-	<string name="_bx_persons_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
-        <string name="_bx_persons_page_title_browse_familiar"><![CDATA[People You May Know]]></string>
-	<string name="_bx_persons_page_title_browse_favorites"><![CDATA[{0} favorites]]></string>
-	<string name="_bx_persons_page_title_browse_by_acl"><![CDATA[{0} People]]></string>
-	<string name="_bx_persons_page_title_browse_by_cmts"><![CDATA[People's Comments]]></string>
-	<string name="_bx_persons_page_title_sys_profile_favorites"><![CDATA[Favorite persons]]></string>
-	<string name="_bx_persons_page_title_profile_favorites"><![CDATA[Favorite persons]]></string>
-	<string name="_bx_persons_page_title_sys_profile_friends"><![CDATA[Friends]]></string>
-	<string name="_bx_persons_page_title_profile_friends"><![CDATA[Friends]]></string>
-	<string name="_bx_persons_page_title_sys_friend_requests"><![CDATA[Friend Requests]]></string>
-	<string name="_bx_persons_page_title_friend_requests"><![CDATA[Friend Requests]]></string>
-	<string name="_bx_persons_page_title_sys_profile_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_persons_page_title_view_profile"><![CDATA[{display_name}]]></string>
+    <string name="_bx_persons_page_title_browse"><![CDATA[People]]></string>
+    <string name="_bx_persons_page_title_browse_featured"><![CDATA[Featured People]]></string>
+    <string name="_bx_persons_page_title_browse_active"><![CDATA[Active People]]></string>
+    <string name="_bx_persons_page_title_browse_online"><![CDATA[Online People]]></string>
+    <string name="_bx_persons_page_title_browse_recent"><![CDATA[New People]]></string>
+    <string name="_bx_persons_page_title_browse_connections"><![CDATA[{0} connections]]></string>
+    <string name="_bx_persons_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
+    <string name="_bx_persons_page_title_browse_familiar"><![CDATA[People You May Know]]></string>
+    <string name="_bx_persons_page_title_browse_favorites"><![CDATA[{0} favorites]]></string>
+    <string name="_bx_persons_page_title_browse_by_acl"><![CDATA[{0} People]]></string>
+    <string name="_bx_persons_page_title_browse_by_cmts"><![CDATA[People's Comments]]></string>
+    <string name="_bx_persons_page_title_sys_profile_favorites"><![CDATA[Favorite persons]]></string>
+    <string name="_bx_persons_page_title_profile_favorites"><![CDATA[Favorite persons]]></string>
+    <string name="_bx_persons_page_title_sys_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_persons_page_title_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_persons_page_title_sys_friend_requests"><![CDATA[Friend Requests]]></string>
+    <string name="_bx_persons_page_title_friend_requests"><![CDATA[Friend Requests]]></string>
+    <string name="_bx_persons_page_title_sys_profile_subscriptions"><![CDATA[Following]]></string>
     <string name="_bx_persons_page_title_profile_subscriptions"><![CDATA[Following & Followers]]></string>
     <string name="_bx_persons_page_title_sys_profile_relations"><![CDATA[Relationships]]></string>
     <string name="_bx_persons_page_title_profile_relations"><![CDATA[Relationships]]></string>
     <string name="_bx_persons_page_title_sys_profile_comments"><![CDATA[Comments]]></string>
     <string name="_bx_persons_page_title_profile_comments"><![CDATA[Comments]]></string>
-	<string name="_bx_persons_page_title_sys_profile_info"><![CDATA[Profile Info]]></string>
-	<string name="_bx_persons_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
-	<string name="_bx_persons_page_title_sys_recent"><![CDATA[New People]]></string>
-	<string name="_bx_persons_page_title_recent"><![CDATA[New People]]></string>
-	<string name="_bx_persons_page_title_sys_manage"><![CDATA[Manage Own People]]></string>
-	<string name="_bx_persons_page_title_sys_manage_administration"><![CDATA[Manage All People]]></string>
-	<string name="_bx_persons_page_title_manage"><![CDATA[Manage People]]></string>
-	<string name="_bx_persons_page_title_sys_active"><![CDATA[Active People]]></string>
-	<string name="_bx_persons_page_title_active"><![CDATA[Active People]]></string>
-	<string name="_bx_persons_page_title_sys_online"><![CDATA[Online People]]></string>
-	<string name="_bx_persons_page_title_online"><![CDATA[Online People]]></string>
-	<string name="_bx_persons_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_persons_page_title_sys_profile_info"><![CDATA[Profile Info]]></string>
+    <string name="_bx_persons_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
+    <string name="_bx_persons_page_title_sys_recent"><![CDATA[New People]]></string>
+    <string name="_bx_persons_page_title_recent"><![CDATA[New People]]></string>
+    <string name="_bx_persons_page_title_sys_manage"><![CDATA[Manage Own People]]></string>
+    <string name="_bx_persons_page_title_sys_manage_administration"><![CDATA[Manage All People]]></string>
+    <string name="_bx_persons_page_title_manage"><![CDATA[Manage People]]></string>
+    <string name="_bx_persons_page_title_sys_active"><![CDATA[Active People]]></string>
+    <string name="_bx_persons_page_title_active"><![CDATA[Active People]]></string>
+    <string name="_bx_persons_page_title_sys_online"><![CDATA[Online People]]></string>
+    <string name="_bx_persons_page_title_online"><![CDATA[Online People]]></string>
+    <string name="_bx_persons_page_title_sys_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_persons_page_title_entries_search"><![CDATA[Search]]></string>
 
     <string name="_bx_persons_page_block_title_profile_private"><![CDATA[Private Profile]]></string>
@@ -148,6 +155,7 @@
     <string name="_bx_persons_page_block_title_create_profile"><![CDATA[Create a Profile - Person]]></string>
     <string name="_bx_persons_page_block_title_edit_profile"><![CDATA[Edit Profile]]></string>
     <string name="_bx_persons_page_block_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_persons_page_block_title_edit_profile_badge"><![CDATA[Edit Badge]]></string>
     <string name="_bx_persons_page_block_title_delete_profile"><![CDATA[Delete Profile]]></string>
     <string name="_bx_persons_page_block_title_profile_all_actions"><![CDATA[All Actions]]></string>
     <string name="_bx_persons_page_block_title_profile_info_link"><![CDATA[About <a href="{profile_link}">{display_name}</a>]]></string>
@@ -223,6 +231,8 @@
     <string name="_bx_persons_menu_item_title_edit_cover"><![CDATA[Edit Cover]]></string>
     <string name="_bx_persons_menu_item_title_system_edit_profile"><![CDATA[Edit Person]]></string>
     <string name="_bx_persons_menu_item_title_edit_profile"><![CDATA[Edit Profile]]></string>
+    <string name="_bx_persons_menu_item_title_system_edit_badge"><![CDATA[Edit Badge]]></string>
+    <string name="_bx_persons_menu_item_title_edit_badge"><![CDATA[Edit Badge]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_profile"><![CDATA[Delete Profile and Data]]></string>
     <string name="_bx_persons_menu_item_title_delete_profile"><![CDATA[Delete Profile and Data]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>

+ 19 - 1
modules/boonex/persons/install/sql/enable.sql

@@ -73,6 +73,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_persons_edit_profile', 1, 'bx_persons', '_bx_persons_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:11:\"entity_edit\";}', 0, 0, 0);
 
+-- PAGE: edit badge
+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_persons_edit_badge', 'edit-persons-badge', '_bx_persons_page_title_sys_edit_profile_badge', '_bx_persons_page_title_edit_profile_badge', 'bx_persons', 5, 2147483647, 1, 'page.php?i=edit-persons-badge', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_persons_edit_badge', 1, 'bx_persons', '_bx_persons_page_block_title_edit_profile_badge', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_persons";s:6:"method";s:17:"entity_edit_badge";}', 0, 0, 0);
+
 -- PAGE: delete 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_persons_delete_profile', 'delete-persons-profile', '_bx_persons_page_title_sys_delete_profile', '_bx_persons_page_title_delete_profile', 'bx_persons', 5, 2147483647, 1, 'page.php?i=delete-persons-profile', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
@@ -250,6 +257,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_persons_view_actions_more', 'bx_persons', 'notes', '_sys_menu_item_title_system_va_notes', '_sys_menu_item_title_va_notes', 'javascript:void(0)', 'javascript:bx_get_notes(this,  ''{module_uri}'', {content_id});', '', 'exclamation-triangle', '', 192, 1, 0, 10),
 ('bx_persons_view_actions_more', 'bx_persons', 'audit', '_sys_menu_item_title_system_va_audit', '_sys_menu_item_title_va_audit', 'page.php?i=dashboard-audit&module=bx_persons&content_id={content_id}', '', '', 'history', '', 192, 1, 0, 20),
 ('bx_persons_view_actions_more', 'bx_persons', 'edit-persons-profile', '_bx_persons_menu_item_title_system_edit_profile', '_bx_persons_menu_item_title_edit_profile', 'page.php?i=edit-persons-profile&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 30),
+('bx_persons_view_actions_more', 'bx_persons', 'edit-persons-badge', '_bx_persons_menu_item_title_system_edit_badge', '_bx_persons_menu_item_title_edit_badge', 'page.php?i=edit-persons-badge&id={content_id}', '', '', 'fa-certificate', '', 2147483647, 1, 0, 32),
 ('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-profile', '_bx_persons_menu_item_title_system_delete_profile', '_bx_persons_menu_item_title_delete_profile', 'page.php?i=delete-persons-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40),
 ('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-account', '_bx_persons_menu_item_title_system_delete_account', '_bx_persons_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}&content=0', '', '', 'user-times', '', 128, 1, 0, 50),
 ('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-account-content', '_bx_persons_menu_item_title_system_delete_account_content', '_bx_persons_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'trash', '', 128, 1, 0, 60);
@@ -422,6 +430,10 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
 ('bx_persons', 'view entry', NULL, '_bx_persons_acl_action_view_profile', '', 1, 0);
 SET @iIdActionProfileView = LAST_INSERT_ID();
 
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_persons', 'change badge', NULL, '_bx_persons_acl_action_change_badge', '', 1, 3);
+SET @iIdActionChangeBadge = LAST_INSERT_ID();
+
 INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
 ('bx_persons', 'edit any entry', NULL, '_bx_persons_acl_action_edit_any_profile', '', 1, 3);
 SET @iIdActionProfileEditAny = LAST_INSERT_ID();
@@ -471,6 +483,11 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionProfileView),
 (@iPremium, @iIdActionProfileView),
 
+-- set profile badge
+(@iModerator, @iIdActionChangeBadge),
+(@iAdministrator, @iIdActionChangeBadge),
+(@iPremium, @iIdActionChangeBadge),
+
 -- any profile edit
 (@iModerator, @iIdActionProfileEditAny),
 (@iAdministrator, @iIdActionProfileEditAny),
@@ -569,4 +586,5 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 -- UPLOADERS
 INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
 ('bx_persons_cover_crop', 1, 'BxPersonsUploaderCoverCrop', 'modules/boonex/persons/classes/BxPersonsUploaderCoverCrop.php'),
-('bx_persons_picture_crop', 1, 'BxPersonsUploaderPictureCrop', 'modules/boonex/persons/classes/BxPersonsUploaderPictureCrop.php');
+('bx_persons_picture_crop', 1, 'BxPersonsUploaderPictureCrop', 'modules/boonex/persons/classes/BxPersonsUploaderPictureCrop.php'),
+('bx_persons_badge_crop', 1, 'BxPersonsUploaderBadgeCrop', 'modules/boonex/persons/classes/BxPersonsUploaderBadgeCrop.php');

+ 15 - 2
modules/boonex/persons/install/sql/install.sql

@@ -10,6 +10,8 @@ CREATE TABLE IF NOT EXISTS `bx_persons_data` (
   `picture` int(11) NOT NULL,
   `cover` int(11) NOT NULL,
   `cover_data` varchar(50) NOT NULL,
+  `badge` int(11) NOT NULL default '0',
+  `badge_link` varchar(255) NOT NULL default '',
   `fullname` varchar(255) NOT NULL,
   `last_name` varchar(255) NOT NULL,
   `description` text NOT NULL,
@@ -274,7 +276,8 @@ INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`,
 ('bx_persons_picture', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
 ('bx_persons_cover', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
 ('bx_persons_cover_thumb', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
-('bx_persons_gallery', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0');
+('bx_persons_gallery', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
+('bx_persons_badge', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0');
 
 INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
 ('bx_persons_icon', 'Resize', 'a:3:{s:1:"w";s:2:"30";s:1:"h";s:2:"30";s:13:"square_resize";s:1:"1";}', '0'),
@@ -284,7 +287,8 @@ INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_par
 ('bx_persons_picture', 'Resize', 'a:3:{s:1:"w";s:4:"1024";s:1:"h";s:4:"1024";s:13:"square_resize";s:1:"0";}', '0'),
 ('bx_persons_cover', 'Resize', 'a:2:{s:1:"w";s:3:"960";s:1:"h";s:3:"480";}', '0'),
 ('bx_persons_cover_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
-('bx_persons_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+('bx_persons_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
+('bx_persons_badge', 'Resize', 'a:3:{s:1:"w";s:2:"32";s:1:"h";s:2:"32";s:13:"square_resize";s:1:"1";}', '0');
 
 -- FORMS
 INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`, `parent_form`) VALUES 
@@ -296,8 +300,10 @@ INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`,
 ('bx_person', 'bx_person_delete', 'bx_persons', 0, '_bx_persons_form_profile_display_delete'),
 ('bx_person', 'bx_person_edit', 'bx_persons', 0, '_bx_persons_form_profile_display_edit'),
 ('bx_person', 'bx_person_edit_cover', 'bx_persons', 0, '_bx_persons_form_profile_display_edit_cover'),
+('bx_person', 'bx_person_edit_badge', 'bx_persons', 0, '_bx_persons_form_profile_display_edit_badge'),
 ('bx_person', 'bx_person_view', 'bx_persons', 1, '_bx_persons_form_profile_display_view'),
 ('bx_person', 'bx_person_view_full', 'bx_persons', 1, '_bx_persons_form_profile_display_view_full'),
+
 ('bx_person_skills', 'bx_person_skills', 'bx_persons', 0, '_bx_persons_skills_form_profile_display_add'),
 ('bx_person_skills', 'bx_person_skills_view', 'bx_persons', 1, '_bx_persons_skills_form_profile_display_view');
 
@@ -314,6 +320,8 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_person', 'bx_persons', 'last_name', '', '', 0, 'text', '_bx_persons_form_profile_input_sys_last_name', '_bx_persons_form_profile_input_last_name', '', 1, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'cover', 'a:1:{i:0;s:21:"bx_persons_cover_crop";}', 'a:1:{s:21:"bx_persons_cover_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_persons_form_profile_input_sys_cover', '_bx_persons_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'picture', 'a:1:{i:0;s:23:"bx_persons_picture_crop";}', 'a:1:{s:23:"bx_persons_picture_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_persons_form_profile_input_sys_picture', '_bx_persons_form_profile_input_picture', '', 0, 0, 0, '', '', '', '', '', '_bx_persons_form_profile_input_picture_err', '', '', 1, 0, ''),
+('bx_person', 'bx_persons', 'badge', 'a:1:{i:0;s:21:"bx_persons_badge_crop";}', 'a:1:{s:21:"bx_persons_badge_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_persons_form_profile_input_sys_badge', '_bx_persons_form_profile_input_badge', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_person', 'bx_persons', 'badge_link', '', '', 0, 'text', '_bx_persons_form_profile_input_sys_badge_link', '_bx_persons_form_profile_input_badge_link', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'birthday', '0', '', 0, 'datepicker', '_bx_persons_form_profile_input_sys_birthday', '_bx_persons_form_profile_input_birthday', '', 1, 0, 0, '', '', '', 'date_range', 'a:3:{s:3:"min";i:18;s:3:"max";i:99;s:8:"required";b:0;}', '_bx_persons_form_profile_input_birthday_err', 'Date', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'gender', '', '#!Sex', 0, 'select', '_bx_persons_form_profile_input_sys_gender', '_bx_persons_form_profile_input_gender', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0, ''),
@@ -327,6 +335,7 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_person', 'bx_persons', 'changed', '', '', 0, 'datetime', '_bx_persons_form_profile_input_sys_date_changed', '_bx_persons_form_profile_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'friends_count', '', '', 0, 'text', '_bx_persons_form_profile_input_sys_friends_count', '_bx_persons_form_profile_input_friends_count', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
 ('bx_person', 'bx_persons', 'followers_count', '', '', 0, 'text', '_bx_persons_form_profile_input_sys_followers_count', '_bx_persons_form_profile_input_followers_count', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+
 ('bx_person_skills', 'bx_persons', 'skill_name', '', '', 0, 'text', '_bx_persons_skills_form_profile_input_sys_skill_name', '_bx_persons_skills_form_profile_input_skill_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_persons_skills_form_profile_input_skill_name_err', 'Xss', '', 1, 0, '');
 
 INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
@@ -368,6 +377,10 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_person_edit_cover', 'cover', 2147483647, 1, 7),
 ('bx_person_edit_cover', 'do_submit', 2147483647, 1, 8),
 
+('bx_person_edit_badge', 'badge', 2147483647, 1, 1),
+('bx_person_edit_badge', 'badge_link', 2147483647, 1, 2),
+('bx_person_edit_badge', 'do_submit', 2147483647, 1, 3),
+
 ('bx_person_view', 'gender', 2147483647, 1, 1),
 ('bx_person_view', 'birthday', 2147483647, 1, 2),
 ('bx_person_view', 'fullname', 2147483647, 1, 3),

+ 4 - 4
modules/boonex/persons/install/sql/uninstall.sql

@@ -9,15 +9,15 @@ DELETE FROM sys_profiles WHERE `type` = 'bx_persons';
 DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_persons_pictures', 'bx_persons_pictures_resized');
 DELETE FROM `sys_storage_tokens` WHERE `object` IN('bx_persons_pictures', 'bx_persons_pictures_resized');
 
-DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_avatar_big', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb', 'bx_persons_gallery');
-DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_avatar_big', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb', 'bx_persons_gallery');
-DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_avatar_big', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb', 'bx_persons_gallery');
+DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_avatar_big', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb', 'bx_persons_gallery', 'bx_persons_badge');
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_avatar_big', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb', 'bx_persons_gallery', 'bx_persons_badge');
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_persons_icon', 'bx_persons_thumb', 'bx_persons_avatar', 'bx_persons_avatar_big', 'bx_persons_picture', 'bx_persons_cover', 'bx_persons_cover_thumb', 'bx_persons_gallery', 'bx_persons_badge');
 
 -- FORMS
 DELETE FROM `sys_objects_form` WHERE `module` = 'bx_persons';
 DELETE FROM `sys_form_displays` WHERE `module` = 'bx_persons';
 DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_persons';
-DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_person_add', 'bx_person_delete', 'bx_person_edit', 'bx_person_edit_cover', 'bx_person_view', 'bx_person_view_full', 'bx_person_skills', 'bx_person_skills_view');
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_person_add', 'bx_person_delete', 'bx_person_edit', 'bx_person_edit_cover', 'bx_person_edit_badge', 'bx_person_view', 'bx_person_view_full', 'bx_person_skills', 'bx_person_skills_view');
 
 -- COMMENTS
 DELETE FROM `sys_objects_cmts` WHERE `Name` LIKE 'bx_persons%';

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

@@ -51,6 +51,10 @@
     <string name="_bx_persons_form_profile_input_online_search"><![CDATA[В сети]]></string>
     <string name="_bx_persons_form_profile_input_sys_cover"><![CDATA[Картинка обложки]]></string>
     <string name="_bx_persons_form_profile_input_cover"><![CDATA[Загрузить новую картинку обложки]]></string>
+    <string name="_bx_persons_form_profile_input_sys_badge"><![CDATA[Изображение значка]]></string>
+    <string name="_bx_persons_form_profile_input_badge"><![CDATA[Загрузить новое изображение значка]]></string>
+    <string name="_bx_persons_form_profile_input_sys_badge_link"><![CDATA[Ссылка значка]]></string>
+    <string name="_bx_persons_form_profile_input_badge_link"><![CDATA[Ссылка значка]]></string>
     <string name="_bx_persons_form_profile_input_sys_delete_confirm"><![CDATA[Удалить подтверждение]]></string>
     <string name="_bx_persons_form_profile_input_delete_confirm"><![CDATA[Я уверен, что хочу удалить этот профиль]]></string>
     <string name="_bx_persons_form_profile_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено.]]></string>
@@ -80,6 +84,7 @@
     <string name="_bx_persons_acl_action_create_profile"><![CDATA[Создать персональный профиль]]></string>
     <string name="_bx_persons_acl_action_delete_profile"><![CDATA[Удалить персональный профиль]]></string>
     <string name="_bx_persons_acl_action_view_profile"><![CDATA[Просмотреть персональный профиль]]></string>
+    <string name="_bx_persons_acl_action_change_badge"><![CDATA[Изменять значок персонального профиля]]></string>
     <string name="_bx_persons_acl_action_edit_any_profile"><![CDATA[Редактировать любой персональный профиль]]></string>
     <string name="_bx_persons_acl_action_delete_any_profile"><![CDATA[Удалять любой персональный профиль]]></string>
 
@@ -89,6 +94,8 @@
     <string name="_bx_persons_page_title_edit_profile"><![CDATA[Редактировать профиль]]></string>
     <string name="_bx_persons_page_title_sys_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
     <string name="_bx_persons_page_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
+    <string name="_bx_persons_page_title_sys_edit_profile_badge"><![CDATA[Редактировать значок]]></string>
+    <string name="_bx_persons_page_title_edit_profile_badge"><![CDATA[Редактировать значок]]></string>
     <string name="_bx_persons_page_title_sys_delete_profile"><![CDATA[Удалить профиль]]></string>
     <string name="_bx_persons_page_title_delete_profile"><![CDATA[Удалить профиль]]></string>
     <string name="_bx_persons_page_title_sys_view_profile"><![CDATA[Просмотр профиля]]></string>
@@ -136,6 +143,7 @@
     <string name="_bx_persons_page_block_title_create_profile"><![CDATA[Создать профиль - человек]]></string>
     <string name="_bx_persons_page_block_title_edit_profile"><![CDATA[Редактировать профиль]]></string>
     <string name="_bx_persons_page_block_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
+    <string name="_bx_persons_page_block_title_edit_profile_badge"><![CDATA[Редактировать значок]]></string>
     <string name="_bx_persons_page_block_title_delete_profile"><![CDATA[Удалить профиль]]></string>
     <string name="_bx_persons_page_block_title_profile_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_persons_page_block_title_profile_info_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Инфо]]></string>
@@ -209,6 +217,8 @@
     <string name="_bx_persons_menu_item_title_edit_cover"><![CDATA[Редактировать обложку]]></string>
     <string name="_bx_persons_menu_item_title_system_edit_profile"><![CDATA[Редактировать персону]]></string>
     <string name="_bx_persons_menu_item_title_edit_profile"><![CDATA[Редактировать профиль]]></string>
+    <string name="_bx_persons_menu_item_title_system_edit_badge"><![CDATA[Редактировать значок]]></string>
+    <string name="_bx_persons_menu_item_title_edit_badge"><![CDATA[Редактировать значок]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_profile"><![CDATA[Удалить профиль и данные]]></string>
     <string name="_bx_persons_menu_item_title_delete_profile"><![CDATA[Удалить профиль и данные]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_account"><![CDATA[Удалить аккаунт]]></string>