BxOrgsModule.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Organizations Organizations
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Organizations profiles module.
  13. */
  14. class BxOrgsModule extends BxBaseModGroupsModule
  15. {
  16. function __construct(&$aModule)
  17. {
  18. parent::__construct($aModule);
  19. $CNF = &$this->_oConfig->CNF;
  20. $this->_aSearchableNamesExcept[] = $CNF['FIELD_AUTHOR'];
  21. $this->_aSearchableNamesExcept[] = $CNF['FIELD_JOIN_CONFIRMATION'];
  22. }
  23. /**
  24. * Check if this module entry can be used as profile
  25. */
  26. public function serviceActAsProfile ()
  27. {
  28. return true;
  29. }
  30. public function serviceGetSearchResultUnit ($iContentId, $sUnitTemplate = '')
  31. {
  32. if(empty($sUnitTemplate))
  33. $sUnitTemplate = 'unit_with_cover.html';
  34. return parent::serviceGetSearchResultUnit($iContentId, $sUnitTemplate);
  35. }
  36. /**
  37. * @see BxBaseModProfileModule::serviceGetSpaceTitle
  38. */
  39. public function serviceGetSpaceTitle()
  40. {
  41. return BxBaseModProfileModule::serviceGetSpaceTitle();
  42. }
  43. /**
  44. * @see iBxDolProfileService::serviceGetParticipatingProfiles
  45. */
  46. public function serviceGetParticipatingProfiles($iProfileId, $aConnectionObjects = false)
  47. {
  48. if (false === $aConnectionObjects)
  49. $aConnectionObjects = array('sys_profiles_friends');
  50. return BxBaseModProfileModule::serviceGetParticipatingProfiles($iProfileId, $aConnectionObjects);
  51. }
  52. public function servicePrepareFields ($aFieldsProfile)
  53. {
  54. return parent::_servicePrepareFields($aFieldsProfile, array('org_cat' => 35), array(
  55. 'org_name' => 'name',
  56. 'org_desc' => 'description',
  57. ));
  58. }
  59. public function serviceGetTimelineData()
  60. {
  61. return BxBaseModProfileModule::serviceGetTimelineData();
  62. }
  63. public function onFanRemovedFromAdmins($iGroupProfileId, $iProfileId)
  64. {
  65. if (!($oProfile = BxDolProfile::getInstance($iProfileId)))
  66. return false;
  67. $oAccount = $oProfile->getAccountObject();
  68. $oAccount->updateProfileContextAuto();
  69. }
  70. public function checkAllowedCompose (&$aDataEntry, $isPerformAction = false)
  71. {
  72. return BxBaseModProfileModule::checkAllowedCompose ($aDataEntry, $isPerformAction);
  73. }
  74. public function checkAllowedContact($aDataEntry, $isPerformAction = false)
  75. {
  76. return BxBaseModProfileModule::checkAllowedContact($aDataEntry, $isPerformAction);
  77. }
  78. }
  79. /** @} */