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

Merge branch 'master' of https://github.com/unaio/una

AntonLV 5 лет назад
Родитель
Сommit
dc9db9d092

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralFormEntry.php

@@ -421,7 +421,7 @@ class BxBaseModGeneralFormEntry extends BxTemplFormView
         
         
         foreach($this->aInputs as $aInput) {
-            if ($aInput['rateable'] && $aInput['type'] != 'nested_form'){
+            if (isset($aInput['rateable']) && $aInput['rateable'] && $aInput['type'] != 'nested_form'){
                 BxDolFormQuery::addFormField($this->id, $aInput['name'], $iContentId, $aValsToAdd[$CNF['FIELD_AUTHOR']], $this->_oModule->getName());
             }
         }

+ 8 - 5
modules/base/profile/classes/BxBaseModProfileFormsEntryHelper.php

@@ -107,8 +107,9 @@ class BxBaseModProfileFormsEntryHelper extends BxBaseModGeneralFormsEntryHelper
 
     public function onDataEditAfter ($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm)
     {
-        if ($s = parent::onDataEditAfter($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm))
+        if ($s = parent::onDataEditAfter($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm)){
             return $s;
+        }
 
         $CNF = &$this->_oModule->_oConfig->CNF;
 
@@ -116,11 +117,13 @@ class BxBaseModProfileFormsEntryHelper extends BxBaseModGeneralFormsEntryHelper
          * Load updated data.
          */
         $aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
+       
+        // change profile to 'pending' only if profile is 'active' 
+        $oEditedProfile = BxDolProfile::getInstanceMagic($aContentInfo['profile_id']);
+        $sStatus = $oEditedProfile->getStatus();
 
-        // change profile to 'pending' only if profile is 'active'
-        $sStatus = $oProfile->getStatus();
-        if (!$this->isAutoApproval(BX_DOL_PROFILE_ACTIVATE_EDIT) && BX_PROFILE_STATUS_ACTIVE == $sStatus && !empty($aTrackTextFieldsChanges['changed_fields']))
-            $oProfile->disapprove(BX_PROFILE_ACTION_AUTO, 0, $this->_oModule->serviceActAsProfile());
+        if (!$this->isAutoApproval(BX_DOL_PROFILE_ACTIVATE_EDIT) && BX_PROFILE_STATUS_ACTIVE == $sStatus )
+            $oEditedProfile->disapprove(BX_PROFILE_ACTION_AUTO, 0, $this->_oModule->serviceActAsProfile());
 
         // process uploaded files
         if (isset($CNF['FIELD_PICTURE']))

+ 5 - 5
modules/boonex/organizations/install/langs/en.xml

@@ -4,7 +4,7 @@
     <string name="_bx_organizations"><![CDATA[Organizations]]></string>
     <string name="_bx_orgs_cmts"><![CDATA[Organizations' Comments]]></string>
 
-    <string name="_bx_orgs_option_autoapproval"><![CDATA[Activate all organizations automatically]]></string>
+    <string name="_bx_orgs_option_autoapproval"><![CDATA[Organization moderation]]></string>
     <string name="_bx_orgs_option_default_acl_level"><![CDATA[Default level to assign after organizations's profile creation]]></string>
     <string name="_bx_orgs_option_enable_profile_activation_letter"><![CDATA[Enable profile activation letter]]></string>
     <string name="_bx_orgs_option_redirect_aadd"><![CDATA[Redirect after organizations's profile creation to]]></string>
@@ -12,10 +12,10 @@
     <string name="_bx_orgs_option_redirect_aadd_last"><![CDATA[Last Page]]></string>
     <string name="_bx_orgs_option_redirect_aadd_custom"><![CDATA[Custom Page]]></string>
     <string name="_bx_orgs_option_redirect_aadd_custom_url"><![CDATA[URL for 'Custom Page' redirect]]></string>
-    <string name="_bx_orgs_option_activation_on"><![CDATA[After creation & after editing]]></string>
-    <string name="_bx_orgs_option_activation_add"><![CDATA[After creation only]]></string>
-    <string name="_bx_orgs_option_activation_edit"><![CDATA[After editing only]]></string>
-    <string name="_bx_orgs_option_activation_off"><![CDATA[Manual activation]]></string>
+    <string name="_bx_orgs_option_activation_on"><![CDATA[Auto-activate after creation & editing]]></string>
+    <string name="_bx_orgs_option_activation_add"><![CDATA[Manually activate after editing, auto-activate after creation]]></string>
+    <string name="_bx_orgs_option_activation_edit"><![CDATA[Manually activate after creating, auto-activate after editing]]></string>
+    <string name="_bx_orgs_option_activation_off"><![CDATA[Activate manually after creation & editing]]></string>
     <string name="_bx_orgs_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
     <string name="_bx_orgs_option_per_page_browse"><![CDATA[Number of items per page]]></string>
     <string name="_bx_orgs_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>

+ 5 - 1
modules/boonex/persons/classes/BxPersonsConfig.php

@@ -203,7 +203,11 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             	'txt_browse_favorites' => '_bx_persons_page_title_browse_favorites',
                 'option_redirect_aadd_profile' => '_bx_persons_option_redirect_aadd_profile',
             	'option_redirect_aadd_last' => '_bx_persons_option_redirect_aadd_last',
-            	'option_redirect_aadd_custom' => '_bx_persons_option_redirect_aadd_custom'
+            	'option_redirect_aadd_custom' => '_bx_persons_option_redirect_aadd_custom',
+                'option_activation_on' => '_bx_persons_option_activation_on',
+            	'option_activation_off' => '_bx_persons_option_activation_off',
+            	'option_activation_add' => '_bx_persons_option_activation_add',
+                'option_activation_edit' => '_bx_persons_option_activation_edit'
             ),
 
         );

+ 5 - 1
modules/boonex/persons/install/langs/en.xml

@@ -4,7 +4,7 @@
 	<string name="_bx_persons"><![CDATA[Persons]]></string>
 	<string name="_bx_persons_cmts"><![CDATA[Persons' Comments]]></string>
 
-	<string name="_bx_persons_option_autoapproval"><![CDATA[Activate all persons after creation automatically]]></string>
+	<string name="_bx_persons_option_autoapproval"><![CDATA[Activate all persons automatically]]></string>
 	<string name="_bx_persons_option_default_acl_level"><![CDATA[Default member's level to assign after person's profile creation]]></string>
   <string name="_bx_persons_option_enable_profile_activation_letter"><![CDATA[Enable profile activation letter]]></string>
   <string name="_bx_persons_option_redirect_aadd"><![CDATA[Redirect after person's profile creation to]]></string>
@@ -12,6 +12,10 @@
 	<string name="_bx_persons_option_redirect_aadd_last"><![CDATA[Last Page]]></string>
 	<string name="_bx_persons_option_redirect_aadd_custom"><![CDATA[Custom Page]]></string>
 	<string name="_bx_persons_option_redirect_aadd_custom_url"><![CDATA[URL for 'Custom Page' redirect]]></string>
+  <string name="_bx_persons_option_activation_on"><![CDATA[After creation & after editing]]></string>
+  <string name="_bx_persons_option_activation_add"><![CDATA[After creation only]]></string>
+  <string name="_bx_persons_option_activation_edit"><![CDATA[After editing only]]></string>
+  <string name="_bx_persons_option_activation_off"><![CDATA[Manual activation]]></string>
 	<string name="_bx_persons_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
 	<string name="_bx_persons_option_per_page_browse"><![CDATA[Number of items per page]]></string>
 	<string name="_bx_persons_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>

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

@@ -11,7 +11,7 @@ VALUES (@iTypeId, 'bx_persons', '_bx_persons', 1);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-('bx_persons_autoapproval', 'on', @iCategId, '_bx_persons_option_autoapproval', 'checkbox', '', '', '', 1),
+('bx_persons_autoapproval', 'on', @iCategId, '_bx_persons_option_autoapproval', 'select', 'a:2:{s:6:"module";s:10:"bx_persons";s:6:"method";s:22:"get_options_activation";}', '', '', 1),
 ('bx_persons_default_acl_level', '3', @iCategId, '_bx_persons_option_default_acl_level', 'select', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"get_memberships";s:6:"params";a:4:{s:11:"purchasable";b:0;s:6:"active";b:1;s:9:"translate";b:1;s:22:"filter_out_auto_levels";b:1;}s:5:"class";s:16:"TemplAclServices";}', '', '', 2),
 ('bx_persons_redirect_aadd', 'profile', @iCategId, '_bx_persons_option_redirect_aadd', 'select', 'a:2:{s:6:"module";s:10:"bx_persons";s:6:"method";s:30:"get_options_redirect_after_add";}', '', '', 3),
 ('bx_persons_redirect_aadd_custom_url', '', @iCategId, '_bx_persons_option_redirect_aadd_custom_url', 'digit', '', '', '', 4),

+ 5 - 1
modules/boonex/russian/data/langs/bx_organizations/ru.xml

@@ -4,7 +4,7 @@
     <string name="_bx_organizations"><![CDATA[Организации]]></string>
     <string name="_bx_orgs_cmts"><![CDATA[Организации - Комментарии]]></string>
 
-    <string name="_bx_orgs_option_autoapproval"><![CDATA[Автоматически активировать все организации после создания]]></string>
+    <string name="_bx_orgs_option_autoapproval"><![CDATA[Автоматически активировать все организации]]></string>
     <string name="_bx_orgs_option_default_acl_level"><![CDATA[Уровень, назначаемый созданному профилю организации по умолчанию]]></string>
     <string name="_bx_orgs_option_enable_profile_activation_letter"><![CDATA[Включить письмо об активации профиля]]></string>
     <string name="_bx_orgs_option_redirect_aadd"><![CDATA[После создания организации перенаправить на]]></string>
@@ -12,6 +12,10 @@
     <string name="_bx_orgs_option_redirect_aadd_last"><![CDATA[Предыдущая страница]]></string>
     <string name="_bx_orgs_option_redirect_aadd_custom"><![CDATA[Пользовательская страница]]></string>
     <string name="_bx_orgs_option_redirect_aadd_custom_url"><![CDATA[URL для перенаправления 'Пользовательская страница']]></string>
+    <string name="_bx_orgs_option_activation_on"><![CDATA[После создания и после редактирования]]></string>
+    <string name="_bx_orgs_option_activation_add"><![CDATA[Только после создания]]></string>
+    <string name="_bx_orgs_option_activation_edit"><![CDATA[Только после редактирования]]></string>
+    <string name="_bx_orgs_option_activation_off"><![CDATA[Ручная активация]]></string>
     <string name="_bx_orgs_option_num_connections_quick"><![CDATA[Количество элементов в блоке друзей]]></string>
     <string name="_bx_orgs_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
     <string name="_bx_orgs_option_num_rss"><![CDATA[Количество элементов в ленте RSS]]></string>

+ 5 - 1
modules/boonex/russian/data/langs/bx_persons/ru.xml

@@ -4,7 +4,7 @@
 	<string name="_bx_persons"><![CDATA[Персоны]]></string>
 	<string name="_bx_persons_cmts"><![CDATA[Персоны - Комментарии]]></string>
 
-	<string name="_bx_persons_option_autoapproval"><![CDATA[Автоматически активировать всех персон после создания]]></string>
+	<string name="_bx_persons_option_autoapproval"><![CDATA[Автоматически активировать всех персон]]></string>
 	<string name="_bx_persons_option_default_acl_level"><![CDATA[Уровень, по умолчанию назначаемый созданному персональному профилю]]></string>
   <string name="_bx_persons_option_enable_profile_activation_letter"><![CDATA[Включить письмо об активации профиля]]></string>
 	<string name="_bx_persons_option_redirect_aadd"><![CDATA[После создания персонального профиля перенаправить на]]></string>
@@ -12,6 +12,10 @@
     <string name="_bx_persons_option_redirect_aadd_last"><![CDATA[Предыдущая страница]]></string>
     <string name="_bx_persons_option_redirect_aadd_custom"><![CDATA[Пользовательская страница]]></string>
     <string name="_bx_persons_option_redirect_aadd_custom_url"><![CDATA[URL для перенаправления 'Пользовательская страница']]></string>
+    <string name="_bx_persons_option_activation_on"><![CDATA[После создания и после редактирования]]></string>
+    <string name="_bx_persons_option_activation_add"><![CDATA[Только после создания]]></string>
+    <string name="_bx_persons_option_activation_edit"><![CDATA[Только после редактирования]]></string>
+    <string name="_bx_persons_option_activation_off"><![CDATA[Ручная активация]]></string>
 	<string name="_bx_persons_option_num_connections_quick"><![CDATA[Количество элементов в блоке друзей]]></string>
 	<string name="_bx_persons_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
     <string name="_bx_persons_option_num_rss"><![CDATA[Количество элементов в ленте RSS]]></string>