Browse Source

Ticket #4776 - Organizations: Rework Members page and add Manage page.

AntonLV 2 years ago
parent
commit
c133746ec3

+ 15 - 9
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -1449,7 +1449,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
      */
      */
     public function serviceGetNotificationsJoinRequest($aEvent)
     public function serviceGetNotificationsJoinRequest($aEvent)
     {
     {
-        return $this->_serviceGetNotification($aEvent, $this->_oConfig->CNF['T']['txt_ntfs_join_request']);
+        return $this->_serviceGetNotification($aEvent, 'join_request', $this->_oConfig->CNF['T']['txt_ntfs_join_request']);
     }
     }
 
 
 	/**
 	/**
@@ -1457,10 +1457,10 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
      */
      */
     public function serviceGetNotificationsFanAdded($aEvent)
     public function serviceGetNotificationsFanAdded($aEvent)
     {
     {
-        return $this->_serviceGetNotification($aEvent, $this->_oConfig->CNF['T']['txt_ntfs_fan_added']);
+        return $this->_serviceGetNotification($aEvent, 'fan_added', $this->_oConfig->CNF['T']['txt_ntfs_fan_added']);
     }
     }
 
 
-    protected function _serviceGetNotification($aEvent, $sLangKey)
+    protected function _serviceGetNotification($aEvent, $sType, $sLangKey)
     {
     {
     	$CNF = &$this->_oConfig->CNF;
     	$CNF = &$this->_oConfig->CNF;
 
 
@@ -1477,24 +1477,30 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         if(!$oProfile)
         if(!$oProfile)
             return array();
             return array();
 
 
+        $iGroupProfileId = $oGroupProfile->id();
+
         /*
         /*
          * Note. Group Profile URL is used for both Entry and Subentry URLs, 
          * Note. Group Profile URL is used for both Entry and Subentry URLs, 
          * because Subentry URL has higher display priority and notification
          * because Subentry URL has higher display priority and notification
-         * should be linked to Group Profile (Group Profile -> Members tab) 
+         * should be linked to Group Profile (Group Profile -> Members tab or Manage page) 
          * instead of Personal Profile of a member, who performed an action.
          * instead of Personal Profile of a member, who performed an action.
          */
          */
-        if(empty($CNF['URL_ENTRY_FANS']))
-            $sEntryUrl = bx_absolute_url(str_replace(BX_DOL_URL_ROOT, '', $oGroupProfile->getUrl()), '{bx_url_root}');
-        else
+        if($sType == 'join_request' && !empty($CNF['URL_ENTRY_MANAGE']))
+            $sEntryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_ENTRY_MANAGE'], [
+                'profile_id' => $iGroupProfileId
+            ]), '{bx_url_root}');
+        else if(!empty($CNF['URL_ENTRY_FANS']))
             $sEntryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_ENTRY_FANS'], [
             $sEntryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_ENTRY_FANS'], [
-                'profile_id' => $oGroupProfile->id()
+                'profile_id' => $iGroupProfileId
             ]), '{bx_url_root}');
             ]), '{bx_url_root}');
+        else
+            $sEntryUrl = bx_absolute_url(str_replace(BX_DOL_URL_ROOT, '', $oGroupProfile->getUrl()), '{bx_url_root}');
 
 
         return [
         return [
             'entry_sample' => $CNF['T']['txt_sample_single'],
             'entry_sample' => $CNF['T']['txt_sample_single'],
             'entry_url' => $sEntryUrl,
             'entry_url' => $sEntryUrl,
             'entry_caption' => $oGroupProfile->getDisplayName(),
             'entry_caption' => $oGroupProfile->getDisplayName(),
-            'entry_author' => $oGroupProfile->id(),
+            'entry_author' => $iGroupProfileId,
             'subentry_sample' => $oProfile->getDisplayName(),
             'subentry_sample' => $oProfile->getDisplayName(),
             'subentry_url' => $sEntryUrl,
             'subentry_url' => $sEntryUrl,
             'lang_key' => $sLangKey
             'lang_key' => $sLangKey

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

@@ -91,6 +91,7 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
             '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',
             'URL_ENTRY_FANS' => 'page.php?i=organization-profile-fans',
             'URL_ENTRY_FANS' => 'page.php?i=organization-profile-fans',
+            'URL_ENTRY_MANAGE' => 'page.php?i=organization-manage',
             'URL_MANAGE_COMMON' => 'page.php?i=organizations-manage',
             'URL_MANAGE_COMMON' => 'page.php?i=organizations-manage',
             'URL_MANAGE_ADMINISTRATION' => 'page.php?i=organizations-administration',
             'URL_MANAGE_ADMINISTRATION' => 'page.php?i=organizations-administration',
 
 

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

@@ -118,9 +118,9 @@ class BxOrgsModule extends BxBaseModGroupsModule
             $sAction = 'accept';
             $sAction = 'accept';
 
 
         if($aEvent['owner_id'] == $aEvent['object_owner_id'])
         if($aEvent['owner_id'] == $aEvent['object_owner_id'])
-            return $this->_serviceGetNotification($aEvent, $CNF['T']['txt_ntfs_' . $sAction . '_request']);
+            return $this->_serviceGetNotification($aEvent, 'join_request', $CNF['T']['txt_ntfs_' . $sAction . '_request']);
 
 
-        return $this->_serviceGetNotification($aEvent, $CNF['T']['txt_ntfs_' . $sAction . '_request_for_owner']);
+        return $this->_serviceGetNotification($aEvent, 'join_request', $CNF['T']['txt_ntfs_' . $sAction . '_request_for_owner']);
     }
     }
 
 
     public function onFanRemovedFromAdmins($iGroupProfileId, $iProfileId)
     public function onFanRemovedFromAdmins($iGroupProfileId, $iProfileId)