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

Ticket #4912 - Organizations: Manage menu is shown to all viewers.

AntonLV 1 год назад
Родитель
Сommit
b27045f0c3

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

@@ -23,6 +23,7 @@ class BxOrgsConfig extends BxBaseModGroupsConfig
         $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
             'view-organization-profile' => 'checkAllowedView',
             'edit-organization-profile' => 'checkAllowedEdit',
+            'organization-manage' => 'checkAllowedEdit',
             'edit-organization-cover' => 'checkAllowedChangeCover',
             'invite-to-organization' => 'checkAllowedInvite',
             'delete-organization-profile' => 'checkAllowedDelete',

+ 4 - 27
modules/boonex/organizations/js/main.js

@@ -9,35 +9,12 @@
  */
 
 function BxOrgsMain(oOptions) {
-    this._sActionsUrl = oOptions.sActionUrl;
-    this._sObjName = oOptions.sObjName == undefined ? 'oBxOrgsMain' : oOptions.sObjName;
-    this._sObjNameGrid = oOptions.sObjNameGrid == undefined ? '' : oOptions.sObjNameGrid;
-    
-    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
-    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    BxBaseModGroupsMain.call(this, oOptions);
 
-    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxOrgsMain' : oOptions.sObjName;
 }
 
-BxOrgsMain.prototype.onClickSetRole = function(iFanProfileId, iRole) {
-    $('.bx-popup-applied:visible').dolPopupHide();
-
-    if(glGrids[this._sObjNameGrid] != undefined)
-        glGrids[this._sObjNameGrid].actionWithId(iFanProfileId, 'set_role_submit', {role: iRole}, '', false, false);
-};
-
-BxOrgsMain.prototype.onClickSetRoleMulti = function(oElement, iFanProfileId, iRole) {
-    if(!glGrids[this._sObjNameGrid])
-        return;
-
-    var oSiblings = $(oElement).parents('.bx-base-group-sr-role:first').siblings();
-    if(iRole == 0)
-        oSiblings.find('input:checked').removeAttr('checked');
-    else
-        oSiblings.find("input[value = '0']:checked").removeAttr('checked');
-
-    var sRoles = $(oElement).parents('.bx-base-group-sr-roles:first').find('input:checked').serialize();
-    glGrids[this._sObjNameGrid].actionWithId(iFanProfileId, 'set_role_submit', {}, sRoles, false, false);
-};
+BxOrgsMain.prototype = Object.create(BxBaseModGroupsMain.prototype);
+BxOrgsMain.prototype.constructor = BxOrgsMain;
 
 /** @} */