Kaynağa Gözat

Ticket #4533 - Notifications: Don't show the same notification for Sent Request and Accept Invitation actions.

AntonLV 3 yıl önce
ebeveyn
işleme
a30517db25

+ 2 - 0
modules/boonex/organizations/classes/BxOrgsConfig.php

@@ -241,6 +241,8 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
                 'txt_ntfs_join_invitation' => '_bx_orgs_txt_ntfs_join_invitation',
             	'txt_ntfs_join_request' => '_bx_orgs_txt_ntfs_join_request',
                 'txt_ntfs_join_request_for_owner' => '_bx_orgs_txt_ntfs_join_request_for_owner',
+                'txt_ntfs_accept_request' => '_bx_orgs_txt_ntfs_accept_request',
+                'txt_ntfs_accept_request_for_owner' => '_bx_orgs_txt_ntfs_accept_request_for_owner',
                 'txt_ntfs_fan_added' => '_bx_orgs_txt_ntfs_fan_added',
             	'txt_ntfs_timeline_post_common' => '_bx_orgs_txt_ntfs_timeline_post_common',
                 'option_members_mode_multi_roles' => '_bx_orgs_option_members_mode_multi_roles',

+ 9 - 2
modules/boonex/organizations/classes/BxOrgsModule.php

@@ -105,10 +105,17 @@ class BxOrgsModule extends BxBaseModGroupsModule
 
     public function serviceGetNotificationsJoinRequest($aEvent)
     {
+        $CNF = &$this->_oConfig->CNF;
+
+        $sAction = 'join';
+        $oConnection = BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS']);
+        if($oConnection !== false && $oConnection->isConnected($aEvent['object_owner_id'], $aEvent['owner_id'], true))
+            $sAction = 'accept';
+
         if($aEvent['owner_id'] == $aEvent['object_owner_id'])
-            return parent::serviceGetNotificationsJoinRequest($aEvent);
+            return $this->_serviceGetNotification($aEvent, $CNF['T']['txt_ntfs_' . $sAction . '_request']);
 
-        return $this->_serviceGetNotification($aEvent, $this->_oConfig->CNF['T']['txt_ntfs_join_request_for_owner']);
+        return $this->_serviceGetNotification($aEvent, $CNF['T']['txt_ntfs_' . $sAction . '_request_for_owner']);
     }
 
     public function onFanRemovedFromAdmins($iGroupProfileId, $iProfileId)

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

@@ -487,6 +487,8 @@
     <string name="_bx_orgs_txt_ntfs_join_invitation"><![CDATA[<b class="bx-ntfs-content-profile">{owner_name}</b> organization's representative invites <b class="bx-ntfs-content-entry">{subentry_sample}</b> to join organization]]></string>
     <string name="_bx_orgs_txt_ntfs_join_request"><![CDATA[Organization <b class="bx-ntfs-content-profile">{owner_name}</b> has a join request from <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
     <string name="_bx_orgs_txt_ntfs_join_request_for_owner"><![CDATA[<b class="bx-ntfs-content-entry">{subentry_sample}</b> sent a join request to your organization]]></string>
+    <string name="_bx_orgs_txt_ntfs_accept_request"><![CDATA[Organization <b class="bx-ntfs-content-profile">{owner_name}</b> accepted <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+    <string name="_bx_orgs_txt_ntfs_accept_request_for_owner"><![CDATA[<b class="bx-ntfs-content-entry">{subentry_sample}</b> was accepted in your organization]]></string>
     <string name="_bx_orgs_txt_ntfs_timeline_post_common"><![CDATA[New post <b class="bx-ntfs-content-entry">{subentry_sample}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> organization timeline]]></string>
 
     <string name="_bx_orgs_txt_sample_single"><![CDATA[organization]]></string>

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

@@ -481,6 +481,8 @@
     <string name="_bx_orgs_txt_ntfs_join_invitation"><![CDATA[Представитель организации <b class="bx-ntfs-content-profile">{owner_name}</b> пригласил <b class="bx-ntfs-content-entry">{subentry_sample}</b> вступить в организацию]]></string>
     <string name="_bx_orgs_txt_ntfs_join_request"><![CDATA[В организацию <b class="bx-ntfs-content-profile">{owner_name}</b> хочет вступить <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
     <string name="_bx_orgs_txt_ntfs_join_request_for_owner"><![CDATA[<b class="bx-ntfs-content-entry">{subentry_sample}</b> хочет вступить в вашу организацию]]></string>
+    <string name="_bx_orgs_txt_ntfs_accept_request"><![CDATA[В организацию <b class="bx-ntfs-content-profile">{owner_name}</b> вступил <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+    <string name="_bx_orgs_txt_ntfs_accept_request_for_owner"><![CDATA[<b class="bx-ntfs-content-entry">{subentry_sample}</b> был принят в вашу организацию]]></string>
     <string name="_bx_orgs_txt_ntfs_timeline_post_common"><![CDATA[В организации <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
 
     <string name="_bx_orgs_txt_sample_single"><![CDATA[Организация]]></string>